* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #bfe3a8;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color: #4a4458; -webkit-user-select: none; user-select: none; touch-action: none;
}
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

.panel {
  position: fixed; background: rgba(255, 255, 255, 0.88); border-radius: 16px;
  padding: 10px 14px; box-shadow: 0 4px 14px rgba(90, 110, 80, 0.18); font-size: 14px;
}
#hud { top: max(10px, env(safe-area-inset-top)); left: 10px; min-width: 132px; }
#hud .row { display: flex; align-items: center; gap: 6px; min-height: 24px; }
#score { font-size: 26px; font-weight: 800; color: #ff8fab; }
.unit { font-size: 13px; }
#rank { margin-left: auto; font-size: 13px; color: #8a84a0; }
#ammo .dot { width: 14px; height: 14px; border-radius: 50%; background: #8a6a4a; border: 2px solid #6b4f35; }
#ammo .dot.off { background: transparent; border-color: #d6cdc2; }
#ammo .wait { font-size: 12px; color: #a39cb5; }
.small { font-size: 13px; }
#mission b { color: #6a9be0; }

#lb { top: max(10px, env(safe-area-inset-top)); right: 10px; min-width: 140px; font-size: 13px; }
#lb .r { display: flex; justify-content: space-between; gap: 12px; line-height: 1.6; }
#lb .r.me { color: #ff7da0; font-weight: 700; }
#lb .n { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#banner {
  position: fixed; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  background: #fff6d6; border: 2px solid #f2c94c; border-radius: 999px; padding: 8px 18px;
  font-size: 15px; font-weight: 700; color: #8a6400; max-width: calc(62 * var(--vw, 1vw)); text-align: center;
}
#feed { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); text-align: center; font-size: 13px; pointer-events: none; }
#feed div { background: rgba(255, 255, 255, 0.85); border-radius: 999px; padding: 4px 12px; margin-top: 4px; }

