/* War Room. Phone first: everything is laid out for a tall narrow screen and centered on wide ones. */
@font-face { font-family: "Big Shoulders"; src: url(/fonts/big-shoulders-display-latin-800-normal.ttf); font-weight: 800; font-display: swap; }
@font-face { font-family: "Plex"; src: url(/fonts/ibm-plex-sans-latin-400-normal.woff); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url(/fonts/ibm-plex-sans-latin-600-normal.woff); font-weight: 600; font-display: swap; }
@font-face { font-family: "JB Mono"; src: url(/fonts/jetbrains-mono-latin-700-normal.ttf); font-weight: 700; font-display: swap; }

:root {
  --ink: #0e0c1c; --ink2: #17142b; --line: #2e2a4d; --text: #f1eefc; --dim: #a9a4c8;
  --amber: #ffb224; --teal: #3ddbb0; --red: #ff5c5c;
  --disp: "Big Shoulders", "Arial Narrow", sans-serif; --body: "Plex", system-ui, sans-serif; --mono: "JB Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; background: #05040b; color: var(--text); font: 400 16px/1.45 var(--body); -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
a { color: var(--teal); }

#app { position: relative; height: 100dvh; max-width: 480px; margin: 0 auto; overflow: hidden; background: var(--ink); }
.screen { position: absolute; inset: 0; display: none; }
.screen.on { display: block; animation: fade .35s ease both; }
.screen.scroll { overflow-y: auto; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.bg { position: absolute; inset: 0; background: var(--ink) center/cover no-repeat; transition: opacity .5s; }
.bg.swap { opacity: 0; }
.shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,12,28,.25) 0%, rgba(14,12,28,.1) 30%, rgba(14,12,28,.92) 62%, var(--ink) 100%); }
.shade.low { background: linear-gradient(180deg, rgba(14,12,28,.55) 0%, rgba(14,12,28,0) 22%, rgba(14,12,28,.2) 45%, var(--ink) 78%); }

.stage3d { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .6s; touch-action: none; pointer-events: none; outline: none; }
.stage3d.on { opacity: 1; }

