/* AI 팀빌딩 방탈출 — 공용 스타일 (흰 바탕 · 검정 · 골드 #B08A42) */
:root { --ink: #111; --gold: #B08A42; --muted: rgba(17,17,17,.58); --soft: rgba(17,17,17,.36); --line: rgba(17,17,17,.13); --tint: rgba(176,138,66,.08); --tint2: rgba(176,138,66,.18); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--ink); font-family: -apple-system, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif; line-height: 1.5; word-break: keep-all; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.wrap { width: min(100% - 28px, 560px); margin: 0 auto; }
.wide { width: min(100% - 32px, 1180px); margin: 0 auto; }

/* 브랜드 */
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1.5px solid var(--ink); border-radius: 10px; font-size: 12px; font-weight: 900; letter-spacing: .04em; }
.brand strong { display: block; font-size: 12px; letter-spacing: .08em; }
.brand small { display: block; color: var(--muted); font-size: 8px; letter-spacing: .14em; }
.eyebrow { color: var(--gold); font-size: 11px; font-weight: 900; letter-spacing: .16em; }

/* 상태 배지 */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 11px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--soft); font-style: normal; }
.badge.live { border-color: var(--ink); color: var(--ink); }
.badge.live i { background: var(--gold); }
.badge.finished { color: var(--ink); background: var(--tint); border-color: var(--gold); }

