* { 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; }
/* 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; }
body[data-screen="game"].ola-has-tabs { padding-bottom: 0; }
#app { flex: 1; min-height: 0; width: 100%; max-width: 1000px; 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: 44px; 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); }
.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); }

.lead { margin: 0; font-size: 16px; font-weight: 800; word-break: keep-all; }

/* 게임 */
#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: 52px; line-height: 1.1; }
.hud-label { font-size: 11px; color: var(--muted); }
.hud-value { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hud-value.small { font-size: 18px; color: var(--muted); }
.hud-mid { text-align: center; min-width: 0; }
.mode-label { font-size: 12px; color: var(--muted); }
.mode-chip { display: inline-block; margin: 2px 0; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.question { font-size: 17px; 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(12px, env(safe-area-inset-bottom)); }
.cards { display: flex; flex-direction: column; gap: 4px; position: relative; flex: none; }
.vs { align-self: center; font-size: 11px; font-weight: 800; color: var(--muted); line-height: 1; margin: -2px 0; }
.card {
  font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%;
  display: grid; grid-template-columns: 38% 1fr; gap: 10px; align-items: stretch;
  padding: 8px; border-radius: 16px; border: 2px solid var(--line); background: var(--card-face);
}
.card:not(:disabled):active { transform: scale(.985); }
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.card:disabled { cursor: default; opacity: 1; color: inherit; }
.card-media { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.card-media .photo { position: relative; flex: 1; min-height: 96px; border-radius: 10px; overflow: hidden; background: var(--surface); }
.card-media .photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; } /* 잘리지 않게(얼굴·물건 전체) — 남는 곳은 카드 바탕색 */
.kind-note { position: absolute; left: 0; right: 0; top: 0; padding: 2px 4px; font-size: 10px; background: rgba(0,0,0,.55); color: #fff; text-align: center; }
.credit { font-size: 9px; line-height: 1.25; color: var(--muted); overflow: hidden; max-height: 2.5em; word-break: break-all; }
.credit a { color: inherit; }
.emoji-only { align-items: center; justify-content: center; }
.emoji { font-size: 52px; line-height: 1; }
.card-body { display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; }
.card-name { font-size: 17px; font-weight: 800; line-height: 1.3; word-break: keep-all; overflow-wrap: anywhere; }
.card-cat { font-size: 12px; color: var(--muted); }
.card-value { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; min-height: 1.3em; color: var(--muted); }
.card-serving { font-size: 12px; color: var(--muted); visibility: hidden; }
.card.revealed .card-serving { visibility: visible; }
.card.win { border-color: var(--ok); box-shadow: 0 0 0 2px var(--ok); }
.card.win .card-value { color: var(--ok); }
.card.lose .card-value { color: var(--muted); }
.card.picked.lose { border-color: var(--bad); box-shadow: 0 0 0 2px var(--bad); }
.card.picked.lose .card-value { color: var(--bad); }
.cards.done .card:not(.picked):not(.win) { opacity: .85; }

.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 var(--delay, 0ms) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.verdict { margin: 0; font-size: 22px; font-weight: 800; }
.verdict.ok { color: var(--ok); } .verdict.bad { color: var(--bad); }
.twist-line { margin: 0; font-size: 15px; font-weight: 700; }
.twist-line.is-twist { color: var(--twist); }
.notes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 1.5; }
.meta { font-size: 11px; color: var(--muted); }
.meta a { color: inherit; }
#game-foot { text-align: center; padding: 0 4px; }

/* 결과 */
.result-mode { margin: 0; color: var(--muted); font-size: 14px; }
.result-score { margin: 0; font-size: 64px; line-height: 1; color: var(--accent); }
.result-score small { font-size: 24px; margin-left: 4px; color: var(--text); }
.result-detail { margin: 0; font-size: 17px; font-weight: 600; }
.scene { border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 12px; }
.scene-label { font-size: 12px; color: var(--twist); font-weight: 800; }
.scene-body { font-size: 14px; font-weight: 700; margin-top: 2px; line-height: 1.5; word-break: keep-all; }

.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) {
  .cards { flex-direction: row; align-items: stretch; justify-content: center; gap: 14px; }
  .cards > .card { max-width: 420px; }
  .vs { align-self: center; font-size: 16px; margin: 0; order: 0; }
  .card { grid-template-columns: 1fr; grid-template-rows: auto 1fr; flex: 1; padding: 12px; }
  .card-media .photo { min-height: 220px; }
  .emoji-only { min-height: 160px; }
  .emoji { font-size: 88px; }
  .card-body { text-align: center; justify-content: flex-start; }
  .card-name { font-size: 20px; }
  .card-value { font-size: 26px; }
  .credit { font-size: 10px; }
}
@media (max-height: 700px) and (max-width: 719px) {
  .hud-value { font-size: 22px; }
  .card-media .photo { min-height: 84px; }
  .emoji { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal.in { animation: none; }
  .btn:active, .card:not(:disabled):active { transform: none; }
}

/* 묶음 안 다른 게임으로(사업관리 10-13 — 게임 사이를 오가게) */
.more-games { margin: 6px 0 0; font-size: 14px; text-align: center; color: var(--muted, #7a6a58); }
.more-games a { color: var(--accent, #C8412B); font-weight: 600; text-decoration: none; white-space: nowrap; }
