@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=VT323&display=swap');
.pixel.illustrated{image-rendering:auto}
.story-tabs{display:flex;gap:6px;margin:12px 0}.story-tabs button{flex:1;font-size:11px;padding:4px 6px}.story-tabs [aria-pressed="true"]{border-color:var(--green);color:var(--green)}.story-copy{text-align:left}.story-copy p{font-size:13px;line-height:1.5}.outcome .outcome-reward{margin:12px 0 0}
:root{color-scheme:dark;--bg:#0c1218;--panel:#151e25;--line:#35434b;--text:#e5e9dd;--muted:#abb7b4;--green:#b5d974;--red:#f18f7a}
*{box-sizing:border-box}html{height:100%}body{margin:0;height:100vh;height:100dvh;min-height:540px;display:grid;grid-template-rows:auto minmax(0,1fr) auto;background:var(--bg);color:var(--text);font:14px/1.55 'IBM Plex Mono',Consolas,monospace;isolation:isolate;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
/* Dynamic viewport units follow mobile browser chrome. Below the supported
   minimum, natural overflow preserves readable content instead of clipping it. */
button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;border:1px solid var(--line);color:inherit;background:var(--panel);border-radius:0;transition:transform 160ms,box-shadow 160ms,border-color 160ms;min-height:44px}button:hover{border-color:var(--green);background:#202c2b}button:focus-visible,a:focus-visible{outline:3px solid #e6bd76;outline-offset:3px}button:disabled{cursor:default;opacity:.5}p{color:var(--muted);margin:8px 0}h1,h2,h3{margin:0;line-height:1.15}h1{font:clamp(30px,4vh,44px)/1.12 'VT323',Consolas,monospace}h2{font-size:24px}small{font-size:12px}
header,main,footer{position:relative;z-index:1;width:100%;max-width:1400px;margin:0 auto}header{display:flex;align-items:center;justify-content:space-between;padding:10px 4%;gap:12px;border-bottom:1px solid var(--line);min-height:64px}.brand{font:32px 'VT323',monospace;letter-spacing:3px;color:var(--text);text-decoration:none;white-space:nowrap}.brand span{font-size:10px;color:var(--green);margin:0 3px}.header-right{display:flex;align-items:center;gap:10px}.small{padding:6px 10px;font-size:11px}.live{color:var(--green);font-size:10px;letter-spacing:1px}main{min-height:0;outline:none}footer{display:flex;align-items:center;justify-content:space-between;padding:6px 4%;border-top:1px solid var(--line);font-size:9px;letter-spacing:1px;color:#84918e;min-height:28px}footer i{color:var(--green);font-style:normal}.primary{background:var(--green);color:#17251d;border-color:var(--green);font-weight:700;padding:10px 22px;box-shadow:3px 3px #3e5734}.primary:hover{background:#c5e28f;color:#17251d}.secondary{padding:10px 20px;background:#0c1218bb}.eyebrow{display:block;color:var(--green);font-size:11px;letter-spacing:1.4px;margin-bottom:8px}.pixel{width:52px;height:52px;flex-shrink:0;image-rendering:pixelated}
.hero{height:100%;min-height:0;position:relative;display:flex;align-items:center;background:transparent;isolation:isolate;overflow:hidden;image-rendering:pixelated}.hero::before{content:'';position:absolute;inset:0;z-index:0;pointer-events:none;background:linear-gradient(90deg,#0b151de8,#0b151d36),url('assets/title.png') center/cover,#1a2a2d;mask-image:linear-gradient(90deg,transparent,#000 16%,#000 84%,transparent),linear-gradient(transparent,#000 16%,#000 84%,transparent);mask-composite:intersect}.hero-shade{position:absolute;inset:0;pointer-events:none;background:linear-gradient(0deg,#0c1218,transparent 35%);z-index:1}.hero-copy{position:relative;z-index:2;padding:24px 6%;max-width:850px}.hero h1{font:clamp(80px,18vh,160px)/.95 'VT323',Impact,monospace;letter-spacing:3px;margin:18px 0;text-shadow:4px 4px #23372b}.hero h1 span{color:var(--green)}.hero h2{font-size:clamp(22px,3.3vh,30px);line-height:1.25}.hero p{font-size:14px;color:#c0cac4;margin:16px 0}.actions{display:flex;gap:14px;margin:24px 0}.hero-facts{display:flex;gap:24px;font-size:10px;color:#adbbb1;letter-spacing:1px;margin-top:26px}.hero-note{position:absolute;z-index:2;bottom:20px;right:4%;text-align:right}.hero-note p{font-size:11px}.hero::after{content:'';position:absolute;inset:-15%;z-index:0;pointer-events:none;opacity:0;background:radial-gradient(ellipse at 75% 70%,#9ecb671a,transparent 42%)}
.screen{height:100%;max-width:1120px;margin:auto;padding:20px 4%;display:flex;flex-direction:column;gap:14px;min-height:0}.screen-heading{flex-shrink:0}.screen-heading p{margin:7px 0 0}.screen-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:auto;flex-shrink:0;padding:4px}.screen-actions.single{justify-content:center}.action-note,.detail-note{font-size:12px;color:var(--muted)}.selection-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:24px;flex:1;min-height:0;align-items:center}.option-list{display:grid;gap:10px}.choice{display:flex;align-items:center;gap:14px;min-height:64px;width:100%;padding:10px 14px;text-align:left}.choice b{flex:1;font-size:13px}.choice>span{color:var(--green)}.choice .pixel{width:38px;height:38px}.choice.selected{border:2px solid var(--green);background:#1b2927;padding:9px 13px}.selected-detail{display:flex;align-items:center;gap:24px;background:var(--panel);border:1px solid var(--line);padding:24px;min-width:0}.portrait{width:clamp(80px,12vw,160px);height:160px}.selected-detail>div{min-width:0}.selected-detail p{font-size:14px}.selected-detail .tags{padding-top:8px;color:var(--text);font-size:12px}.selected-detail .detail-note{font-size:11px}.hud{display:grid;grid-template-columns:1.7fr 1.2fr 1.2fr .7fr 1.2fr;gap:12px;align-items:center;flex-shrink:0;padding:10px 14px;border:1px solid var(--line);background:var(--panel)}.hud span{display:block;color:var(--muted);font-size:10px}.hud b{font-size:12px}.survivor-status{display:flex;align-items:center;gap:8px}.hud .pixel{width:36px;height:36px}meter{display:block;width:128px;height:12px}meter::-webkit-meter-bar{background:#37413d;border:0}meter::-webkit-meter-optimum-value{background:var(--green)}.pursuit-tracker b{color:#deaa67}.prep-steps{display:flex;gap:8px;flex-shrink:0}.prep-steps button{flex:1;font-size:12px;padding:5px;min-height:36px}.prep-steps span{color:var(--muted);margin-right:5px}.prep-steps [aria-current]{border-color:var(--green);background:#223428;color:var(--green)}.review-panel{display:grid;grid-template-columns:1fr 1fr;gap:24px;align-items:center;flex:1;min-height:0;border:1px solid var(--line);background:var(--panel);padding:20px}.loadout-review{display:grid;gap:10px}.loadout-review>div{display:flex;align-items:center;gap:12px}.loadout-review small,.loadout-review b{display:block}.loadout-review small{color:var(--muted)}.review-stats p{font-size:13px}
.raid-context{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:12px;flex-shrink:0}.raid-context>span{color:var(--muted)}.raid-body{display:flex;flex-direction:column;justify-content:center;gap:22px;background:var(--panel);border:1px solid var(--line);padding:30px;flex:1;min-height:0}.raid-body h1{font-size:clamp(30px,4.5vh,42px);max-width:850px}.decision-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}.decision{display:flex;flex-direction:column;gap:12px;padding:22px;text-align:left}.decision strong{font:38px 'VT323',monospace;color:var(--green)}.decision strong span{float:right}.decision b{font-size:14px;min-height:2.5em}.pursuit{font-size:12px;color:var(--green)}.decision small{font-size:12px;color:var(--muted);line-height:1.6}.odds-note{font-size:12px;margin:0}.outcome{padding:22px;border:1px solid var(--green)}.outcome.bad{border-color:var(--red)}.outcome.bad .eyebrow{color:var(--red)}.outcome-reward{font-size:22px;color:var(--green);margin:20px 0}.outcome.bad .outcome-reward{color:var(--red)}.result{text-align:center;max-width:780px;justify-content:center;gap:12px}.result-art{width:64px;height:64px;margin:0 auto;flex-shrink:0}.result .screen-heading h1{font-size:clamp(30px,5vh,46px)}.fragments{display:flex;justify-content:center;gap:12px;flex-shrink:0}.fragments>span{border:1px solid var(--line);padding:6px;opacity:.3}.fragments .pixel{width:36px;height:36px}.fragments small{display:block;font-size:10px}.fragments .filled{opacity:1;border-color:var(--green);background:#1b2927}.result-panel{background:var(--panel);border:1px solid var(--line);padding:16px}.result-panel p{font-size:13px;margin:8px 0}.result .screen-actions{margin-top:0}
dialog{width:min(620px,calc(100% - 28px));max-height:calc(100dvh - 36px);background:var(--panel);color:var(--text);border:2px solid var(--green);padding:24px}dialog::backdrop{background:#050a10e8}.dialog-top{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:10px;color:var(--muted)}#manual-content{min-height:255px;padding:20px 0}#manual-content h2{font:36px 'VT323',monospace}#manual-content p{font-size:14px;margin:18px 0}.manual-controls{display:flex;justify-content:space-between;align-items:center;gap:10px}.manual-controls>span{font-size:12px}/* CRT texture stays static and leaves small text sharp. */
body.crt{--muted:#bec8c4;--crt-line:.24}
.crt footer{color:#abbab4}.crt .small{color:#edf0e6}
.crt::before,.crt::after{content:'';position:fixed;inset:0;pointer-events:none;z-index:10}
.crt::before{background:radial-gradient(ellipse at center,transparent 48%,#02080d30 85%,#02080d50 100%);box-shadow:inset 0 0 48px #77c9c510}
.crt::after{background:repeating-linear-gradient(0deg,transparent 0 2px,rgba(0,0,0,var(--crt-line)) 2px 3px,#d7f6e008 3px 4px),repeating-linear-gradient(90deg,#ff604008 0 1px,#6fffc408 1px 2px,#6a8fff08 2px 3px)}
.crt h1,.crt h2,.crt .brand{text-shadow:0 0 6px #b5d97430,1px 0 #77c9c52b,-1px 0 #deaa6720}
@media(max-width:600px){body.crt{--crt-line:.18}.crt::before{background:radial-gradient(ellipse at center,transparent 60%,#02080d28 90%,#02080d40 100%)}}

.ambient{position:fixed;inset:0;z-index:0;overflow:hidden;pointer-events:none;contain:strict}.ambient::before{content:'';position:absolute;inset:-20%;background:radial-gradient(ellipse at 12% 75%,#77c9c51b,transparent 45%),radial-gradient(ellipse at 88% 35%,#b5d97414,transparent 48%);opacity:.7}.ambient::after{content:'';position:absolute;inset:0;background:linear-gradient(#77c9c506 1px,transparent 1px),linear-gradient(90deg,#77c9c506 1px,transparent 1px);background-size:48px 48px;mask-image:linear-gradient(transparent,#000,transparent)}.mote{position:absolute;left:var(--x);top:var(--y);height:3px;width:2px;background:#8aae7c;opacity:.25}.mote:nth-child(3n){height:2px;width:3px;background:#77c9c5}
@media(prefers-reduced-motion:no-preference){body:not(.motion-off) .hero::before{background-image:linear-gradient(90deg,#0b151de8,#0b151d36),url('assets/title-loop.gif')}body:not(.motion-off) .hero::after{opacity:1;animation:menu-mist 12s ease-in-out infinite}body:not(.motion-off) .hero h1{animation:title-glow 7s ease-in-out infinite}body:not(.motion-off) .hero-note .live{animation:signal-breathe 4s ease-in-out infinite}body:not(.motion-off) .hero .primary{animation:menu-beacon 3.5s ease-in-out infinite}body:not(.motion-off) button:is(:hover,:focus-visible){transform:translateY(-2px);box-shadow:0 4px 0 #070c11,0 0 18px #b5d97412}body:not(.motion-off) .hero .primary:is(:hover,:focus-visible){animation:none;transform:translate(2px,-2px);box-shadow:3px 5px #3e5734}body:not(.motion-off) .ambient::before{animation:quarantine-fog 22s ease-in-out infinite}body:not(.motion-off) .mote{animation:pixel-drift var(--duration) linear var(--delay) infinite}}
@keyframes menu-mist{0%,100%{transform:translate(-1%,1%);opacity:.55}50%{transform:translate(2%,-1%);opacity:1}}@keyframes title-glow{0%,100%{text-shadow:4px 4px #23372b}50%{text-shadow:4px 4px #23372b,0 0 24px #b5d97425}}@keyframes signal-breathe{0%,100%{opacity:.65}50%{opacity:1}}@keyframes menu-beacon{0%,100%{box-shadow:3px 3px #3e5734}50%{box-shadow:3px 3px #3e5734,0 0 22px #b5d97420}}@keyframes quarantine-fog{0%,100%{transform:translate(-3%,2%);opacity:.5}50%{transform:translate(4%,-3%);opacity:.9}}@keyframes pixel-drift{0%{transform:translate(0,60px);opacity:0}15%{opacity:.45}75%{opacity:.35}100%{transform:translate(35px,-160px);opacity:0}}
body.motion-off button{transition:none}
@media(max-width:800px){.header-right .live,.hero-note{display:none}.screen{padding:16px 3%;gap:12px}.selection-layout{grid-template-columns:190px 1fr;gap:14px}.selected-detail{padding:16px;gap:14px}.portrait{width:76px;height:100px}.hud{gap:8px;padding:8px}.hud b{font-size:11px}meter{width:112px}.raid-body{padding:20px}.review-panel{gap:16px;padding:16px}}
/* Phone: compact selectors above one detail pane; both decisions remain visible. */
@media(max-width:600px){
  body{font-size:13px}header{min-height:56px;padding:6px 12px;gap:6px}.brand{font-size:25px;letter-spacing:1px}.header-right{gap:4px}.small{font-size:10px;padding:5px 7px;min-height:40px}footer{font-size:8px;padding:4px 12px;min-height:24px}.footer-signal{display:none}
  .hero-copy{padding:20px 6%}.hero .eyebrow{font-size:9px;letter-spacing:1px}.hero h1{font-size:clamp(76px,14vh,110px);margin:16px 0}.hero h2{font-size:24px}.hero p{font-size:13px;line-height:1.6;margin:14px 0}.actions{flex-direction:column;gap:12px;margin:22px 0}.actions button{min-height:48px}.hero-facts{font-size:9px;gap:16px;margin-top:24px}
  .screen{padding:12px;gap:10px}.eyebrow{font-size:10px;margin-bottom:5px}.screen-heading h1{font-size:30px}.screen-heading p{font-size:12px;margin-top:5px}.screen-actions{gap:8px;padding:3px}.screen-actions .primary,.screen-actions .secondary{font-size:12px;padding:10px 14px}.action-note{font-size:10px;max-width:130px}
  .selection-layout{display:flex;flex-direction:column;gap:12px;justify-content:center;align-items:stretch}.option-list{display:flex;gap:6px}.choice{flex:1;min-width:0;min-height:78px;padding:6px 4px;flex-direction:column;gap:3px;text-align:center}.choice.selected{padding:5px 3px}.choice .pixel{width:32px;height:32px}.choice b{font-size:11px;line-height:1.2;display:flex;align-items:center}.choice>span{display:none}.selected-detail{padding:14px;gap:12px;align-items:center}.portrait{width:58px;height:76px}.selected-detail h2{font-size:20px}.selected-detail p{font-size:13px;line-height:1.45}.selected-detail .tags{font-size:11px;line-height:1.5;padding-top:4px}.selected-detail .detail-note{font-size:10px}.character-screen .selected-detail{flex-direction:column;text-align:center}.character-screen .portrait{width:100px;height:120px}
  .hud{grid-template-columns:1.6fr 1.2fr 1.2fr;gap:5px 8px;padding:8px;min-height:85px}.hud span{font-size:9px}.hud b{font-size:10px;line-height:1.5}.hud .pixel{display:none}.survivor-status{grid-column:1/3}.hud>div:nth-child(2){grid-column:3}.hud>div:nth-child(3){grid-column:1}.pursuit-tracker{grid-column:3}meter{height:10px;width:130px}
  .prep-steps{gap:4px}.prep-steps button{font-size:10px;min-height:34px;padding:4px 2px}.prep-steps span{display:none}.prep-screen .selection-layout{justify-content:center;gap:10px}.prep-screen .selected-detail{padding:10px;gap:8px}.prep-screen .portrait{width:44px;height:58px}.prep-screen .selected-detail p{font-size:12px}.review-panel{display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:12px;padding:12px}.loadout-review{gap:6px}.loadout-review .pixel{width:30px;height:30px}.loadout-review b{font-size:12px}.loadout-review small{font-size:10px}.review-stats p{font-size:12px;margin:6px 0}.review-stats .detail-note{font-size:11px}
  .raid-context{flex-direction:column;align-items:flex-start;gap:2px;font-size:11px}.raid-context>span{font-size:10px}.raid-body{padding:14px;gap:14px;justify-content:center}.raid-body h1{font-size:28px;line-height:1.15}.decision-grid{gap:8px}.decision{padding:12px 10px;gap:9px}.decision strong{font-size:30px}.decision b{font-size:12px;min-height:3.1em;line-height:1.35}.pursuit{font-size:10px;line-height:1.4;min-height:2.8em}.decision small{font-size:10px;line-height:1.6}.odds-note{font-size:10px}.outcome{padding:14px}.outcome p{font-size:13px}.outcome-reward{font-size:18px;margin:18px 0}
  .result{gap:10px}.result-art{width:46px;height:46px}.result .screen-heading h1{font-size:32px}.result .screen-heading p{font-size:13px}.fragments{gap:10px}.fragments .pixel{width:28px;height:28px}.fragments>span{padding:4px}.result-panel{padding:12px}.result-panel p{font-size:12px;margin:8px 0}.result-panel b{font-size:13px}
  dialog{padding:18px}#manual-content{min-height:290px;padding:16px 0}#manual-content h2{font-size:30px}#manual-content p{font-size:13px;line-height:1.6;margin:16px 0}.manual-controls button{font-size:12px;padding:10px 14px}.mote:nth-child(even){display:none}
}
/* Height matters independently of width, including small laptop windows. */
@media(max-height:740px){.screen{gap:10px;padding-top:12px;padding-bottom:12px}.screen-heading h1{font-size:32px}.selection-layout{gap:14px}.choice{min-height:58px}.option-list{gap:8px}.portrait{height:110px}.raid-body{gap:14px;padding:20px}.result{gap:8px}.result-art{width:44px;height:44px}.result-panel{padding:12px}.result-panel p{margin:6px 0}}
@media(max-width:600px) and (max-height:740px){.screen-heading h1{font-size:28px}.hero h1{font-size:88px}.character-screen .portrait{width:80px;height:90px}.prep-screen .screen-heading p{margin-top:3px}.prep-screen .selected-detail .eyebrow{font-size:9px}.prep-screen .selected-detail h2{font-size:18px}.raid-body{padding:12px;gap:12px}.raid-body h1{font-size:27px}.result .screen-heading h1{font-size:30px}.selected-detail{gap:10px}.prep-screen .selected-detail p{margin:6px 0}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}.hero::after{display:none}}

/* Encounter scenery is decorative; text and controls keep their own contrast. */
.encounter-description{position:relative;isolation:isolate;overflow:hidden;display:flex;align-items:flex-end;flex:1 0 auto;padding:16px 0}
.encounter-description>.screen-heading{width:100%;min-width:0}
.encounter-scene{position:absolute;inset:0;width:100%;height:100%;opacity:.7;pointer-events:none;z-index:-2;mask-image:linear-gradient(90deg,transparent,#000 16%,#000 84%,transparent),linear-gradient(transparent,#000 16%,#000 84%,transparent);mask-composite:intersect}
.encounter-description::before{content:'';position:absolute;inset:0;background:linear-gradient(90deg,#0c1218c9,#0c12184d);pointer-events:none;z-index:-1;mask-image:linear-gradient(90deg,transparent,#000 16%,#000 84%,transparent),linear-gradient(transparent,#000 16%,#000 84%,transparent);mask-composite:intersect}
.encounter-description .screen-heading h1,.encounter-description .screen-heading .eyebrow{text-shadow:0 2px 4px #050a10,0 0 12px #050a10}

.decision-stat{align-self:flex-start;font-size:11px;line-height:1.4;padding:3px 7px;border:1px solid currentColor;border-radius:2px;color:var(--green);white-space:nowrap}
.decision-stat.combat{color:#deaa67}.decision-stat.stealth{color:#77c9c5}.decision-stat span{font-weight:700}
@media(max-width:600px){.decision{gap:6px}.decision-stat{font-size:10px;padding:2px 5px}.encounter-description::before{background:#0c12188c}}

@media(max-width:600px),(max-height:740px){.encounter-description{padding:0}}

/* Keep the encounter in view while the desktop debrief fills the scene. */
.outcome>.encounter-scene{display:none}
@media(min-width:1000px){
  [data-phase="outcome"] .raid-body{justify-content:flex-start}
  .outcome{position:relative;isolation:isolate;overflow:hidden;flex:1;min-height:0;display:flex;align-items:flex-end;padding:28px;background:#101a20;--outcome-tint:rgba(117,155,64,.16)}
  .outcome.bad{--outcome-tint:rgba(184,65,48,.2)}
  .outcome>.encounter-scene{display:block}
  .outcome::before{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(90deg,#0c1218f2 0%,#0c1218d9 38%,#0c121870 70%,#0c121830),linear-gradient(0deg,#0c1218d9,transparent 90%),linear-gradient(var(--outcome-tint),var(--outcome-tint))}
  .outcome-content{width:100%;max-width:650px}
  .outcome .screen-heading h1{font-size:clamp(30px,3.8vh,38px)}
  .outcome .story-copy p{color:var(--text)}
  .outcome .story-tabs button{background:#101a20d9}
  .outcome .screen-heading,.outcome .story-copy,.outcome .outcome-reward{text-shadow:0 2px 4px #050a10}
}