/* 팀 화면 */
.team-head { padding: 22px 0 14px; }
.team-head .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.team-name { margin: 18px 0 0; font-size: 26px; font-weight: 900; letter-spacing: -.02em; line-height: 1.2; }
.team-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 14px; }
.stat { padding: 12px 12px; border: 1px solid var(--line); border-radius: 14px; }
.stat span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.stat b { display: block; font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat b em { font-style: normal; color: var(--gold); }
.notice { margin: 12px 0 0; padding: 12px 14px; border: 1px solid var(--gold); border-radius: 12px; background: var(--tint); font-size: 13px; }
.vaults { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 6px 0 40px; }
.vault { position: relative; aspect-ratio: 1 / 1; min-height: 56px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 14px; background: #fff; padding: 0; }
.vault b { font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; }
.vault small { position: absolute; left: 0; right: 0; bottom: 6px; font-size: 8px; font-weight: 800; letter-spacing: .06em; color: var(--muted); }
.vault.solved { background: var(--ink); color: #fff; }
.vault.solved small { color: var(--gold); }
.vault.solved::after { content: "✓"; position: absolute; top: 5px; right: 8px; font-size: 12px; color: var(--gold); }
.vault.html::before { content: ""; position: absolute; top: 7px; left: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.vault:disabled { opacity: .45; cursor: default; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 11px; padding-bottom: 10px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-right: 4px; }

/* 모달 */
.backdrop { position: fixed; inset: 0; z-index: 20; display: none; overflow-y: auto; background: rgba(17,17,17,.55); padding: 14px; }
.backdrop.open { display: block; }
.modal { position: relative; width: min(100%, 560px); min-width: 0; margin: 0 auto; padding: 24px 20px 22px; border: 1.5px solid var(--ink); border-radius: 22px; background: #fff; }
.modal .close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--ink); color: #fff; font-size: 20px; line-height: 1; }
.modal .vault-icon { width: 64px; height: 64px; margin: 0 auto 10px; border: 2px solid var(--ink); border-radius: 18px; display: grid; place-items: center; }
.modal .vault-icon i { width: 26px; height: 26px; border: 2px solid var(--ink); border-radius: 50%; display: grid; place-items: center; font-style: normal; }
.modal .vault-icon i::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.modal.solved .vault-icon { background: var(--ink); }
.modal.solved .vault-icon i { border-color: var(--gold); }
.modal .eyebrow { display: block; text-align: center; }
.modal h2 { margin: 6px 0 8px; text-align: center; font-size: 28px; letter-spacing: -.02em; line-height: 1.2; }
.modal .question { margin: 0 0 16px; text-align: center; color: var(--muted); font-size: 16px; white-space: pre-wrap; }
.field { display: grid; gap: 6px; margin-top: 12px; font-size: 12px; font-weight: 800; color: var(--muted); }
.field input { width: 100%; min-width: 0; min-height: 54px; padding: 0 16px; border: 1.5px solid var(--ink); border-radius: 14px; background: #fff; font-size: 19px; font-weight: 700; }
.field input:focus { outline: none; box-shadow: 0 0 0 3px var(--tint2); }
.primary { width: 100%; min-height: 56px; margin-top: 10px; border: 0; border-radius: 14px; background: var(--ink); color: #fff; font-size: 17px; font-weight: 900; }
.primary:disabled { opacity: .35; cursor: default; }
.result { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 700; border: 1px solid var(--line); }
.result.success { background: var(--ink); color: #fff; border-color: var(--ink); }
.result.duplicate { background: var(--tint); border-color: var(--gold); }
.result.wrong, .result.closed, .result.error { border-color: var(--ink); }
.hint-toggle { display: block; margin: 14px auto 0; background: none; border: 0; text-decoration: underline; font-size: 14px; font-weight: 700; }
.hint-box { margin: 10px 0 0; padding: 12px 14px; border: 1px dashed var(--gold); border-radius: 12px; background: var(--tint); font-size: 14px; }
.hidden { display: none !important; }

/* HTML 게임 iframe */
.game-wrap { margin: 4px 0 6px; border: 1.5px solid var(--ink); border-radius: 16px; overflow: hidden; }
.game-frame { display: block; width: 100%; height: min(56vh, 480px); border: 0; background: #fff; }
@media (max-height: 700px) { .game-frame { height: 390px; } }
.game-status { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.game-status.received { background: var(--ink); color: #fff; border-color: var(--ink); }

/* 현장 화면 */
.station { padding: 22px 0 40px; }
.station .card { margin-top: 16px; padding: 22px 18px; border: 1.5px solid var(--ink); border-radius: 22px; }
.team-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.team-pick button { min-height: 52px; border: 1.5px solid var(--ink); border-radius: 12px; background: #fff; font-weight: 800; font-size: 14px; }
.team-pick button.on { background: var(--ink); color: #fff; }
.team-pick button.on::after { content: " ✓"; color: var(--gold); }

/* 점수판 */
.board { padding: 26px 0 40px; }
.board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.board-head h1 { margin: 8px 0 0; font-size: clamp(26px, 4vw, 44px); letter-spacing: -.02em; line-height: 1.1; }
.board-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-top: 22px; }
@media (max-width: 760px) { .board-grid { grid-template-columns: 1fr; } }
.rank-list { display: grid; gap: 10px; }
.rank { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 16px 18px; border: 1.5px solid var(--ink); border-radius: 18px; background: #fff; }
.rank.first { background: var(--ink); color: #fff; }
.rank .no { font-size: clamp(24px, 3vw, 34px); font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; }
.rank .name { font-size: clamp(18px, 2.4vw, 26px); font-weight: 900; }
.rank .bar { height: 8px; margin-top: 8px; border-radius: 999px; background: rgba(17,17,17,.12); overflow: hidden; }
.rank.first .bar { background: rgba(255,255,255,.18); }
.rank .bar i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 999px; transition: width .6s; }
.rank .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.rank.first .meta { color: rgba(255,255,255,.65); }
.rank .score { text-align: right; font-size: clamp(26px, 3.4vw, 40px); font-weight: 900; font-variant-numeric: tabular-nums; }
.rank .score small { display: block; font-size: 11px; font-weight: 700; color: var(--gold); letter-spacing: .08em; }
.feed { padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; }
.feed h2 { margin: 0 0 8px; font-size: 13px; letter-spacing: .1em; color: var(--muted); }
.feed ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.feed li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--tint); font-size: 14px; }
.feed li b { color: var(--gold); white-space: nowrap; }
.feed .empty { color: var(--soft); font-size: 13px; }
.board-foot { margin-top: 18px; color: var(--soft); font-size: 12px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* 메인 */
.landing { min-height: 100vh; display: grid; place-items: center; padding: 30px 0; }
.landing-card { width: min(100%, 460px); padding: 34px 28px 28px; border: 1.5px solid var(--ink); border-radius: 26px; }
.landing-card h1 { margin: 22px 0 8px; font-size: 32px; letter-spacing: -.02em; line-height: 1.15; }
.landing-card p { margin: 0 0 22px; color: var(--muted); font-size: 15px; }
.landing-card a.btn { display: block; margin-top: 10px; padding: 16px 18px; border: 1.5px solid var(--ink); border-radius: 14px; text-decoration: none; font-weight: 900; font-size: 16px; }
.landing-card a.btn.main { background: var(--ink); color: #fff; }
.landing-card a.btn small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.landing-card a.btn.main small { color: rgba(255,255,255,.65); }
.landing-foot { margin-top: 18px; color: var(--soft); font-size: 11px; letter-spacing: .1em; text-align: center; }
