/* 탭탭! 스카이라인 v1.2 — '노선도' 디자인: 종이색 바탕, 먹색 굵은 선, 동그란 역, 도시마다 강조색 하나.
   상자·그림자·그러데이션·이모지를 쓰지 않는다. 구분은 선·여백·글자 크기로. 밤(body.night)에는 종이와 먹을 뒤집는다. */
:root {
  --paper: #F1EEE4; --ink: #1F2329; --mut: #8A877D; --line: #D9D4C5; --ac: #D8432F;
  --c-heart: #D8432F; --c-focus: #2F6DB5; --c-magnet: #E3A51A; --c-net: #2F8F74; --c-crane: #1F2329; --c-brace: #8A877D;
  --f: Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --fn: Outfit, Pretendard, -apple-system, "Apple SD Gothic Neo", system-ui, sans-serif;
  --sl: max(18px, env(safe-area-inset-left)); --sr: max(18px, env(safe-area-inset-right));
  --st: env(safe-area-inset-top); --sb: env(safe-area-inset-bottom);
  color-scheme: light dark;
}
body.night { --ink: #F1EEE4; --mut: #94918A; --line: #3A3F47; --c-crane: #3A3F47; }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--paper); color: var(--ink); font-family: var(--f); font-weight: 600;
  word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
[hidden] { display: none !important; }
.num { font-family: var(--fn); font-feature-settings: "tnum"; }
.ic { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: square; vertical-align: -0.12em; flex: none; }
.sp { flex: 1; }
#scene, #fx { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: block; }
#fx { pointer-events: none; z-index: 2; }

/* 맨 위 줄: 어디·몇 시·날씨, 소리·처음 화면 */
.top { position: fixed; z-index: 9; left: var(--sl); right: var(--sr); top: calc(var(--st) + 10px); height: 28px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.where { font: 700 10.5px/1 var(--fn); letter-spacing: 0.14em; white-space: nowrap; }
.tools { display: flex; gap: 2px; margin-right: -6px; pointer-events: auto; flex: none; }
#cityChip { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; margin-right: 8px; }
.ib { width: 34px; height: 34px; display: grid; place-items: center; font-size: 19px; }

/* 노선: 선 한가운데에 역 */
.metro { position: relative; display: flex; justify-content: space-between; align-items: center; height: 18px; }
.metro::before { content: ""; position: absolute; left: 8px; right: 8px; top: 50%; height: 5px; margin-top: -2.5px; background: var(--ink); }
.metro i { position: relative; flex: none; width: 17px; height: 17px; border-radius: 50%; background: var(--paper); border: 4px solid var(--ink); transition: background 0.2s, border-color 0.2s, transform 0.2s; }
.metro i.done { background: var(--ink); }
.metro i.on { border-color: var(--ac); transform: scale(1.18); }

/* 플레이 화면 */
#hud { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.hudtop { position: absolute; left: 0; right: 0; top: 0; padding: calc(var(--st) + 46px) var(--sr) 10px var(--sl); background: var(--paper); }
.r1 { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; margin-top: 8px; gap: 10px; }
.r1 #stName { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r1 .num { white-space: nowrap; font-weight: 600; }
.r1 .num span { color: var(--mut); }
#hNow { display: inline-block; font-weight: 800; }
#hNow.pop { transform: scale(1.25); }
.r2 { display: flex; align-items: center; gap: 12px; margin-top: 10px; height: 16px; }
.hp { display: flex; gap: 4px; align-items: center; }
/* 안전 = 하트 그림(조건 판의 아이템 그림과 같게). 가진 것은 강조색 채움, 잃은 것은 회색 테두리 */
.hp svg { width: 16px; height: 16px; fill: var(--ac); stroke: var(--ac); stroke-width: 1.8; }
.hp svg.e { fill: none; stroke: var(--mut); }
/* 안전망: 누르는 버튼이 아니라 하트 옆 작은 회색 표시(그물 + 개수) */
.netg { display: flex; align-items: center; gap: 2px; margin-left: -4px; color: var(--mut); font-size: 11px; font-weight: 700; }
.netg .ic { font-size: 15px; }
.hp.hit { animation: hb 0.5s; }
@keyframes hb { 20% { transform: translateX(-5px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } }
.feverg { display: flex; gap: 3px; align-items: center; }
.feverg i { width: 7px; height: 7px; border: 1.5px solid var(--ink); }
.feverg i.on { background: var(--ink); }
.feverg b { font-size: 11px; font-weight: 700; background: var(--ac); color: #fff; padding: 2px 7px; animation: blink 0.5s infinite alternate; }
@keyframes blink { to { opacity: 0.7; } }
/* 지금 점수(기획 12 4장, 옛 돈 자리) */
.scoreh { margin-left: auto; font-size: 15px; font-weight: 700; white-space: nowrap; }
.scoreh small { font: 600 10.5px var(--f); color: var(--mut); margin-left: 2px; }
.wob { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 10.5px; color: var(--mut); }
.wob u { flex: 1; height: 3px; background: var(--line); text-decoration: none; position: relative; }
.wob u i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--ink); transition: width 0.25s; }
.wob.warn u i, .wob.warn b { background: var(--ac); }
.wob.warn b { background: none; color: var(--ac); }
.wob b { font-weight: 600; }
.combo { position: absolute; left: var(--sl); top: calc(var(--st) + 158px); font-size: 11.5px; font-weight: 700; border: 2px solid var(--ink); padding: 2px 8px; background: var(--paper); }
.combo.fever { background: var(--ink); color: var(--paper); }
.hint { position: absolute; left: 50%; bottom: calc(var(--sb) + 132px); transform: translateX(-50%); background: var(--ink); color: var(--paper); font-size: 13px; padding: 7px 12px; white-space: nowrap; animation: nudge 1s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translate(-50%, -5px); } }

/* 아래 물건 토큰: 집중은 왼쪽 끝, 자석은 오른쪽 끝(화면 가장자리에서 같은 여백), 가운데 내려놓기 */
.dock { position: absolute; left: var(--sl); right: var(--sr); bottom: calc(var(--sb) + 16px); height: 84px; }
#focusBtn { position: absolute; left: 0; bottom: 0; }
#magnetBtn { position: absolute; right: 0; bottom: 0; }
.tk { pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; }
.tk i { position: relative; width: 60px; height: 60px; border-radius: 50%; border: 4px solid var(--ink); background: var(--paper); display: grid; place-items: center; font-size: 26px; font-style: normal; transition: transform 0.1s; }
.tk:active i { transform: scale(0.92); }
.tk b { position: absolute; right: -8px; top: -8px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--ink); color: var(--paper); font: 700 12px/22px var(--fn); text-align: center; }
.tk.act i { background: var(--ink); color: var(--paper); }
.tk.act b { background: var(--ac); color: #fff; }
/* 내려놓기 버튼(11-26): 화면 탭 대신. 가운데 큰 먹색 원, 흔들리는 중이 아니면 테두리만 */
.drop { pointer-events: auto; touch-action: none; position: absolute; left: 50%; bottom: 0; width: 84px; height: 84px; margin-left: -42px; border-radius: 50%; border: 4px solid var(--ink); background: var(--ink); color: var(--paper); display: grid; place-items: center; font-size: 38px; transition: transform 0.08s; }
.drop .ic { stroke-width: 2.2; }
.drop:active { transform: scale(0.92); background: var(--ac); border-color: var(--ac); color: #fff; }
.drop.wait { background: var(--paper); color: var(--ink); }

/* 처음 한 번 화면 안내(기획 12 v3 ③): 먹색 안개(모달 뒤 안개 — 원칙 2의 유일한 예외) 위에 종이 판.
   위 HUD 띠와 아래 버튼은 안개 위로 올려, 번호가 가리키는 곳이 밝게 보이게 한다. .guide 는 쌓임 맥락을 만들지 않는다. */
.guide { position: absolute; inset: 0; }
.guide .fog { position: absolute; inset: 0; z-index: 5; background: rgba(31, 35, 41, 0.62); pointer-events: auto; }
body.guiding .hudtop, body.guiding .dock { z-index: 6; }
body.guiding .tk span { color: #F1EEE4; }
.gpanel { position: absolute; z-index: 7; left: max(14px, env(safe-area-inset-left)); right: max(14px, env(safe-area-inset-right)); top: 184px; background: var(--paper); border-top: 3px solid var(--ink); padding: 14px 16px 16px; overflow-y: auto; overscroll-behavior: contain; pointer-events: auto; }
.gpanel .k { display: block; font: 700 10.5px/1 var(--fn); letter-spacing: 0.14em; color: var(--ac); }
.gpanel h3 { margin: 6px 0 8px; font-size: 21px; font-weight: 800; letter-spacing: -0.03em; }
.gl { display: grid; grid-template-columns: 26px 1fr; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--mut); line-height: 1.4; }
.gl b { display: block; font-size: 13px; font-weight: 700; color: var(--ink); }
.gl b svg { width: 13px; height: 13px; fill: var(--ac); stroke: var(--ac); stroke-width: 1.8; vertical-align: -1px; margin-left: 4px; }
.gl .no { width: 22px; height: 22px; border-radius: 50%; background: var(--ac); color: #fff; font: 800 12px/22px var(--fn); text-align: center; }
.gpanel .go { margin-top: 8px; }
.pin { position: absolute; z-index: 8; width: 18px; height: 18px; border-radius: 50%; background: var(--ac); color: #fff; font: 800 11px/18px var(--fn); text-align: center; outline: 2px solid var(--paper); pointer-events: none; }

/* 판정 글자 + 눈금자 */
.judge { position: fixed; z-index: 4; left: var(--sl); top: calc(var(--st) + 198px); pointer-events: none; white-space: nowrap; transform-origin: 0 100%; animation: judge 0.75s ease-out forwards; }
.judge b { display: block; font-size: 40px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; text-shadow: 3px 0 var(--paper), -3px 0 var(--paper), 0 3px var(--paper), 0 -3px var(--paper), 2px 2px var(--paper), -2px 2px var(--paper), 2px -2px var(--paper), -2px -2px var(--paper); }
.judge.p b { font-size: 60px; }
.judge.s b { color: var(--mut); }
.judge.m b { color: var(--ac); }
.judge small { display: table; font-size: 12.5px; font-weight: 600; margin: 6px 0 0 -5px; padding: 2px 5px; color: var(--ac); background: var(--paper); }
.judge.s small, .judge.g small { color: var(--ink); }
.ruler { position: relative; width: 128px; height: 14px; margin-top: 8px; background: var(--paper); outline: 5px solid var(--paper); border-left: 1.5px solid var(--mut); border-right: 1.5px solid var(--mut); }
.ruler::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 1.5px; background: var(--mut); }
.ruler .g { position: absolute; top: 3px; height: 8px; border: 1.5px solid var(--ink); background: var(--paper); }
.ruler .p { position: absolute; top: 3px; height: 8px; background: var(--ink); }
.ruler .m { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1.5px; background: var(--ac); }
/* 0%부터 보이게 한다 — 기기가 느려 애니메이션 시작이 늦어도 글자는 바로 보인다 */
@keyframes judge { 0% { transform: scale(0.7); opacity: 1; } 14% { transform: scale(1.12); } 26% { transform: scale(1); } 75% { opacity: 1; } 100% { transform: translateY(-10px); opacity: 0; } }

/* 번쩍임: 평평한 색으로 아주 잠깐 */
.flash { position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0; }
.flash.p { background: var(--ink); animation: fl1 0.22s ease-out; }
.flash.m { background: var(--ac); animation: fl2 0.4s ease-out; }
.flash.focus { background: var(--c-focus); animation: fl2 0.45s ease-out; }
.flash.fever { background: var(--ac); animation: fl2 0.7s ease-out; }
@keyframes fl1 { from { opacity: 0.1; } to { opacity: 0; } }
@keyframes fl2 { from { opacity: 0.22; } to { opacity: 0; } }
body.fever::after { content: ""; position: fixed; inset: 0; z-index: 2; pointer-events: none; box-shadow: inset 0 0 0 5px var(--ac); }

/* 알림 한 줄 */
.toast { position: fixed; z-index: 6; left: var(--sl); right: var(--sr); bottom: calc(var(--sb) + 118px); width: fit-content; max-width: calc(100vw - 36px); background: var(--ink); color: var(--paper); padding: 9px 12px; font-size: 14px; font-weight: 700; line-height: 1.35; pointer-events: none; animation: drop 0.25s ease-out; }
.toast small { display: block; font-size: 11.5px; font-weight: 500; opacity: 0.75; margin-top: 2px; }
@keyframes drop { from { transform: translateY(8px); opacity: 0; } }

/* 시작 화면 */
.home { position: fixed; inset: 0; z-index: 8; display: flex; flex-direction: column; justify-content: flex-end; pointer-events: none; }
.hhead { position: absolute; left: var(--sl); right: var(--sr); top: calc(var(--st) + 56px); }
.hhead h1 { margin: 0; font-size: 60px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; }
.hhead .k { display: block; font: 700 10.5px/1 var(--fn); letter-spacing: 0.14em; }
.hhead .k em, .banner .k em { font-style: normal; color: var(--ac); }
.hhead h1 { margin-top: 8px; white-space: nowrap; } /* 긴 이름은 main.mjs fitTitle 이 줄인다 */
.hhead p { margin: 9px 0 0; font-size: 12.5px; font-weight: 500; color: var(--mut); }
.hpanel { pointer-events: auto; background: var(--paper); padding: 14px var(--sr) calc(var(--sb) + 16px) var(--sl); max-height: 72dvh; overflow-y: auto; border-top: 3px solid var(--ink); }
.lab { font-size: 11px; font-weight: 700; letter-spacing: 0.02em; display: flex; justify-content: space-between; align-items: center; }
.lab small { font-weight: 500; color: var(--mut); font-size: 11px; margin-left: 6px; }
/* 오늘의 랜덤 도시 노선 8역(시안 v6 ⑦⑧, 기획 13 L-2): 오늘 지은 역 먹 채움(f), 지금 도시 강조색 테두리(now), 방금 지은 도시 강조색 채움(new).
   역 한 칸 폭 --slot 은 그릴 때 잰다(main.mjs fitLines). 판 폭을 넘으면 판 좌우 여백까지 넘쳐 옆으로 민다(스크롤 막대 숨김) */
.lab .cnt { font: 700 12px var(--fn); }
.wxc { margin: 8px 0 0; font-size: 9.5px; font-weight: 500; color: var(--mut); letter-spacing: 0.02em; }
.lab.two { align-items: flex-start; }
.lab.two small { display: block; margin: 4px 0 0; }
.clwrap { overflow-x: auto; overflow-y: hidden; margin: 8px calc(-1 * var(--sr)) 0 calc(-1 * var(--sl)); scrollbar-width: none; overscroll-behavior-x: contain; }
.clwrap::-webkit-scrollbar { display: none; }
.cl8 { --slot: 44px; position: relative; display: flex; width: max-content; padding: 2px var(--sr) 0 var(--sl); } /* 위 2px: 1.2배로 커진 지금 역이 잘리지 않게 */
.cl8::before { content: ""; position: absolute; left: calc(var(--sl) + var(--slot) / 2); right: calc(var(--sr) + var(--slot) / 2); top: 8px; height: 4px; background: var(--ink); }
.cl8 span { position: relative; flex: none; width: var(--slot); display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 10px; font-weight: 600; color: var(--mut); white-space: nowrap; }
.cl8 span i { width: 16px; height: 16px; border-radius: 50%; border: 3.5px solid var(--ink); background: var(--paper); }
.cl8 span.f { color: var(--ink); }
.cl8 span.f i { background: var(--ink); }
.cl8 span.now, .cl8 span.new { color: var(--ink); font-weight: 800; }
.cl8 span.now i { border-color: var(--ac); transform: scale(1.2); }
.cl8 span.new i { background: var(--ac); border-color: var(--ac); transform: scale(1.2); }
/* 이번 시작 수량(세로 목록: 그림 · 이름 개수 · 회색 설명, 덤은 강조색 "이번 덤") */
.kitsec { padding: 10px 0 4px; margin-top: 12px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.kitsec .h { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 700; }
.kitsec .h small { font-size: 11px; font-weight: 500; color: var(--mut); }
.kitrow { display: grid; grid-template-columns: 24px max-content 1fr; align-items: center; gap: 8px; column-gap: 10px; min-height: 31px; }
.kitrow .ic { font-size: 19px; }
.kitrow b { font-size: 14px; font-weight: 700; white-space: nowrap; min-width: 72px; }
.kitrow b span { font: 800 15px var(--fn); margin-left: 4px; }
.kitrow small { font-size: 11.5px; font-weight: 500; color: var(--mut); line-height: 1.35; }
.kitrow small em { font-style: normal; font-weight: 700; color: var(--ac); margin-right: 4px; }
.go { pointer-events: auto; width: 100%; height: 52px; margin-top: 14px; background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; font-size: 16px; font-weight: 700; }
.go .ic { font-size: 20px; stroke-width: 2.2; }
.go:active { background: var(--ac); color: #fff; }
.go.alt { background: none; color: var(--ink); border: 2px solid var(--ink); justify-content: center; gap: 8px; }
.go.sm { height: 44px; font-size: 14px; }

/* 아래에서 올라오는 판(결과) · 화면을 덮는 판(카드) */
.banner { position: fixed; z-index: 7; left: 0; right: 0; bottom: 0; background: var(--paper); border-top: 3px solid var(--ink); padding: 16px var(--sr) calc(var(--sb) + 16px) var(--sl); animation: up 0.28s ease-out; max-height: 82dvh; overflow-y: auto; }
.banner.full { top: 0; border-top: 0; max-height: none; padding-top: calc(var(--st) + 52px); animation: fade 0.2s ease-out; display: flex; flex-direction: column; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.banner .k { font: 700 10.5px/1 var(--fn); letter-spacing: 0.14em; }
.banner h2 { margin: 8px 0 0; font-size: 30px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.15; }
.banner p { margin: 6px 0 0; font-size: 12.5px; font-weight: 500; color: var(--mut); line-height: 1.5; }
.banner p b { color: var(--ink); font-weight: 700; }
.cards { margin-top: 20px; border-bottom: 2px solid var(--ink); }
.card { display: flex; width: 100%; height: 104px; border-top: 2px solid var(--ink); align-items: stretch; }
.card .pic { flex: none; width: 104px; display: grid; place-items: center; color: #fff; font-size: 56px; transition: transform 0.1s; }
.card .pic .ic { stroke-width: 1.5; }
.card:active .pic { transform: scale(0.94); }
.card .t { padding: 13px 0 0 14px; min-width: 0; }
.card .t b { display: flex; align-items: baseline; gap: 8px; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.card .t b em { font: 800 22px var(--fn); font-style: normal; }
.card .t small { display: block; font-size: 12px; font-weight: 500; color: var(--mut); margin-top: 3px; line-height: 1.45; }
.card .t small.ch { color: var(--ink); font-weight: 700; font-family: var(--fn); }
.foot { margin-top: auto; padding-top: 14px; font-size: 11.5px; font-weight: 500; color: var(--mut); }
/* 결과 판(시안 v4 ⑧): 큰 점수 · 오른쪽 등급 · 내역 4줄 · 이 도시 내 최고 · 오늘의 랜덤 도시 노선 */
.res-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 10px; }
.score { font: 800 56px/0.9 var(--fn); letter-spacing: -0.04em; min-width: 0; }
.score span { font-size: 22px; font-family: var(--f); letter-spacing: -0.02em; margin-left: 2px; }
.score small { display: block; margin-top: 8px; font: 600 12px var(--f); letter-spacing: 0; color: var(--mut); }
.grade { font: 800 76px/0.85 var(--fn); letter-spacing: -0.04em; color: var(--ac); text-align: right; flex: none; }
.grade small { display: block; font: 700 12px var(--f); letter-spacing: 0; margin-bottom: 6px; }
.grade.gB, .grade.gC { color: var(--ink); }
.brk { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; margin-top: 12px; border-top: 2px solid var(--ink); }
.brk span { display: flex; justify-content: space-between; align-items: baseline; height: 30px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--mut); padding-top: 7px; white-space: nowrap; }
.brk span em { font-style: normal; font: 600 11.5px var(--fn); color: var(--ink); margin-left: 4px; }
.brk span b { font: 700 13.5px var(--fn); color: var(--ink); }
.best { margin-top: 8px; font-size: 12px; font-weight: 500; color: var(--mut); }
.best b { color: var(--ink); font: 700 13.5px var(--fn); }
.best em { font-style: normal; font-weight: 700; color: var(--ac); margin-left: 6px; }
.mine { margin-top: 10px; padding-top: 10px; border-top: 2px solid var(--ink); }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btns .go { margin-top: 8px; }

/* ── 오늘의 도전(기획 13 C, 시안 v6 ①②⑤⑥⑩⑪) ── */
.where em, .sheet .k em { font-style: normal; color: var(--ac); }
.kitrow b u { text-decoration: none; }
/* ① 시작 화면: 어제 순위 한 줄 · 도전자 수와 다음 도시까지 · [오늘의 도전](두 줄 먹 막대) · [랜덤 도시 즐기기] */
.yday { font-size: 11.5px; font-weight: 500; color: var(--mut); padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.yday b { color: var(--ink); font-weight: 700; }
.tstats { display: grid; grid-template-columns: 1fr 1fr; }
.tstats span { font-size: 10.5px; font-weight: 500; color: var(--mut); line-height: 1.4; }
.tstats span:last-child { text-align: right; }
.tstats b { display: block; font: 700 21px var(--fn); font-feature-settings: "tnum"; color: var(--ink); }
.go2 { display: flex; flex-direction: column; justify-content: center; align-items: stretch; height: 60px; margin-top: 12px; }
.go2 .r { display: flex; justify-content: space-between; align-items: center; }
.go2 small { display: block; text-align: left; margin-top: 2px; font-size: 12px; font-weight: 600; opacity: 0.75; }
.go.alt small { font-size: 12px; font-weight: 600; color: var(--mut); }
.go.rnd { height: 46px; margin-top: 8px; }
.offline { font-size: 13px; font-weight: 700; padding: 12px 0; border-bottom: 1px solid var(--line); }
.offline + .offline { padding-top: 0; }
/* 덮는 판(조건 판 · 순위표 · 닉네임과 나라): 화면 전체 종이, 맨 위 줄에 뒤로 · 어디 */
.sheet { position: fixed; inset: 0; z-index: 10; background: var(--paper); display: flex; flex-direction: column; padding: calc(var(--st) + 52px) var(--sr) calc(var(--sb) + 16px) var(--sl); overflow-y: auto; overscroll-behavior: contain; animation: fade 0.2s ease-out; }
.sbar { position: absolute; left: var(--sl); right: var(--sr); top: calc(var(--st) + 10px); height: 28px; display: flex; align-items: center; justify-content: space-between; }
.sbar .ib { margin-left: -8px; font-size: 22px; }
.sheet .k { font: 700 10.5px/1 var(--fn); letter-spacing: 0.14em; }
.sheet h2 { margin: 8px 0 0; font-size: 30px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.15; }
.sheet .lead { margin: 8px 0 0; font-size: 12.5px; font-weight: 500; color: var(--mut); line-height: 1.5; }
.sheet .foot { margin: 10px 0 0; font-size: 11.5px; font-weight: 500; color: var(--mut); text-align: center; }
.sheet .foot b { color: var(--ink); font-weight: 700; }
.sheet .empty { margin: 0; padding: 18px 0; font-size: 13px; font-weight: 500; color: var(--mut); text-align: center; border-bottom: 1px solid var(--line); }
/* ② 조건 판 */
.cond { margin-top: 16px; border-top: 2px solid var(--ink); }
.cond > .r { display: flex; align-items: center; min-height: 54px; border-bottom: 1px solid var(--line); gap: 12px; }
.cond .t { width: 70px; flex: none; font-size: 12px; font-weight: 700; }
.cond .v { font-size: 14px; font-weight: 700; line-height: 1.35; }
.cond .v small { display: block; font-size: 11px; font-weight: 500; color: var(--mut); }
.cond .v.big { font: 700 22px var(--fn); }
.cond .v.big > span { font-size: 13px; font-family: var(--f); }
.cond .v.big small { font-family: var(--f); }
.cond .kitsec { margin-top: 0; padding: 12px 0 6px; border-top: 0; }
.cond .kitrow { min-height: 36px; }
.crowd { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 14px; text-align: center; }
.crowd span { font-size: 10.5px; font-weight: 500; color: var(--mut); }
.crowd span + span { border-left: 1px solid var(--line); }
.crowd b { display: block; font: 700 19px var(--fn); font-feature-settings: "tnum"; color: var(--ink); margin-top: 2px; }
.cfoot { margin-top: auto; padding-top: 6px; }
.cfoot .go { margin-top: 12px; }
.cfoot .err { margin: 8px 0 0; font-size: 12px; font-weight: 700; color: var(--ac); text-align: center; }
/* ⑤⑩ 결과 판(오늘의 도전): 오른쪽 세계 상위 %(도전자 1,000명 미만이면 세계 순위), 순위 한 줄, 분포 20칸, 연속 참가 점 7개 */
.pct { text-align: right; color: var(--ac); flex: none; }
.pct small { display: block; font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.pct b { font: 800 56px/0.9 var(--fn); letter-spacing: -0.04em; }
.pct b span { font-size: 26px; }
.pct.rkv b { font-size: 44px; }
.pct.rkv b span { font: 800 20px var(--f); margin-left: 2px; }
.rankline { margin-top: 8px; font-size: 12px; font-weight: 500; color: var(--mut); line-height: 1.6; }
.rankline b { color: var(--ink); font: 700 13.5px var(--fn); }
.rankline em { font-style: normal; font-size: 10px; font-weight: 700; border: 1.5px solid var(--mut); padding: 0 4px; margin-left: 4px; }
.rankline.note { color: var(--ink); font-weight: 700; padding: 4px 0 2px; }
.hist { position: relative; margin-top: 10px; padding-top: 12px; }
.hist .bars { display: flex; align-items: flex-end; gap: 2px; height: 52px; border-bottom: 2px solid var(--ink); }
.hist .bars i { flex: 1; background: var(--line); }
.hist .bars i.me { background: var(--ac); }
.hist .me-l { position: absolute; top: -1px; font: 700 10.5px var(--f); color: var(--ac); transform: translateX(-50%); white-space: nowrap; }
.hist .ax { display: flex; justify-content: space-between; margin-top: 4px; font: 600 10px var(--f); color: var(--mut); }
.minor { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-size: 11.5px; font-weight: 500; color: var(--mut); }
.minor b { color: var(--ink); font-weight: 700; }
.streak { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.streak i { width: 9px; height: 9px; border-radius: 50%; border: 1.8px solid var(--ink); }
.streak i.f { background: var(--ink); }
.streak span { margin-left: 6px; }
.adtag { font: 700 9.5px var(--fn); letter-spacing: 0.1em; border: 1.5px solid currentColor; padding: 1px 4px; margin-left: 6px; opacity: 0.8; }
.go small { font-size: 12px; font-weight: 600; }
.go:not(.alt) > small { opacity: 0.75; }
.go.txt { background: none; color: var(--ink); height: 34px; justify-content: center; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; margin-top: 4px; }
.go.txt:active { background: none; color: var(--ac); }
/* 랜덤 도시 결과 판의 오늘의 도전 띠(C-7) */
.dband { pointer-events: auto; display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 2px solid var(--ink); font-size: 13px; font-weight: 700; text-align: left; }
.dband .k { font: 700 10.5px/1 var(--fn); letter-spacing: 0.14em; color: var(--ac); margin-right: 6px; }
.dband small { display: block; font-size: 11px; font-weight: 500; color: var(--mut); margin-top: 3px; }
.dband small b { font-weight: 600; color: var(--mut); }
.dband .ic { font-size: 20px; stroke-width: 2.2; }
/* ⑥ 순위표: 갈래 두 개, 국기 칸 머리글 없음, 내 줄은 줄 전체를 옅은 강조색으로(세로 막대·굵은 선 없음) */
.tabs { display: flex; gap: 22px; margin-top: 14px; border-bottom: 1px solid var(--line); }
.tabs button { padding: 0 0 9px; font-size: 14px; font-weight: 700; color: var(--mut); }
.tabs button.on { color: var(--ink); box-shadow: inset 0 -3px var(--ink); }
.rk { display: grid; grid-template-columns: 46px minmax(0, 1fr) 28px 62px 38px; align-items: center; height: 37px; border-bottom: 1px solid var(--line); font-size: 13.5px; font-weight: 700; }
.rk .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 6px; }
.rk .n { font: 700 14px var(--fn); font-feature-settings: "tnum"; }
.rk .n.first { color: var(--ac); }
.rk .s { font: 700 14px var(--fn); font-feature-settings: "tnum"; text-align: right; }
.rk .t { font: 500 11px var(--fn); font-feature-settings: "tnum"; color: var(--mut); text-align: right; }
.rk.head { height: 28px; font-size: 10.5px; font-weight: 600; color: var(--mut); border-bottom: 2px solid var(--ink); }
.rk.head .s, .rk.head .t { font: 600 10.5px var(--f); }
.rk.me { background: color-mix(in srgb, var(--ac) 20%, var(--paper)); margin: 0 calc(-1 * var(--sr)) 0 calc(-1 * var(--sl)); padding: 0 var(--sr) 0 var(--sl); }
.gapline { height: 22px; display: flex; align-items: center; justify-content: center; gap: 6px; border-bottom: 1px solid var(--line); }
.gapline i { width: 4px; height: 4px; border-radius: 50%; background: var(--mut); }
.fl { display: block; width: 22px; height: 15px; outline: 1.5px solid var(--ink); flex: none; }
.nick { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 2px solid var(--ink); font-size: 12px; font-weight: 500; color: var(--mut); }
.rks + .nick { margin-top: auto; }
.rks { margin-bottom: 14px; }
.nick b { color: var(--ink); font-weight: 700; font-size: 14px; }
.nick .nl { display: block; margin-bottom: 7px; font-size: 11px; }
.nick .fl { display: inline-block; vertical-align: -2px; margin: 0 4px 0 2px; }
.nick .cn { white-space: nowrap; }
.nick .chg { flex: none; border: 2px solid var(--ink); color: var(--ink); padding: 5px 10px; font-weight: 700; font-size: 12px; }
/* ⑪ 닉네임과 나라 */
.fld { margin-top: 14px; }
.fld label { display: block; font-size: 11px; font-weight: 700; }
.fld small { display: block; margin-top: 5px; font-size: 11px; font-weight: 500; color: var(--mut); }
.fld small.err { color: var(--ac); font-weight: 700; }
.inp { width: 100%; height: 46px; border: 2px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); display: flex; align-items: center; gap: 10px; padding: 0 12px; font: 700 15px var(--f); margin: 6px 0 0; -webkit-user-select: text; user-select: text; outline: none; -webkit-appearance: none; appearance: none; }
.inp:focus { border-color: var(--ac); }
.inp em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 500; color: var(--mut); white-space: nowrap; }
.inp .ph { color: var(--mut); font-weight: 500; font-size: 13px; }
.inp.search { border-width: 0 0 2px; font-weight: 500; font-size: 13px; height: 38px; padding: 0; margin-top: 12px; }
.inp.search::placeholder { color: var(--mut); }
.inp.search::-webkit-search-decoration, .inp.search::-webkit-search-cancel-button { -webkit-appearance: none; }
.clist { flex: 1 0 120px; min-height: 120px; overflow-y: auto; overscroll-behavior: contain; }
.cr { display: flex; width: 100%; align-items: center; gap: 10px; height: 37px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 700; }
.cr.on { background: color-mix(in srgb, var(--ac) 20%, var(--paper)); margin: 0 calc(-1 * var(--sr)) 0 calc(-1 * var(--sl)); padding: 0 var(--sr) 0 var(--sl); width: calc(100% + var(--sl) + var(--sr)); }
.cr small { margin-left: auto; font-size: 11px; font-weight: 700; }
.pfoot { padding-top: 6px; }
.pfoot .foot { text-align: left; }
.pfoot .go { margin-top: 10px; }
/* 그만둘지 묻는 판: 모달 뒤 안개(원칙 2의 유일한 예외) + 종이 판 */
.modal { position: fixed; inset: 0; z-index: 12; display: flex; align-items: center; padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); }
.modal .fog { position: absolute; inset: 0; background: rgba(31, 35, 41, 0.62); }
.mpanel { position: relative; width: 100%; background: var(--paper); border-top: 3px solid var(--ink); padding: 16px 16px 16px; }
.mpanel h3 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -0.03em; }
.mpanel p { margin: 6px 0 4px; font-size: 13px; font-weight: 500; color: var(--mut); }

/* 로딩: 역이 차례로 채워진다 */
.load { position: fixed; inset: 0; z-index: 20; background: var(--paper); display: grid; place-content: center; justify-items: center; gap: 16px; transition: opacity 0.2s; }
.load.off { opacity: 0; pointer-events: none; }
.load .metro { width: 132px; }
.load .metro i { animation: fill 1.2s infinite; }
.load .metro i:nth-child(2) { animation-delay: 0.2s; } .load .metro i:nth-child(3) { animation-delay: 0.4s; }
@keyframes fill { 0%, 70%, 100% { background: var(--paper); } 25%, 50% { background: var(--ink); } }
.nogl { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; background: var(--paper); z-index: 10; }
@media (max-height: 700px) {
  .hhead h1 { font-size: 46px; } .hhead { top: calc(var(--st) + 46px); }
  .kitrow { min-height: 27px; } .card { height: 92px; } .card .pic { width: 92px; font-size: 48px; }
  /* 낮은 화면(아이폰 SE 667px): 제목을 빼고 줄을 촘촘히 — [알겠어요]가 판 안에 다 보여야 한다 */
  .gpanel { padding: 10px 14px 10px; } .gpanel h3 { display: none; } .gpanel .k { margin-bottom: 6px; }
  .gl { padding: 2px 0; font-size: 11.5px; line-height: 1.25; } .gl b { font-size: 12.5px; } .gl .no { width: 20px; height: 20px; line-height: 20px; font-size: 11px; } .gpanel .go { height: 40px; margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) { .hint, .feverg b, .load .metro i { animation: none; } }

/* 건설 영상(docs/plans/11-REPLAY.md): 화면 전체 종이 판, 가운데 9:16 미리보기, 아래 먹 막대 진행 */
.reel { position: fixed; inset: 0; z-index: 9; background: var(--paper); display: flex; flex-direction: column; padding: calc(var(--st) + 18px) var(--sr) calc(var(--sb) + 16px) var(--sl); animation: fade 0.2s ease-out; }
.reel h2 { margin: 8px 0 12px; font-size: 30px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.15; }
.reel .stage { flex: 1; min-height: 0; display: flex; justify-content: center; align-items: center; }
.reel .stage canvas, .reel .stage video { height: 100%; max-width: 100%; aspect-ratio: 9 / 16; object-fit: contain; border: 2px solid var(--ink); background: var(--paper); }
.reel .bar { height: 5px; margin-top: 16px; background: var(--line); }
.reel .bar i { display: block; height: 100%; width: 0; background: var(--ink); }
.reel .btns { grid-template-columns: 1fr 1fr; }
.reel a.go { text-decoration: none; }
.reel .reelmsg { margin: 10px 0 0; font-size: 12px; font-weight: 700; text-align: center; color: var(--ink); }
.go.sm .ic { font-size: 18px; }

/* ── 표지 + 언어 판(기획 14 1장 A안, 지시서 13 I-1): 처음 실행엔 3D 장면 위 이름표 + 아래 판(노선 세 역 · [시작] · 안내 한 줄).
   시작 화면 오른쪽 위 언어 버튼 → 같은 판이 먹색 안개 위에([바꾸기]) */
body.covering .top, body.covering #home { visibility: hidden; }
.cover { position: fixed; z-index: 9; left: var(--sl); right: var(--sr); top: calc(var(--st) + 64px); pointer-events: none; }
.cover .wm { font: 800 58px/0.92 var(--fn); letter-spacing: -0.03em; }
.langp { position: fixed; inset: 0; z-index: 13; display: flex; flex-direction: column; justify-content: flex-end; pointer-events: none; }
.langp .fog { position: absolute; inset: 0; background: rgba(31, 35, 41, 0.62); pointer-events: auto; }
.cpanel { position: relative; pointer-events: auto; background: var(--paper); border-top: 3px solid var(--ink); padding: 16px var(--sr) calc(var(--sb) + 16px) var(--sl); }
.cpanel .k { display: block; font: 700 10.5px/1 var(--fn); letter-spacing: 0.14em; }
.lline { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0 6px; }
.lline::before { content: ""; position: absolute; left: 16.6%; right: 16.6%; top: 9px; height: 5px; background: var(--ink); }
.lline button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px; padding-bottom: 4px; font-size: 16px; font-weight: 700; color: var(--mut); text-align: center; }
.lline button i { width: 23px; height: 23px; border-radius: 50%; border: 5px solid var(--ink); background: var(--paper); transition: transform 0.15s, border-color 0.15s; }
.lline button.now { color: var(--ink); font-weight: 800; }
.lline button.now i { border-color: var(--ac); transform: scale(1.18); }
/* 한국어·영어 화면의 '日本語'는 기기 일본어 글꼴로(일본어 글꼴 파일을 일본어 화면에서만 내려받게) */
html:not([lang="ja"]) .lline button[lang="ja"] { font-family: "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", var(--f); }
.cpanel .go { margin-top: 12px; }
.cpanel .foot { margin: 10px 0 0; padding: 0; font-size: 11.5px; font-weight: 500; color: var(--mut); text-align: center; }
.lgb span { width: 30px; height: 24px; border: 2px solid var(--ink); display: grid; place-items: center; font: 800 12px/1 var(--fn); }
@media (max-height: 700px) { .cover { top: calc(var(--st) + 52px); } .cover .wm { font-size: 50px; } }

/* ── 언어별(기획 14 3장 5·6·7): 줄바꿈 · 일본어 글꼴과 머리말 자간 · 판정 큰 글자 · 조건 판 제목 칸 */
html[lang="en"] body { word-break: normal; overflow-wrap: break-word; }
html[lang="ja"] body { word-break: normal; line-break: strict; overflow-wrap: anywhere; }
html[lang="ja"] {
  --f: "Pretendard JP", Pretendard, "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", -apple-system, system-ui, sans-serif;
  --fn: Outfit, "Pretendard JP", Pretendard, "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", system-ui, sans-serif;
}
html[lang="ja"] .where, html[lang="ja"] .k { letter-spacing: 0.06em; }
html[lang="en"] .cond .t { width: 92px; }
html[lang="ja"] .cond .t { width: 84px; }