#actions {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: max(12px, env(safe-area-inset-bottom));
  display: flex; gap: 8px; max-width: calc(100 * var(--vw, 1vw)); padding: 0 8px;
}
#actions button {
  border: 0; border-radius: 16px; background: rgba(255, 255, 255, 0.92); color: #4a4458;
  min-width: 58px; height: 56px; padding: 4px 8px; font: inherit; cursor: pointer;
  box-shadow: 0 4px 0 rgba(120, 140, 110, 0.35); display: flex; flex-direction: column; align-items: center; justify-content: center;
}
#actions button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(120, 140, 110, 0.35); }
#actions b { font-size: 15px; white-space: nowrap; }
#actions i { font-style: normal; font-size: 10px; color: #a39cb5; }
#actions .shoot { background: #ffd9e2; margin-left: 10px; }
#actions .shoot + .shoot { margin-left: 0; }
/* 말풍선 고르는 창 (11/17) */
#actions { --emo-gap: 10px; }
#actions #emoPick { position: absolute; left: 8px; bottom: calc(100% + var(--emo-gap)); display: flex; gap: 6px; padding: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.95); box-shadow: 0 6px 18px rgba(70, 90, 70, 0.18); }
#actions #emoPick.hidden { display: none; }
#actions:has(#emoPick:not(.hidden)) { z-index: 40; }
#actions #emoPick button { min-width: 0; width: 42px; height: 42px; padding: 0; border-radius: 50%; box-shadow: none; background: #f7f4fb; font: 700 20px/1 'Jua', sans-serif; position: relative; }
#actions #emoPick button small { position: absolute; right: 2px; bottom: 0; font: 9px sans-serif; color: #b6aec6; }
@media (pointer: coarse) { #actions #emoPick button small { display: none; } }
#actions button[data-a="emo"] svg { stroke: #9a80dc; }
#actions .shoot.on { background: #ff8fab; color: #fff; }
#actions .shoot.on i { color: #fff; }
@media (pointer: coarse) { #actions i { display: none; } }
@media (max-width: 520px) {
  #actions { gap: 5px; width: 100%; }
  #actions button { min-width: 0; flex: 1; height: 52px; padding: 4px 6px; }
  #actions b { font-size: 13px; }
  #actions .shoot { margin-left: 2px; }
  #banner { top: 96px; max-width: calc(92 * var(--vw, 1vw)); font-size: 13px; }
  #feed { top: 140px; }
  #lb { min-width: 110px; }
}

.overlay {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(214, 240, 200, 0.72); backdrop-filter: blur(3px); padding: 16px;
}
.card {
  background: #fffdf8; border-radius: 28px; padding: 28px 28px 22px; width: min(420px, 100%);
  text-align: center; box-shadow: 0 12px 40px rgba(90, 110, 80, 0.25);
}
h1 { margin: 0; font-size: 38px; letter-spacing: -1px; color: #ff8fab; }
h2 { margin: 0 0 6px; font-size: 28px; color: #ff8fab; }
.tag { margin: 8px 0 14px; font-size: 15px; color: #7b748f; }
.how { list-style: none; margin: 0 0 16px; padding: 12px 14px; background: #f3f9ee; border-radius: 16px; text-align: left; font-size: 14px; line-height: 1.7; }
.how li::before { content: "•"; color: #8fcf8a; margin-right: 8px; }
#name {
  width: 100%; height: 46px; border: 2px solid #e6e0f0; border-radius: 14px; padding: 0 14px;
  font: inherit; font-size: 16px; text-align: center; background: #fff; color: inherit; -webkit-user-select: text; user-select: text;
}
#name:focus { outline: none; border-color: #ffb3c7; }
.primary {
  margin-top: 10px; width: 100%; height: 52px; border: 0; border-radius: 16px; background: #ff8fab; color: #fff;
  font: inherit; font-size: 18px; font-weight: 800; cursor: pointer; box-shadow: 0 5px 0 #e0708f;
}
#privLink { display: block; margin-top: 10px; text-align: center; font-size: 11.5px; color: #a49cb6; text-decoration: none; }
#privLink:hover { text-decoration: underline; }
.primary:active { transform: translateY(3px); box-shadow: 0 2px 0 #e0708f; }
.primary:disabled { background: #d9d4e2; box-shadow: 0 5px 0 #c1bbcc; cursor: default; }
.note { min-height: 18px; margin: 10px 0 0; font-size: 13px; color: #a39cb5; }
#dead p { margin: 6px 0; font-size: 15px; }

/* ---- 3D 화면용 ---- */
html, body { background: #cfeeff; }
#cross {
  position: fixed; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border: 3px solid #ff5c7a; border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}
#cross::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: #ff5c7a; }
#joy {
  position: fixed; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.35); border: 2px solid rgba(255, 255, 255, 0.8); pointer-events: none;
}
#stick { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(255, 255, 255, 0.9); }
#compass {
  position: fixed; left: 10px; top: 128px; display: flex; align-items: center; gap: 8px; pointer-events: none;
  background: rgba(255, 255, 255, 0.88); border-radius: 999px; padding: 6px 12px 6px 8px; font-size: 13px; color: #4f86d6; font-weight: 700;
}
#needle { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 18px solid #6a9be0; }
.keys { margin: 0 0 12px; font-size: 12.5px; color: #8a84a0; line-height: 1.6; }
#actions .fire { margin-left: 0; display: none; }
#actions.aiming .fire { display: flex; background: #ff8fab; color: #fff; }
#actions.aiming .fire i { color: #fff; }
@media (pointer: fine) { #actions { opacity: 0.85; } }
@media (pointer: coarse) { .keys { display: none; } }

/* ---- 가이드, 알림 ---- */
#guide { background: #f3f9ee; border-radius: 18px; padding: 12px 14px 10px; margin: 0 0 14px; }
#gpic svg { width: 100%; height: auto; display: block; }
#gtitle { margin: 6px 0 4px; font-size: 17px; color: #4a4458; }
#gtext { margin: 0; font-size: 14px; line-height: 1.55; color: #6b6480; min-height: 44px; }
#gnav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 8px; }
#gdots i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #cfe6c4; margin: 0 3px; }
#gdots i.on { background: #ff8fab; }
.ghost { border: 0; background: #fff; color: #7b748f; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; cursor: pointer; box-shadow: 0 2px 0 rgba(120, 140, 110, 0.3); }
#actions .fire { display: flex; background: #ff8fab; color: #fff; margin-left: 0; }
#actions .fire i { color: #fff; }
#toast {
  position: fixed; left: 50%; top: 30%; transform: translateX(-50%); pointer-events: none; text-align: center;
  font-size: 30px; font-weight: 900; color: #fff; padding: 10px 26px; border-radius: 999px; white-space: nowrap;
  background: #6fcf8f; box-shadow: 0 6px 20px rgba(60, 90, 60, 0.25); animation: pop 0.25s ease-out;
}
#toast.bad { background: #ff7d96; }
@keyframes pop { from { transform: translateX(-50%) scale(0.6); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
#freeze {
  position: fixed; left: 50%; top: 18%; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  font-size: 34px; font-weight: 900; color: #fff; background: #5aa9ee; padding: 10px 28px; border-radius: 18px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.7); animation: pop 0.15s ease-out;
}
#coach {
  position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%); pointer-events: none; text-align: center;
  background: rgba(74, 68, 88, 0.82); color: #fff; font-size: 15px; padding: 9px 18px; border-radius: 14px; max-width: calc(92 * var(--vw, 1vw));
}
#lockhint {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, 70px); pointer-events: none;
  background: rgba(255, 255, 255, 0.9); color: #4a4458; font-size: 14px; padding: 8px 16px; border-radius: 999px;
}
#deadWhy { font-weight: 700; color: #ff7d96; }
@media (max-width: 520px) {
  #toast { font-size: 22px; }
  #freeze { font-size: 26px; }
  #coach { bottom: 76px; font-size: 13px; }
}

#mute {
  position: fixed; left: 10px; bottom: max(12px, env(safe-area-inset-bottom)); width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); color: #4a4458; font-size: 20px; cursor: pointer; box-shadow: 0 3px 0 rgba(120, 140, 110, 0.35);
}
#mute.off { color: #c9c3d6; text-decoration: line-through; }
@media (max-width: 520px) { #mute { bottom: 76px; } }

#gauge {
  position: fixed; left: 50%; top: 50%; width: 150px; height: 14px; margin: 46px 0 0 -75px; border-radius: 999px; pointer-events: none;
  background: rgba(255, 255, 255, 0.85); box-shadow: 0 0 0 2px rgba(74, 68, 88, 0.25); overflow: hidden;
}
#gfill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #ffd27a, #ff7d96); }
#mprog {
  position: fixed; left: 50%; bottom: 132px; transform: translateX(-50%); pointer-events: none; text-align: center;
  background: rgba(255, 255, 255, 0.92); color: #4f86d6; font-size: 14px; font-weight: 700; padding: 8px 14px 10px; border-radius: 14px;
}
#mprog .bar { width: 170px; height: 10px; margin-top: 6px; border-radius: 999px; background: #dbe9fb; overflow: hidden; }
#mfill { height: 100%; width: 0; background: #6a9be0; border-radius: 999px; }
@media (max-width: 520px) { #mprog { bottom: 122px; } }

#quiz {
  position: fixed; left: 50%; top: 16%; transform: translateX(-50%); text-align: center; width: min(340px, calc(92 * var(--vw, 1vw)));
  background: rgba(255, 255, 255, 0.96); border-radius: 22px; padding: 12px 16px 14px; box-shadow: 0 8px 26px rgba(60, 90, 60, 0.25);
}
#qtitle { font-size: 13px; font-weight: 800; color: #8f73d6; }
#qtext { font-size: 34px; font-weight: 900; color: #4a4458; margin: 4px 0 8px; letter-spacing: 1px; }
#quiz .bar { height: 8px; border-radius: 999px; background: #eee9f7; overflow: hidden; }
#qfill { height: 100%; width: 100%; background: #8f73d6; border-radius: 999px; }
#qbtns { display: flex; gap: 10px; margin-top: 10px; }
#qbtns button {
  flex: 1; height: 54px; border: 0; border-radius: 16px; font: inherit; font-size: 28px; font-weight: 900; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff;
}
#qbtns i { font-style: normal; font-size: 11px; opacity: 0.8; border: 1.5px solid rgba(255, 255, 255, 0.8); border-radius: 6px; padding: 1px 5px; }
#qo { background: #6fcf8f; box-shadow: 0 4px 0 #4fae6f; }
#qx { background: #ff7d96; box-shadow: 0 4px 0 #dc5c76; }
#qbtns button.dim { opacity: 0.3; }
#qbtns button.picked { outline: 4px solid #4a4458; }
@media (pointer: coarse) { #qbtns i { display: none; } }
#actions button.cd { opacity: 0.45; }

#mem {
  position: fixed; left: 50%; top: 16%; transform: translateX(-50%); text-align: center; width: min(360px, calc(92 * var(--vw, 1vw)));
  background: rgba(255, 255, 255, 0.96); border-radius: 22px; padding: 12px 16px 14px; box-shadow: 0 8px 26px rgba(60, 90, 60, 0.25);
}
#mtitle { font-size: 14px; font-weight: 800; color: #e08a4f; }
#mtext { font-size: 40px; font-weight: 900; color: #4a4458; margin: 4px 0 8px; letter-spacing: 6px; min-height: 52px; }
#mem .bar { height: 8px; border-radius: 999px; background: #fbeee2; overflow: hidden; }
#mbar { height: 100%; width: 100%; background: #ffb070; border-radius: 999px; }
#mbtns { display: flex; gap: 8px; margin-top: 10px; }
#mbtns button {
  flex: 1; height: 54px; border: 0; border-radius: 16px; font: inherit; font-size: 26px; font-weight: 900; cursor: pointer;
  background: #ffc299; color: #6b4a2e; box-shadow: 0 4px 0 #e08a4f; display: flex; align-items: center; justify-content: center; gap: 6px;
}
#mbtns i { font-style: normal; font-size: 11px; opacity: 0.75; border: 1.5px solid rgba(107, 74, 46, 0.5); border-radius: 6px; padding: 1px 5px; }
#mbtns button.dim { opacity: 0.3; }
#mbtns button.picked { outline: 4px solid #4a4458; }
@media (pointer: coarse) { #mbtns i { display: none; } }

#weapon { color: #8a84a0; }
#weapon b { color: #e08a4f; margin-right: 6px; }

#mini {
  position: fixed; right: 10px; bottom: max(12px, env(safe-area-inset-bottom)); width: 198px; height: 143px; pointer-events: none;
  border-radius: 16px; background: rgba(255, 255, 255, 0.9); box-shadow: 0 4px 14px rgba(90, 110, 80, 0.22);
}
@media (max-width: 900px) { #mini { width: 132px; height: 95px; bottom: 76px; } }

/* 총 이름 줄이 생겨 HUD 가 길어졌다. 나침반과 안내 글이 다른 것과 겹치지 않게 */
#compass { top: 156px; }
@media (max-width: 900px) { #coach { bottom: 186px; } #mprog { bottom: 240px; } }

#fwarn {
  position: fixed; left: 50%; top: 34%; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  font-size: 64px; font-weight: 900; color: #fff; -webkit-text-stroke: 3px #5aa9ee; text-shadow: 0 6px 0 rgba(90, 169, 238, 0.35);
  animation: pop 0.12s ease-out;
}
#skill {
  position: fixed; left: 64px; bottom: max(12px, env(safe-area-inset-bottom)); height: 44px; padding: 0 16px; border: 0; border-radius: 999px;
  background: #cdb8ff; color: #4a3b78; font: inherit; font-size: 15px; cursor: pointer; box-shadow: 0 3px 0 #8f73d6;
  display: flex; align-items: center; gap: 8px; animation: pop 0.25s ease-out;
}
#skill i { font-style: normal; font-size: 11px; border: 1.5px solid rgba(74, 59, 120, 0.5); border-radius: 6px; padding: 1px 5px; }
#buff {
  position: fixed; left: 50%; top: 96px; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  background: #8f73d6; color: #fff; font-size: 15px; font-weight: 800; padding: 7px 16px; border-radius: 999px;
}
#detect {
  position: fixed; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none;
}
#dneedle {
  position: absolute; left: -11px; top: -150px; width: 0; height: 0; transform-origin: 11px 150px;
  border-left: 11px solid transparent; border-right: 11px solid transparent; border-bottom: 26px solid #ff5c7a;
  filter: drop-shadow(0 0 3px #fff);
}
#dtext {
  position: absolute; left: 0; top: 150px; transform: translateX(-50%); white-space: nowrap;
  background: #ff5c7a; color: #fff; font-size: 14px; font-weight: 800; padding: 5px 12px; border-radius: 999px;
}
@media (pointer: coarse) { #skill i { display: none; } }
@media (max-width: 900px) { #skill { bottom: 76px; } #fwarn { font-size: 46px; } }

#settings { z-index: 5; }
#settings h3 { margin: 14px 0 6px; font-size: 15px; text-align: left; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 2px; border-bottom: 1px solid #f0ecf6; font-size: 15px; }
.tog { min-width: 96px; height: 38px; border: 0; border-radius: 999px; background: #ff8fab; color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.tog.off { background: #d9d4e2; color: #7b748f; }
#setSens { width: 150px; accent-color: #ff8fab; }
#skillList { margin-bottom: 14px; font-size: 13.5px; }
#skillList b { color: #8f73d6; }
.card { max-height: calc(94 * var(--vh, 1vh)); overflow-y: auto; }

#picker { display: flex; align-items: center; gap: 12px; background: #fdf3f6; border-radius: 18px; padding: 8px 12px; margin: 0 0 8px; }
#pvc { width: 96px; height: 96px; flex: none; }
#pvc.locked { filter: grayscale(1) brightness(1.1); opacity: 0.45; }
#pkside { flex: 1; min-width: 0; }
#pkrow { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
#pkname { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pkcolors { display: flex; justify-content: center; gap: 7px; margin-top: 8px; }
#pkcolors button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; cursor: pointer; padding: 0; font-size: 12px; color: #7b748f; box-shadow: 0 0 0 1px #e6e0f0; }
#pkcolors button.on { box-shadow: 0 0 0 3px #4a4458; }
#pklock { margin: 7px 0 0; font-size: 12.5px; color: #e0708f; min-height: 16px; }
#mystats { margin: 0 0 10px; font-size: 12.5px; color: #8a84a0; }
#deadNew { font-weight: 800; color: #6fa8e8; }

/* 게임 시작을 누르면 묻는 구글 로그인 창 (11/17) */
#setAcct.hidden { display: none; }
#acct { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 10px; min-height: 34px; font-size: 13px; color: #6fa8e8; font-weight: 700; }
/* 쿨타임: 어두운 막이 버튼을 덮었다가 아래로 줄어든다 */
#actions button[data-a="dash"] { position: relative; overflow: hidden; }
#actions button[data-a="dash"]::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: calc(var(--cd, 0) * 100%);
  background: rgba(74, 68, 88, 0.42); pointer-events: none;
}
#actions button[data-a="dash"] b, #actions button[data-a="dash"] i { position: relative; }
#actions button[data-a="dash"].cd { opacity: 1; }
#actions button[data-a="dash"].cd i { font-size: 15px; font-weight: 900; color: #fff; display: block; }
#actions button[data-a="dash"].ready { animation: pop 0.25s ease-out; }

#rpbar {
  position: fixed; left: 50%; top: 22px; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  background: rgba(74, 68, 88, 0.85); color: #fff; font-size: 16px; font-weight: 800; padding: 9px 20px; border-radius: 999px;
}
.textbtn { margin-top: 10px; border: 0; background: none; color: #8a84a0; font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }
@media (max-width: 520px) { #rpbar { font-size: 13px; } }

/* 친구 방 */
#roomrow { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; font-size: 13px; color: #7b748f; }
#roomName b { color: #e8799a; letter-spacing: 1px; }
.chip { border: 0; background: #fff; color: #6f6885; padding: 7px 12px; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 2px 0 rgba(120, 140, 110, 0.3); }
.chip:active { transform: translateY(1px); }

/* ================= 디자인 손질: 장난감 스티커 느낌 ================= */
:root {
  --ink: #4a4458; --soft: #7b748f; --pink: #ff8fab; --pink-d: #e0708f; --cream: #fffdf8;
  --mint: #eef8e6; --sky: #6a9be0; --grape: #8f73d6; --sun: #ffc94d;
  --disp: "Jua", "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --toy: 0 4px 0 rgba(96, 120, 92, 0.22), 0 10px 22px rgba(90, 110, 80, 0.16);
}
html, body { font-family: "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; }
h1, h2, h3, .primary, .chip, .tog, #score, #toast, #freeze, #fwarn, #banner, #buff, #rpbar, #qtext, #mtext, #qtitle, #mtitle,
#actions b, #skill b, #pkname, #lb, #dist, #dtext, #qbtns button, #mbtns button, #weapon b, #mprog, #coach, #lockhint {
  font-family: var(--disp); font-weight: 400;
}

/* --- 시작 화면 --- */
.overlay { background: radial-gradient(120% 90% at 50% 35%, rgba(255, 253, 248, 0.28), rgba(196, 232, 186, 0.62)); backdrop-filter: blur(2px); }
.card { border: 4px solid #fff; border-radius: 32px; box-shadow: 0 8px 0 rgba(96, 120, 92, 0.16), 0 24px 50px rgba(90, 110, 80, 0.28); animation: rise 0.35s cubic-bezier(0.2, 1.3, 0.4, 1); }
@keyframes rise { from { transform: translateY(18px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
.logo {
  font-size: 50px; letter-spacing: 0.5px; line-height: 1.1; color: var(--pink); white-space: nowrap;
  text-shadow: 0 4px 0 rgba(224, 112, 143, 0.2);
}
.logo .dots { display: inline-flex; gap: 5px; margin-left: 6px; vertical-align: -2px; }
/* 점 세 개는 작은 몬스터 얼굴. 하나만 다르게 깜빡인다 (누가 사람일까?) */
.logo .dots i {
  position: relative; width: 17px; height: 17px; border-radius: 50%; background: #ffd27a; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.1);
  animation: hop 2.4s ease-in-out infinite;
}
.logo .dots i:nth-child(2) { background: #a8e0a0; animation-delay: 0.18s; }
.logo .dots i:nth-child(3) { background: #a9c9ff; animation-delay: 0.36s; }
.logo .dots i::before, .logo .dots i::after { content: ""; position: absolute; top: 6px; width: 3px; height: 4px; border-radius: 50%; background: var(--ink); animation: blink 3.6s infinite; }
.logo .dots i::before { left: 4px; }
.logo .dots i::after { right: 4px; }
.logo .dots i:nth-child(2)::before, .logo .dots i:nth-child(2)::after { animation-duration: 1.7s; }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-7px); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
.tag { font-size: 14.5px; color: var(--soft); }
#guide { background: var(--mint); border-radius: 22px; }
#gtitle { font-size: 19px; }
#picker { background: #fff1f5; border-radius: 22px; padding: 10px 14px; }
.ghost { transition: transform 0.12s; }
.ghost:hover { transform: scale(1.1); }
#name { height: 50px; border-radius: 16px; border-color: #ece6f5; font-weight: 600; }
#name::placeholder { color: #b9b2c9; font-weight: 400; }
.primary { height: 58px; font-size: 22px; border-radius: 18px; letter-spacing: 0.5px; background: linear-gradient(#ffa1b9, #ff86a5); box-shadow: 0 6px 0 var(--pink-d), 0 12px 20px rgba(255, 143, 171, 0.35); transition: transform 0.1s, filter 0.15s; }
.primary:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
.primary:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--pink-d); }
.primary:disabled { background: #d9d4e2; box-shadow: 0 6px 0 #c1bbcc; }
.chip { font-size: 14px; padding: 8px 14px; box-shadow: 0 3px 0 rgba(120, 140, 110, 0.28); transition: transform 0.1s; }
.chip:hover { transform: translateY(-1px); }
#roomrow { background: #f6f3fb; border-radius: 16px; padding: 8px 10px; font-size: 13.5px; }
#roomName b { font-family: var(--disp); font-weight: 400; font-size: 16px; }
#mystats { background: #fff8e6; color: #9a7a2e; border-radius: 12px; padding: 7px 10px; }
#mystats:empty { display: none; }
.col { min-width: 0; }
@media (min-width: 900px) and (min-height: 520px) {
  .card.wide { width: min(880px, 100%); display: grid; grid-template-columns: 1.08fr 1fr; gap: 26px; align-items: center; padding: 30px; }
  .card.wide #guide { margin-bottom: 0; }
  .card.wide #picker { padding: 14px; }
  .card.wide #pvc { width: 128px; height: 128px; }
}
/* 화면이 낮으면(눕힌 폰, 작은 노트북) 가이드 그림을 줄인다 */
@media (max-height: 760px) and (max-width: 899px) { #gpic svg { max-height: 120px; } .logo { font-size: 36px; } }
@media (max-width: 520px) { .card { padding: 20px 18px 16px; border-radius: 26px; } .logo { font-size: 36px; } }

/* --- 잡힌 화면 --- */
#dead h2 { font-size: 46px; transform: rotate(-3deg); text-shadow: 0 4px 0 rgba(224, 112, 143, 0.2); margin-bottom: 12px; }
#deadWhy { font-size: 16px; }
#deadStat { background: var(--mint); border-radius: 14px; padding: 10px; font-weight: 700; }
#deadNew:not(:empty) { background: #eef4ff; border-radius: 14px; padding: 8px 10px; }

/* --- 게임 중 HUD --- */
.panel { background: rgba(255, 253, 248, 0.93); border: 3px solid #fff; border-radius: 20px; box-shadow: var(--toy); }
#hud { min-width: 150px; padding: 8px 14px 10px; }
#score { font-size: 34px; line-height: 1; text-shadow: 0 2px 0 rgba(224, 112, 143, 0.2); }
#rank { background: #f3eefb; color: var(--grape); border-radius: 999px; padding: 2px 9px; font-family: var(--disp); }
#rank:empty { display: none; }
#ammo .dot { width: 15px; height: 15px; background: radial-gradient(circle at 35% 30%, #b08a63, #7c5a3c); border: 0; box-shadow: 0 2px 0 rgba(90, 60, 30, 0.3); }
#ammo .dot.off { background: #ece6dd; box-shadow: none; }
#weapon b { font-size: 15px; }
#lb { padding: 8px 12px; font-size: 14.5px; }
#lb .r { padding: 1px 6px; border-radius: 9px; }
#lb .r:first-child .n { color: #d79a12; }
#lb .r.me { background: #fff0f4; }
#banner { font-size: 16px; border-width: 3px; box-shadow: var(--toy); }
#feed div { background: rgba(255, 253, 248, 0.9); border: 2px solid #fff; font-weight: 600; }
#compass { border: 3px solid #fff; box-shadow: var(--toy); font-size: 15px; }
#actions { gap: 10px; }
#actions button {
  background: var(--cream); border: 3px solid #fff; border-radius: 20px; min-width: 68px; height: 62px;
  box-shadow: 0 5px 0 rgba(96, 120, 92, 0.3), 0 10px 18px rgba(90, 110, 80, 0.16); transition: transform 0.08s;
}
#actions button:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(96, 120, 92, 0.3); }
#actions b { font-size: 17px; }
#actions i { margin-top: 3px; padding: 1px 7px; border-radius: 6px; background: #f1edf7; color: #8a84a0; font-size: 10.5px; font-weight: 700; }
#actions .fire { background: linear-gradient(#ffa1b9, #ff86a5); box-shadow: 0 5px 0 var(--pink-d), 0 10px 18px rgba(255, 143, 171, 0.3); }
#actions .fire i { background: rgba(255, 255, 255, 0.28); color: #fff; }
#actions button[data-a="dash"].cd i { background: none; }
@media (pointer: fine) { #actions { opacity: 0.95; } }
@media (max-width: 520px) { #actions { gap: 6px; } #actions button { min-width: 0; height: 56px; border-radius: 18px; } #actions b { font-size: 15px; } }
#mute, #skill { border: 3px solid #fff; }
#mute { width: 48px; height: 48px; box-shadow: var(--toy); }
#skill { left: 68px; height: 48px; font-size: 17px; }
#mini { border: 3px solid #fff; border-radius: 20px; box-shadow: var(--toy); box-sizing: content-box; }
#coach { background: rgba(74, 68, 88, 0.86); border-radius: 20px; padding: 10px 22px; font-size: 16px; letter-spacing: 0.2px; width: max-content; }
#lockhint { border: 3px solid #fff; box-shadow: var(--toy); font-size: 15px; }
#mprog { border: 3px solid #fff; box-shadow: var(--toy); font-size: 15px; }
#toast { font-size: 34px; border: 4px solid #fff; box-shadow: 0 6px 0 rgba(60, 90, 60, 0.18), 0 14px 26px rgba(60, 90, 60, 0.22); animation: pop 0.3s cubic-bezier(0.2, 1.5, 0.4, 1); }
#freeze { font-size: 38px; border-radius: 22px; }
#quiz, #mem { border: 4px solid #fff; border-radius: 26px; box-shadow: var(--toy); }
#qtext { font-size: 38px; }
#buff { border: 3px solid #fff; }
#rpbar { border: 3px solid rgba(255, 255, 255, 0.85); }
#cross { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 2px 6px rgba(0, 0, 0, 0.15); }
.tog { font-size: 15px; box-shadow: 0 3px 0 var(--pink-d); }
.tog.off { box-shadow: 0 3px 0 #c1bbcc; }
@media (max-width: 520px) { #toast { font-size: 24px; } #freeze { font-size: 28px; } #score { font-size: 28px; } }
@media (prefers-reduced-motion: reduce) { .logo .dots i, .card { animation: none; } }
/* 폰에서는 퀴즈 창이 점수판과 나침반 아래로 내려온다 */
@media (max-width: 520px) { #quiz, #mem { top: 206px; } }
/* 감도 막대 */
#setSens { -webkit-appearance: none; appearance: none; height: 10px; border-radius: 999px; background: #efe9f6; outline: none; }
#setSens::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--pink); border: 3px solid #fff; box-shadow: 0 2px 0 var(--pink-d); cursor: pointer; }
#setSens::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--pink); border: 3px solid #fff; box-shadow: 0 2px 0 var(--pink-d); cursor: pointer; }
/* 화면 가장자리를 살짝 눌러 가운데로 눈이 가게 한다 */
#vig { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, rgba(255, 255, 255, 0) 55%, rgba(86, 130, 96, 0.2) 100%); }

/* --- 눕힌 폰 (낮고 넓은 화면) --- */
@media (max-height: 520px) and (min-width: 600px) {
  .overlay { padding: 8px; }
  .card.wide { width: min(800px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: center; padding: 12px 16px; border-radius: 24px; }
  .logo { font-size: 30px; }
  .logo .dots i { width: 12px; height: 12px; }
  .logo .dots i::before, .logo .dots i::after { top: 4px; width: 2px; height: 3px; }
  .logo .dots i::before { left: 3px; }
  .logo .dots i::after { right: 3px; }
  .tag { margin: 2px 0 6px; font-size: 12px; }
  #guide { margin: 0; padding: 6px 10px; border-radius: 16px; }
  #gpic svg { max-height: 86px; }
  #gtitle { font-size: 15px; margin: 2px 0; }
  #gtext { font-size: 12px; line-height: 1.4; min-height: 34px; }
  #gnav { margin-top: 2px; }
  .ghost { width: 28px; height: 28px; font-size: 17px; }
  #picker { padding: 4px 10px; margin-bottom: 6px; border-radius: 16px; }
  #pvc { width: 70px; height: 70px; }
  #pkcolors { margin-top: 4px; }
  #pklock { margin-top: 3px; min-height: 0; }
  #mystats { margin-bottom: 6px; padding: 4px 8px; font-size: 11.5px; }
  #acct { margin-bottom: 6px; min-height: 0; }
  #roomrow { margin-bottom: 6px; padding: 4px 8px; }
  .chip { padding: 5px 11px; font-size: 13px; }
  #name { height: 38px; font-size: 15px; }
  .primary { height: 44px; font-size: 19px; margin-top: 6px; box-shadow: 0 4px 0 var(--pink-d); }
  .note { min-height: 0; margin-top: 4px; font-size: 12px; }
  #dead .card, #settings .card { padding: 14px 20px; }
  #dead h2 { font-size: 34px; margin-bottom: 6px; }
  /* 게임 중 */
  #hud { transform: scale(0.8); transform-origin: top left; }
  #lb { transform: scale(0.85); transform-origin: top right; }
  #compass { top: 112px; }
  #coach { bottom: 78px; font-size: 13px; padding: 7px 16px; }
  #mprog { bottom: 116px; }
  #mini, #mute, #skill { bottom: max(10px, env(safe-area-inset-bottom)); }
  #mini { width: 132px; height: 95px; }
  #actions button { height: 52px; min-width: 62px; }
  #quiz, #mem { top: 8px; padding: 8px 14px 10px; }
  #qtext { font-size: 28px; margin: 2px 0 6px; }
  #mtext { font-size: 30px; min-height: 38px; }
  #qbtns button, #mbtns button { height: 44px; }
  #toast { top: 22%; font-size: 24px; }
  #freeze { top: 12%; font-size: 26px; }
  #fwarn { font-size: 42px; top: 28%; }
}
/* 잡힌 화면 그림 */
#deadPic svg { width: 220px; height: auto; display: block; margin: -14px auto -8px; overflow: visible; }
#deadPic .spin { transform-origin: 60px 22px; transform-box: view-box; animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-height: 520px) { #deadPic svg { width: 96px; } }
/* 작은 움직임: 점수, 소식, 알림 */
#score { display: inline-block; }
#score.bump { animation: bump 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.7) rotate(-6deg); color: #ff5c7a; } 100% { transform: scale(1); } }
#feed div { animation: drop 0.3s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes drop { from { transform: translateY(-10px) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
#banner:not(.hidden) { animation: bannerIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes bannerIn { from { transform: translateX(-50%) translateY(-16px) scale(0.9); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
#lb .r { transition: background 0.3s; }
@media (prefers-reduced-motion: reduce) { #score.bump, #feed div, #banner:not(.hidden) { animation: none; } }
/* 한글이 낱말 중간에서 끊기지 않게 */
body { word-break: keep-all; overflow-wrap: anywhere; }

/* 행동 버튼 아이콘 */
#actions svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 1px; position: relative; flex: none; }
#actions button { height: 72px; }
#actions button[data-a="do"] svg { fill: #ffe08a; stroke: #e0a92e; }
#actions button[data-a="jump"] svg { stroke: #6a9be0; }
#actions button[data-a="dash"] svg { stroke: #6fbf8a; }
#actions .fire svg { stroke: #fff; }
@media (pointer: coarse) { #actions button { height: 60px; } }
@media (max-width: 520px) { #actions button { height: 60px; } #actions svg { width: 19px; height: 19px; } }
@media (max-height: 520px) and (min-width: 600px) { #actions button { height: 54px; } #actions svg { width: 17px; height: 17px; margin: 0; } }
/* 순위표: 1등 왕관, 2, 3등 메달 */
#lb .rk { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 5px; border-radius: 50%; font-size: 11.5px; font-weight: 800; color: #8a84a0; background: #f1edf7; vertical-align: 1px; }
#lb .r:nth-child(1) .rk { background: #ffd66e; color: #8a5a00; box-shadow: 0 2px 0 #e6b43a; }
#lb .r:nth-child(2) .rk { background: #e3e7ef; color: #5f6678; box-shadow: 0 2px 0 #c3c9d6; }
#lb .r:nth-child(3) .rk { background: #f3c9a4; color: #7a4a22; box-shadow: 0 2px 0 #dca67a; }
#lb .crown { display: block; width: 18px; height: 11px; margin: -14px auto -1px; }
#lb .r .sc { font-weight: 800; color: #6b6480; }

/* 시작 화면: 뒤의 마을과 하늘이 보이게 막을 걷는다. 카드 아래쪽만 살짝 받쳐 준다. */
#start { background: linear-gradient(180deg, rgba(255, 253, 248, 0) 35%, rgba(255, 248, 236, 0.42) 100%); backdrop-filter: none; }
#start .card { box-shadow: 0 8px 0 rgba(96, 120, 92, 0.18), 0 30px 70px rgba(70, 90, 70, 0.32); }

/* 점수판의 지금 내 모습. 변신하면 통 튄다. */
#face { width: 42px; height: 42px; margin: -4px 4px -4px -4px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #ffffff, #fdeef3); border: 3px solid #fff; box-shadow: 0 2px 0 rgba(96, 120, 92, 0.18); flex: none; }
#face.bump { animation: bump 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }

/* 로고 글자가 물결처럼 차례로 통통 */
.logo .ch { display: inline-block; animation: hop 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * 0.07s); }
.logo .ch.gap { width: 0.28em; }
@keyframes hop { 0%, 62%, 100% { transform: none; } 70% { transform: translateY(-7px) rotate(-3deg); } 78% { transform: translateY(1px) scaleY(0.94); } 84% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .logo .ch { animation: none; } }

/* 얼음 신호: 화면 가장자리에 하늘색 서리, 네 귀퉁이에 눈송이 */
#frost { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.18s; background: radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0) 52%, rgba(196, 232, 255, 0.5) 86%, rgba(232, 247, 255, 0.85) 100%); box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.7), inset 0 0 60px rgba(150, 205, 245, 0.55); }
#frost.on { opacity: 1; transition: opacity 0.08s; }
#frost i { position: absolute; width: 64px; height: 64px; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke='%23ffffff' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M20 3v34M5.3 11.5l29.4 17M5.3 28.5l29.4-17M20 3l-4 4M20 3l4 4M20 37l-4-4M20 37l4-4'/%3E%3C/svg%3E"); filter: drop-shadow(0 2px 4px rgba(90, 160, 220, 0.6)); }
#frost.on i { animation: flake 0.35s cubic-bezier(0.2, 1.6, 0.4, 1); }
/* 귀퉁이는 점수판, 순위표, 미니맵 자리라 양옆 가운데쯤에 둔다 */
#frost i:nth-child(1) { left: 16px; top: 36%; }
#frost i:nth-child(2) { right: 16px; top: 33%; transform: rotate(20deg); }
#frost i:nth-child(3) { left: 30px; top: 56%; width: 40px; height: 40px; transform: rotate(-15deg); }
#frost i:nth-child(4) { right: 34px; top: 54%; width: 42px; height: 42px; transform: rotate(35deg); }
@keyframes flake { from { scale: 0.3; opacity: 0; } to { scale: 1; opacity: 1; } }
@media (max-width: 520px) { #frost i { width: 40px; height: 40px; } }

/* 시작 화면 오른쪽 위 언어 바꾸기 */
#start .card { position: relative; }
#langBtn { position: absolute; top: 6px; right: 12px; z-index: 2; font-size: 12px; padding: 4px 10px; }
@media (max-height: 520px), (max-width: 560px) { #langBtn { top: 4px; right: 8px; font-size: 11px; padding: 3px 9px; } }
/* 언어 목록: 칩 모양 그대로, 오른쪽에 작은 화살표 */
select.langsel { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 24px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236f6885' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 9px center; }
#settings select.langsel { font-size: 14px; padding: 6px 26px 6px 12px; }
#langBtn.langsel { padding-right: 24px; width: 104px; text-overflow: ellipsis; }
@media (max-height: 520px), (max-width: 560px) { #langBtn.langsel { width: 86px; padding-right: 20px; background-position: right 7px center; } }

/* 결과 카드: 이번 판 별명, 기록 네 칸, 다시 하기와 자랑하기 */
#deadBadge { display: inline-block; margin: 2px auto 10px; padding: 6px 16px; border-radius: 999px; font-family: 'Jua', 'Pretendard Variable', sans-serif; font-size: 17px; color: #fff; background: #8fcf8a; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12); transform: rotate(-2deg); animation: badgeIn 0.5s 0.15s both cubic-bezier(0.2, 1.6, 0.4, 1); }
#deadBadge.b0 { background: linear-gradient(135deg, #ff8fa8, #ff6b8b); }
#deadBadge.b1 { background: linear-gradient(135deg, #7cc0ff, #5a9bd8); }
#deadBadge.b2 { background: linear-gradient(135deg, #ffb070, #f08a4b); }
#deadBadge.b3 { background: linear-gradient(135deg, #b89cff, #8f73d6); }
#deadBadge.b4 { background: linear-gradient(135deg, #ffd36b, #e8ae2f); color: #6b4d00; }
#deadBadge.b5 { background: linear-gradient(135deg, #9fdba0, #5fb870); }
@keyframes badgeIn { from { transform: scale(0.3) rotate(-14deg); opacity: 0; } to { transform: rotate(-2deg); opacity: 1; } }
#deadGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 12px; }
.rt { background: #f6f3fb; border-radius: 16px; padding: 10px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; animation: rtIn 0.4s both cubic-bezier(0.2, 1.4, 0.4, 1); animation-delay: calc(0.25s + var(--i) * 0.08s); }
.rt svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rt b { font-family: 'Jua', 'Pretendard Variable', sans-serif; font-size: 24px; line-height: 1.1; color: #4a4560; }
.rt span { font-size: 11.5px; color: #8c86a0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rt-score { color: #e8a93a; background: #fff6df; }
.rt-time { color: #5a9bd8; background: #e8f3ff; }
.rt-catch { color: #e0708f; background: #ffecf1; }
.rt-rank { color: #8f73d6; background: #f1ebff; }
@keyframes rtIn { from { transform: translateY(10px) scale(0.8); opacity: 0; } to { transform: none; opacity: 1; } }
#deadBtns { display: flex; gap: 8px; align-items: stretch; }
#deadBtns .primary { flex: 1; margin: 0; }
.sharebtn { border: 0; border-radius: 18px; background: #fff; color: #6f6885; font: inherit; font-weight: 800; padding: 0 16px; display: flex; align-items: center; gap: 6px; cursor: pointer; box-shadow: 0 4px 0 rgba(120, 140, 110, 0.28); }
.sharebtn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(120, 140, 110, 0.28); }
.sharebtn.hidden { display: none; }
.sharebtn:disabled { opacity: 0.6; cursor: default; }
#clip.rec svg { stroke: #ff5b7f; animation: clipBlink 1s ease-in-out infinite; }
@keyframes clipBlink { 50% { opacity: 0.3; } }
/* 영상 버튼까지 셋이면: 다시 시작은 한 줄 전체, 자랑하기와 영상은 아래에 나란히 (글자가 보이는 넓이에서만) */
@media (min-width: 521px) {
  #deadBtns.three { flex-wrap: wrap; }
  #deadBtns.three .primary { flex: 1 1 100%; }
  #deadBtns.three .sharebtn { flex: 1 1 0; justify-content: center; height: 48px; }
}
.sharebtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 520px) { #deadGrid { gap: 5px; } .rt b { font-size: 19px; } .rt span { font-size: 10.5px; } .sharebtn b { display: none; } .sharebtn { padding: 0 14px; } }
@media (prefers-reduced-motion: reduce) { #deadBadge, .rt { animation: none; } }

/* 서버 깨우는 중: 졸린 z 가 하나씩 떠오른다 */
#status.waking { color: #7b748f; background: #f6f3fb; border-radius: 14px; padding: 8px 12px; line-height: 1.45; }
.zzz { display: inline-flex; gap: 1px; margin-right: 6px; font-family: 'Jua', sans-serif; font-size: 15px; color: #8f73d6; }
.zzz i { font-style: normal; animation: zz 1.8s ease-in-out infinite; }
.zzz i:nth-child(2) { animation-delay: 0.3s; font-size: 1.15em; }
.zzz i:nth-child(3) { animation-delay: 0.6s; font-size: 1.3em; }
@keyframes zz { 0%, 100% { opacity: 0.25; transform: translateY(2px); } 50% { opacity: 1; transform: translateY(-3px); } }
/* 맞혔을 때 */
#flash { position: fixed; inset: 0; pointer-events: none; z-index: 6; opacity: 0; }
#flash.good { background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0) 30%, rgba(255, 236, 160, 0.55) 100%); animation: flash 0.45s ease-out; }
#flash.bad { background: radial-gradient(circle at 50% 45%, rgba(255, 140, 170, 0) 25%, rgba(255, 120, 150, 0.45) 100%); animation: flash 0.8s ease-out; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }
#hitpop { position: fixed; left: 50%; top: 20%; z-index: 7; pointer-events: none; font-family: 'Jua', sans-serif; font-size: 64px; color: #ffcf3f; -webkit-text-stroke: 3px #fff; paint-order: stroke; text-shadow: 0 5px 0 rgba(214, 150, 40, 0.45); opacity: 0; transform: translate(-50%, -50%); }
#hitpop.on { animation: hitpop 0.9s cubic-bezier(0.2, 1.5, 0.4, 1) forwards; }
@keyframes hitpop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.3); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 70% { opacity: 1; transform: translate(-50%, -60%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -85%) scale(0.9); } }
@media (prefers-reduced-motion: reduce) { #hitpop.on { animation-duration: 0.01s; } .zzz i { animation: none; } }

/* 방 찾기 창 */
#rooms .card { width: min(460px, calc(94 * var(--vw, 1vw))); text-align: left; }
#rooms h2 { text-align: center; margin-bottom: 12px; }
#rooms h3 { margin: 14px 0 8px; font-size: 15px; color: #6f6885; }
#rooms input { width: 100%; box-sizing: border-box; border: 2px solid #ece7f5; border-radius: 14px; padding: 10px 12px; font: inherit; font-size: 15px; background: #fff; outline: none; }
#rooms input:focus { border-color: #cdb8ff; }
#rmList { margin: 10px 0; max-height: calc(34 * var(--vh, 1vh)); overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.rmitem { display: flex; align-items: center; gap: 10px; background: #f6f3fb; border-radius: 14px; padding: 8px 8px 8px 12px; animation: rtIn 0.3s both; }
.rmname { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rmname b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #4a4560; }
.rmname span { font-size: 12px; color: #9a94ad; letter-spacing: 0.08em; }
.rmn { position: relative; font-size: 12px; font-weight: 800; color: #6f6885; min-width: 44px; text-align: center; padding: 3px 6px; border-radius: 999px; background: #fff; overflow: hidden; }
.rmn i { position: absolute; left: 0; top: 0; bottom: 0; background: #dff3d8; z-index: 0; }
.rmn { isolation: isolate; }
.rmn i { z-index: -1; }
.rmitem .chip:disabled { opacity: 0.5; cursor: default; }
.rmnone { text-align: center; color: #9a94ad; padding: 14px 6px; background: #f6f3fb; border-radius: 14px; margin: 0; }
.rmcode { display: flex; gap: 8px; }
.rmcode input { flex: 1; text-transform: uppercase; letter-spacing: 0.12em; }
#rmMsg { min-height: 1em; margin: 6px 2px 0; font-size: 13px; color: #ff7d96; font-weight: 700; }
.rmmake { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rmbtn { border: 0; border-radius: 18px; padding: 12px 10px; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.08); }
.rmbtn:active { transform: translateY(2px); }
.rmbtn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.rmbtn b { font-size: 15px; }
.rmbtn span { font-size: 12px; opacity: 0.8; line-height: 1.3; }
.rmbtn.open { background: #e3f6dc; color: #3f8a4e; }
.rmbtn.priv { background: #f1ebff; color: #7358c2; }
#rmClose { display: block; margin: 12px auto 0; }
.rtag { font-style: normal; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; vertical-align: 1px; }
.rtag.open { background: #dff3d8; color: #3f8a4e; }
.rtag.priv { background: #ece4ff; color: #7358c2; }

/* ===== 폰: 가로 화면이 기본 (모바일 슈팅 게임 배치) ===== */
/* 세로로 들면 돌려 달라고 한다 */
#rotate { display: none; }
@media (pointer: coarse) and (orientation: portrait) and (max-width: 600px) {
  #rotate { display: flex; position: fixed; inset: 0; z-index: 60; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: linear-gradient(160deg, #e9f7ff, #fdf3ff); color: #6f6885; font-family: 'Jua', 'Pretendard Variable', sans-serif; font-size: 20px; text-align: center; padding: 24px; }
  .rphone { width: 64px; height: 110px; border: 5px solid #ff8fab; border-radius: 16px; position: relative; animation: rphone 2.2s ease-in-out infinite; background: #fff; }
  .rphone i { position: absolute; left: 50%; bottom: 6px; width: 14px; height: 4px; margin-left: -7px; border-radius: 4px; background: #ffc2d1; }
  @keyframes rphone { 0%, 25% { transform: rotate(0); } 55%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
}
@media (pointer: coarse) and (orientation: landscape) {
  /* 오른쪽 아래: 큰 발사 버튼과 그 둘레의 점프, 대시, 액션 */
  html body #actions { left: auto; transform: none; right: max(14px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); width: 210px; height: 200px; padding: 0; display: block; max-width: none; opacity: 1; }
  html body #actions button[data-a] { position: absolute; margin: 0; overflow: hidden; width: 58px; height: 58px; min-width: 0; padding: 0; border-radius: 50%; flex: none; gap: 0; border: 3px solid #fff; background: rgba(255, 255, 255, 0.88); }
  html body #actions button svg { width: 22px; height: 22px; }
  html body #actions b { font-size: 10px; line-height: 1; margin-top: 2px; }
  html body #actions i { display: none; }
  html body #actions button[data-a="fire"] { width: 92px; height: 92px; right: 0; bottom: 0; background: #ff8fab; color: #fff; display: flex; }
  html body #actions button[data-a="fire"] svg { width: 36px; height: 36px; }
  html body #actions button[data-a="fire"] b { font-size: 12px; }
  /* 발사 버튼 둘레 반원(반지름 131) 위에 30도 간격: 점프, 검, 대시, 액션 (서로 10px 남짓 띄움) */
  html body #actions [data-a="jump"] { right: 148px; bottom: 17px; }
  html body #actions [data-a="slash"] { right: 130px; bottom: 83px; }
  html body #actions [data-a="dash"] { right: 83px; bottom: 130px; }
  html body #actions [data-a="do"] { right: 17px; bottom: 148px; }
  /* 말풍선: 점프 왼쪽 아래에 작게, 고르는 창은 3 x 2 로 그 위에 */
  html body #actions button[data-a="emo"] { right: 214px; bottom: 22px; width: 42px; height: 42px; }
  html body #actions button[data-a="emo"] svg { width: 17px; height: 17px; }
  html body #actions button[data-a="emo"] b { font-size: 9px; }
  html body #actions #emoPick { left: auto; right: 232px; bottom: 74px; display: grid; grid-template-columns: repeat(3, 42px); border-radius: 22px; }
  html body #actions #emoPick.hidden { display: none; }
  html body #skill { left: auto; right: max(180px, calc(env(safe-area-inset-right) + 166px)); bottom: max(164px, calc(env(safe-area-inset-bottom) + 152px)); height: 42px; font-size: 14px; padding: 0 14px; }
  /* 왼쪽 아래: 늘 보이는 이동 스틱 (누른 곳으로 따라온다) */
  html body #joy.rest { left: max(96px, calc(env(safe-area-inset-left) + 84px)); top: calc(100% - max(96px, calc(env(safe-area-inset-bottom) + 84px))); opacity: 0.55; }
  /* 위: 왼쪽은 설정 단추와 내 정보, 오른쪽은 미니맵과 순위 */
  html body #mute { top: max(8px, env(safe-area-inset-top)); bottom: auto; left: max(8px, env(safe-area-inset-left)); width: 40px; height: 40px; font-size: 18px; }
  html body #hud { left: max(56px, calc(env(safe-area-inset-left) + 52px)); top: max(8px, env(safe-area-inset-top)); min-width: 0; padding: 5px 10px 6px; font-size: 12px; }
  html body #hud #weapon { display: none; }
  html body #hud #mission { font-size: 11px; max-width: calc(34 * var(--vw, 1vw)); }
  html body #compass { top: 96px; left: max(56px, calc(env(safe-area-inset-left) + 52px)); font-size: 12px; padding: 3px 10px 3px 6px; }
  html body #mini { top: max(8px, env(safe-area-inset-top)); bottom: auto; right: max(10px, env(safe-area-inset-right)); width: 128px; height: 92px; }
  html body #lb { top: max(8px, env(safe-area-inset-top)); right: calc(var(--miniW, 128px) + 24px + env(safe-area-inset-right)); min-width: 0; padding: 4px 8px; font-size: 11px; }
  html body #lb .r:nth-child(n+4):not(.me) { display: none; }
  html body #coach { bottom: max(10px, env(safe-area-inset-bottom)); font-size: 12.5px; padding: 7px 14px; max-width: calc(44 * var(--vw, 1vw)); width: auto; white-space: normal; }
  html body #toast { font-size: 22px; }
  html body #hitpop { font-size: 46px; }
  html body #feed { top: 52px; font-size: 11px; }
  /* 신호 문제 창: 가운데 위에 작게 */
  html body #quiz, html body #mem { top: max(6px, env(safe-area-inset-top)); width: min(300px, calc(40 * var(--vw, 1vw))); padding: 6px 10px 8px; border-radius: 18px; }
  html body #qtext { font-size: 22px; margin: 2px 0 4px; }
  html body #mtext { font-size: 26px; min-height: 32px; margin: 2px 0 4px; letter-spacing: 4px; }
  html body #qbtns, html body #mbtns { margin-top: 6px; gap: 6px; }
  html body #qbtns button, html body #mbtns button { height: 40px; font-size: 20px; }
}

/* 세로로 든 폰: 화면 전체를 돌려 가로로 (크기와 돌리기는 client.js applyRot 가 맞춘다) */
html.rot, html.rot body { overflow: hidden; }
html.rot body { position: fixed; top: 0; left: 0; margin: 0; transform-origin: 0 0; }

/* 창 안의 두 칸: 평소에는 위아래 그대로, 낮은 화면(가로 폰)에서는 좌우로 나눠 한눈에 */
.cols, .colL, .colR { display: contents; }
@media (max-height: 520px) and (min-width: 600px) {
  #settings .card, #dead .card, #rooms .card { width: min(760px, calc(96 * var(--vw, 1vw))); max-height: calc(94 * var(--vh, 1vh)); padding: 12px 18px; }
  .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; text-align: left; }
  .colL, .colR { display: block; min-width: 0; }
  #settings h2, #rooms h2 { margin: 0 0 8px; font-size: 22px; }
  #settings h3 { margin: 4px 0 6px; }
  .setrow { padding: 6px 2px; font-size: 14px; }
  #skillList { font-size: 12.5px; margin: 0; }
  #setClose { margin-top: 10px; height: 44px; }
  #dead .colL { text-align: center; align-self: center; }
  #dead h2 { font-size: 30px; margin: 0 0 4px; }
  #deadPic svg { width: 88px; margin: -6px auto -4px; }
  #dead p { margin: 3px 0; font-size: 13.5px; }
  #deadBadge { margin: 4px auto 0; font-size: 15px; }
  #deadGrid { margin: 0 0 8px; }
  .rt { padding: 7px 2px 6px; }
  .rt b { font-size: 20px; }
  #deadNew:not(:empty) { font-size: 12.5px; padding: 6px 8px; margin: 0 0 8px; }
  #deadBtns .primary { height: 48px; }
  #rmList { max-height: calc(58 * var(--vh, 1vh)); margin: 8px 0 0; }
  #rooms h3 { margin: 10px 0 6px; }
  .rmbtn { padding: 8px 6px; }
  .rmbtn span { font-size: 11px; }
  #rmClose { margin-top: 8px; }
}

/* 처음 두 판: 폰 조작 말풍선 (통통 튀며 가리킨다) */
.mhint { position: fixed; z-index: 4; pointer-events: none; max-width: 190px; background: #4a4458; color: #fff; font-size: 12.5px; font-weight: 700; line-height: 1.35; padding: 7px 11px; border-radius: 12px; box-shadow: 0 4px 10px rgba(40, 30, 60, 0.25); animation: mhint 1.4s ease-in-out infinite; }
.mhint::after { content: ""; position: absolute; bottom: -6px; width: 12px; height: 12px; background: inherit; transform: rotate(45deg); border-radius: 2px; }
#hintMove { left: max(40px, calc(env(safe-area-inset-left) + 30px)); bottom: max(170px, calc(env(safe-area-inset-bottom) + 160px)); }
#hintMove::after { left: 48px; }
#hintFire { right: max(186px, calc(env(safe-area-inset-right) + 172px)); bottom: max(62px, calc(env(safe-area-inset-bottom) + 50px)); }
#hintFire::after { right: -5px; bottom: auto; top: calc(50% - 6px); }
@keyframes mhint { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .mhint { animation: none; } }

/* PC: 톱니 옆에 설정 키(P) 안내 */
@media (pointer: fine) {
  #mute::after { content: "P  " attr(data-label); position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%); white-space: pre; font-size: 13px; font-weight: 800; color: #6f6885; background: rgba(255, 255, 255, 0.92); padding: 5px 10px; border-radius: 999px; box-shadow: 0 2px 0 rgba(120, 140, 110, 0.3); text-decoration: none; pointer-events: none; }
  #mute.off::after { color: #6f6885; }
}

/* 모자 고르기 */
#pkhats { display: flex; justify-content: center; gap: 5px; margin-top: 7px; }
#pkhats button { width: 30px; height: 30px; border-radius: 10px; border: 0; background: #fff; padding: 3px; cursor: pointer; box-shadow: 0 0 0 1px #eee6f2; }
#pkhats button svg { width: 100%; height: 100%; display: block; }
#pkhats button.on { box-shadow: 0 0 0 3px #4a4458; }
@media (max-height: 520px) { #pkhats { margin-top: 4px; gap: 4px; } #pkhats button { width: 24px; height: 24px; padding: 2px; border-radius: 8px; } }
#pkhats { flex-wrap: wrap; max-width: 220px; margin-left: auto; margin-right: auto; }
#pkhats button { position: relative; }
#pkhats button.locked svg { opacity: 0.35; filter: grayscale(0.6); }
#pkhats button.locked i { position: absolute; right: -4px; bottom: -4px; font-style: normal; font-size: 9px; font-weight: 800; color: #fff; background: #8f73d6; border-radius: 999px; padding: 1px 4px; line-height: 1.2; }
@media (max-height: 520px) { #pkhats { max-width: 190px; } }

/* 결과 화면: 새로 열린 것 */
#deadNew svg.nh { width: 26px; height: 26px; vertical-align: -8px; margin-left: 4px; background: #fff; border-radius: 8px; padding: 2px; box-shadow: 0 0 0 2px #cdb8ff; animation: pop 0.4s ease-out; }
#deadNew.fresh { background: linear-gradient(135deg, #fff4d6, #ffe7f0); color: #c9748a; }

/* 시작 화면: 지금 접속한 사람 수 (초록 점이 숨 쉰다) */
#online { display: flex; width: max-content; max-width: 100%; align-items: center; gap: 7px; margin: -4px auto 10px; padding: 4px 12px; border-radius: 999px; background: #e9f8e4; color: #3f8a4e; font-size: 13px; font-weight: 800; }
#online.hidden { display: none; }
#online i { width: 8px; height: 8px; border-radius: 50%; background: #4cc26a; box-shadow: 0 0 0 0 rgba(76, 194, 106, 0.6); animation: live 1.8s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(76, 194, 106, 0.55); } 100% { box-shadow: 0 0 0 9px rgba(76, 194, 106, 0); } }
@media (max-height: 520px) { #online { margin: 0 auto 4px; font-size: 11.5px; padding: 2px 10px; } }

/* 처음 온 사람 체크리스트 (왼쪽, 나침반 아래) */
#tut { position: fixed; left: 10px; top: 210px; z-index: 3; pointer-events: none; background: rgba(255, 253, 248, 0.94); border: 3px solid #fff; border-radius: 18px; padding: 8px 12px 9px; box-shadow: var(--toy, 0 4px 12px rgba(60, 90, 60, 0.18)); font-size: 13px; color: #6f6885; min-width: 150px; }
#tut b { display: block; font-size: 12px; color: #ff7da0; margin-bottom: 4px; letter-spacing: 0.3px; }
#tut div { display: flex; align-items: center; gap: 7px; line-height: 1.75; }
#tut i { width: 14px; height: 14px; border-radius: 5px; border: 2px solid #d9d3e6; box-sizing: border-box; flex: none; }
#tut div.ok { color: #9a94ad; text-decoration: line-through; }
#tut div.ok i { border-color: #6fcf8f; background: #6fcf8f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.5l4.5-5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; animation: pop 0.3s ease-out; }
@media (pointer: coarse) and (orientation: landscape) { html body #tut { top: 132px; left: max(56px, calc(env(safe-area-inset-left) + 52px)); font-size: 11.5px; padding: 5px 10px 6px; min-width: 0; } html body #tut div { line-height: 1.6; } }

/* HUD 손맛 */
#hud .row:first-child { position: relative; }
#scoreUp { position: absolute; left: 64px; top: -4px; font-family: 'Jua', sans-serif; font-size: 20px; color: #ffb02e; -webkit-text-stroke: 2px #fff; paint-order: stroke; opacity: 0; pointer-events: none; }
#scoreUp.on { animation: scoreUp 1.1s ease-out forwards; }
@keyframes scoreUp { 0% { opacity: 0; transform: translateY(8px) scale(0.6); } 20% { opacity: 1; transform: translateY(0) scale(1.15); } 100% { opacity: 0; transform: translateY(-22px) scale(1); } }
#ammo .dot.fresh { animation: ammoPop 0.45s cubic-bezier(0.2, 1.8, 0.4, 1); }
@keyframes ammoPop { 0% { transform: scale(0.3); } 100% { transform: scale(1); } }
#lb .r.me.up { animation: lbUp 1.2s ease-out; }
@keyframes lbUp { 0%, 40% { background: #fff1b8; transform: scale(1.06); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { #scoreUp.on, #ammo .dot.fresh, #lb .r.me.up { animation: none; } }
/* 내 체력 하트 (11/17). 맞으면 깨진 하트가 흔들리고 화면 가장자리가 붉게 번쩍인다 */
#hp { gap: 3px; }
#hp .ht { width: 17px; height: 16px; fill: #ff6b8b; filter: drop-shadow(0 2px 0 rgba(200, 60, 90, 0.3)); }
#hp .ht.off { fill: #ece6dd; filter: none; }
#hp .ht.lost { animation: htLost 0.6s ease-out; }
#hp .wait { font-size: 12px; color: #a39cb5; margin-left: 4px; }
@keyframes htLost { 0% { transform: scale(1.5) rotate(-12deg); fill: #ff6b8b; } 40% { transform: scale(0.9) rotate(8deg); } 100% { transform: none; } }
#hurt { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at 50% 45%, rgba(255, 90, 120, 0) 45%, rgba(255, 60, 100, 0.5) 100%); }
#hurt.on { animation: hurtF 0.7s ease-out; }
@keyframes hurtF { 0% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #hp .ht.lost { animation: none; } }
#hud #scoreUp { font-size: 24px; left: 74px; top: -12px; width: auto; }
#pkhats { max-width: 250px; }
@media (max-height: 520px) { #pkhats { max-width: 220px; } }

/* ===== 시작 화면 (11/17 새로 짬) =====
   넓은 화면: 게임 방법 | 캐릭터 무대 | 입장 패널 세 칸. 칸마다 같은 흰 패널, 강조색은 분홍 하나.
   예전 규칙(#picker, #guide, #mystats 등)보다 앞서도록 모두 #start 아래로 묶는다. */
#start.overlay {
  padding: 22px; align-items: center; overflow-y: auto;
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.5) 0%, rgba(236, 247, 230, 0.7) 100%);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
#start .st {
  width: min(1180px, 100%); height: min(680px, 100%); display: grid; gap: 18px;
  grid-template-columns: 290px minmax(0, 1fr) 440px; grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top top top" "guide play stage" "foot foot foot";
}
#start .st-top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 6px; }
#start .st-brand { min-width: 0; }
#start .logo { font-size: 46px; text-align: left; margin: 0; }
#start .tag { margin: 2px 0 0; font-size: 14px; color: var(--soft); text-align: left; }
#start .st-tools { display: flex; align-items: center; gap: 10px; flex: none; }
#start #online { margin: 0; background: rgba(255, 255, 255, 0.9); box-shadow: 0 2px 8px rgba(70, 90, 70, 0.1); }
#start #langBtn { position: static; font-size: 13px; height: 38px; width: 118px; padding: 0 26px 0 14px; box-shadow: 0 2px 8px rgba(70, 90, 70, 0.12); }
#start .st-icon {
  width: 38px; height: 38px; border: 0; border-radius: 50%; background: #fff; color: var(--soft); cursor: pointer;
  display: none; place-items: center; box-shadow: 0 2px 8px rgba(70, 90, 70, 0.12); padding: 0;
}
#start .st-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

#start .st-panel {
  min-height: 0; background: rgba(255, 255, 255, 0.9); border-radius: 28px; padding: 22px;
  box-shadow: 0 1px 0 #fff inset, 0 2px 0 rgba(70, 90, 70, 0.05), 0 18px 40px rgba(70, 90, 70, 0.14);
  animation: rise 0.4s cubic-bezier(0.2, 1.2, 0.4, 1) both;
}
#start .st-play { animation-delay: 0.05s; }
#start .st-stage { animation-delay: 0.1s; }
/* 칸 제목과 줄 이름 (11/17: 무엇을 하는 칸인지 바로 알게) */
#start .st-h { margin: 0 0 4px; font-family: var(--disp); font-weight: 400; font-size: 17px; color: var(--soft); letter-spacing: 0.02em; text-align: center; }
#start #guide .st-h { margin-bottom: 14px; }
#start #picker .st-h { margin-bottom: 6px; }
#start .st-lab { margin: 14px 0 6px; font-size: 12.5px; font-weight: 700; color: var(--soft); text-align: center; }
#start .st-lab small { font-weight: 500; font-size: 11.5px; color: #b6aec6; }
#start #pkhint { margin: 2px 0 0; font-size: 12.5px; color: var(--soft); min-height: 0; }
#start #pkhint:empty { display: none; }
/* 제목은 세 칸 모두 맨 위, 내용은 그 아래 남은 자리의 가운데 (제목 아래와 끝의 빈 공간을 똑같이 나눈다) */
#start .st-h { margin-bottom: auto !important; }
#start #guide::after, #start .st-play::after, #start #picker::after { content: ""; flex: 0 0 0; margin-top: auto; }

/* 게임 방법 */
#start #guide { grid-area: guide; position: relative; margin: 0; display: flex; flex-direction: column; justify-content: center; text-align: center; }
#start #gpic { background: #f4faef; border-radius: 20px; padding: 10px 6px; }
#start #gpic svg { max-height: 150px; }
#start #gtitle { margin: 16px 0 6px; font-size: 19px; color: var(--ink); }
#start #gtext { margin: 0; font-size: 14px; line-height: 1.6; color: var(--soft); min-height: 68px; }
#start #gnav { margin-top: 14px; }
#start #gdots i { background: #e6dfee; }
#start #gdots i.on { background: var(--pink); width: 18px; border-radius: 4px; }
#start .ghost { background: #f6f3fa; box-shadow: none; color: var(--soft); }
#start .st-close { display: none; position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; }

/* 캐릭터 무대 */
#start #picker {
  grid-area: stage; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  background: radial-gradient(120% 80% at 50% 30%, #ffffff 0%, #fff7fa 52%, #fdebf1 100%), rgba(255, 255, 255, 0.9);
}
#start .st-hero { display: flex; align-items: center; gap: 14px; }
#start .st-ped { position: relative; width: 250px; height: 250px; }
#start .st-ped::before {
  content: ""; position: absolute; left: 50%; bottom: 14px; width: 62%; height: 22px; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(closest-side, rgba(200, 120, 150, 0.32), rgba(200, 120, 150, 0));
}
#start #pvc { position: relative; width: 100%; height: 100%; }
#start .st-arrow {
  width: 48px; height: 48px; flex: none; border: 0; border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer;
  font-size: 28px; line-height: 1; padding-bottom: 4px; box-shadow: 0 3px 0 rgba(224, 112, 143, 0.18), 0 6px 16px rgba(70, 90, 70, 0.12); transition: transform 0.12s;
}
#start .st-arrow:hover { transform: scale(1.08); }
#start .st-arrow:active { transform: scale(0.95); }
#start #pkname { margin-top: 2px; font-size: 28px; color: var(--ink); }
#start #pklock { margin: 6px 0 0; min-height: 0; font-size: 13px; font-weight: 700; color: #b0577a; }
#start #pklock:not(:empty) { background: #ffe8ef; padding: 4px 12px; border-radius: 999px; }
#start #pkcolors { margin-top: 0; gap: 10px; }
#start #pkcolors button { width: 30px; height: 30px; border: 3px solid #fff; box-shadow: 0 0 0 1px #e8e1ef, 0 2px 4px rgba(70, 90, 70, 0.1); transition: transform 0.12s; }
#start #pkcolors button:hover { transform: scale(1.12); }
#start #pkcolors button.on { box-shadow: 0 0 0 3px var(--ink); }
#start #pkhats { display: grid; grid-template-columns: repeat(8, 40px); gap: 12px 7px; max-width: none; margin: 0 0 6px; }
#start #pkhats button { width: 40px; height: 40px; padding: 6px; border-radius: 13px; background: #fff; box-shadow: 0 0 0 1px #eee6f2, 0 2px 4px rgba(70, 90, 70, 0.08); transition: transform 0.12s; }
#start #pkhats button:hover { transform: translateY(-2px); }
#start #pkhats button.on { box-shadow: 0 0 0 3px var(--ink); }
#start #pkhats button.locked { background: #f7f5fa; }
#start #pkhats button.locked svg { opacity: 0.28; }
#start #pkhats button.locked i { right: auto; left: 50%; bottom: -5px; transform: translateX(-50%); white-space: nowrap; font-size: 9.5px; line-height: 14px; padding: 0 5px; background: #9a80dc; box-shadow: 0 0 0 2px #fff; }

/* 입장 패널 */
#start .st-play { grid-area: play; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
#start .st-play > * { width: 100%; max-width: 400px; align-self: center; }
#start #name { height: 52px; margin: 0; border-radius: 16px; font-size: 16px; }
#start #roomrow { margin: 0; justify-content: space-between; background: #f7f4fb; border-radius: 16px; padding: 8px 8px 8px 14px; font-size: 13.5px; }
#start #roomrow .chip { box-shadow: 0 2px 6px rgba(70, 90, 70, 0.12); }
#start #go { margin: 2px 0 0; height: 60px; border-radius: 18px; font-size: 23px; background: linear-gradient(180deg, #ff9fb8, #ff7fa1); box-shadow: 0 5px 0 #e0708f, 0 12px 24px rgba(255, 127, 161, 0.32); }
#start #go:active { box-shadow: 0 2px 0 #e0708f; }
/* 로그인하지 않았을 때 게임 시작 아래에 구글 로그인 시작 (로그인되면 바로 들어간다) */
#start #gbtnGo { display: flex; justify-content: center; min-height: 44px; }
/* 재생 버튼 모양: 게임 시작 버튼이라는 걸 글자 없이도 알게 */
#start #go { display: flex; align-items: center; justify-content: center; gap: 12px; }
#start #go::before { content: ""; width: 30px; height: 30px; flex: none; border-radius: 50%; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6.8v10.4c0 .8.9 1.3 1.6.8l7.6-5.2c.6-.4.6-1.2 0-1.6l-7.6-5.2C9.9 5.5 9 6 9 6.8z' fill='%23ff7fa1'/%3E%3C/svg%3E") no-repeat center / 20px; box-shadow: 0 2px 0 rgba(224, 112, 143, 0.35); }
#start .note { margin: 0; min-height: 0; text-align: center; }
#start .note:empty { display: none; }
#start #mystats { margin: 4px 0 0; padding: 0; background: none; border-radius: 0; color: var(--soft); }
#start .st-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
#start .st-stat { background: #faf7fd; border-radius: 16px; padding: 10px 4px 8px; text-align: center; }
#start .st-stat b { display: block; font-family: var(--disp); font-weight: 400; font-size: 24px; line-height: 1.1; color: var(--ink); }
#start .st-stat span { font-size: 11.5px; color: var(--soft); }
#start .st-next { margin-top: 10px; }
#start .st-bar { height: 8px; border-radius: 999px; background: #f0ebf5; overflow: hidden; }
#start .st-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffb27a, #ff7fa1); }
#start .st-next span { display: block; margin-top: 6px; font-size: 12.5px; color: var(--soft); text-align: center; }
#start #acct { margin: 2px 0 0; padding-top: 12px; border-top: 1px solid #f0ebf3; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--soft); text-align: center; }
#start #acct.hidden { display: none; }
#start #privLink { grid-area: foot; margin: 0; }

/* 1100 아래: 칸을 조금 좁힌다 */
@media (max-width: 1100px) {
  #start .st { grid-template-columns: 250px minmax(0, 1fr) 390px; gap: 14px; }
  #start .st-ped { width: 210px; height: 210px; }
  #start #pkhats { grid-template-columns: repeat(8, 36px); gap: 6px; }
  #start #pkhats button { width: 36px; height: 36px; padding: 5px; }
}
/* 좁은 화면(세로 창, 태블릿): 한 줄로 쌓는다. 게임 시작 -> 캐릭터 -> 게임 방법 */
@media (max-width: 860px) and (min-height: 561px) {
  #start.overlay { align-items: flex-start; }
  #start .st { height: auto; max-width: 520px; grid-template-columns: 1fr; grid-template-rows: none; grid-template-areas: "top" "play" "stage" "guide" "foot"; }
  #start .logo { font-size: 38px; }
}
/* 눕힌 폰 (낮고 넓은 화면): 게임 시작 | 캐릭터 두 칸, 게임 방법은 ? 버튼으로 연다 */
@media (max-height: 560px) and (min-width: 600px) {
  #start.overlay { padding: 10px 14px; }
  #start .st { height: 100%; gap: 10px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "top top" "play stage" "foot foot"; }
  #start .logo { font-size: 26px; }
  #start .logo .dots i { width: 12px; height: 12px; }
  #start .tag { font-size: 11.5px; }
  #start .st-icon { display: grid; width: 32px; height: 32px; }
  #start #langBtn { height: 32px; width: 96px; font-size: 12px; }
  #start #online { font-size: 11px; padding: 2px 10px; }
  #start .st-panel { padding: 10px 14px; border-radius: 20px; }
  #start .st-ped { width: 118px; height: 118px; }
  /* 낮은 화면: 칸 제목은 작게, 줄 이름과 랜덤 설명은 숨겨서 한 화면에 들어가게 */
  #start .st-h { font-size: 12.5px; line-height: 1.2; margin: 0 0 2px; }
  #start #guide .st-h { margin-bottom: 6px; }
  #start .st-lab, #start #pkhint { display: none; }
  #start #pkhats { margin-top: 8px; }
  #start .st-arrow { width: 36px; height: 36px; font-size: 22px; }
  #start #pkname { font-size: 19px; }
  #start #pklock { font-size: 11.5px; margin-top: 3px; }
  #start #pkcolors { margin-top: 6px; gap: 7px; }
  #start #pkcolors button { width: 22px; height: 22px; border-width: 2px; }
  #start #pkhats { margin-top: 7px; grid-template-columns: repeat(8, 28px); gap: 5px; }
  #start #pkhats button { width: 28px; height: 28px; padding: 3px; border-radius: 9px; }
  #start #pkhats button.locked i { font-size: 8px; bottom: 1px; padding: 0 3px; }
  #start .st-play { gap: 7px; }
  #start #name { height: 40px; font-size: 14px; border-radius: 12px; }
  #start #roomrow { padding: 4px 4px 4px 10px; font-size: 12px; border-radius: 12px; }
  #start #roomrow .chip { font-size: 12px; padding: 5px 10px; }
  #start #go { height: 46px; font-size: 19px; border-radius: 14px; }
  #start #go::before { width: 24px; height: 24px; background-size: 16px; }
  #start .st-stat { padding: 5px 2px 4px; border-radius: 12px; }
  #start .st-stat b { font-size: 17px; }
  #start .st-stat span { font-size: 10px; }
  #start .st-next { margin-top: 5px; }
  #start .st-next span { font-size: 10.5px; margin-top: 3px; }
  #start #acct { padding-top: 6px; gap: 3px; font-size: 10.5px; }
  #start #guide { display: none; }
  #start.guideOn #guide {
    display: flex; position: fixed; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: min(420px, calc(100% - 28px)); max-height: calc(100% - 24px); padding: 16px 18px; animation: none;
    background: #fff; box-shadow: 0 0 0 100vmax rgba(60, 70, 80, 0.28), 0 20px 60px rgba(60, 70, 60, 0.3);
  }
  #start.guideOn #gpic svg { max-height: 100px; }
  #start .st-close { display: grid; }
  #start #privLink { font-size: 10px; }
}
/* 아주 좁은 화면 (폭 600 아래): 한 줄 쌓기 */
@media (max-width: 599px) {
  #start.overlay { align-items: flex-start; padding: 14px; }
  #start .st { height: auto; grid-template-columns: 1fr; grid-template-rows: none; grid-template-areas: "top" "play" "stage" "guide" "foot"; }
  #start .st-top { flex-wrap: wrap; }
  #start .logo { font-size: 32px; }
  #start .st-ped { width: 170px; height: 170px; }
  #start #pkhats { grid-template-columns: repeat(8, 34px); gap: 6px; }
  #start #pkhats button { width: 34px; height: 34px; padding: 4px; }
}
@media (prefers-reduced-motion: reduce) { #start .st-panel { animation: none; } }

/* ===== 창 공통 (11/17): 결과, 설정, 친구 방 창을 시작 화면과 같은 흰 패널로 ===== */
.overlay:not(#start) {
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.42) 0%, rgba(236, 247, 230, 0.6) 100%);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.overlay .card {
  background: #fff; border: 0; border-radius: 28px;
  box-shadow: 0 1px 0 #fff inset, 0 2px 0 rgba(70, 90, 70, 0.05), 0 24px 60px rgba(60, 80, 60, 0.22);
}
.overlay .card h2 { color: var(--ink); }
.overlay .primary { border-radius: 18px; background: linear-gradient(180deg, #ff9fb8, #ff7fa1); box-shadow: 0 5px 0 #e0708f, 0 12px 24px rgba(255, 127, 161, 0.28); }
.overlay .primary:active { box-shadow: 0 2px 0 #e0708f; }
.overlay .primary:disabled { background: #d9d4e2; box-shadow: 0 5px 0 #c1bbcc; }
.overlay .chip { box-shadow: 0 2px 6px rgba(70, 90, 70, 0.12); }
.overlay .textbtn { color: var(--soft); text-decoration-color: #d9d2e3; text-underline-offset: 3px; }

/* 결과 창 */
#dead h2 { color: var(--pink); }
#dead .rt { background: #faf7fd; }
#dead .rt b { color: var(--ink); }
#deadNew { font-weight: 700; color: var(--soft); }
#deadNew:not(:empty) { background: none; padding: 0; margin: 0 0 12px; }
#deadNew.fresh { background: #fff3d6; color: #9a6a12; border-radius: 14px; padding: 8px 10px; }
#deadNew .st-next { margin: 0; }
#deadNew .st-bar { height: 8px; border-radius: 999px; background: #f0ebf5; overflow: hidden; }
#deadNew .st-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffb27a, #ff7fa1); }
#deadNew .st-next span { display: block; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--soft); text-align: center; }
#again { display: flex; align-items: center; justify-content: center; gap: 10px; }
#again::before {
  content: ""; width: 28px; height: 28px; flex: none; border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6.8v10.4c0 .8.9 1.3 1.6.8l7.6-5.2c.6-.4.6-1.2 0-1.6l-7.6-5.2C9.9 5.5 9 6 9 6.8z' fill='%23ff7fa1'/%3E%3C/svg%3E") no-repeat center / 18px;
  box-shadow: 0 2px 0 rgba(224, 112, 143, 0.35);
}
.sharebtn { box-shadow: 0 0 0 1px #eee6f2, 0 4px 0 rgba(120, 110, 140, 0.16); }

/* 설정 창: 켜고 끄기를 분홍/회색 알약에서 같은 모양의 스위치로 */
.overlay .setrow { border-bottom-color: #f3eff7; }
.overlay .tog { box-shadow: none; background: #ffe3ec; color: #d75c86; }
.overlay .tog.off { background: #f1eef5; color: #9a93ad; box-shadow: none; }
.overlay .how { background: #faf7fd; }

/* ===== 왼쪽 위 정보 묶음 (11/17) =====
   내 정보 카드, 임무 방향(나침반), 처음 온 사람 목록이 각자 고정 위치(top 10/128/156/210)에 떠 있어
   내용 길이에 따라 겹치거나 틈이 들쭉날쭉했다. 한 세로 묶음 안에서 늘 같은 간격으로 붙인다. */
#leftcol {
  position: fixed; top: max(10px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left));
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; pointer-events: none;
}
#leftcol #hud, #leftcol #compass, #leftcol #tut { position: static; top: auto; left: auto; transform: none; margin: 0; }
#leftcol #hud { background: rgba(255, 255, 255, 0.92); border: 0; border-radius: 20px; box-shadow: 0 1px 0 #fff inset, 0 8px 22px rgba(70, 90, 70, 0.16); }
#leftcol #compass { border: 0; background: rgba(255, 255, 255, 0.92); box-shadow: 0 6px 16px rgba(70, 90, 70, 0.14); }
#leftcol #tut { border: 0; background: rgba(255, 255, 255, 0.92); box-shadow: 0 6px 16px rgba(70, 90, 70, 0.14); border-radius: 18px; }
/* 눕힌 폰 (낮은 창): 묶음 전체를 줄인다 (카드만 줄이면 그 자리가 비어 틈이 생긴다) */
@media (max-height: 520px) and (min-width: 600px) {
  #leftcol { transform: scale(0.8); transform-origin: top left; gap: 6px; }
}
/* 터치 가로 화면: 왼쪽 위 설정 단추 옆에서 시작 */
@media (pointer: coarse) and (orientation: landscape) {
  html body #leftcol { left: max(56px, calc(env(safe-area-inset-left) + 52px)); top: max(8px, env(safe-area-inset-top)); transform: none; gap: 6px; }
}

/* 순위표와 미니맵도 같은 부드러운 흰 패널 (11/17) */
#lb.panel { background: rgba(255, 255, 255, 0.92); border: 0; box-shadow: 0 1px 0 #fff inset, 0 8px 22px rgba(70, 90, 70, 0.16); }
#mini { border: 0; box-shadow: 0 1px 0 #fff inset, 0 8px 22px rgba(70, 90, 70, 0.18); }

/* 등급 (11/18): 레어 파랑, 에픽 보라, 전설 금빛. 높은 등급일수록 칸과 받침대가 더 빛난다 */
#start .pk-namerow { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 2px; max-width: 100%; flex-shrink: 0; }
#start .pk-namerow #pkname { margin-top: 0; min-width: 0; }
#start #pktier { flex: none; margin-top: 2px; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: 0.02em; }
#start #pktier:empty, #start #pktier.t0 { display: none; }
#start #pktier.t1 { background: #e3f1ff; color: #3f86d0; }
#start #pktier.t2 { background: #efe6ff; color: #8656d6; }
#start #pktier.t3 { background: linear-gradient(90deg, #fff0b8, #ffd9e6); color: #b0740c; box-shadow: inset 0 0 0 1px #ffd76a; }
#start #pkhats button.t1:not(.on) { box-shadow: 0 0 0 2px #cfe5ff, 0 2px 4px rgba(70, 90, 70, 0.08); }
#start #pkhats button.t2:not(.on) { box-shadow: 0 0 0 2px #dccbff, 0 2px 6px rgba(134, 86, 214, 0.18); background: linear-gradient(180deg, #ffffff, #f6f0ff); }
#start #pkhats button.t3:not(.on) { box-shadow: 0 0 0 2px #ffd76a, 0 2px 8px rgba(240, 173, 44, 0.3); background: linear-gradient(180deg, #fffdf3, #fff2c8); }
#start #pkhats button.t1.locked i { background: #6fa8e8; }
#start #pkhats button.t2.locked i { background: #a77bf0; }
#start #pkhats button.t3.locked i { background: linear-gradient(90deg, #f6b73c, #ff8fab); }
#start #pkhats button.t3.locked svg { opacity: 0.4; }
#start .st-ped.t1::before { background: radial-gradient(closest-side, rgba(111, 168, 232, 0.4), rgba(111, 168, 232, 0)); }
#start .st-ped.t2::before { width: 70%; background: radial-gradient(closest-side, rgba(167, 123, 240, 0.5), rgba(167, 123, 240, 0)); }
#start .st-ped.t3::before { width: 78%; height: 26px; background: radial-gradient(closest-side, rgba(255, 196, 60, 0.6), rgba(255, 196, 60, 0)); }
#start .st-ped.t2::after, #start .st-ped.t3::after {
  content: ""; position: absolute; inset: 12% 14% 8%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(200, 170, 255, 0.28), rgba(200, 170, 255, 0)); animation: pedGlow 2.6s ease-in-out infinite;
}
#start .st-ped.t3::after { background: radial-gradient(closest-side, rgba(255, 220, 120, 0.38), rgba(255, 220, 120, 0)); }
@keyframes pedGlow { 0%, 100% { opacity: 0.6; transform: scale(0.96); } 50% { opacity: 1; transform: scale(1.04); } }
@media (max-height: 520px) { #start #pktier { padding: 1px 8px; font-size: 10.5px; } }
/* 넓고 낮은 화면(1280x720 등): 무대가 넘쳐 이름이 눌리고 모자 둘째 줄이 잘리던 것을 받침대를 줄여 맞춘다 */
@media (min-width: 1101px) and (max-height: 800px) { #start .st-ped { width: 210px; height: 210px; } }

/* 결과 창 아래 줄 (11/18): 처음으로(시작 화면) + 잡힌 순간 다시 보기 */
#deadMore { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
#deadMore:has(#rewatch.hidden) { justify-content: center; }
#deadMore .textbtn { margin-top: 0; }
.homebtn { border: 0; background: #f6f3fa; color: var(--soft); font: inherit; font-size: 14px; font-weight: 800; padding: 8px 15px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.homebtn:hover { background: #efeaf6; }
.homebtn:active { transform: translateY(1px); }
.homebtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-height: 520px) { #deadMore { margin-top: 6px; } .homebtn { padding: 5px 12px; font-size: 13px; } }
/* 모두의 마을 아래 한 줄 (11/18): 나라와 상관없이 다 같이 만나는 곳이라는 것 */
#roomName .rhint { display: block; font-size: 11.5px; font-weight: 600; color: var(--soft); margin-top: 1px; }
@media (max-height: 520px) { #roomName .rhint { font-size: 10px; } }
/* 친구 기록 도전 문구 (11/18): 공유 링크 ?c= 로 들어왔을 때 */
#chal { margin: 2px 0 8px; padding: 8px 12px; border-radius: 14px; background: #fff3c4; color: #7a5a12; font-size: 13px; font-weight: 600; text-align: center; line-height: 1.35; }
#chal b { color: #e0731e; white-space: nowrap; }
/* 친구 모자 초대 버튼 (11/18) */
#pkInvite { display: block; margin: 6px auto 0; border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; color: #b0577a; background: #ffe8ef; padding: 4px 12px; border-radius: 999px; }
#pkInvite u { color: #e0457a; text-underline-offset: 2px; }
@media (max-height: 520px) { #pkInvite { font-size: 11.5px; margin-top: 3px; } }
#pkInvite.hidden { display: none; }
/* 초대 안내가 뜨면 랜덤 설명 한 줄은 숨겨 모자 두 줄이 판 안에 들어가게 */
#start #pkhint:has(~ #pkInvite:not(.hidden)) { display: none; }
/* 낮은 노트북 화면: 잠김 안내나 초대 안내가 한 줄 더 생기면 받침대를 조금 줄여 모자 두 줄이 판 안에 남게 */
@media (min-width: 1101px) and (max-height: 800px) { #picker:has(#pklock:not(:empty)) .st-ped, #picker:has(#pkInvite:not(.hidden)) .st-ped { width: 180px; height: 180px; } }
/* 오늘의 순위 (11/18) */
#today { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; margin: 10px 0 0; padding: 7px 12px; border: 0; border-radius: 999px; background: #fff7dc; color: #7a5a12; font: inherit; font-size: 13px; cursor: pointer; }
#today.hidden { display: none; }
#today svg { width: 18px; height: 11px; flex: none; }
#today span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#today b { color: #c4610f; }
#topDlg .card { width: min(360px, calc(92 * var(--vw, 1vw))); }
#topList { list-style: none; margin: 10px 0 6px; padding: 0; }
#topList li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; }
#topList li:nth-child(odd) { background: #faf6fd; }
#topList li i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: #ece6f5; color: #6b6380; flex: none; }
#topList li.r1 i { background: #ffd76a; color: #7a5a12; }
#topList li.r2 i { background: #dfe6f0; }
#topList li.r3 i { background: #f3cfa8; color: #7a4a1e; }
#topList li b { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#topList li span { font-weight: 800; color: #c4610f; }
#topList li.empty { justify-content: center; color: var(--soft); }
@media (max-height: 520px) { #today { margin-top: 6px; padding: 5px 10px; font-size: 12px; } }