/* title */
.title-wrap { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 20px calc(18px + env(safe-area-inset-bottom)); }
.kicker { font: 700 13px var(--mono); letter-spacing: .14em; color: var(--amber); }
.kicker span { color: var(--dim); margin-left: 8px; }
h1 { font: 800 clamp(48px, 15vw, 68px)/.92 var(--disp); text-transform: uppercase; margin: 6px 0 10px; }
.tag { font-size: 17px; max-width: 30ch; }
.pick { margin-top: 18px; font-size: 14px; color: var(--dim); }
.countries { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 14px; }
.country { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 6px; background: rgba(23,20,43,.8); text-align: center; }
.country b { display: block; font: 800 22px var(--disp); letter-spacing: .03em; }
.country span { font: 700 11px var(--mono); color: var(--dim); }
.country.on { border-color: var(--amber); background: rgba(255,178,36,.14); }
.country.on span { color: var(--amber); }
.cta { display: block; width: 100%; padding: 15px 18px; border-radius: 14px; background: var(--amber); color: #1a1200; font: 800 24px var(--disp); letter-spacing: .04em; text-transform: uppercase; }
.cta:active { transform: translateY(1px) scale(.99); }
.cta.small { width: auto; font-size: 19px; padding: 11px 18px; }
.cta.ghost { background: transparent; color: var(--text); border: 1.5px solid var(--line); }
.opts { display: flex; gap: 18px; margin-top: 12px; font-size: 14px; color: var(--dim); }
.opts input { accent-color: var(--amber); }
.fine { font-size: 12px; color: var(--dim); margin-top: 10px; }

/* play */
.hud { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 8px; z-index: 3; }
.clock { font: 700 26px var(--mono); letter-spacing: .02em; }
.clock.tick { animation: pop .4s ease; }
.chip { flex: 1; min-width: 0; font: 700 12px var(--mono); padding: 6px 10px; border-radius: 999px; background: rgba(23,20,43,.85); border: 1px solid var(--line); color: var(--amber); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.hot { color: var(--red); border-color: var(--red); }
.chip.ok { color: var(--teal); border-color: var(--teal); }
.mute { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: rgba(23,20,43,.85); font-size: 16px; }
.mute.off { opacity: .45; text-decoration: line-through; }
.steps { position: absolute; top: calc(58px + env(safe-area-inset-top)); left: 14px; right: 14px; display: flex; gap: 4px; z-index: 3; }
.steps i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.18); }
.steps i.done { background: var(--amber); }
.portrait { position: absolute; left: 50%; bottom: 44%; height: 40%; transform: translateX(-50%); z-index: 1; filter: drop-shadow(0 12px 24px rgba(0,0,0,.6)); transition: opacity .3s; pointer-events: none; }
.portrait.hide { opacity: 0; }
.portrait.in { animation: rise .45s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes rise { from { transform: translate(-50%, 14px); opacity: 0 } to { transform: translate(-50%, 0); opacity: 1 } }
.panel { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; max-height: 72%; overflow-y: auto; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(14,12,28,0), var(--ink) 28px); }
.panel.tall { max-height: 88%; }
.nametag { display: inline-block; font: 700 12px var(--mono); letter-spacing: .08em; color: var(--ink); background: var(--teal); border-radius: 6px; padding: 3px 8px; margin-bottom: 6px; }
.nametag:empty { display: none; }
h2 { font: 800 30px/1 var(--disp); text-transform: uppercase; letter-spacing: .01em; margin-bottom: 8px; }
.lines p { margin-bottom: 8px; font-size: 16.5px; }
.lines p.new { animation: fade .4s both; }
.ask { font: 600 15px var(--body); color: var(--amber); margin: 10px 0 8px; }
.choices { display: grid; gap: 8px; }
.choice { text-align: left; padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--ink2); font-size: 15.5px; font-weight: 600; animation: fade .3s both; }
.choice:active, .choice.picked { border-color: var(--amber); background: rgba(255,178,36,.14); }
.timer { height: 5px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; margin-bottom: 8px; }
.timer i { display: block; height: 100%; width: 100%; background: var(--teal); transform-origin: left; }
.timer.hot i { background: var(--red); }
.after p { font-size: 16.5px; margin: 4px 0 10px; }
.delta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pill { font: 700 12px var(--mono); padding: 5px 9px; border-radius: 999px; border: 1px solid; animation: pop .45s cubic-bezier(.2,.9,.3,1.6) both; }
.pill.up { color: var(--teal); } .pill.down { color: var(--red); }
@keyframes pop { from { transform: scale(.6); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.log { font: 700 11px/1.5 var(--mono); background: #07060f; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; max-height: 34dvh; overflow: auto; }
.log div { padding: 2px 0; border-bottom: 1px dashed rgba(255,255,255,.06); color: var(--dim); overflow-wrap: anywhere; }
.log b { color: var(--teal); margin-right: 6px; }
.log .src { color: var(--amber); margin-right: 6px; }
.shake { animation: shake .35s; }
@keyframes shake { 20% { transform: translateX(-5px) } 40% { transform: translateX(5px) } 60% { transform: translateX(-3px) } 80% { transform: translateX(3px) } }

/* end */
.end-wrap { padding: calc(22px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom)); }
.scorecard { display: flex; gap: 14px; align-items: center; margin: 10px 0 14px; }
.score { font: 800 84px/1 var(--disp); color: var(--amber); min-width: 2ch; }
.scorecard h2 { margin: 0 0 2px; }
.scorecard p { color: var(--dim); font-size: 14px; }
.meters { display: grid; gap: 9px; margin-bottom: 14px; }
.meter { display: grid; grid-template-columns: 96px 1fr 62px; gap: 8px; align-items: center; font: 700 12px var(--mono); }
.meter .bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: var(--teal); width: 0; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.meter .bar i.mid { background: var(--amber); } .meter .bar i.low { background: var(--red); }
.meter span:last-child { text-align: right; color: var(--dim); }
.verdict { border-left: 4px solid var(--teal); background: var(--ink2); border-radius: 0 12px 12px 0; padding: 12px 14px; margin-bottom: 16px; }
.verdict.miss { border-color: var(--red); }
.verdict b { font: 700 12px var(--mono); letter-spacing: .08em; display: block; margin-bottom: 4px; color: var(--teal); }
.verdict.miss b { color: var(--red); }
.actions { display: grid; gap: 8px; margin: 14px 0 20px; }
h3 { font: 800 22px var(--disp); text-transform: uppercase; margin: 18px 0 8px; color: var(--amber); }
.review { padding-left: 20px; display: grid; gap: 10px; }
.review li b { display: block; }
.review li span { color: var(--dim); font-size: 14.5px; }
.rule { background: var(--ink2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14.5px; }
.rule b { display: block; margin-bottom: 4px; }
.rule small { display: block; color: var(--dim); margin-top: 8px; }
.signup { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.signup input { min-width: 0; padding: 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--ink2); color: var(--text); font: inherit; }
.signup .fine { grid-column: 1 / -1; margin: 0; min-height: 1.2em; }
.toast { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--teal); color: #05241b; font-weight: 600; padding: 10px 16px; border-radius: 999px; z-index: 9; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
