* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); display: flex; flex-direction: column; min-height: 100dvh; }
#app { flex: 1; min-height: 0; width: 100%; max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
.screen { flex: 1; display: flex; flex-direction: column; padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }

/* 게임 중엔 당겨서 새로고침을 막는다(진행 중인 판을 잃지 않게) */
body[data-screen="game"] { overflow: hidden; overscroll-behavior: none; height: 100dvh; }
body[data-screen="game"] #app, body[data-screen="game"] .screen { min-height: 0; }

.start-box, .result-box { margin: auto; width: min(440px, 100%); display: flex; flex-direction: column; gap: 12px; text-align: center; padding: 8px 0; }
.title { font-size: 40px; margin: 0; color: var(--accent); letter-spacing: -1px; }
.rule { margin: 0 0 4px; color: var(--muted); line-height: 1.5; }
.today-score { margin: 0; font-weight: 700; font-size: 18px; }
.best { margin: 0; color: var(--muted); font-size: 14px; }
.btn { font: inherit; font-size: 18px; font-weight: 700; padding: 14px 16px; border-radius: 14px; cursor: pointer; border: 2px solid var(--line); background: var(--surface); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); font-weight: 500; }
.btn:disabled { opacity: .6; }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.next-board { margin: 0; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.daily-note { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.notice { margin: 4px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.notice a { color: inherit; }
.footnote { margin: 0; font-size: 11px; line-height: 1.5; color: var(--muted); }
.load-error { margin: 0; color: var(--bad); font-weight: 700; }
.share-msg { margin: 0; min-height: 1.2em; font-size: 13px; color: var(--muted); }

/* 게임 */
#screen-game { height: 100dvh; padding-bottom: 0; }
.hud { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; padding: 0 2px 6px; }
.hud-item { display: flex; flex-direction: column; align-items: center; min-width: 64px; line-height: 1.15; }
.hud-label { font-size: 11px; color: var(--muted); }
.hud-value { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.hud-mid { text-align: center; min-width: 0; }
.mode-label { font-size: 12px; color: var(--muted); }
.question { font-size: 16px; font-weight: 800; }
.play { flex: 1; min-height: 0; overflow-y: auto; padding: 3px 4px; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; }
.btn.hint { font-size: 14px; padding: 7px 12px; border-radius: 999px; }
.hint-note { font-size: 12px; color: var(--muted); }
.stmts { display: flex; flex-direction: column; gap: 8px; flex: none; }
.stmt {
  font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%;
  display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 16px;
  border: 2px solid var(--line); background: var(--card-face);
}
.stmt:not(:disabled):active { transform: scale(.985); }
.stmt:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.stmt:disabled { cursor: default; opacity: 1; color: inherit; }
.stmt-row { display: flex; gap: 10px; align-items: center; }
.num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--text); font-weight: 800; font-size: 14px; }
.stmt-text { font-size: 17px; font-weight: 700; line-height: 1.4; word-break: keep-all; overflow-wrap: anywhere; }
.stmt-note { margin: 0 0 0 38px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.stmt-note b { color: var(--ok); }
.stmt-src { display: block; font-size: 11px; opacity: .85; }
.stmt.removed { opacity: .35; border-style: dashed; }
.stmt.removed .stmt-text { text-decoration: line-through; }
.stmt.fake { border-color: var(--bad); background: var(--bad-bg); }
.stmt.fake .num { background: var(--bad); color: #fff; }
.stmt.fake .stmt-note { color: var(--text); font-weight: 700; }
.stmt.fake .stmt-note b { color: var(--bad); }
.stmt.picked:not(.fake) { border-color: var(--ok); }
.stmts.done .stmt:not(.fake):not(.picked) { opacity: .9; }
.reveal { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); }
.reveal.in { animation: rise .25s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.verdict { margin: 0; font-size: 20px; font-weight: 800; }
.verdict.ok { color: var(--ok); } .verdict.bad { color: var(--bad); }
#game-foot { text-align: center; padding: 0 4px; }

/* 결과 */
.result-mode { margin: 0; color: var(--muted); font-size: 14px; }
.result-marks { margin: 0; font-size: 34px; letter-spacing: 4px; line-height: 1.2; }
.result-score { margin: 0; font-size: 28px; color: var(--accent); }
.result-score b { font-size: 64px; line-height: 1; }
.result-detail { margin: 0; font-size: 17px; font-weight: 600; }

.ad-slot { flex: none; display: flex; align-items: center; justify-content: center; min-height: 50px; margin-top: 8px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 12px; }
.result-box .ad-slot { min-height: 100px; }
/* 광고 단위 번호가 있는 자리만 보인다 (src/ui/ads.js) */
.ad-slot:not([data-on]) { display: none; }
.ad-slot[data-on] { border: 0; }

/* 안내·출처 화면 */
.screen.doc { display: block; flex: none; width: 100%; max-width: 640px; margin: 0 auto; padding: 16px 16px 48px; line-height: 1.65; text-align: left; }
.doc h1 { font-size: 22px; margin: 0 0 4px; }
.doc h2 { font-size: 17px; margin: 24px 0 6px; }
.doc ul { padding-left: 20px; margin: 0; }
.doc a { color: var(--accent); }
.doc .muted { color: var(--muted); font-size: 14px; }
.doc .footnote { margin-top: 28px; }

@media (min-width: 720px) {
  .stmt { padding: 14px 16px; }
  .stmt-text { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal.in { animation: none; }
  .btn:active, .stmt:not(:disabled):active { transform: none; }
}

/* olapaca 공용 이름표(.ola-top)·탭(.ola-tabbar)은 /common/bar.js 가 넣는다(허브). 게임 중엔 숨긴다 */
body[data-screen="game"] .ola-top, body[data-screen="game"] .ola-tabbar, body[data-screen="game"] .ola-pop { display: none !important; }
/* 「다른 게임」 링크 */
.more-games { margin: 6px 0 0; font-size: 14px; line-height: 1.7; text-align: center; color: var(--muted); }
.more-games a { color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.doc code { font-size: .9em; }
