/* CAPCOM: Storm Watch — one 3D stage. HUD on top, SOL bottom-left, subtitles beside him, answer cards along the bottom,
   real NASA media and fact cards top-right. Title, site pick, menus and debriefs are overlays on the same stage. */
:root {
  --desk: #060b1a; --ink: #0b0f1a; --paper: #f5f3ea; --text: #eef3ff; --muted: #a9b7da;
  --signal: #ff6b1a; --data: #48d1ff; --dose: #ff4f6d; --power: #ffd23f; --mission: #7ee08a; --sol: #ffc21a;
  --f-sfx: 'Bangers', Impact, sans-serif; --f-hud: 'Barlow Condensed', 'Arial Narrow', sans-serif; --f-body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --solw: clamp(150px, 21%, 250px); --solh: clamp(190px, 36%, 300px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--desk); color: var(--text); font-family: var(--f-body); font-size: 17px; line-height: 1.4;
  padding-block: 10px 18px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--data); outline-offset: 3px; }
[hidden] { display: none !important; }
a { color: var(--data); }
.wrap { max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.stage { position: relative; height: min(88svh, 780px); min-height: 600px; border-radius: 18px; overflow: hidden; border: 4px solid var(--ink); outline: 3px solid #22305c; background: #000; }
.stage.shake { animation: shake .5s; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: pointer; }
.fade, .flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.fade { transition: opacity .6s; z-index: 30; }
.fade.on { opacity: 1; }
.flash.go { animation: flash .9s ease-out; }
.snow { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; background-image: radial-gradient(#fff 1px, transparent 1.3px), radial-gradient(#fff 1px, transparent 1.3px); background-size: 23px 29px, 37px 31px; background-position: 0 0, 11px 7px; mix-blend-mode: screen; }
.stage.impact .snow { opacity: .55; animation: snow .22s steps(3) infinite; }
.vignette { position: absolute; inset: 0; pointer-events: none; transition: box-shadow .6s; }
.stage.hot .vignette { box-shadow: inset 0 0 160px 30px rgba(255, 79, 109, .45); }

/* HUD */
.hud { position: absolute; inset: 10px 10px auto 10px; display: flex; align-items: flex-start; gap: 8px 12px; flex-wrap: wrap; pointer-events: none; z-index: 5; }
.hud > * { pointer-events: auto; }
.hudl { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.gp { font-family: var(--f-hud); font-weight: 600; font-size: 13px; color: var(--paper); background: rgba(6, 11, 26, .85); border: 1px dashed #8a93b8; border-radius: 6px; padding: 0 8px; }
.lvl { font-family: var(--f-hud); font-weight: 700; font-size: 18px; background: rgba(6, 11, 26, .85); border-radius: 8px; padding: 2px 10px; }
.meters { display: flex; gap: 8px; flex-wrap: wrap; margin-inline-start: auto; align-items: center; justify-content: flex-end; max-width: 100%; }
.m { display: flex; gap: 6px; align-items: center; background: rgba(6, 11, 26, .85); border: 2px solid #2a3a6c; border-radius: 999px; padding: 4px 12px 4px 6px; font-family: var(--f-hud); font-weight: 600; font-size: 15px; }
.m svg { width: 22px; height: 22px; flex: none; }
.m small { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2.6em; }
.m.bump { animation: bump .5s; }
.bar { position: relative; width: 78px; height: 10px; border-radius: 5px; background: #1c2748; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; border-radius: 5px; transition: width .6s; }
.bar em { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #fff; }
.stars { color: var(--mission); font-size: 17px; letter-spacing: 2px; }
.stars.sh { color: var(--data); }
.clock { position: relative; width: 72px; height: 72px; }
.clock svg { width: 72px; height: 72px; transform: rotate(-90deg); }
.clock b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-hud); font-size: 19px; font-variant-numeric: tabular-nums; color: var(--power); text-shadow: 0 2px 0 var(--ink); line-height: 1; text-align: center; }
.clock b.sm { font-size: 14px; }
.stage.hot .clock b { color: #fff; animation: pulse .8s steps(2) infinite; }
.tbtn { font-family: var(--f-hud); font-weight: 600; font-size: 15px; background: rgba(6, 11, 26, .85); border: 2px solid #2a3a6c; border-radius: 999px; padding: 4px 12px; min-height: 36px; cursor: pointer; }

/* NASA cards */
.card { position: absolute; inset: var(--hudb, 112px) 14px auto auto; width: min(38%, 420px); background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 10px; padding: 8px; box-shadow: 6px 6px 0 var(--signal); transform: rotate(1.5deg); animation: slidein .7s cubic-bezier(.2, 1.3, .4, 1); z-index: 4; }
.card video, .card img { width: 100%; max-height: min(30vh, 260px); object-fit: contain; display: block; border: 3px solid var(--ink); border-radius: 6px; background: #000; }
.card p { margin: 6px 2px 0; font-family: var(--f-hud); font-weight: 600; font-size: 15px; line-height: 1.2; }
.card small { display: block; font-weight: 500; color: #4b5270; }
.card .tag { position: absolute; inset: -15px auto auto -10px; background: var(--signal); color: #1d0b00; font-family: var(--f-sfx); font-size: 20px; padding: 0 10px; border: 3px solid var(--ink); transform: rotate(-5deg); }
.card .big { font-family: var(--f-sfx); font-size: clamp(28px, 3.2vw, 40px); overflow-wrap: anywhere; line-height: 1; color: var(--ink); -webkit-text-stroke: 0; text-shadow: none; letter-spacing: .01em; margin: 6px 0 0; }
.card.fact { background: #e9fbff; box-shadow: 6px 6px 0 var(--data); }
.sfx { position: absolute; inset: 24% auto auto 30%; font-family: var(--f-sfx); font-size: clamp(56px, 10vw, 120px); color: var(--power); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 7px 7px 0 var(--ink); transform: rotate(-8deg); pointer-events: none; animation: pop .6s cubic-bezier(.2, 1.6, .4, 1); z-index: 3; }

/* SOL + subtitles */
#solCv { position: absolute; inset: auto auto 0 0; width: var(--solw); height: var(--solh); cursor: pointer; z-index: 6; }
.plate { position: absolute; inset: auto auto 8px 12px; font-family: var(--f-hud); font-weight: 700; font-size: 15px; background: var(--sol); color: #1d1400; border: 2px solid var(--ink); border-radius: 6px; padding: 0 8px; pointer-events: none; z-index: 7; }
.quip { position: absolute; inset: auto auto var(--solh) 30px; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 14px; padding: 4px 10px; font-family: var(--f-hud); font-weight: 700; font-size: 17px; pointer-events: none; animation: pop .35s both; z-index: 8; }
.sub { position: absolute; inset: auto 14px 16px calc(var(--solw) + 8px); max-width: 760px; background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 20px; padding: 10px 14px; box-shadow: 5px 5px 0 var(--ink); font-size: 19px; line-height: 1.35; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; align-items: start; z-index: 9; }
.sub::before { content: ""; position: absolute; inset: auto auto 18px -18px; border: 12px solid transparent; border-right: 14px solid var(--ink); }
.sub.radio { background: #dff3ff; } .sub.nour { background: #ffe2c8; }
.sub .face { width: 54px; height: 54px; border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; grid-row: span 2; }
.sub .face:empty { border: 0; width: 0; }
.sub .face svg { width: 100%; height: 100%; display: block; }
.sub strong { font-family: var(--f-hud); font-size: 16px; letter-spacing: .03em; display: flex; gap: 8px; align-items: center; }
.sub strong i { font-style: normal; font-size: 12px; background: var(--data); color: var(--ink); padding: 0 6px; border-radius: 3px; }
.sub .ctl { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
.pill { font-family: var(--f-hud); font-weight: 700; font-size: 16px; background: var(--ink); color: var(--paper); border: 0; border-radius: 999px; padding: 4px 14px; min-height: 40px; cursor: pointer; }

/* answers */
.answers { position: absolute; inset: auto 14px 14px calc(var(--solw) + 8px); display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; z-index: 9; }
.ans { position: relative; display: flex; gap: 10px; align-items: center; text-align: start; background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 16px; padding: 8px 12px; cursor: pointer; box-shadow: 5px 5px 0 var(--ink); min-height: 64px; animation: rise .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.ans:nth-child(2) { animation-delay: .07s; } .ans:nth-child(3) { animation-delay: .14s; } .ans:nth-child(4) { animation-delay: .21s; }
.ans:hover { transform: translateY(-3px); }
.ans:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.ans[disabled] { opacity: .5; cursor: not-allowed; }
.ans.nour { background: #ffd9b5; }
.ans svg { flex: none; width: 40px; height: 40px; }
.ans .q { font-weight: 700; font-size: 17px; line-height: 1.2; }
.ans .by { display: block; font-family: var(--f-hud); font-size: 13px; color: #4b5270; }
.answers.pulse .ans { animation: rise .45s both, glow 1.4s 1s infinite; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.chip { font-family: var(--f-hud); font-weight: 600; font-size: 13px; border: 2px solid var(--ink); border-radius: 999px; padding: 0 7px; background: #fff; }
.chip.p { background: #fff1b8; } .chip.d { background: #ffd0d8; } .chip.ms { background: #d5f5d9; } .chip.sh { background: #cdeeff; }
.go { font-family: var(--f-sfx); font-size: 28px; letter-spacing: .04em; background: var(--signal); color: #1d0b00; border: 4px solid var(--ink); border-radius: 16px; padding: 6px 26px; min-height: 56px; cursor: pointer; box-shadow: 5px 5px 0 var(--ink); animation: rise .45s both, glow 1.4s 1s infinite; }
.go.alt { background: var(--paper); animation: rise .45s both; }
.go.sm { font-size: 22px; min-height: 48px; padding: 4px 16px; }
.go:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.arrow { position: absolute; z-index: 12; width: 54px; height: 54px; pointer-events: none; animation: nudge .8s ease-in-out infinite; filter: drop-shadow(3px 3px 0 #0b0f1a); }
.arrow.down { transform: rotate(90deg); animation: bob .8s ease-in-out infinite; }

/* overlays */
.ov { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 90px clamp(18px, 4vw, 48px) 40px calc(var(--solw) + 20px); overflow: auto; z-index: 10; }
.ov.dim { background: linear-gradient(90deg, rgba(0, 0, 0, .82), rgba(0, 0, 0, .5) 60%, rgba(0, 0, 0, .15)); }
.big { font-family: var(--f-sfx); font-size: clamp(48px, 9vw, 110px); line-height: .9; margin: 0; color: var(--paper); -webkit-text-stroke: 2px var(--ink); text-shadow: 6px 6px 0 var(--signal); letter-spacing: .02em; }
.big.mid { font-size: clamp(40px, 6vw, 72px); }
.kicker { font-family: var(--f-hud); font-weight: 600; font-size: 19px; color: var(--data); margin: 0; }
.honest { background: var(--paper); color: var(--ink); border: 3px solid var(--ink); padding: 8px 12px; font-family: var(--f-hud); font-weight: 600; font-size: 17px; box-shadow: 4px 4px 0 var(--signal); max-width: 46ch; margin: 0; }
.polaroid { position: absolute; inset: 70px 40px auto auto; width: min(28%, 300px); background: var(--paper); padding: 8px 8px 6px; border: 3px solid var(--ink); transform: rotate(4deg); box-shadow: 6px 6px 0 rgba(0, 0, 0, .5); animation: float 6s ease-in-out infinite; }
.polaroid img { width: 100%; display: block; border: 2px solid var(--ink); }
.polaroid p { margin: 4px 2px 0; color: var(--ink); font-family: var(--f-hud); font-size: 13px; line-height: 1.2; }
.skipi { position: absolute; top: 12px; right: 12px; z-index: 11; }
.namesl { font-size: 16px; color: var(--muted); }
.names span { cursor: default; }
.names { display: flex; flex-wrap: wrap; gap: 6px; max-width: 760px; }
.names span { font-family: var(--f-hud); font-size: 15px; border: 1px solid #3b4c84; border-radius: 999px; padding: 1px 9px; background: rgba(16, 28, 62, .85); animation: rise .4s both; }
.sites { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 900px; }
.site { display: flex; flex-direction: column; gap: 4px; text-align: start; background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 14px; padding: 10px; cursor: pointer; box-shadow: 5px 5px 0 var(--ink); animation: rise .5s both; transition: transform .2s; }
.site:hover, .site:focus-visible { transform: rotate(-1.5deg) translateY(-4px); }
.site h3 { margin: 0; font-family: var(--f-hud); font-size: 23px; line-height: 1; }
.credit { font-size: 13px; color: var(--muted); margin: 0; }
.levels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 860px; }
.lvbtn { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: start; background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 14px; padding: 12px 14px; min-height: 64px; cursor: pointer; box-shadow: 5px 5px 0 var(--ink); font-family: var(--f-hud); font-weight: 700; font-size: 21px; animation: rise .45s both; }
.lvbtn b { color: #d99a00; font-size: 22px; letter-spacing: 2px; }
.lvbtn small { display: block; font-size: 14px; font-weight: 600; color: #4b5270; }
.lvbtn.locked { background: #c9cbd3; color: #3b4258; cursor: not-allowed; box-shadow: 3px 3px 0 var(--ink); animation: none; }
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.rules li { display: flex; gap: 12px; align-items: center; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: 12px; padding: 8px 12px; font-size: 18px; box-shadow: 4px 4px 0 var(--ink); animation: rise .45s both; }
.rules li:nth-child(2) { animation-delay: .1s; } .rules li:nth-child(3) { animation-delay: .2s; } .rules li:nth-child(4) { animation-delay: .3s; }
.rules .ri { flex: none; width: 44px; height: 44px; border-radius: 10px; background: var(--c); display: grid; place-items: center; border: 2px solid var(--ink); }
.rules .ri svg { width: 30px; height: 30px; }
.rules .rs { font-size: 26px; color: var(--ink); }
.ask { background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 14px; padding: 12px 14px; max-width: 560px; box-shadow: 5px 5px 0 var(--dose); display: flex; flex-direction: column; gap: 10px; }
.ask p { margin: 0; font-weight: 700; }
.lvbtn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* debrief */
.deb { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; max-width: 1000px; background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 14px; padding: 16px; box-shadow: 7px 7px 0 var(--signal); animation: rise .6s both; }
.debm { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.debm video, .debm img { width: 100%; border: 3px solid var(--ink); border-radius: 6px; display: block; background: #000; }
.debm .credit, .deb .credit { color: #3b4258; }
.debt { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.deb h2 { font-family: var(--f-sfx); font-size: 46px; margin: 0; line-height: 1; }
.deb a { color: #0b4fb3; font-weight: 700; }
.starrow { display: flex; gap: 6px; }
.starrow span { font-size: 44px; color: #d8d3c0; -webkit-text-stroke: 2px var(--ink); display: inline-block; }
.starrow span.on { color: #ffc61a; animation: starpop .6s cubic-bezier(.2, 1.8, .4, 1) both; }
.starrow span:nth-child(2) { animation-delay: .35s; } .starrow span:nth-child(3) { animation-delay: .7s; }
.score { display: flex; flex-wrap: wrap; gap: 4px 12px; background: #eef1fa; border: 2px dashed #8a93b8; border-radius: 10px; padding: 8px 10px; font-family: var(--f-hud); font-size: 17px; }
.score b { width: 100%; font-size: 14px; color: #4b5270; }
.score em { width: 100%; font-style: normal; font-size: 14px; color: #4b5270; }
.tip { margin: 0; }
.real { border-left: 6px solid var(--signal); padding: 6px 10px; background: #fff; font-size: 16px; }
.real b { display: block; font-family: var(--f-hud); font-size: 15px; color: #a43d00; }

/* certificate, live, about */
.cert { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.certtxt { font-size: 20px; margin: 0; max-width: 55ch; }
.certstars { font-family: var(--f-sfx); font-size: 44px; color: var(--sol); margin: 0; }
.live { background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 14px; padding: 14px; max-width: 900px; box-shadow: 6px 6px 0 var(--data); }
.live p { margin: 6px 0; }
.livestamp { font-family: var(--f-hud); font-weight: 700; color: #a43d00; }
.livegrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.livegrid div { background: #eef1fa; border-radius: 10px; padding: 8px; }
.livegrid b { display: block; font-family: var(--f-sfx); font-size: 30px; line-height: 1.1; }
.livegrid span { font-size: 14px; color: #3b4258; }
.about { background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 14px; padding: 14px; max-width: 1000px; overflow-x: auto; }
.about table { border-collapse: collapse; width: 100%; font-size: 15px; }
.about th, .about td { text-align: start; padding: 6px 8px; border-bottom: 1px solid #c9cde0; vertical-align: top; }
.about a { color: #0b4fb3; font-weight: 700; }
.about p { margin: 10px 0 0; }
footer { color: var(--muted); font-size: 13px; }

/* phones */
@media (max-width: 760px) {
  :root { --solw: 110px; --solh: 150px; }
  .stage { height: auto; min-height: 0; display: flex; flex-direction: column; }
  .stage > #gl { position: relative; height: 300px; flex: none; }
  .hud { position: relative; inset: auto; order: -1; padding: 8px; background: #060b1a; }
  .meters { justify-content: flex-start; }
  .bar { width: 50px; }
  .m { font-size: 14px; padding: 3px 10px 3px 5px; }
  .clock, .clock svg { width: 58px; height: 58px; }
  .clock b { font-size: 16px; }
  #solCv { inset: auto auto auto 0; top: 0; position: relative; order: 2; height: var(--solh); }
  .plate { display: none; }
  .quip { position: relative; inset: auto; order: 3; margin: 0 8px; align-self: flex-start; }
  .sub, .answers, .card { position: relative; inset: auto; margin: 8px; max-width: none; width: auto; transform: none; order: 4; }
  .answers { order: 5; grid-template-columns: minmax(0, 1fr); }
  .sub::before { display: none; }
  .ov { position: relative; padding: 20px 16px; order: 6; }
  .polaroid { display: none; }
  .sites, .deb, .levels, .livegrid { grid-template-columns: minmax(0, 1fr); }
  .sfx { font-size: 54px; }
}
@keyframes shake { 10%, 50%, 90% { transform: translate(-6px, 3px); } 30%, 70% { transform: translate(6px, -3px); } }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }
@keyframes snow { 50% { background-position: 7px 13px, 3px 19px; } }
@keyframes pulse { 50% { opacity: .5; } }
@keyframes pop { from { transform: rotate(-8deg) scale(.2); opacity: 0; } }
@keyframes slidein { from { transform: translateX(120%) rotate(12deg); } }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
@keyframes float { 50% { transform: rotate(2deg) translateY(-8px); } }
@keyframes starpop { from { transform: scale(0) rotate(-90deg); } }
@keyframes glow { 50% { box-shadow: 5px 5px 0 var(--ink), 0 0 0 6px rgba(255, 194, 26, .55); } }
@keyframes bob { 50% { transform: rotate(90deg) translateX(-10px); } }
@keyframes nudge { 50% { transform: translateX(-10px); } }
@keyframes bump { 40% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
