/* 끝까지 진화 — 어두운 원시 바다 + 생물발광(GDD §1-5a). 글자·버튼 = DOM 층, 월드만 캔버스. 버튼 최소 48px · 대비 ≥ 4.5:1 */
:root {
  --bg: #050b1a; --bg2: #0a1630; --panel: rgba(10, 22, 48, 0.86); --line: rgba(120, 220, 255, 0.22);
  --ink: #eaf6ff; --muted: #a9c3dc; --glow: #5ff2e8; --violet: #a68bff; --warn: #ff6b6b; --gold: #ffd54a; --ok: #6cff9a;
  --r: 16px; --gap: 12px; --tap: 52px;
  --font: system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); overflow: hidden; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; touch-action: none; }
input, select { user-select: text; -webkit-user-select: text; font: inherit; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
#world { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); gap: var(--gap); z-index: 5; background: radial-gradient(ellipse at 50% 30%, rgba(30, 60, 120, 0.25), rgba(5, 11, 26, 0.55) 70%); }
.top, .bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.top { flex-wrap: nowrap; } .top .chip { min-width: 0; flex-shrink: 1; } .top .icon, .top .tix { flex-shrink: 0; }
.bar { justify-content: space-between; }
.bar b { font-size: 1.15rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); max-width: 46vw; }
.chip b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip small { color: var(--muted); }
#fsBtn { margin-left: auto; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 10px var(--glow); }
.tix b { color: var(--gold); font-size: 1.2rem; }
.icon { width: 48px; height: 48px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); font-size: 1.3rem; }
.brand { text-align: center; margin-top: 2vh; }
.brand h1 { margin: 0; font-size: clamp(2rem, 7vw, 3.4rem); letter-spacing: 0.04em; background: linear-gradient(90deg, #7ff8ee, #b49bff); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 0 30px rgba(95, 242, 232, 0.25); }
.brand p { margin: 4px 0 0; color: var(--muted); }
.cards { flex: 1; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); align-content: center; max-width: 760px; width: 100%; margin: 0 auto; min-height: 0; }
.card { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 4px; padding: 16px; min-height: 96px; max-height: 22vh; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); text-align: left; position: relative; overflow: hidden; }
.card i { font-style: normal; font-size: 1.6rem; position: absolute; top: 12px; right: 14px; opacity: 0.85; }
.card b { font-size: 1.15rem; }
.card small { color: var(--muted); }
.c-quiz { border-color: rgba(255, 213, 74, 0.5); box-shadow: inset 0 0 40px rgba(255, 213, 74, 0.08); }
.c-play { border-color: rgba(95, 242, 232, 0.6); box-shadow: inset 0 0 40px rgba(95, 242, 232, 0.12); }
.c-prac { border-color: rgba(166, 139, 255, 0.5); }
.rankbar { text-align: center; color: var(--muted); padding: 8px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 0.95rem; }
.rankbar b { color: var(--gold); }
.back { min-height: 44px; padding: 0 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: center; }
.pill { min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.pill.on { background: rgba(95, 242, 232, 0.2); border-color: var(--glow); }
.row.units { max-width: 680px; gap: 6px; }
.pill.unit { padding: 0 12px; font-size: 0.9rem; }
.pill:disabled { opacity: 0.35; }
.linkbtn { min-height: 44px; padding: 0 10px; background: none; border: 0; color: var(--muted); font-size: 0.82rem; text-decoration: underline; }
.big { min-height: 56px; padding: 0 28px; border-radius: 14px; background: linear-gradient(90deg, #1fb5ad, #6d55e8); font-weight: 700; font-size: 1.1rem; box-shadow: 0 0 20px rgba(95, 242, 232, 0.25); }
.big:disabled { opacity: 0.45; }
.mid { min-height: 48px; padding: 0 18px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.quiz-setup, .quiz-done { display: flex; flex-direction: column; gap: 16px; align-items: center; justify-content: center; flex: 1; text-align: center; }
.quiz-run { flex: 1; display: flex; flex-direction: column; gap: 14px; max-width: 720px; width: 100%; margin: 0 auto; justify-content: center; }
.qprog { display: flex; gap: 6px; justify-content: center; }
.qprog span { width: 28px; height: 8px; border-radius: 4px; background: var(--line); }
.qprog span.cur { background: var(--glow); }
.qprog span.done { background: var(--violet); }
.qtext { font-size: clamp(1.2rem, 4.5vw, 1.7rem); text-align: center; line-height: 1.45; padding: 12px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); }
.qchoices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qchoices button { min-height: 60px; padding: 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); font-size: 1.1rem; }
.qnum { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.qnum #qPad { align-self: stretch; }
.qnum input { width: 9ch; min-height: 56px; text-align: center; font-size: 1.6rem; letter-spacing: 0.3em; border-radius: 14px; border: 2px solid var(--glow); background: #071226; color: var(--ink); }
.qres { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.qres span { padding: 6px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.qres .r { border-color: var(--ok); } .qres .w { border-color: var(--warn); }
.mode-list { display: grid; gap: 10px; max-width: 640px; width: 100%; margin: 0 auto; }
.mode { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; text-align: left; padding: 14px 16px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); min-height: 72px; }
.mode b { font-size: 1.15rem; } .mode small { color: var(--muted); grid-column: 1; } .mode em { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-style: normal; color: var(--gold); }
.mode:disabled { opacity: 0.5; }
.friend { max-width: 640px; width: 100%; margin: 0 auto; padding: 12px; border-radius: var(--r); border: 1px dashed var(--line); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.friend input { width: 9ch; min-height: 48px; text-align: center; border-radius: 12px; border: 1px solid var(--line); background: #071226; color: var(--ink); text-transform: uppercase; letter-spacing: 0.15em; }
.waitbox, .resbox { margin: auto; display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; padding: 24px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); max-width: 560px; width: 100%; max-height: 92vh; overflow: auto; }
.big-num { font-size: 3rem; font-weight: 800; color: var(--glow); }
.code { font-size: 1.6rem; letter-spacing: 0.3em; color: var(--gold); }
/* ── HUD ── */
#hud { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
#hud button, #hud .evo, #hud .spec { pointer-events: auto; }
.hud-tl { position: absolute; left: max(12px, env(safe-area-inset-left)); top: max(10px, env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 4px; text-shadow: 0 1px 4px #000; }
.energy b { font-size: 1.7rem; color: var(--glow); } .energy small, .dna small { color: var(--muted); }
.dna span { font-size: 0.75rem; color: var(--violet); margin-right: 4px; } .dna b { color: #d6c8ff; }
.stage { font-size: 0.95rem; } .lives { color: #ff9eb0; letter-spacing: 0.1em; }
.hud-tc { position: absolute; left: 50%; top: max(10px, env(safe-area-inset-top)); transform: translateX(-50%); text-align: center; text-shadow: 0 1px 4px #000; }
.clock { font-size: 1.3rem; font-weight: 700; } .alive { color: var(--muted); font-size: 0.9rem; } .nextev { color: var(--gold); font-size: 0.85rem; }
#minimap { position: absolute; right: max(12px, env(safe-area-inset-right)); top: max(10px, env(safe-area-inset-top)); width: 120px; height: 120px; border-radius: 50%; border: 1px solid var(--line); background: rgba(5, 11, 26, 0.6); }
.banner { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); padding: 10px 18px; border-radius: 14px; background: rgba(40, 8, 8, 0.85); border: 1px solid var(--warn); font-size: 1.15rem; font-weight: 700; text-align: center; max-width: 90vw; }
.banner.info { background: rgba(8, 30, 40, 0.85); border-color: var(--glow); }
.tip { position: absolute; left: 50%; bottom: 26%; transform: translateX(-50%); padding: 8px 14px; border-radius: 12px; background: rgba(60, 10, 10, 0.85); border: 1px solid var(--warn); white-space: nowrap; }
.hint { position: absolute; left: 50%; bottom: 34%; transform: translateX(-50%); padding: 8px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); max-width: 86vw; text-align: center; }
.evo { position: absolute; right: max(12px, env(safe-area-inset-right)); top: 150px; display: flex; flex-direction: column; gap: 8px; width: min(46vw, 230px); }
.evo button { text-align: left; padding: 10px 12px; min-height: 56px; border-radius: 14px; background: rgba(20, 16, 50, 0.92); border: 1px solid var(--violet); box-shadow: 0 0 16px rgba(166, 139, 255, 0.35); }
.evo button b { display: block; } .evo button small { color: var(--muted); }
.evo .evt { font-size: 0.8rem; color: var(--muted); text-align: right; }
.ctl { position: absolute; right: max(18px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 14px; }
.dash { width: 92px; height: 92px; border-radius: 50%; background: radial-gradient(circle, rgba(95, 242, 232, 0.35), rgba(10, 22, 48, 0.85)); border: 2px solid var(--glow); font-weight: 800; }
.dash b { display: block; font-size: 1.05rem; } .dash small { display: block; font-size: 0.68rem; font-weight: 600; opacity: 0.8; margin-top: 2px; }
.dash.on { background: radial-gradient(circle, rgba(127, 248, 238, 0.95), rgba(40, 160, 200, 0.75)); color: #032; border-color: #fff; box-shadow: 0 0 22px 6px rgba(127, 248, 238, 0.75); animation: dashOn 0.28s ease-in-out infinite alternate; }
.dash.wait { border-style: dashed; opacity: 0.85; }
@keyframes dashOn { from { transform: scale(1.04); } to { transform: scale(1.12); } }
.abil { width: 60px; height: 60px; border-radius: 50%; background: rgba(20, 16, 50, 0.85); border: 2px solid var(--violet); font-size: 1.4rem; }
.abil:disabled { opacity: 0.35; }
.stick { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.05); }
.knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(95, 242, 232, 0.45); }
body.left .evo { right: auto; left: max(12px, env(safe-area-inset-left)); }
body.left .ctl { right: auto; left: max(18px, env(safe-area-inset-left)); flex-direction: row-reverse; }
body.left #minimap { right: auto; left: max(12px, env(safe-area-inset-left)); top: 150px; }
.spec { position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 10px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); max-width: 94vw; }
.cheers button { width: 44px; height: 44px; font-size: 1.3rem; border-radius: 12px; background: rgba(255, 255, 255, 0.06); }
.arrow { position: absolute; width: 30px; height: 30px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 10px var(--warn); display: grid; place-items: center; }
.arrow b { color: #fff; font-weight: 900; font-size: 18px; line-height: 1; }
.arrow i { position: absolute; inset: 0; transform: rotate(var(--r, 0rad)); }
.arrow i::before { content: ''; position: absolute; left: 50%; top: -9px; margin-left: -7px; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 9px solid var(--warn); }
.res-rank { font-size: 3rem; font-weight: 800; color: var(--gold); }
.res-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.res-table td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.res-table tr.me td { color: var(--glow); font-weight: 700; }
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; overflow: auto; padding-bottom: 20px; }
.cx { padding: 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); min-height: 120px; display: flex; flex-direction: column; gap: 4px; }
.cx .sw { width: 34px; height: 34px; border-radius: 50%; }
.cx.locked { opacity: 0.4; filter: grayscale(1); }
.cx small { color: var(--muted); }
dialog { border: 1px solid var(--line); border-radius: 18px; background: #0a1630; color: var(--ink); padding: 0; max-width: min(560px, 94vw); width: 100%; }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.dlg { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.dlg select, .dlg input { min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: #071226; color: var(--ink); padding: 0 10px; }
.dlg input { flex: 1; min-width: 8ch; }
.list { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow: auto; }
.list button { text-align: left; min-height: 48px; padding: 8px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.sw { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.sw input { width: 24px; height: 24px; }
.toast { position: fixed; left: 50%; bottom: 18%; transform: translateX(-50%); z-index: 20; padding: 10px 16px; border-radius: 14px; background: rgba(10, 22, 48, 0.95); border: 1px solid var(--glow); max-width: 90vw; text-align: center; }

/* ── 로비 = 기본틀(학교 순위 맨 위 · 모드 카드 4 · 주 단추 1) ── */
/* 🔴 로비는 한 화면·스크롤 0 이 기본이지만, html/body 가 overflow:hidden 이라 내용이
   화면보다 길어지면 «잘림»이 된다(가려짐 금지 규칙 위반) — 로비만 세로 스크롤을 열어 둔다. */
.gb-home { gap: 10px; overflow-y: auto; }
a[data-gb="site-link"] { display: inline-flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; margin-top: 4px; color: var(--muted); font-size: 0.8rem; text-decoration: none; border-radius: 10px; background: rgba(255,255,255,.04); }
.rank-card { max-width: 760px; width: 100%; margin: 0 auto; padding: 10px 14px; border-radius: var(--r); background: var(--panel); border: 1px solid rgba(255, 213, 74, 0.4); display: flex; flex-direction: column; gap: 4px; min-height: 96px; }
.rk-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rk-head > b { color: var(--gold); }
.gb-link { min-height: 44px; padding: 0 8px; border-radius: 10px; color: var(--glow); font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52%; }
.rk-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; font-size: 0.9rem; }
.rk-list li { display: flex; gap: 6px; white-space: nowrap; overflow: hidden; }
.rk-list li span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.rk-list li em { font-style: normal; color: var(--muted); }
.rk-list li.me span { color: var(--glow); font-weight: 700; }
.rk-mine { font-size: 0.9rem; color: var(--muted); }
.rk-mine b { color: var(--gold); }
.brand { margin-top: 0; }
.brand h1 { font-size: clamp(1.7rem, 6vw, 2.8rem); }
.gb-modes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-width: 760px; width: 100%; margin: 0 auto; }
.gb-mode { height: 78px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; padding: 8px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); text-align: left; position: relative; }
.gb-mode b { font-size: 1.02rem; } .gb-mode small { color: var(--muted); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.gb-mode em { position: absolute; top: 8px; right: 10px; font-style: normal; color: var(--gold); font-size: 0.85rem; }
.gb-mode[aria-pressed="true"] { border-color: var(--glow); background: rgba(95, 242, 232, 0.14); box-shadow: 0 0 18px rgba(95, 242, 232, 0.25); }
.play { max-width: 760px; width: 100%; margin: 0 auto; }
.sub { max-width: 760px; width: 100%; margin: 0 auto; }
.sub .mid { flex: 1; padding: 0 8px; white-space: nowrap; }
.sub small { color: var(--muted); }
@media (min-width: 900px) { .gb-modes { grid-template-columns: repeat(4, 1fr); } }
@media (max-height: 520px) {
  .brand { display: none; } .gb-home { gap: 6px; }
  .gb-modes { grid-template-columns: repeat(4, 1fr); } .gb-mode { height: 64px; } .rk-list { grid-template-columns: repeat(3, 1fr); }
  .dash { width: 78px; height: 78px; } .evo { top: 110px; }
}
@media (max-width: 380px) { .chip { max-width: 40vw; } .card b { font-size: 1rem; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.rk-list li.muted { grid-column: 1 / -1; white-space: normal; }
/* 모드 카드가 홀수(5개)면 마지막 카드는 한 줄을 다 쓴다 — 같은 카드 같은 모양 유지 */
#modeGrid > .gb-mode:last-child:nth-child(odd) { grid-column: 1 / -1; }
/* @gb-juice-css v1 — kit/juice/juice.css. 게임 스타일시트 끝에 그대로 붙인다(CSP style-src 'self' 라 JS 가 <style> 을 넣지 않는다). */
.gbj-layer{position:fixed;inset:0;pointer-events:none;z-index:40;overflow:hidden}
.gbj-pop{position:absolute;transform:translate(-50%,-50%) scale(var(--s));font:900 22px/1 system-ui,sans-serif;text-shadow:0 2px 0 #0008,0 0 12px currentColor;white-space:nowrap;animation:gbjPop .9s cubic-bezier(.2,1.6,.4,1) forwards}
@keyframes gbjPop{0%{opacity:0;transform:translate(-50%,-50%) scale(calc(var(--s)*.3))}15%{opacity:1;transform:translate(-50%,-80%) scale(calc(var(--s)*1.35))}35%{transform:translate(calc(-50% + var(--dx)),-120%) scale(var(--s))}100%{opacity:0;transform:translate(calc(-50% + var(--dx)),-260%) scale(calc(var(--s)*.9))}}
.gbj-punch{animation:gbjPunch .32s cubic-bezier(.2,2,.4,1)}
@keyframes gbjPunch{0%{transform:scale(1)}30%{transform:scale(var(--gbj-p))}100%{transform:scale(1)}}
.gbj-flash{position:absolute;inset:0;opacity:0}
.gbj-flash.gbj-go{animation:gbjFlash .35s ease-out forwards}
@keyframes gbjFlash{to{opacity:0}}
/* 가운데 큰 글자 — 자리는 게임이 --gbj-banner-top 으로 옮긴다(HUD 배너·선택 카드와 겹치지 않게 · 2026-10-12 끝까지 진화 실측). 좁은 화면에서 넘치지 않게 vw 로 줄인다 */
.gbj-banner{position:absolute;left:50%;top:var(--gbj-banner-top,40%);transform:translate(-50%,-50%);font:900 clamp(22px,8vw,44px)/1.1 system-ui,sans-serif;text-align:center;opacity:0;text-shadow:0 3px 0 #000a,0 0 24px currentColor;max-width:92vw;width:max-content}
.gbj-banner.gbj-go{animation:gbjBan var(--d,1.4s) cubic-bezier(.2,1.5,.4,1) forwards}
@keyframes gbjBan{0%{opacity:0;transform:translate(-50%,-50%) scale(.2) rotate(-8deg)}15%{opacity:1;transform:translate(-50%,-50%) scale(1.25) rotate(2deg)}30%{transform:translate(-50%,-50%) scale(1)}80%{opacity:1}100%{opacity:0;transform:translate(-50%,-70%) scale(1.05)}}
@media (prefers-reduced-motion:reduce){.gbj-pop,.gbj-banner.gbj-go,.gbj-punch{animation-duration:.01s}}

/* 1.4 — 첫 화면 통계 줄 · 전체 순위(더보기). 글자 ≥12px · 누르는 곳 ≥44px */
.rk-head { flex-wrap: wrap; } .rk-head .rk-stats { order: 3; flex: 1 0 100%; }
.rk-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; text-align: center; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.rk-stats span { display: flex; flex-direction: column; min-width: 0; }
.rk-stats b { font-size: 1rem; font-variant-numeric: tabular-nums; }
.rk-stats small { font-size: 0.8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rk-foot .rk-mine { flex: 1; min-width: 0; }
.rk-more { max-width: 60%; flex: none; min-height: 44px; }
.rk-more[hidden] { display: none; }
.rank-all-back { position: fixed; inset: 0; z-index: 40; background: rgba(2, 6, 16, 0.72); display: flex; align-items: center; justify-content: center; padding: 8px; }
.rank-all { width: min(520px, 94vw); max-height: 94vh; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r); background: #0a1630; border: 1px solid var(--line); }
.rank-all h2 { margin: 0; text-align: center; font-size: 1.2rem; }
.rank-tabs { display: flex; gap: 8px; justify-content: center; }
.rank-tabs button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); font-size: 0.95rem; }
.rank-tabs button.on { background: var(--glow); color: #04121c; border-color: transparent; font-weight: 700; }
.rank-scroll { touch-action: pan-y; margin: 0; padding: 0 4px; list-style: none; overflow-y: auto; max-height: min(56vh, 520px); font-size: 0.95rem; display: flex; flex-direction: column; gap: 4px; }
.rank-scroll li { display: flex; gap: 8px; min-height: 28px; align-items: baseline; }
.rank-scroll li em { font-style: normal; color: var(--muted); min-width: 2.2em; text-align: right; }
.rank-scroll li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-scroll li small { color: var(--muted); font-size: 0.8rem; }
.rank-scroll li.me span { color: var(--glow); font-weight: 700; }
.rank-all .big { min-height: 48px; }
@media (max-height: 520px) { .rank-card { padding-top: 4px; padding-bottom: 4px; gap: 0; min-height: 0; } .rk-head .rk-stats { order: 0; flex: 1 1 auto; border-bottom: 0; padding: 0; } .gb-home { gap: 4px; } .gb-mode { height: 54px; } .gb-home { overflow-y: auto; } .gb-home > * { flex-shrink: 0; } .rk-stats { padding-bottom: 2px; } .rk-stats span { flex-direction: row; justify-content: center; align-items: baseline; gap: 4px; } .rk-stats b { font-size: 0.9rem; } .rk-stats small { font-size: 0.8rem; } .rank-scroll { max-height: 40vh; } .rank-all-back { align-items: flex-start; } }
/* 아이콘(js/ui/icons.js · 이모지 대신 SVG) */
.ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.ic.gold { color: #f5c75a; }
#livesTxt .ic { color: #ff7b93; width: 1em; height: 1em; margin-right: 1px; }
#nextEv .ic { color: #ffb347; }
.tix .ic { color: #ffd76a; }
.cheers button { display: inline-grid; place-items: center; vertical-align: middle; color: #ffe08a; }
.cheers button .ic { width: 24px; height: 24px; pointer-events: none; }
.cheer-fx { color: #ffe08a; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5)); }
/* 글자 겹침 전수검사(tests/overlap-check.mjs · 2026-10-18 폰 412×686 «학교 순위 안내문이 제목과 겹침»)
   화면(.screen)은 세로 flex 라 칸이 모자라면 자식이 줄어들어 글자가 상자 밖으로 넘쳤다 → 자식은 줄지 않고, 넘치면 화면이 스크롤한다 */
.screen { overflow-y: auto; overscroll-behavior: contain; }
.screen > * { flex-shrink: 0; }
.quiz-setup, .quiz-done, .quiz-run { justify-content: safe center; }
@media (max-height: 760px) and (max-width: 899px) {
  .brand p { display: none; }
  .brand h1 { font-size: clamp(1.5rem, 6vw, 2.2rem); }
  .gb-mode { height: 64px; }
  .gb-home { gap: 8px; }
}
@media (max-height: 680px) and (max-width: 899px) { .brand { display: none; } }
/* 관전 상자가 뜨면 아래쪽 안내 말풍선은 숨긴다(두 상자가 겹쳤다) */
#specBox:not(.hidden) ~ #hint { display: none !important; }
/* 가로로 낮은 화면(폰 가로): 문제는 왼쪽, 보기·숫자판은 오른쪽 — 숫자판이 화면 밖으로 나갔다 */
@media (max-height: 520px) and (orientation: landscape) {
  .quiz-run { display: grid; grid-template-columns: 1fr 1fr; align-items: center; align-content: center; gap: 8px 16px; max-width: 980px; }
  .quiz-run > .qprog { grid-column: 1 / -1; }
  .quiz-run > .qtext { grid-column: 1; }
  .quiz-run > .qchoices, .quiz-run > .qnum { grid-column: 2; grid-row: 2; }
  .qnum { flex-direction: row; align-items: center; gap: 10px; }
  .qnum input { width: 6ch; }
  .qnum #qPad { align-self: center; flex: 1; }
  .qnum .gb-numpad { margin: 0; gap: 6px; }
  .qnum .gb-numpad-key { min-height: 44px; font-size: 1.25rem; }
  .qchoices button { min-height: 48px; }
  .quiz-done { gap: 8px; } .quiz-done .big-num { font-size: 2rem; }
}
/* 긴 별명(«조용한 도롱뇽»)이 칩을 넘어 ↻ 와 겹쳤다 — flex 자식 b 가 줄어들어야 말줄임이 된다 */
.chip b { min-width: 0; } .chip .dot, .chip small, .chip .ic { flex-shrink: 0; }
/* 위험 알림(js/danger.js) — 붉은 테두리 맥박 · 위협 생물 과녁 고리 */
.danger-vig { position: fixed; inset: 0; pointer-events: none; z-index: 4; opacity: 0; transition: opacity 0.15s; box-shadow: inset 0 0 90px 30px rgba(255, 30, 50, 0.75); animation: dangerBeat var(--beat, 1s) ease-in-out infinite; }
@keyframes dangerBeat { 0%, 100% { filter: brightness(0.75); } 18% { filter: brightness(1.5); } 36% { filter: brightness(0.9); } 52% { filter: brightness(1.25); } }
body:not(.in-danger) .danger-vig { animation: none; }
.danger-mark { position: fixed; pointer-events: none; z-index: 4; transform: translate(-50%, -50%); }
.danger-mark i { position: absolute; inset: 0; border-radius: 50%; border: 3px solid #ff4d5e; box-shadow: 0 0 16px #ff2030, inset 0 0 12px rgba(255, 32, 48, 0.5); animation: dangerRing var(--beat, 1s) ease-out infinite; }
.danger-mark b { position: absolute; left: 50%; top: -6px; transform: translate(-50%, -100%); padding: 2px 8px; border-radius: 999px; background: #ff3346; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
@keyframes dangerRing { 0% { transform: scale(0.82); opacity: 1; } 100% { transform: scale(1.25); opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .danger-vig, .danger-mark i { animation: none; } }
/* 지역 안내(js/zones.js) — 위 가운데 띠 · 경계 쪽 세상 글자 */
.zone-tip { position: absolute; left: 50%; top: calc(max(12px, env(safe-area-inset-top)) + 92px); transform: translateX(-50%); max-width: min(92vw, 560px); padding: 8px 14px; border-radius: 12px; background: rgba(8, 14, 32, 0.88); border: 2px solid var(--zc, #ffb347); font-size: 0.92rem; text-align: center; line-height: 1.35; pointer-events: none; z-index: 3; }
.zone-tip b { color: var(--zc, #ffb347); } .zone-tip em { font-style: normal; color: #7ff8ee; font-weight: 700; } .zone-tip .ic { color: var(--zc, #ffb347); }
.zone-tip.in { animation: zonePulse 0.9s ease-in-out infinite; box-shadow: 0 0 18px var(--zc, #ff4d5e); }
.zone-tip.near { border-style: dashed; }
.zone-tip .dir { display: inline-block; vertical-align: -3px; } .zone-tip .dir .ic { width: 1.05em; height: 1.05em; color: #7ff8ee; }
@keyframes zonePulse { 50% { box-shadow: 0 0 4px var(--zc, #ff4d5e); } }
.zone-tag { position: absolute; transform: translate(-50%, -100%); padding: 2px 8px; border-radius: 999px; background: var(--zc, #ffb347); color: #0a1020; font-size: 12px; font-weight: 800; white-space: nowrap; pointer-events: none; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); z-index: 3; }
@media (prefers-reduced-motion: reduce) { .zone-tip.in { animation: none; } }
/* 안내 칸(js/zones.js #advice) — 미니맵 아래 위쪽 가운데에 한 줄로 쌓는다. 화면 가운데(내 생물)를 가리지 않는다(2026-10-18 «알림이 캐릭터를 너무 가리잖아») */
.advice { position: absolute; left: 50%; top: calc(max(10px, env(safe-area-inset-top)) + 178px); transform: translateX(-50%); width: min(calc(100vw - 24px), 560px); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 3; }
.advice > .banner, .advice > .tip, .advice > .hint, .advice > .zone-tip { position: static; transform: none; left: auto; top: auto; bottom: auto; max-width: 100%; margin: 0; font-size: 0.9rem; padding: 6px 12px; line-height: 1.35; }
.advice > .banner { font-size: 1rem; }
/* 한 줄로(10-18 «글씨가 너무 가린다») — 지역·배고픔 안내는 짧은 문구 한 줄, 넘치면 말줄임 */
.advice > .zone-tip { font-size: 0.82rem; padding: 4px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; border-width: 1.5px; }
#nextEv { white-space: nowrap; }
@media (min-width: 900px) { .advice { top: calc(max(10px, env(safe-area-inset-top)) + 96px); } }
@media (max-height: 520px) { .advice { top: calc(max(8px, env(safe-area-inset-top)) + 64px); width: min(calc(100vw - 360px), 520px); } }
.gbj-layer { --gbj-banner-top: 30%; }
.hud-fs { position: absolute; right: max(12px, env(safe-area-inset-right)); top: calc(max(10px, env(safe-area-inset-top)) + 160px); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(8, 14, 32, 0.6); border: 1px solid var(--line); color: #dff; }
.hud-fs .ic { width: 22px; height: 22px; }
@media (max-height: 520px) { .hud-fs { top: auto; bottom: max(12px, env(safe-area-inset-bottom)); right: calc(max(12px, env(safe-area-inset-right)) + 130px); } }
.advice > .tip { white-space: normal; }
body.left .advice { top: calc(max(10px, env(safe-area-inset-top)) + 280px); }
/* 이름표 — 사람·컴퓨터 구분(hud.js labelsFrame) */
.lbl.lbl-me { color: #7ff8ee !important; font-weight: 800; }
.lbl.lbl-human { color: #fff !important; font-weight: 800; padding: 1px 7px; border-radius: 999px; border: 1.5px solid #ffd76a; background: rgba(40, 30, 0, 0.55); }
.lbl.lbl-bot { color: #9fb2c8 !important; font-weight: 500; opacity: 0.85; }
