/*
 * The Life of Jensen Huang — "Deadpan Terminal"
 * Rules of the house (design/style-guide.md):
 *   1. The interface never changes; only the badge photo, the product and the stock do.
 *   2. Green = work. Amber = HR warning. Red = destroyed / terminated. Everything else is black and grey.
 *   3. Blueprint line art, mechanical motion, nothing that blocks a click.
 *   4. The termination letter is the only white thing in the game.
 */

@font-face{font-family:"IBM Plex Mono";font-weight:400;font-style:normal;font-display:swap;src:url(../fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2")}
@font-face{font-family:"IBM Plex Mono";font-weight:400;font-style:italic;font-display:swap;src:url(../fonts/ibm-plex-mono-latin-400-italic.woff2) format("woff2")}
@font-face{font-family:"IBM Plex Mono";font-weight:500;font-style:normal;font-display:swap;src:url(../fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2")}
@font-face{font-family:"IBM Plex Mono";font-weight:600;font-style:normal;font-display:swap;src:url(../fonts/ibm-plex-mono-latin-600-normal.woff2) format("woff2")}
@font-face{font-family:"IBM Plex Mono";font-weight:700;font-style:normal;font-display:swap;src:url(../fonts/ibm-plex-mono-latin-700-normal.woff2) format("woff2")}

:root{
  --bg:#050705; --panel:#090D07; --line:#1C2713; --line2:#2A3A1B;
  --green:#76B900; --green-hi:#D2FF5E; --green-dim:#44690A; --green-edge:#A9F01C; --on-green:#061000;
  --ink:#E6EDD9; --mute:#7F8C6D; --faint:#4D5942;
  --amber:#FFB000; --red:#FF4B33;
  --paper:#F3EFE4; --paper-ink:#15150F; --paper-mute:#6B6A5E; --stamp:#D7261E;
  --mono:"IBM Plex Mono",ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  --pad-x:16px;
  --key-h:92px;
  color-scheme:dark;
}

*{box-sizing:border-box}
[hidden]{display:none!important}
html{height:100%;background:#020302;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{
  position:fixed;top:0;right:0;bottom:0;left:0;margin:0;overflow:hidden;overscroll-behavior:none;
  display:flex;align-items:center;justify-content:center;
  font-family:var(--mono);font-size:14px;line-height:1.4;color:var(--ink);background:#020302;
  -webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent;touch-action:manipulation;
}
button{font:inherit;color:inherit;background:none;border:0;padding:0;margin:0;cursor:pointer;-webkit-appearance:none;appearance:none;touch-action:manipulation}
a{color:inherit}
:focus{outline:none}
:focus-visible{outline:2px solid var(--ink);outline-offset:2px}

/* ───────── frame ───────── */
.app{
  position:relative;width:100%;max-width:480px;height:100%;max-height:940px;
  display:flex;flex-direction:column;overflow:hidden;background:var(--bg);
  padding-top:env(safe-area-inset-top);padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);
}
.app[data-view="boot"]>*{visibility:hidden}
@media (min-width:540px) and (min-height:720px){
  .app{height:calc(100% - 40px);border-radius:22px;box-shadow:0 0 0 1px var(--line2),0 0 0 9px #0A0D08,0 0 0 10px #1B2315}
}
.view{flex:1;min-height:0;display:flex;flex-direction:column}
.scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;display:flex;flex-direction:column;padding:0 var(--pad-x)}
.lbl{font-size:10px;letter-spacing:.16em;color:var(--mute);font-weight:500;text-transform:uppercase}

/* ───────── top band: fake ticker + year ───────── */
.band{flex:none;height:40px;display:flex;align-items:center;justify-content:space-between;padding:0 6px 0 var(--pad-x);border-bottom:1px solid var(--line);font-size:12.5px}
.tick{display:flex;align-items:baseline;gap:8px;white-space:nowrap}
.tick b{letter-spacing:.06em;font-weight:700}
.tick .px{color:var(--green);font-weight:600;font-variant-numeric:tabular-nums}
.tick .pre{color:var(--faint);letter-spacing:.1em;font-size:11px}
.chg{display:inline-flex;align-items:center;gap:4px;color:var(--green);font-size:11.5px;font-variant-numeric:tabular-nums}
.chg i{width:0;height:0;border:4px solid transparent;border-top:0;border-bottom:6px solid currentColor}
.chg.down{color:var(--red)}
.chg.down i{border-bottom:0;border-top:6px solid currentColor}
.tick.crash .px{color:var(--red)}
.yr{display:flex;align-items:center;gap:8px}
.yr b{font-size:15px;font-weight:600;font-variant-numeric:tabular-nums}
.menuBtn{width:40px;height:40px;display:flex;align-items:center;justify-content:center;color:var(--mute);border-radius:6px}
.menuBtn svg{width:18px;height:18px;display:block}
.menuBtn:hover{color:var(--ink)}

/* ───────── news line ───────── */
.news{flex:none;height:28px;display:flex;align-items:stretch;border-bottom:1px solid var(--line);font-size:12px;overflow:hidden}
.news .tag{flex:none;background:var(--green);color:var(--on-green);font-weight:700;letter-spacing:.1em;padding:0 9px;display:flex;align-items:center;font-size:10.5px}
.news .roll{flex:1;min-width:0;overflow:hidden;white-space:nowrap;display:flex;align-items:center}
.news .roll span{display:inline-block;padding-left:12px;will-change:transform}
.news.idle .tag{background:none;color:var(--faint);border-right:1px solid var(--line)}
.news.idle .roll span::before{content:"· · ·";color:var(--faint);letter-spacing:.3em}

/* ───────── title ───────── */
.title .scroll{padding-top:24px}
.title h1{margin:0;font-size:13px;font-weight:500;letter-spacing:.34em;color:var(--mute);line-height:1.4}
.title h1 strong{display:block;font-size:clamp(34px,11.6vw,45px);line-height:1;letter-spacing:-.012em;color:var(--green);font-weight:700;margin-top:9px;white-space:nowrap}
@media (min-width:480px){.title h1 strong{font-size:54px}}
.specs{margin:16px 0 0;display:grid;grid-template-columns:auto 1fr;gap:1px 12px;font-size:13.5px}
.specs b{color:var(--green);text-align:right;font-weight:600}
.firedBox{margin-top:18px;border:1px solid var(--line2);border-radius:8px;padding:11px 14px 12px;display:flex;justify-content:space-between;align-items:flex-end;background:var(--panel)}
.firedBox .n{font-size:32px;font-weight:600;line-height:1.1;font-variant-numeric:tabular-nums}
.firedBox .turn{color:var(--green);font-weight:600;font-size:14px;padding-bottom:4px;white-space:nowrap}
.firedBox .turn::after{content:"";display:inline-block;width:8px;height:15px;background:var(--green);margin-left:4px;vertical-align:-2px;animation:blink 1s steps(2,jump-none) infinite}
.link{align-self:flex-end;font-size:11px;letter-spacing:.12em;color:var(--mute);padding:9px 0 9px 12px}
.link:hover{color:var(--ink)}
.title p{margin:6px 0 0;font-size:12.5px;line-height:1.55;color:var(--mute)}
.title p.how{border-left:2px solid var(--green-dim);padding-left:11px;margin-top:14px}
.title p.how .lbl{display:block;margin-bottom:2px}
.title .scroll{padding-bottom:18px}
.cta{flex:none;padding:0 var(--pad-x);position:relative}
.cta::before{content:"";position:absolute;left:0;right:0;bottom:100%;height:22px;background:linear-gradient(transparent,var(--bg));pointer-events:none}
.title .deal{color:var(--ink);font-size:13.5px;font-weight:500;line-height:1.45}
.start{display:block;margin:10px 0 12px;height:62px;border-radius:9px;border:1px solid var(--green-edge);background:var(--green);color:var(--on-green);font-weight:700;font-size:17px;letter-spacing:.12em;box-shadow:0 0 30px rgba(118,185,0,.45),inset 0 1px 0 rgba(255,255,255,.4);width:100%}
.start:active{transform:translateY(1px)}

/* ───────── game: badge row ───────── */
.idrow{flex:none;display:flex;align-items:center;gap:12px;padding:12px var(--pad-x);position:relative}
.photo{width:60px;height:60px;border-radius:5px;overflow:hidden;flex:none;box-shadow:0 0 0 1px var(--line2);position:relative;background:#5F9600}
.photo>div{position:absolute;top:0;right:0;bottom:0;left:0}
.photo svg{display:block;width:100%;height:100%}
.who{flex:1;min-width:0}
.who .lv{color:var(--faint);margin-left:6px;letter-spacing:.08em}
.rank{font-size:18px;font-weight:600;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rank.top{color:var(--green)}
.rank.long{font-size:clamp(13px,4.1vw,18px)}
.mist{text-align:right;flex:none}
.mist b{display:block;font-size:18px;font-weight:600;line-height:1.25;font-variant-numeric:tabular-nums}
.mist.warn b{color:var(--amber)}
.mist.bad b{color:var(--red)}

/* notices drop in beside the badge photo and never cover the bench or the keys */
.toasts{position:absolute;left:calc(var(--pad-x) + 70px);right:12px;top:6px;z-index:3;pointer-events:none}
.toast{min-height:72px;padding:9px 12px;border-radius:6px;font-size:12px;line-height:1.45;display:flex;flex-direction:column;justify-content:center;box-shadow:0 10px 26px rgba(0,0,0,.7);animation:toastIn .12s ease-out both}
.toast b{display:flex;align-items:center;gap:6px;font-size:13.5px;letter-spacing:.03em}
.toast b svg{width:14px;height:14px;flex:none}
.toast em{font-size:11.5px;opacity:.85}
.toast.promo{background:var(--green);color:var(--on-green)}
.toast.hr{background:#1C1400;border:1px solid var(--amber);color:var(--amber)}
.toast.pen{background:#1E0906;border:1px solid var(--red);color:var(--red)}
.toast.ward{background:#0C100A;border:1px solid var(--ink);color:var(--ink)}
.toast.note{background:#0C100A;border:1px solid var(--line2);color:var(--ink)}
.toast.out{animation:toastOut .14s ease-in both}

/* ───────── game: bench ───────── */
.bench{flex:1;min-height:0;margin:0 var(--pad-x);border:1px solid var(--line);border-radius:8px;position:relative;display:flex;flex-direction:column;overflow:hidden;
  background:radial-gradient(circle at 1px 1px,#141D0D 1px,transparent 1.5px) 0 0/14px 14px,var(--panel)}
.bhead{flex:none;display:flex;justify-content:space-between;align-items:flex-start;gap:10px;padding:12px 14px 0}
.pinfo{min-width:0}
.prod{font-size:15px;font-weight:600;line-height:1.3}
.pnote{font-size:11px;line-height:1.4;color:var(--mute);margin-top:1px;min-height:0}
.pips{display:flex;gap:5px;padding-top:3px;flex:none}
.pips i{width:11px;height:11px;border-radius:2px;border:1px solid var(--green-dim)}
.pips i.on{background:var(--green);border-color:var(--green)}
.stage{flex:1;min-height:0;position:relative;margin:2px 14px}
.art,.ghost{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center}
.ghost{pointer-events:none}
.stage svg{display:block;width:100%;height:100%;overflow:visible}
.shipped{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;pointer-events:none;z-index:2}
.shipped span{border:3px solid var(--red);color:var(--red);font-weight:700;font-size:20px;letter-spacing:.08em;padding:4px 14px;border-radius:5px;transform:rotate(-8deg);background:rgba(5,7,5,.82);animation:slam .14s ease-in both}
.tally{flex:none;padding:0 14px 14px}
.tally .lbl{display:flex;justify-content:space-between;align-items:baseline}
.gain{color:var(--green);letter-spacing:.02em;font-size:11px;opacity:0;font-variant-numeric:tabular-nums;text-transform:none}
.gain.loss{color:var(--red)}
.count{font-size:clamp(25px,8.5vw,33px);font-weight:600;color:var(--green);line-height:1.12;letter-spacing:-.015em;font-variant-numeric:tabular-nums;white-space:nowrap}
@media (min-width:420px){.count{font-size:35px}}
.goal{font-size:12.5px;color:var(--mute);margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.goal b{color:var(--ink);font-weight:500}
.bar{height:10px;margin-top:10px;background:repeating-linear-gradient(90deg,#1D2913 0 5px,transparent 5px 7px)}
.bar i{display:block;height:100%;width:0;background:repeating-linear-gradient(90deg,var(--green) 0 5px,transparent 5px 7px)}

/* ───────── game: the four keys ───────── */
.pad{flex:none;display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:14px var(--pad-x) 10px;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.key{height:var(--key-h);border-radius:9px;border:1px solid var(--line2);background:linear-gradient(#0E140A,#0A0F07);color:#35432A;font-weight:700;font-size:22px;letter-spacing:.2em;text-indent:.2em;display:flex;align-items:center;justify-content:center;touch-action:none;-webkit-user-select:none;user-select:none}
.key.lit{background:var(--green);color:var(--on-green);border-color:var(--green-edge);box-shadow:0 0 0 1px var(--green-edge),0 0 30px rgba(118,185,0,.5),inset 0 1px 0 rgba(255,255,255,.4);animation:lit 1.1s ease-in-out infinite}
.key.bad{border-color:var(--red);color:var(--red);box-shadow:inset 0 0 0 1px var(--red)}
.key.lit.bad{color:var(--on-green)}

.foot{flex:none;padding:2px 18px max(12px,env(safe-area-inset-bottom));font-size:9.5px;line-height:1.5;color:#66735A;text-align:center}
.foot a{color:var(--mute);text-decoration:none;white-space:nowrap}
.foot a:hover{color:var(--ink)}

/* ───────── assembly art ───────── */
.asm .s1,.asm .s2,.asm .s3{opacity:0;transform:translateY(-9px);transition:opacity .08s linear,transform .11s cubic-bezier(.2,.9,.3,1)}
.asm[data-step="1"] .s1,.asm[data-step="2"] .s1,.asm[data-step="3"] .s1,
.asm[data-step="2"] .s2,.asm[data-step="3"] .s2,.asm[data-step="3"] .s3{opacity:1;transform:none}
.asm[data-step="0"] .s1,.asm[data-step="0"] .s2,.asm[data-step="0"] .s3{transition:none}
.asm .spin{animation:spin .9s linear infinite}
.asm .led{animation:blink 1s steps(2,jump-none) infinite}
.asm .led.d1{animation-delay:.14s}.asm .led.d2{animation-delay:.27s}.asm .led.d3{animation-delay:.41s}
.asm .led.d4{animation-delay:.55s}.asm .led.d5{animation-delay:.68s}.asm .led.d6{animation-delay:.82s}
.asm .steam{animation:steam 1.5s linear infinite}
.asm .steam.d1{animation-delay:.26s}.asm .steam.d2{animation-delay:.52s}.asm .steam.d3{animation-delay:.78s}
.asm .spark{transform-box:fill-box;transform-origin:left bottom;opacity:0}
.asm[data-step="3"] .spark{animation:spark .5s ease-out both}
.ghost.ship{animation:ship .16s ease-in .15s both}
.ghost.broken .asm,.ghost.broken .asm *{stroke:var(--red)}
.ghost.broken .asm text,.ghost.broken .asm [stroke="none"]{fill:var(--red);stroke:none}
.ghost.broken .asm .s1,.ghost.broken .asm .s2,.ghost.broken .asm .s3{transform-box:fill-box;transform-origin:center;transition:none}
.ghost.broken .asm .s1{animation:frag1 .34s ease-in both}
.ghost.broken .asm .s2{animation:frag2 .34s ease-in both}
.ghost.broken .asm .s3{animation:frag3 .34s ease-in both}

/* ───────── glory: the only time the screen turns green ───────── */
.app[data-view="glory"]{background:var(--green);color:var(--on-green)}
.app[data-view="glory"] .band,.app[data-view="glory"] .news{border-color:rgba(0,0,0,.25)}
.app[data-view="glory"] .tick .px,.app[data-view="glory"] .chg{color:var(--on-green)}
.app[data-view="glory"] .lbl{color:rgba(6,16,0,.62)}
.app[data-view="glory"] .news .tag{background:var(--on-green);color:var(--green)}
.app[data-view="glory"] .menuBtn{visibility:hidden}
.app[data-view="glory"] .foot,.app[data-view="glory"] .foot a{color:rgba(6,16,0,.62)}
.glory{align-items:center;justify-content:center;text-align:center;padding:0 22px}
.glory .photo{width:150px;height:150px;border-radius:10px;box-shadow:0 0 0 3px var(--on-green)}
.glory h2{margin:22px 0 0;font-size:15px;letter-spacing:.3em;font-weight:500}
.glory h2 strong{display:block;font-size:clamp(34px,11vw,44px);letter-spacing:-.01em;line-height:1.05;margin-top:6px;white-space:nowrap}
.glory .big{font-size:clamp(21px,7vw,27px);font-weight:700;margin-top:18px;font-variant-numeric:tabular-nums}
.glory .lbl{margin-top:4px}

/* ───────── ending: the letter ───────── */
.endscr .scroll{padding-top:16px;padding-bottom:10px}
.letter{flex:none;background:var(--paper);color:var(--paper-ink);position:relative;padding:22px 20px 18px;font-size:13px;line-height:1.55;animation:paperUp .22s ease-out both}
.ltop{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.letter .lh1{font-weight:700;letter-spacing:.12em}
.letter .lh2{font-size:.82em;letter-spacing:.14em;color:var(--paper-mute);margin-top:.2em}
.idcard{width:54px;flex:none;position:relative;margin-top:-4px}
.idcard .ph{border-radius:4px;overflow:hidden;box-shadow:0 0 0 1.5px var(--paper-ink);aspect-ratio:1;background:#5F9600}
.idcard .ph svg{display:block;width:100%;height:100%}
.idcard span{position:absolute;left:-7px;right:-7px;top:19px;text-align:center;background:var(--stamp);color:#fff;font-size:8px;font-weight:700;letter-spacing:.18em;padding:1.5px 0;transform:rotate(-12deg)}
.letter hr{border:0;border-top:1.5px solid var(--paper-ink);margin:.8em 0 1em}
.letter dl{display:grid;grid-template-columns:auto 1fr;gap:.1em 1.2em;margin:0;font-size:.92em}
.letter dt{color:var(--paper-mute);letter-spacing:.1em}
.letter dd{margin:0}
.letter .body{margin:1.2em 0 0;font-size:1.06em}
.letter .you{margin:1em 0 0;font-size:1.28em;font-weight:700;line-height:1.3}
.letter .stats{display:flex;justify-content:space-between;gap:1.2em;margin-top:1.3em;border-top:1px dashed #A9A696;padding-top:.9em;font-size:.9em}
.letter .stats span{display:block;font-size:.8em;letter-spacing:.14em;color:var(--paper-mute);text-transform:uppercase}
.letter .stats b{font-weight:600}
.letter .sig{margin-top:1em;display:flex;justify-content:space-between;align-items:flex-end;font-size:.9em;color:#3B3A31}
.letter .sig svg{display:block;width:9em;height:2.6em}
.stampmark{position:absolute;right:12px;top:104px;font-size:23px;transform:rotate(-11deg);border:.13em solid var(--stamp);color:var(--stamp);font-weight:700;letter-spacing:.07em;padding:.06em .42em;border-radius:.16em;opacity:.86;mix-blend-mode:multiply;line-height:1.2;pointer-events:none}
.stampmark::after{content:"";position:absolute;top:.09em;right:.09em;bottom:.09em;left:.09em;border:.035em solid var(--stamp);border-radius:.08em}
/* staged reveal: .wait hides what the board has not decided yet; lines print one by one */
.letter .ln{animation:lineIn .16s ease-out both;animation-delay:calc(var(--i,0) * 130ms)}
.letter.typing .stampmark{animation:stampIn .13s ease-in both;animation-delay:calc(var(--i,0) * 130ms + 120ms)}
.letter.wait .late,.letter.wait .stampmark{visibility:hidden;animation:none}
.letter.instant,.letter.instant .ln,.letter.instant .stampmark{animation:none}
.cursor::after{content:"";display:inline-block;width:.55em;height:1em;background:currentColor;vertical-align:-.12em;margin-left:.15em;animation:blink 1s steps(2,jump-none) infinite}
.status{margin:10px 0 0;font-size:11.5px;line-height:1.5;color:var(--mute);min-height:1.5em;text-align:center}
.status.bad{color:var(--red)}
.acts{flex:none;display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:8px}
.acts.late{animation:lineIn .2s ease-out both}
.btn{height:52px;border-radius:8px;border:1px solid var(--line2);background:var(--panel);color:var(--ink);font-weight:600;font-size:13px;letter-spacing:.12em;display:flex;align-items:center;justify-content:center;width:100%;padding:0 10px}
.btn:active{transform:translateY(1px)}
.btn.pri{background:var(--green);color:var(--on-green);border-color:var(--green-edge)}
.btn.quiet{grid-column:1/-1;height:42px;color:var(--mute);border-style:dashed}
.btn.danger{border-color:var(--red);color:var(--red)}
.btn[disabled]{opacity:.45;cursor:default}
.endscr .link{align-self:center;padding:12px}

/* ───────── fired list ───────── */
.fired .scroll{padding-top:6px;padding-bottom:16px}
.fired .link{align-self:flex-start;padding:10px 12px 10px 0}
.fired h2{margin:6px 0 0;font-size:24px;font-weight:700;color:var(--green);letter-spacing:-.01em}
.fired .firedBox{margin-top:14px}
.ftable{margin-top:16px;font-size:12.5px;font-variant-numeric:tabular-nums}
.frow{display:grid;grid-template-columns:minmax(74px,auto) 1fr auto auto;gap:0 12px;align-items:baseline;padding:7px 2px;border-bottom:1px solid var(--line)}
.frow.head{color:var(--mute);font-size:10px;letter-spacing:.14em;text-transform:uppercase;border-bottom-color:var(--line2);padding-bottom:6px}
.frow .no{font-weight:600}
.frow .end{color:var(--mute);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.frow .end.rare{color:var(--amber)}
.frow .dur{text-align:right}
.frow .when{text-align:right;color:var(--mute);min-width:62px}
.frow.me{background:rgba(118,185,0,.1)}
.frow.me .no{color:var(--green)}
.frow .tag{display:inline-block;margin-left:6px;font-size:9px;letter-spacing:.12em;background:var(--green);color:var(--on-green);padding:0 4px;border-radius:2px;font-weight:700;vertical-align:1px}

/* ───────── menu sheet + image viewer ───────── */
.sheet,.viewer{position:absolute;top:0;right:0;bottom:0;left:0;z-index:20;background:rgba(2,3,2,.82);display:flex;flex-direction:column;justify-content:flex-end}
.sheetBox{background:var(--bg);border-top:1px solid var(--line2);padding:16px var(--pad-x) max(16px,env(safe-area-inset-bottom));display:grid;gap:10px;animation:sheetUp .14s ease-out both}
.sheetBox h2{margin:2px 0 0;font-size:18px;font-weight:700;letter-spacing:.04em}
.sheetBox p{margin:0 0 6px;font-size:12.5px;line-height:1.55;color:var(--mute)}
.viewer{justify-content:center;align-items:center;padding:16px;gap:12px;background:rgba(2,3,2,.94)}
.viewer img{display:block;max-width:100%;max-height:calc(100% - 110px);border-radius:4px;box-shadow:0 0 0 1px var(--line2);-webkit-touch-callout:default;-webkit-user-select:auto;user-select:auto}
.viewer p{margin:0;font-size:12px;color:var(--mute);text-align:center}
.viewer .btn{max-width:220px}

.noscript{position:fixed;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;font-family:var(--mono);color:#E6EDD9;background:#050705}

/* ───────── motion ───────── */
@keyframes lit{50%{box-shadow:0 0 0 1px var(--green-edge),0 0 44px rgba(118,185,0,.72),inset 0 1px 0 rgba(255,255,255,.4)}}
@keyframes blink{50%{opacity:.25}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes steam{from{transform:translateY(3px);opacity:0}30%{opacity:1}to{transform:translateY(-6px);opacity:0}}
@keyframes spark{from{opacity:1;transform:scale(.6)}60%{opacity:1}to{opacity:0;transform:scale(1.15)}}
@keyframes ship{to{transform:translateX(64px);opacity:0}}
@keyframes frag1{to{transform:translate(-22px,30px) rotate(-16deg);opacity:0}}
@keyframes frag2{to{transform:translate(18px,36px) rotate(11deg);opacity:0}}
@keyframes frag3{to{transform:translate(36px,24px) rotate(26deg);opacity:0}}
@keyframes toastIn{from{opacity:0;transform:translateY(-6px)}}
@keyframes toastOut{to{opacity:0}}
@keyframes slam{from{opacity:0;transform:rotate(-8deg) scale(1.7)}}
@keyframes paperUp{from{opacity:0;transform:translateY(26px)}}
@keyframes lineIn{from{opacity:0;transform:translateY(3px)}}
@keyframes stampIn{from{opacity:0;transform:rotate(-11deg) scale(1.9)}to{opacity:.86;transform:rotate(-11deg) scale(1)}}
@keyframes sheetUp{from{transform:translateY(16px);opacity:0}}
@keyframes roll{from{transform:translateX(0)}12%{transform:translateX(0)}to{transform:translateX(-105%)}}

/* ───────── smaller and stranger screens ───────── */
/* The four keys never go below 88px; on short screens everything else gives way so the bench keeps its part. */
@media (max-height:700px){
  :root{--key-h:88px}
  .title .scroll{padding-top:14px}
  .title h1 strong{font-size:clamp(32px,10.4vw,40px);margin-top:6px}
  .specs{margin-top:10px;font-size:12.5px}
  .firedBox{margin-top:12px;padding:8px 14px 9px}
  .firedBox .n{font-size:27px}
  .title .link{padding-top:6px;padding-bottom:4px}
  .title p{font-size:12px;line-height:1.5;margin-top:4px}
  .title p.how{margin-top:10px}
  .idrow{padding-top:8px;padding-bottom:8px}
  .photo{width:52px;height:52px}
  .toasts{top:3px;left:calc(var(--pad-x) + 62px)}
  .toast{min-height:62px;padding:7px 11px}
  .bhead{padding-top:9px}
  .pnote{display:none}
  .count{font-size:clamp(25px,8vw,30px)}
  .tally{padding-bottom:10px}
  .bar{margin-top:7px}
  .pad{padding-top:10px;padding-bottom:8px}
}
@media (max-height:600px){
  .band,.menuBtn{height:36px}
  .news{height:24px}
  .idrow{padding-top:6px;padding-bottom:6px}
  .photo{width:44px;height:44px}
  .toasts{top:2px;left:calc(var(--pad-x) + 54px)}
  .toast{min-height:52px;padding:5px 10px;font-size:11.5px}
  .toast b{font-size:12.5px}
  .rank{font-size:16px}
  .bhead{padding-top:7px}
  .bhead .lbl{display:none}
  .count{font-size:25px}
  .goal{font-size:11.5px}
  .tally{padding-bottom:8px}
  .bar{margin-top:5px;height:8px}
  .pad{padding-top:8px;padding-bottom:6px;gap:8px}
  .foot{font-size:8.5px;line-height:1.4;padding-bottom:max(8px,env(safe-area-inset-bottom))}
}
@media (min-height:880px) and (min-width:400px){:root{--key-h:100px}}

/* A portrait window too short for everything (split screen, a very small phone): the four keys always stay
   on screen at full size, so the news line and the goal line step aside to leave the part some room. */
@media (max-height:500px) and (orientation:portrait){
  .news{display:none}
  .goal{display:none}
  .bhead{padding-top:5px}
  .tally{padding-bottom:6px}
}

/* a phone on its side: bench on the left, keys on the right */
@media (orientation:landscape) and (max-height:520px){
  .app{max-width:none}
  .game{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr)}
  .idrow{grid-column:1;padding:6px var(--pad-x)}
  .photo{width:40px;height:40px}
  .toasts{left:calc(var(--pad-x) + 50px);top:2px}
  .toast{min-height:44px;padding:4px 10px;font-size:11px}
  .toast b{font-size:12px}
  .rank{font-size:15px}
  .rank.long{font-size:13px;white-space:normal;line-height:1.15}
  .bench{grid-column:1;margin-bottom:6px}
  .bhead{padding-top:6px}
  .pnote{display:none}
  .count{font-size:24px}
  .tally{padding-bottom:8px}
  .bar{margin-top:5px}
  .pad{grid-column:2;grid-row:1 / span 2;padding:6px var(--pad-x) 6px 0;grid-template-rows:1fr 1fr}
  .key{height:auto;min-height:88px}
  .foot{padding-top:0;font-size:8.5px;line-height:1.35}
  .news{height:24px}
  .band{height:34px}
  .menuBtn{height:34px}
}

@media (prefers-reduced-motion:reduce){
  .key.lit,.asm .spin,.asm .led,.asm .steam,.firedBox .turn::after,.cursor::after{animation:none}
  .asm .s1,.asm .s2,.asm .s3{transform:none!important;transition:opacity .08s linear}
  .ghost.ship{animation:fadeOut .16s linear .15s both}
  .ghost.broken .asm .s1,.ghost.broken .asm .s2,.ghost.broken .asm .s3{animation:fadeOut .3s linear both}
  .toast,.letter,.letter .ln,.sheetBox,.shipped span{animation-name:fadeIn}
  .letter.typing .stampmark{animation-name:fadeInStamp}
}
@keyframes fadeOut{to{opacity:0}}
@keyframes fadeIn{from{opacity:0}}
@keyframes fadeInStamp{from{opacity:0}to{opacity:.86}}
