/* KALMAR Z — the layer over the world.
   Cold Baltic night for the panels; flare red for blood and danger; road-sign
   yellow for where to go; sea blue for home and the radio. Panels are cut
   plates (two chamfered corners), like a stencilled crate lid. */

:root {
  --asphalt: #0c1216;
  --panel: rgba(11, 17, 21, 0.8);
  --panel-solid: #0f171c;
  --panel-raise: rgba(233, 230, 220, 0.05);
  --line: rgba(233, 230, 220, 0.12);
  --line-strong: rgba(233, 230, 220, 0.26);
  --frost: #ebe7dc;
  --frost-2: #aab0aa;
  --frost-3: #6c7470;
  --flare: #ff5436;
  --flare-deep: #9c1f10;
  --signal: #ffcc2e;
  --signal-ink: #1a1405;
  --baltic: #79bcd8;
  --lichen: #b6d06e;
  --dusk: #f0a04c;
  --night: #8ea3dd;
  --cut: 0.7rem;
  --gutter: 1.25rem;
  --display: 'Big Shoulders Display', 'Oswald', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  /* The arcade layer: chunky type, black outlines, nothing boxed in. */
  --arcade: 'Bungee', 'Big Shoulders Display', Impact, system-ui, sans-serif;
  --outline: #070b0e;
  --ts: 1px 0 0 var(--outline), -1px 0 0 var(--outline), 0 1px 0 var(--outline), 0 -1px 0 var(--outline), 1px 1px 0 var(--outline), -1px 1px 0 var(--outline), 1px -1px 0 var(--outline), -1px -1px 0 var(--outline), 0 2px 4px rgba(0, 0, 0, 0.6);
  --icon-ink: drop-shadow(1px 0 0 #070b0e) drop-shadow(-1px 0 0 #070b0e) drop-shadow(0 1px 0 #070b0e) drop-shadow(0 -1px 0 #070b0e) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
  --heart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21.4C5.7 16.9 1 12.6 1 7.5 1 3.9 3.8 1.1 7.2 1.1c2 0 3.7.9 4.8 2.5 1.1-1.6 2.8-2.5 4.8-2.5 3.4 0 6.2 2.8 6.2 6.4 0 5.1-4.7 9.4-11 13.9z'/%3E%3C/svg%3E");
  /* Everything in the HUD scales with this: 13px at 1024 × 640, 14px at 720p, 21px at 1080p,
     22px from 1440p up, times the player's HUD size (the settings' "Gränssnitt"): every step
     of it changes the size on every screen. */
  --hud-scale: 1;
  font-size: calc(clamp(13px, min(1.1vw, 2vh), 22px) * var(--hud-scale));
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--asphalt); color: var(--frost); font-family: var(--body); -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; }
canvas#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
body.aiming canvas#view { cursor: none; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.6rem; height: 1.6rem; padding: 0 0.35rem;
  border-radius: 0.3rem; background: linear-gradient(180deg, #ffffff 0%, #e8e3d6 55%, #bcb5a5 100%); color: #10171b; font: 400 0.8rem/1 var(--arcade);
  box-shadow: 0 0 0 1.5px var(--outline), inset 0 -2px 0 rgba(0, 0, 0, 0.22), 0 2px 3px rgba(0, 0, 0, 0.45); white-space: nowrap; -webkit-text-stroke: 0;
}

.ico { width: 100%; height: 100%; display: block; }

/* A cut plate: the panel shape everything in play sits on. */
.plate {
  position: relative; background: var(--panel);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  box-shadow: inset 0 0 0 1px var(--line);
}

/* ================================================================ loading */
#loading {
  position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: 1fr auto auto; justify-items: center;
  padding: 0 var(--gutter) 2rem; background: radial-gradient(120% 90% at 50% 38%, #1a2a33 0%, #0b1115 62%, #06090b 100%);
  transition: opacity 1.1s ease, visibility 0s 1.1s;
}
#loading.done { opacity: 0; visibility: hidden; pointer-events: none; }
.ld-grain { position: absolute; inset: 0; opacity: 0.5; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 3px); }
.ld-main { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 1.1rem; width: min(30rem, 86vw); }
.ld-logo { font: 400 clamp(3rem, 7.5vw, 5.4rem)/0.9 var(--arcade); letter-spacing: 0.02em; display: flex; align-items: flex-end; gap: 0.1em; color: #f4f1e8; -webkit-text-stroke: 0.1em var(--outline); paint-order: stroke fill; text-shadow: 0 0.08em 0 rgba(0, 0, 0, 0.45); }
.ld-logo b { color: var(--flare); font-size: 1.25em; transform: skewX(-8deg); text-shadow: 0 0.08em 0 rgba(0, 0, 0, 0.45), 0 0 2.4rem rgba(255, 84, 54, 0.4); }
.ld-coord { font: 500 0.82rem var(--mono); color: var(--frost-3); letter-spacing: 0.08em; }
.ld-progress { width: 100%; margin-top: 1.4rem; }
.ld-row { display: flex; justify-content: space-between; font-size: 0.86rem; color: var(--frost-2); margin-bottom: 0.5rem; }
#loading-pct { font: 400 0.86rem var(--arcade); color: var(--frost); }
.loading-track { width: 100%; height: 0.55rem; border-radius: 0.28rem; background: linear-gradient(180deg, #05080a, #141b20); box-shadow: 0 0 0 1.5px var(--outline), inset 0 0 0 1px rgba(233, 230, 220, 0.12); overflow: hidden; }
.loading-track i { display: block; height: 100%; background: linear-gradient(180deg, #ffd9cf, var(--flare) 40%, #9c140a); transform-origin: left; transform: scaleX(0); transition: transform 0.35s var(--ease); }
.ld-tip { width: min(36rem, 90vw); text-align: center; padding: 1.4rem 0 1.6rem; border-top: 1px solid var(--line); }
.ld-tip-head { display: block; font: 400 0.85rem var(--arcade); letter-spacing: 0.14em; text-transform: uppercase; color: var(--signal); -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; margin-bottom: 0.5rem; }
#loading-tip { margin: 0; min-height: 3em; font-size: 1.02rem; line-height: 1.5; color: var(--frost); opacity: 0; transform: translateY(4px); transition: opacity 0.38s ease, transform 0.38s ease; }
#loading-tip.in { opacity: 1; transform: none; }
.ld-foot { font-size: 0.8rem; color: var(--frost-3); }

/* ================================================================ HUD frame */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.play { position: absolute; inset: 0; }
.play > .tl, .play > .top-mid, .play > .tr, .play > .left-stack, .play > .br { transition: opacity 0.7s ease, transform 0.7s var(--ease), filter 0.7s ease; }
.play.intro > .tl, .play.intro > .top-mid, .play.intro > .tr, .play.intro > .left-stack > .kitbox, .play.intro > .br { opacity: 0; transform: translateY(0.6rem); }
/* The radio stays up through the opening: the premise is told there. */
.play.dead > .tl, .play.dead > .top-mid, .play.dead > .tr, .play.dead > .left-stack, .play.dead > .br { opacity: 0.25; filter: grayscale(1); }
.play.dead .prompt, .play.dead .objmark, .play.dead .ix, .play.dead .ix-pips, .play.dead .coach { display: none; }
.play.under-map > :not(.banner) { visibility: hidden; }
.play.talk > .left-stack, .play.talk > .br, .play.talk > .prompt, .play.talk > .objmark, .play.talk > .ix, .play.talk > .ix-pips, .play.talk > .coach { opacity: 0; }

/* Chunky outlined display text: the same words twice, an ink stroke under a (gradient) fill. */
.ink { display: inline-grid; isolation: isolate; }
.ink > i { grid-area: 1 / 1; font-style: normal; white-space: nowrap; padding: 0.22em 0.12em 0.08em; margin: -0.22em -0.12em -0.08em; }
.ink > i:first-child { color: transparent; -webkit-text-stroke: var(--ink-w, 0.16em) var(--ink, #0a0f12); text-shadow: 0 0.08em 0.08em rgba(0, 0, 0, 0.55); }
.ink > i:last-child { color: var(--fill, #f4f1e8); }
.ink.grad > i:last-child { color: transparent; background: var(--grad); -webkit-background-clip: text; background-clip: text; }

.fx { position: absolute; inset: 0; }
.vignette { position: absolute; inset: 0; background: radial-gradient(ellipse 75% 70% at center, transparent 50%, rgba(2, 5, 8, 0.88) 100%); opacity: 0.3; transition: opacity 1.4s ease; }
.lowhp { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse 70% 65% at center, transparent 40%, rgba(120, 6, 2, 0.55) 78%, rgba(70, 0, 0, 0.9) 100%); transition: opacity 0.6s ease; }
.lowhp.beat { animation: beat 1.15s ease-in-out infinite; }
.lowhp.fast { animation-duration: 0.72s; }
@keyframes beat { 0%, 100% { filter: brightness(0.75); } 12% { filter: brightness(1.25); } 24% { filter: brightness(0.9); } 36% { filter: brightness(1.15); } }
.hurtflash { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse 80% 75% at center, transparent 55%, rgba(200, 20, 8, 0.7) 100%); }
.hurt-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.hurt-arc {
  position: absolute; left: -8.5rem; top: -8.5rem; width: 17rem; height: 17rem; border-radius: 50%; opacity: 0;
  border-top: 0.55rem solid var(--flare); filter: drop-shadow(0 0 0.5rem rgba(255, 50, 20, 0.8));
  -webkit-mask: linear-gradient(90deg, transparent 22%, #000 46%, #000 54%, transparent 78%);
  mask: linear-gradient(90deg, transparent 22%, #000 46%, #000 54%, transparent 78%);
}

.corner-shade {
  position: absolute; inset: 0;
  background: radial-gradient(34rem 19rem at 100% 0, rgba(3, 6, 8, 0.5), transparent 72%), radial-gradient(28rem 15rem at 0 0, rgba(3, 6, 8, 0.4), transparent 72%);
}
.multflash { position: absolute; inset: 0; opacity: 0; background: radial-gradient(42rem 26rem at 100% 0, rgba(255, 196, 46, 0.34), transparent 66%); box-shadow: inset 0 0 0 0.22rem rgba(255, 204, 46, 0.45); }

/* ---------------------------------------------------------------- score numbers in the world */
.pops { position: absolute; inset: 0; overflow: hidden; contain: strict; }
.pp { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; }
.pp-in { position: absolute; left: 0; top: 0; font-family: 'Bungee', var(--display); font-weight: 400; line-height: 1; letter-spacing: 0.01em; white-space: nowrap; opacity: 0; transform-origin: 50% 50%; will-change: transform, opacity; }
.pp-t { display: block; }
.pp-t + .pp-t { position: absolute; left: 0; top: 0; }
.pp-ink { color: transparent; -webkit-text-stroke: 0.15em var(--pp-ink); text-shadow: 0 0.06em 0.04em rgba(0, 0, 0, 0.45); }
.pp-a, .pp-b, .pp-c { color: transparent; -webkit-background-clip: text; background-clip: text; }
.pp-b, .pp-c, .pp-w { opacity: 0; }
.pp-w { color: #fff; }
.pp-x { position: absolute; right: -0.62em; top: -0.3em; font: 400 0.36em/1 'Bungee', var(--display); color: var(--signal); -webkit-text-stroke: 0.12em #1a1405; paint-order: stroke fill; transform: rotate(-10deg); }
.k-kill { --pp-ink: #03232a; }
.k-kill .pp-a { background-image: linear-gradient(180deg, #f2fffc 6%, #95f8e6 47%, #17bba8 51%, #0a7b84 100%); }
.k-kill .pp-b { background-image: linear-gradient(180deg, #f3fbff 6%, #9be8ff 47%, #2f9ef3 51%, #1550c4 100%); }
.k-kill .pp-c { background-image: linear-gradient(180deg, #fff3ff 6%, #f6b0ff 47%, #b65cff 51%, #6a22cc 100%); }
.k-boss { --pp-ink: #2a1300; }
.k-boss .pp-a { background-image: linear-gradient(180deg, #fffbea 6%, #ffe783 47%, #ffb81f 51%, #c76c06 100%); }
.k-boss .pp-b { background-image: linear-gradient(180deg, #fff7e4 6%, #ffd47e 47%, #ff9426 51%, #c2440b 100%); }
.k-boss .pp-c { background-image: linear-gradient(180deg, #fff1ec 6%, #ffb6a2 47%, #ff5a36 51%, #a8170c 100%); }
.k-boss .pp-ink { -webkit-text-stroke-width: 0.13em; }
.k-loot { --pp-ink: #13270a; }
.k-loot .pp-a { background-image: linear-gradient(180deg, #f8ffe9 6%, #d6f892 47%, #86d13a 51%, #3e8917 100%); }
.k-loot .pp-b { background-image: linear-gradient(180deg, #fffbe6 6%, #fbef8c 47%, #e5bf1e 51%, #a47708 100%); }
.k-loot .pp-c { background-image: linear-gradient(180deg, #effff8 6%, #a8f5d2 47%, #2fc497 51%, #11786a 100%); }

/* ---------------------------------------------------------------- top left: needs meters + clock */
.tl { position: absolute; left: var(--gutter); top: var(--gutter); display: flex; flex-direction: column; align-items: flex-start; gap: 0.8rem; }
.meters { position: relative; display: grid; gap: 0.34rem; padding-right: 2rem; }
.meter { --m: #ffb347; --m2: #e8731a; --m3: #8a3a06; --mg: rgba(255, 190, 110, 0.5); display: flex; align-items: center; gap: 0.45rem; height: 1.6rem; }
.meter[data-n='water'] { --m: #86e6ff; --m2: #1f95e0; --m3: #0b437e; --mg: rgba(140, 220, 255, 0.5); }
.meter[data-n='rest'] { --m: #d2b8ff; --m2: #8360ea; --m3: #382290; --mg: rgba(205, 180, 255, 0.5); }
.m-ico { width: 1.6rem; height: 1.6rem; flex: none; color: var(--m); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); }
.glyph { display: block; width: 100%; height: 100%; overflow: visible; }
.m-bar { position: relative; width: 10.5rem; height: 0.92rem; border-radius: 0.46rem; background: linear-gradient(180deg, #05080a, #141b20); box-shadow: 0 0 0 1.5px #070a0c, inset 0 0 0 1px rgba(233, 230, 220, 0.16), 0 2px 6px rgba(0, 0, 0, 0.5); overflow: hidden; }
.m-bar > i { position: absolute; top: 2px; bottom: 2px; left: 2px; right: 2px; border-radius: 0.3rem; transform-origin: left; }
.m-ghost { background: var(--mg); transition: transform 0.6s ease 0.35s; }
.m-fill { background: linear-gradient(180deg, #fff 0%, var(--m) 26%, var(--m2) 64%, var(--m3) 100%); transition: transform 0.5s cubic-bezier(0.3, 0.7, 0.3, 1); }
.m-bar > .m-seg { left: 0; right: 0; top: 0; bottom: 0; border-radius: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(7, 10, 12, 0.85) calc(10% - 2px) 10%); }
/* Gloss along the top, and a tick where the meter starts to blink. */
.m-bar::after { content: ''; position: absolute; left: 0.3rem; right: 0.3rem; top: 2px; height: 32%; border-radius: 0.3rem; background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0)); }
.m-bar::before { content: ''; position: absolute; z-index: 1; left: 20%; top: 0; bottom: 0; width: 2px; background: rgba(255, 84, 54, 0.75); }
.meter[data-tier='low'] .m-ico { animation: nudge-ico 1.6s ease-in-out infinite; }
@keyframes nudge-ico { 0%, 100% { transform: none; } 50% { transform: scale(1.12); } }
.meter[data-tier='crit'] { animation: blink 0.5s ease-in-out infinite alternate; }
.meter[data-tier='crit'] .m-ico { color: var(--flare); }
.meter[data-tier='crit'] .m-bar { box-shadow: 0 0 0 1.5px #070a0c, inset 0 0 0 1px rgba(255, 84, 54, 0.85), 0 0 0.9rem rgba(255, 60, 30, 0.6); }
.m-key { position: absolute; right: 0; top: 50%; transform: translateY(-50%); min-width: 1.4rem; height: 1.4rem; font-size: 0.8rem; opacity: 0.8; }
/* Beside the meters: T and what it would have now (the next thing's icon and how many of its
   kind are carried). Dim with nothing in the pack; asking to be pressed when it would help. */
.meters:has(.m-eat) { padding-right: 3.1rem; }
.m-eat { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 2.6rem; display: flex; flex-direction: column; align-items: center; gap: 0.18rem; --ec: #ffc46b; transition: opacity 0.3s ease; }
.m-eat.drink { --ec: #8fdcff; }
.m-eat kbd { min-width: 1.4rem; height: 1.4rem; font-size: 0.8rem; }
.m-eat-ico { width: 1.45rem; height: 1.45rem; color: var(--ec); filter: var(--icon-ink); }
.m-eat-ico .ico { width: 100%; height: 100%; display: block; }
.m-eat-n { font: 400 0.8rem/1 var(--arcade); color: #f4f1e8; -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
.m-eat-t { position: absolute; left: 0.35rem; right: 0.35rem; bottom: -0.42rem; height: 0.22rem; border-radius: 0.11rem; background: rgba(5, 8, 10, 0.85); box-shadow: 0 0 0 1px var(--outline); overflow: hidden; opacity: 0; transition: opacity 0.2s ease; }
.m-eat-t u { display: block; height: 100%; background: var(--ec); transform-origin: left; transform: scaleX(0); }
.m-eat.eating .m-eat-t { opacity: 1; }
.m-eat.none { opacity: 0.5; }
.m-eat.none .m-eat-ico, .m-eat.none .m-eat-n { display: none; }
.m-eat.full .m-eat-ico { opacity: 0.55; }
.m-eat.want kbd { background: linear-gradient(180deg, #fffbe2, var(--signal) 50%, #d99a10); color: var(--signal-ink); animation: eat-ask 1.15s ease-in-out infinite; }
.m-eat.want .m-eat-ico { animation: nudge-ico 1.15s ease-in-out infinite; }
@keyframes eat-ask { 0%, 100% { box-shadow: 0 0 0 1.5px var(--outline); } 50% { box-shadow: 0 0 0 1.5px var(--outline), 0 0 0.75rem 0.15rem rgba(255, 204, 46, 0.75); } }
@media (prefers-reduced-motion: reduce) { .m-eat.want kbd, .m-eat.want .m-eat-ico { animation: none; } }

/* The clock floats too: chunky day and time, the sun's (or moon's) arc, the countdown and the place as outlined captions. */
.clock { position: relative; isolation: isolate; width: 16.5rem; padding: 0.1rem 0.15rem 0; }
.clock::before, .objective::before, .msg::before, .prompt::before, .car::before { content: ''; position: absolute; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(4, 7, 9, 0.52), rgba(4, 7, 9, 0.3) 55%, rgba(4, 7, 9, 0)); }
.clock::before { inset: -1.4rem -2.4rem -1.6rem -1.8rem; }
.clock-top { display: flex; align-items: baseline; gap: 0.75rem; }
.clock-day { font: 400 1.5rem/1 var(--arcade); letter-spacing: 0.04em; text-transform: uppercase; color: #f4f1e8; -webkit-text-stroke: 0.15em var(--outline); paint-order: stroke fill; text-shadow: 0 0.08em 0.05em rgba(0, 0, 0, 0.5); }
.clock-time { font: 400 1.15rem/1 var(--arcade); color: var(--signal); -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; font-variant-numeric: tabular-nums; text-shadow: 0 0.08em 0.05em rgba(0, 0, 0, 0.5); }
.arc-wrap { width: 12.5rem; margin-top: 0.45rem; }
.arc { display: block; width: 100%; height: auto; overflow: visible; }
.arc-ink { fill: none; stroke: var(--outline); stroke-width: 5.2; stroke-linecap: round; opacity: 0.8; }
.arc-track { fill: none; stroke: rgba(233, 230, 220, 0.4); stroke-width: 1.6; stroke-dasharray: 2 3; }
.arc-done { fill: none; stroke: url(#kzArcDay); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0 1; }
.arc.night .arc-done { stroke: url(#kzArcNight); }
.arc-horizon { stroke: rgba(233, 230, 220, 0.6); stroke-width: 1.3; }
.arc-orb { fill: #ffd977; stroke: var(--outline); stroke-width: 1.8; }
.arc-glow { fill: rgba(255, 190, 80, 0.3); }
.arc.night .arc-orb { fill: #e3e9ff; }
.arc.night .arc-glow { fill: rgba(150, 175, 255, 0.28); }
.arc-ends { display: flex; justify-content: space-between; margin-top: 0.15rem; font: 700 0.8rem var(--mono); color: var(--frost-2); text-shadow: var(--ts); }
.clock-note { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.3rem; font-size: 0.84rem; font-weight: 600; color: var(--frost); text-shadow: var(--ts); }
.clock-left.warn { color: #ffb25a; }
.wx { display: flex; gap: 0.3rem; color: var(--frost); }
.wx span { width: 1.1rem; height: 1.1rem; filter: var(--icon-ink); }
.clock-place { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.3rem; font-size: 0.86rem; font-weight: 700; min-height: 1.1rem; text-shadow: var(--ts); }
.place-ico { width: 1.05rem; height: 1.05rem; color: var(--baltic); flex: none; filter: var(--icon-ink); }
.clock-place.home { color: #9fd6ea; }

/* The castle's defence, under the clock when it matters: a glossy bar per barricade. */
.defence { position: relative; width: 13.5rem; margin-top: 0.55rem; }
.df-head { display: flex; align-items: center; gap: 0.4rem; }
.df-ico { width: 1.05rem; height: 1.05rem; color: var(--baltic); flex: none; filter: var(--icon-ink); }
.df-title { font: 400 0.82rem/1 var(--arcade); letter-spacing: 0.08em; text-transform: uppercase; color: #f4f1e8; -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
.df-waves { margin-left: auto; font: 700 0.8rem var(--mono); color: var(--frost); white-space: nowrap; text-shadow: var(--ts); }
.df-waves.hot { color: #ffb29e; animation: blink 0.6s ease-in-out infinite alternate; }
.df-next { margin-top: 0.35rem; font: 700 0.8rem var(--mono); color: var(--frost-2); white-space: nowrap; text-shadow: var(--ts); }
.df-next.storm { color: #ffc46a; }
.df-next.hot { color: #ffb29e; }
.df-gates { display: flex; gap: 0.3rem; margin-top: 0.4rem; }
.gate { flex: 1; height: 0.55rem; border-radius: 0.28rem; background: linear-gradient(180deg, #05080a, #141b20); box-shadow: 0 0 0 1.5px var(--outline); overflow: hidden; }
.gate i { display: block; height: 100%; border-radius: 0.28rem; background: linear-gradient(180deg, #f4ffd8, #b6d06e 35%, #6f8f2c 100%); transform-origin: left; transition: transform 0.3s ease; }
.gate.worn i { background: linear-gradient(180deg, #fffbe2, var(--signal) 40%, #c98508); }
.gate.bad i { background: linear-gradient(180deg, #ffd9cf, var(--flare) 40%, #9c140a); }
.gate.down { box-shadow: 0 0 0 1.5px var(--outline), 0 0 0 3px var(--flare); animation: blink 0.5s ease-in-out infinite alternate; }
.df-alert { display: none; margin-top: 0.4rem; font-size: 0.86rem; font-weight: 800; line-height: 1.3; color: #ffd6cc; text-shadow: var(--ts); }
.defence.breach .df-ico, .defence.breach .df-title { color: var(--flare); }
.defence.breach .df-alert { display: block; }
.defence.breach::before { content: ''; position: absolute; inset: -0.8rem -1.6rem; z-index: -1; background: radial-gradient(closest-side, rgba(200, 30, 10, 0.55), rgba(200, 30, 10, 0)); animation: alarm 0.9s ease-in-out infinite alternate; }
@keyframes alarm { from { opacity: 1; } to { opacity: 0.35; } }
.fx.alarm::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 0.35rem rgba(255, 50, 20, 0.75), inset 0 0 6rem rgba(255, 30, 10, 0.35); animation: blink 0.8s ease-in-out infinite alternate; }

/* ---------------------------------------------------------------- objective (top centre) */
.top-mid { position: absolute; left: 0; right: 0; margin-inline: auto; top: var(--gutter); width: min(33rem, 40vw); display: flex; flex-direction: column; gap: 0.6rem; }
/* A slim floating pager strip: step pips and the distance chip, a punchy title, the words, the count. */
.objective { position: relative; isolation: isolate; padding: 0.1rem 0.2rem 0.2rem; }
.objective::before { inset: -1.1rem -2.6rem -1.3rem; }
.obj-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.obj-steps { display: flex; gap: 0.3rem; margin: 0; padding: 0; list-style: none; }
.obj-steps li { width: 1.1rem; height: 0.5rem; border-radius: 0.25rem; background: linear-gradient(180deg, #05080a, #182026); box-shadow: 0 0 0 1.5px var(--outline); }
.obj-steps li.done { background: linear-gradient(180deg, #fff3bf, #e7b02a 50%, #9d6a06); }
.obj-steps li.now { background: linear-gradient(180deg, #fffbe2, var(--signal) 45%, #d48a06); box-shadow: 0 0 0 1.5px var(--outline), 0 0 0.6rem rgba(255, 204, 46, 0.75); animation: pip 0.9s ease-in-out infinite alternate; }
@keyframes pip { to { filter: brightness(1.35); } }
.obj-dist { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.22rem 0.5rem 0.2rem 0.35rem; border-radius: 0.32rem; background: linear-gradient(180deg, #fff3bf, var(--signal) 45%, #d99a10); color: var(--signal-ink); font: 400 0.8rem/1 var(--arcade); letter-spacing: 0.02em; box-shadow: 0 0 0 2px var(--outline), inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 4px rgba(0, 0, 0, 0.45); }
.obj-arrow { display: block; width: 0.9rem; height: 0.9rem; transition: transform 0.2s linear; }
.obj-arrow svg { display: block; width: 100%; height: 100%; }
.obj-title { margin: 0.4rem 0 0; font: 400 1.45rem/1.05 var(--arcade); letter-spacing: 0.03em; text-transform: uppercase; color: var(--signal); -webkit-text-stroke: 0.15em var(--outline); paint-order: stroke fill; text-shadow: 0 0.08em 0.05em rgba(0, 0, 0, 0.5); }
.obj-text { margin: 0.28rem 0 0; font-size: 0.94rem; font-weight: 600; line-height: 1.38; color: var(--frost); max-width: 60ch; text-shadow: var(--ts); }
.obj-prog { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.45rem; }
.obj-bar { --segs: 10; position: relative; flex: 1; height: 0.55rem; border-radius: 0.28rem; background: linear-gradient(180deg, #05080a, #141b20); box-shadow: 0 0 0 1.5px var(--outline); overflow: hidden; }
.obj-bar i { display: block; height: 100%; background: linear-gradient(180deg, #fffbe2, var(--signal) 40%, #c98508); transform-origin: left; transform: scaleX(0); transition: transform 0.5s var(--ease); }
.obj-bar::after, .pack-bar::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--segs) - 2px), rgba(7, 10, 12, 0.9) calc(100% / var(--segs) - 2px) calc(100% / var(--segs))); }
.obj-prog.count-only .obj-bar { display: none; }
.obj-count { font: 400 0.8rem/1 var(--arcade); color: var(--signal); white-space: nowrap; -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }

/* A boss near: its name in big outlined type and a glossy segmented health bar. */
.boss { padding: 0.15rem 0 0; }
.boss-head { display: flex; align-items: center; gap: 0.5rem; }
.boss-ico { width: 1.35rem; height: 1.35rem; color: var(--flare); filter: var(--icon-ink); }
.boss-name { font: 400 1.35rem/1 var(--arcade); letter-spacing: 0.08em; text-transform: uppercase; color: #fff; -webkit-text-stroke: 0.15em var(--outline); paint-order: stroke fill; text-shadow: 0 0 1rem rgba(255, 60, 30, 0.5); }
.boss-pct { margin-left: auto; font: 400 0.8rem/1 var(--arcade); color: #ffc9bd; -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
.boss-bar { position: relative; height: 0.95rem; margin-top: 0.4rem; border-radius: 0.48rem; background: linear-gradient(180deg, #05080a, #1a1012); box-shadow: 0 0 0 2px var(--outline), 0 0 1.2rem rgba(255, 40, 20, 0.35); overflow: hidden; }
.boss-bar i { position: absolute; inset: 2px; border-radius: 0.35rem; transform-origin: left; }
.boss-bar::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(5% - 2px), rgba(7, 10, 12, 0.75) calc(5% - 2px) 5%); }
.boss-ghost { background: #ffd2c4; transition: transform 0.6s ease 0.3s; }
.boss-fill { background: linear-gradient(180deg, #ffc0b0 0%, #ff4c30 30%, #cc1e0b 62%, #6e0a04 100%); transition: transform 0.12s ease-out; }

/* Blodrus: the timed kill run's counter, in the objective's place while it lasts. */
.top-mid.frenzy-on .objective { display: none; }
.frenzy { position: relative; display: flex; flex-direction: column; align-items: center; padding: 0.5rem 3.5rem 1rem; background: radial-gradient(closest-side, rgba(40, 4, 8, 0.8), rgba(40, 4, 8, 0.55) 55%, rgba(40, 4, 8, 0) 100%); }
.fz-top { display: flex; align-items: center; gap: 0.55rem; }
.fz-ico { width: 1.25rem; height: 1.25rem; color: var(--flare); filter: drop-shadow(0 1px 2px #000); }
.fz-title { font: 400 1.45rem/1 'Bungee', var(--display); letter-spacing: 0.2em; text-transform: uppercase; --ink: #1c0402; --grad: linear-gradient(180deg, #ffe2da 8%, #ff8a6c 46%, #ff3b1f 52%, #9c140a 100%); }
.fz-row { display: flex; align-items: baseline; gap: 1.8rem; margin-top: 0.35rem; }
.fz-kills { font: 400 2.6rem/1 'Bungee', var(--display); font-variant-numeric: tabular-nums; --ink: #0a0f12; transform-origin: 50% 60%; }
.fz-time { font: 400 2.1rem/1 'Bungee', var(--display); font-variant-numeric: tabular-nums; --ink: #1d1203; --grad: linear-gradient(180deg, #fffbe2 8%, #ffe27a 46%, #ffb21c 52%, #d17206 100%); }
.frenzy.hot .fz-time { --ink: #1c0402; --grad: linear-gradient(180deg, #ffe2da 8%, #ff8a6c 46%, #ff3b1f 52%, #9c140a 100%); animation: fzflash 0.5s linear infinite; }
@keyframes fzflash { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0.3; } }
.fz-bar { width: 16rem; max-width: 80vw; height: 5px; margin-top: 0.5rem; background: rgba(7, 10, 12, 0.85); box-shadow: 0 0 0 1px rgba(7, 10, 12, 0.9); overflow: hidden; }
.fz-bar i { display: block; height: 100%; background: linear-gradient(90deg, #a3150a, #ff3b1f, #ff9a7e); transform-origin: left; transform: scaleX(0); transition: transform 0.25s ease-out; }

/* A new weapon's (or car's) name, under the objective for a moment. */
.namepop { position: absolute; left: 50%; top: calc(100% + 0.9rem); transform: translateX(-50%); font: 400 1.6rem/1 'Bungee', var(--display); letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; filter: drop-shadow(0 0.25rem 0.6rem rgba(0, 0, 0, 0.6)); }
.np-t { --ink: #1c0402; --ink-w: 0.17em; --grad: linear-gradient(180deg, #ffe2da 8%, #ff8a6c 46%, #ff3b1f 52%, #9c140a 100%); }
.namepop.car .np-t { --ink: #03141c; --grad: linear-gradient(180deg, #effaff 8%, #aee6f8 46%, #4fb0d8 52%, #1d6890 100%); }

/* ---------------------------------------------------------------- top right: score, hearts, gun, armour */
.tr { position: absolute; right: var(--gutter); top: var(--gutter); display: flex; flex-direction: column; align-items: flex-end; gap: 0.32rem; }
.sc-row { display: flex; align-items: flex-start; gap: 0.75rem; }
.score { font: 400 2.2rem/1 'Bungee', var(--display); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; transform-origin: 100% 50%; }
.score-n { --ink: #1d1203; --grad: linear-gradient(180deg, #fffbe2 8%, #ffe27a 46%, #ffb21c 52%, #d17206 100%); }
.mult { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding-top: 0.32rem; font: 400 1.35rem/1 'Bungee', var(--display); transform-origin: 50% 50%; }
.mult-n { --ink: #1c0402; --grad: linear-gradient(180deg, #ffe0d8 8%, #ff8d6e 46%, #ff3b1f 52%, #a3150a 100%); transition: opacity 0.3s ease, filter 0.3s ease; }
.mult[data-m='1'] .mult-n { opacity: 0.6; filter: saturate(0.4); }
.mult[data-m='4'] .mult-n, .mult[data-m='5'] .mult-n { animation: hot 0.9s ease-in-out infinite alternate; }
@keyframes hot { from { filter: drop-shadow(0 0 0 rgba(255, 80, 40, 0)); } to { filter: drop-shadow(0 0 0.45rem rgba(255, 80, 40, 0.85)); } }
.mult-chain { width: 2.6rem; height: 3px; background: rgba(7, 10, 12, 0.85); box-shadow: 0 0 0 1px rgba(7, 10, 12, 0.85); overflow: hidden; opacity: 0; transition: opacity 0.25s ease; }
.mult-chain i { display: block; height: 100%; background: linear-gradient(90deg, #ff8a3a, var(--signal)); transform-origin: left; transform: scaleX(0); transition: transform 0.12s linear; }
.mult.live .mult-chain { opacity: 1; }
.mult.ending .mult-chain i { background: var(--flare); animation: blink 0.18s steps(2) infinite; }
.mult-ghost { position: absolute; left: 50%; top: 50%; font: inherit; color: var(--signal); opacity: 0; pointer-events: none; white-space: nowrap; text-shadow: 0 0 0.6rem rgba(255, 140, 40, 0.8); }

.hearts { display: flex; gap: 0.24rem; margin-top: 0.1rem; }
.hrt { position: relative; width: 1.62rem; height: 1.48rem; filter: drop-shadow(1.5px 0 0 #130406) drop-shadow(-1.5px 0 0 #130406) drop-shadow(0 1.5px 0 #130406) drop-shadow(0 -1.5px 0 #130406) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55)); }
.hrt-in { position: absolute; inset: 0; -webkit-mask: var(--heart) center / 100% 100% no-repeat; mask: var(--heart) center / 100% 100% no-repeat; }
.hrt-in > i { position: absolute; inset: 0; transform-origin: left; }
.hrt-bg { background: linear-gradient(180deg, #43161a, #1c0709); }
.hrt-heal { background: rgba(190, 236, 150, 0.6); transform: scaleX(0); transition: transform 0.4s ease; }
.hrt-ghost { background: #ffe0d6; transition: transform 0.5s ease 0.35s; }
.hrt-fill { background: linear-gradient(180deg, #ffa08c 0%, #ff4c36 34%, #e3200f 58%, #8c0b05 100%); transition: transform 0.14s ease-out; }
.hrt-in > .hrt-shine { inset: 14% 54% 56% 15%; border-radius: 50%; background: rgba(255, 255, 255, 0.5); transform: rotate(-28deg); }
.hrt.empty .hrt-shine { opacity: 0.35; }
.hrt.beat { animation: hbeat 1.1s ease-in-out infinite; }
.hearts[data-tier='crit'] .hrt.beat { animation-duration: 0.72s; }
.hearts[data-tier='crit'] .hrt-bg { background: linear-gradient(180deg, #5a1015, #26080a); }
@keyframes hbeat { 0%, 45%, 100% { transform: scale(1); } 10% { transform: scale(1.24); } 20% { transform: scale(1.04); } 30% { transform: scale(1.16); } }
.stam { width: calc(5 * 1.62rem + 4 * 0.24rem); height: 4px; border-radius: 2px; background: rgba(7, 10, 12, 0.8); box-shadow: 0 0 0 1px rgba(7, 10, 12, 0.9); overflow: hidden; transition: opacity 0.6s ease; }
.stam i { display: block; height: 100%; background: linear-gradient(90deg, #cfc47c, #f6efbd); transform-origin: left; }
.stam.full { opacity: 0.3; }
.stam.low i { background: var(--dusk); }

.weapon { display: flex; flex-direction: column; align-items: flex-end; margin-top: 0.3rem; transition: opacity 0.4s ease; }
.weapon.dim { opacity: 0.35; }
.w-sil { width: 8.4rem; height: 2.7rem; color: #eef2e4; filter: drop-shadow(1.5px 0 0 #0a0f12) drop-shadow(-1.5px 0 0 #0a0f12) drop-shadow(0 1.5px 0 #0a0f12) drop-shadow(0 -1.5px 0 #0a0f12) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.55)); }
.w-sil .wsil { width: 100%; height: 100%; display: block; }
.w-ammo { display: flex; align-items: baseline; gap: 0.2rem; margin-top: 0.15rem; }
.w-mag { font: 400 1.65rem/1 'Bungee', var(--display); font-variant-numeric: tabular-nums; --ink: #070a0c; }
.w-res { font: 700 0.95rem var(--mono); color: var(--frost); text-shadow: 0 0 2px #000, 0 1px 3px #000, 0 0 6px rgba(0, 0, 0, 0.7); }
.w-rel { width: 5.5rem; height: 3px; margin-top: 0.25rem; background: rgba(7, 10, 12, 0.85); overflow: hidden; visibility: hidden; }
.w-rel i { display: block; height: 100%; background: var(--signal); transform-origin: left; transform: scaleX(0); }
.weapon[data-state='reload'] .w-rel { visibility: visible; }
.weapon[data-state='reload'] .w-mag { opacity: 0.4; }
.weapon[data-state='low'] .w-mag { --fill: #ffb86b; }
.weapon[data-state='dry'] .w-mag, .weapon[data-state='empty'] .w-mag { --fill: var(--flare); animation: blink 0.45s ease-in-out infinite alternate; }
.weapon.melee .w-ammo, .weapon.melee .w-rel { display: none; }
.w-slots { display: flex; gap: 0.35rem; margin-top: 0.35rem; }
.slot { position: relative; width: 2.6rem; height: 1.3rem; padding: 0.1rem 0.1rem 0.08rem 0.75rem; color: #c9cec6; opacity: 0.62; }
.slot b { position: absolute; left: 0; top: 0.05rem; font: 400 0.8rem/1 var(--arcade); color: #f4f1e8; -webkit-text-stroke: 0.2em var(--outline); paint-order: stroke fill; }
.slot .wsil { width: 100%; height: 100%; display: block; filter: var(--icon-ink); }
.slot.on { color: var(--signal); opacity: 1; }
.slot.on b { color: var(--signal); }

.armor { display: flex; align-items: center; gap: 0.3rem; margin-top: 0.15rem; transform-origin: 100% 50%; }
.ar-ico { width: 1.7rem; height: 1.7rem; color: #62b9ff; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); }
.ar-num { font: 400 1.2rem/1 'Bungee', var(--display); --ink: #04131f; --grad: linear-gradient(180deg, #eef8ff 8%, #a6dbff 46%, #3c9cea 52%, #1b57a4 100%); }
.armor.low .ar-ico { animation: blink 0.6s ease-in-out infinite alternate; }

/* ---------------------------------------------------------------- notifications (a lane up the middle: `placeNotes`) */
.notes { position: absolute; left: 0; top: 0; z-index: 2; isolation: isolate; width: 22rem; display: flex; flex-direction: column-reverse; align-items: center; gap: 0.25rem; pointer-events: none; will-change: transform; }
.notes.below { flex-direction: column; }
/* A soft dark ground under the lines, as under the objective: they read over a bright street too. */
.notes::before { content: ''; position: absolute; inset: -0.9rem -2.2rem; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(4, 7, 9, 0.46), rgba(4, 7, 9, 0.26) 55%, rgba(4, 7, 9, 0)); transition: opacity 0.4s ease; }
.notes:empty::before { opacity: 0; }
.note { display: flex; align-items: center; gap: 0.5rem; max-width: 100%; padding: 0.15rem 0; font-size: 0.92rem; font-weight: 700; line-height: 1.3; color: var(--frost); text-shadow: var(--ts); transition: opacity 0.55s ease, transform 0.55s ease; }
.note.out { opacity: 0; transform: translateY(-0.7rem); }
.nt-ico { flex: none; width: 1.3rem; height: 1.3rem; color: var(--frost); filter: var(--icon-ink); }
.nt-ico.wpn { width: 2.8rem; height: 1rem; }
.nt-ico .wsil { width: 100%; height: 100%; display: block; }
.nt-body { display: flex; align-items: baseline; gap: 0.45rem; min-width: 0; }
.nt-n, .nt-x { font: 400 0.85rem/1 var(--arcade); color: #f4f1e8; -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; text-shadow: none; }
.nt-x { margin-left: 0.2rem; color: var(--frost-2); }
.note.good .nt-ico { color: var(--lichen); }
.note.item.good .nt-ico, .note.item.good .nt-n { color: var(--signal); }
.note.warn { color: #ffc3b6; }
.note.warn .nt-ico { color: var(--flare); }
/* A bite or a swig: what it did, picked out. */
.nt-gain { font-weight: 800; color: #b9f0a8; white-space: nowrap; }
/* A find put on at once: its picture, "Utrustad", its name in its rarity's colour, what it beat. */
.note.equip { align-items: center; gap: 0.6rem; padding: 0.4rem 0.6rem 0.42rem 0.45rem; margin: 0.15rem 0; border-radius: 0.4rem; background: linear-gradient(90deg, rgba(6, 9, 11, 0.82), rgba(6, 9, 11, 0.55)); box-shadow: 0 0 0 1.5px var(--outline), inset 0 0 0 1px rgba(233, 230, 220, 0.08), inset 3px 0 0 var(--eqc, #ece8de); --eqc: #ece8de; }
.note.equip.magic { --eqc: #9497ff; } .note.equip.rare { --eqc: #ffe95c; } .note.equip.set { --eqc: #4ee34e; } .note.equip.unique { --eqc: #e0b86c; } .note.equip.low { --eqc: #9a9a9a; }
.note.equip .eq-art { flex: none; width: 2.3rem; height: 2.3rem; display: flex; align-items: center; justify-content: center; color: var(--eqc); filter: var(--icon-ink); }
.note.equip .eq-art .ico { width: 100%; height: 100%; }
.note.equip .eq-art.wpn { width: 3.2rem; height: 1.5rem; }
.note.equip .eq-art.wpn svg { width: 100%; height: 100%; }
.note.equip .nt-body { flex-direction: column; align-items: flex-start; gap: 0.08rem; }
.note.equip .eq-lab { font: 400 0.8rem/1 var(--arcade); letter-spacing: 0.1em; text-transform: uppercase; color: var(--signal); -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; text-shadow: none; }
.note.equip .nt-name { color: var(--eqc); font-size: 0.95rem; }
.note.equip .eq-was { font-size: 0.8rem; font-weight: 600; color: var(--frost-2); }
.note.equip .eq-cmp { display: flex; flex-wrap: wrap; gap: 0.1rem 0.55rem; font-size: 0.8rem; font-weight: 800; }
.note.equip .eq-up { color: #9fe6a0; }
.note.equip .eq-down { color: #ff9c86; }

/* ---------------------------------------------------------------- bottom left: radio talking head + kit */
.left-stack { position: absolute; left: var(--gutter); bottom: var(--gutter); display: flex; flex-direction: column; align-items: flex-start; gap: 0.8rem; }
.msg { position: relative; isolation: isolate; display: flex; align-items: center; gap: 0.9rem; width: min(31rem, calc(100vw - 2 * var(--gutter) - 16rem)); padding: 0.3rem 0.4rem 0.3rem 0.3rem; transition: opacity 0.45s ease, transform 0.45s ease; }
.msg::before { inset: -1.4rem -3.5rem -1.4rem -1.4rem; background: radial-gradient(farthest-side at 0% 50%, rgba(4, 7, 9, 0.66), rgba(4, 7, 9, 0.4) 55%, rgba(4, 7, 9, 0)); }
.msg.out { opacity: 0; transform: translateY(0.5rem); }
.msg-face { --pt-bg: #1f4a4d; position: relative; flex: none; align-self: flex-start; width: 4.9rem; height: 4.9rem; overflow: hidden; border-radius: 0.4rem; background: radial-gradient(110% 90% at 50% 28%, var(--pt-bg) 0%, #06090b 100%); box-shadow: 0 0 0 2px #9fd6ea, 0 0 0 4.5px var(--outline), 0 0.35rem 0.7rem rgba(0, 0, 0, 0.55); }
.msg-pt { position: absolute; inset: 0; }
.msg-pt .pt { display: block; width: 100%; height: 100%; }
.msg-scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px), linear-gradient(160deg, rgba(255, 255, 255, 0.14), transparent 45%); }
.msg-face.static .msg-scan { background: repeating-linear-gradient(0deg, rgba(200, 220, 230, 0.13) 0 1px, transparent 1px 2px, rgba(0, 0, 0, 0.3) 2px 3px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 5px); animation: static 0.16s steps(3) infinite; }
@keyframes static { 0% { background-position: 0 0, 0 0; } 33% { background-position: 0 2px, 3px 0; } 66% { background-position: 0 -1px, -2px 0; } }
.pt-mo { opacity: 0; transform-box: fill-box; transform-origin: center; }
.msg.talking .pt-mo { opacity: 1; animation: talk 0.17s ease-in-out infinite alternate; }
.msg.talking .pt-shut { opacity: 0; }
.msg.talking .msg-pt { animation: bob 0.46s ease-in-out infinite alternate; }
@keyframes talk { from { transform: scaleY(0.2); } to { transform: scaleY(1); } }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(1.5px) rotate(-1deg); } }
.msg-body { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: center; gap: 0.5rem; }
.msg-from { font: 400 0.92rem/1 var(--arcade); letter-spacing: 0.06em; text-transform: uppercase; color: #9fd6ea; -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
.msg-sig { display: flex; align-items: flex-end; gap: 2px; height: 0.8rem; margin-left: auto; filter: drop-shadow(0 0 1px #000); }
.msg-sig i { width: 3px; height: 30%; background: rgba(121, 188, 216, 0.6); }
.msg.talking .msg-sig i { animation: sig 0.5s ease-in-out infinite alternate; background: var(--baltic); }
.msg.talking .msg-sig i:nth-child(2) { animation-delay: -0.15s; }
.msg.talking .msg-sig i:nth-child(3) { animation-delay: -0.3s; }
.msg.talking .msg-sig i:nth-child(4) { animation-delay: -0.45s; }
@keyframes sig { from { height: 20%; } to { height: 100%; } }
.msg-text { margin: 0.4rem 0 0; font-size: 1rem; font-weight: 600; line-height: 1.42; color: #eef8fb; text-shadow: var(--ts); }
.mt-rest { visibility: hidden; }

/* Level, gear and backpack: floating outlined icons and counts, no card. */
.kitbox { width: 22rem; }
.lv-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.lv-badge { position: relative; isolation: isolate; flex: none; display: grid; place-items: center; width: 2.35rem; height: 2.6rem; filter: drop-shadow(1.5px 0 0 var(--outline)) drop-shadow(-1.5px 0 0 var(--outline)) drop-shadow(0 1.5px 0 var(--outline)) drop-shadow(0 -1.5px 0 var(--outline)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); }
.lv-badge::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #fffbe2 0%, var(--signal) 42%, #c98508 100%); clip-path: polygon(50% 0, 100% 24%, 100% 76%, 50% 100%, 0 76%, 0 24%); }
.lv-num { font: 400 1.1rem/1 var(--arcade); color: #2a1c02; }
.lv-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.lv { font: 400 0.8rem/1 var(--arcade); letter-spacing: 0.12em; text-transform: uppercase; color: var(--signal); -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
.xp-bar { height: 0.42rem; border-radius: 0.21rem; background: linear-gradient(180deg, #05080a, #141b20); box-shadow: 0 0 0 1.5px var(--outline); overflow: hidden; }
.xp-bar i { display: block; height: 100%; background: linear-gradient(180deg, #fffbe2, var(--signal) 40%, #c98508); transform-origin: left; transform: scaleX(0); transition: transform 0.6s var(--ease); }
.sk-hint { display: inline-flex; align-items: center; gap: 0.35rem; font: 400 0.8rem/1 var(--arcade); letter-spacing: 0.04em; text-transform: uppercase; color: var(--signal); white-space: nowrap; -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; animation: nudge 1.4s ease-in-out infinite; }
.sk-hint kbd { background: linear-gradient(180deg, #fffbe2, var(--signal) 50%, #d99a10); color: var(--signal-ink); -webkit-text-stroke: 0; }
.sk-pts { font: inherit; }
@keyframes nudge { 0%, 100% { filter: none; } 50% { filter: drop-shadow(0 0 0.45rem rgba(255, 204, 46, 0.85)); } }
@keyframes blink { from { opacity: 1; } to { opacity: 0.45; } }

.kit { display: flex; align-items: center; gap: 0.55rem; }
.kit-item { display: inline-flex; align-items: center; gap: 0.25rem; height: 1.8rem; color: var(--frost); }
.kit-item .ico { width: 1.45rem; height: 1.45rem; filter: var(--icon-ink); }
.kit-item b { font: 400 0.95rem/1 var(--arcade); color: #f4f1e8; -webkit-text-stroke: 0.17em var(--outline); paint-order: stroke fill; }
/* None left: the icon greys and its count goes quiet, but it stays readable (what you lack is worth seeing). */
.kit-item.none { color: #8d958f; }
.kit-item.none b { color: #a3aaa4; }
.kit-gap { width: 0.25rem; }
.kit-sep { flex: 1; }
.kit-item.torch { color: var(--frost-2); }
.kit-item.torch.on { color: var(--signal); }
.kit-item.torch.on .ico { filter: var(--icon-ink) drop-shadow(0 0 0.4rem rgba(255, 204, 46, 0.8)); }
.kit kbd { min-width: 1.35rem; height: 1.35rem; font-size: 0.8rem; }
.kit-item.key { color: var(--signal); }

.pack { margin-top: 0.65rem; }
.pack-head { display: flex; justify-content: space-between; align-items: baseline; }
.pack-head span:first-child, .pack-num { font: 400 0.8rem/1 var(--arcade); letter-spacing: 0.08em; text-transform: uppercase; color: #f4f1e8; -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
.pack-bar { --segs: 12; position: relative; height: 0.55rem; margin-top: 0.4rem; border-radius: 0.28rem; background: linear-gradient(180deg, #05080a, #141b20); box-shadow: 0 0 0 1.5px var(--outline); overflow: hidden; }
.pack-bar i { display: block; height: 100%; background: linear-gradient(180deg, #e8f8ff, #79bcd8 40%, #2f7aa0); transform-origin: left; transition: transform 0.35s var(--ease); }
.pack.near .pack-bar i { background: linear-gradient(180deg, #fffbe2, var(--signal) 40%, #c98508); }
.pack.full .pack-bar i { background: linear-gradient(180deg, #ffd9cf, var(--flare) 40%, #9c140a); }
.pack.full .pack-num { color: var(--flare); }
.pack-slots { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.ps { flex: 1; display: flex; align-items: center; gap: 0.2rem; height: 1.7rem; color: var(--frost); }
.ps .ico { width: 1.3rem; height: 1.3rem; filter: var(--icon-ink); }
.ps b { font: 400 0.85rem/1 var(--arcade); color: #f4f1e8; -webkit-text-stroke: 0.17em var(--outline); paint-order: stroke fill; }
.ps.none { color: #8d958f; }
.ps.none b { color: #a3aaa4; }

/* ---------------------------------------------------------------- bottom right: minimap, and the car beside it */
.br { position: absolute; right: var(--gutter); bottom: var(--gutter); display: flex; align-items: flex-end; gap: 1.4rem; }
/* The round map in a chunky outlined rim. */
.mm { --threat: 0; position: relative; flex: none; width: 13.5rem; height: 13.5rem; margin: 0 0.55rem 0.55rem 0; border-radius: 50%; }
.mm::before { content: ''; position: absolute; inset: -0.55rem; border-radius: 50%; background: linear-gradient(160deg, #46535d 0%, #1a2228 45%, #0b1014 70%, #2b363f 100%); box-shadow: 0 0 0 2.5px var(--outline), inset 0 1.5px 0 rgba(255, 255, 255, 0.28), 0 0.35rem 0.8rem rgba(0, 0, 0, 0.5), 0 0 calc(0.3rem + var(--threat) * 1.6rem) calc(var(--threat) * 0.4rem) rgba(255, 60, 30, calc(var(--threat) * 0.75)); transition: box-shadow 0.8s ease; }
.mm-canvas { position: relative; display: block; width: 100%; height: 100%; border-radius: 50%; }
.mm::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--outline), inset 0 0 0 3.5px rgba(233, 230, 220, 0.22); }
.mm-rose b { position: absolute; z-index: 1; font: 400 0.8rem/1 var(--arcade); color: #f4f1e8; -webkit-text-stroke: 0.18em var(--outline); paint-order: stroke fill; transform: translate(-50%, -50%); }
.mm-rose .r-n { left: 50%; top: -0.28rem; padding: 0.2rem 0.3rem 0.16rem; border-radius: 0.25rem; color: var(--signal-ink); -webkit-text-stroke: 0; background: linear-gradient(180deg, #fffbe2, var(--signal) 50%, #d99a10); box-shadow: 0 0 0 2px var(--outline); }
.mm-rose .r-s { left: 50%; top: calc(100% + 0.28rem); }
.mm-rose .r-e { left: calc(100% + 0.28rem); top: 50%; }
.mm-rose .r-w { left: -0.28rem; top: 50%; }

/* The car: the gauge floats with outlined numbers and glossy fuel and damage bars. */
.car { position: relative; isolation: isolate; width: 14.5rem; padding: 0 0.6rem 0.2rem; }
.car::before { inset: -0.8rem -1.4rem -1rem; }
.car-gauge { position: relative; width: 12rem; margin: 0 auto; }
.gauge { display: block; width: 100%; height: auto; overflow: visible; }
.g-track { fill: none; stroke: rgba(7, 10, 12, 0.88); stroke-width: 9; stroke-linecap: round; }
.g-fill { fill: none; stroke: var(--signal); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 0 1; transition: stroke-dasharray 0.15s linear; }
.g-tick { stroke: rgba(233, 230, 220, 0.6); stroke-width: 1.3; }
.g-tick.major { stroke: #f4f1e8; stroke-width: 2.2; }
.g-num { fill: #f4f1e8; font: 400 11px var(--arcade); text-anchor: middle; stroke: var(--outline); stroke-width: 2.8px; paint-order: stroke; }
.g-needle { fill: var(--flare); stroke: var(--outline); stroke-width: 1.2; transition: transform 0.15s linear; }
.car-speed { position: absolute; left: 0; right: 0; top: 56%; display: flex; flex-direction: column; align-items: center; }
.car-speed b { font: 400 2.3rem/0.95 var(--arcade); color: #f4f1e8; font-variant-numeric: tabular-nums; -webkit-text-stroke: 0.14em var(--outline); paint-order: stroke fill; }
.car-speed span { font: 700 0.8rem var(--mono); color: var(--frost); text-shadow: var(--ts); }
.car-name { text-align: center; font: 400 0.95rem/1 var(--arcade); letter-spacing: 0.08em; text-transform: uppercase; color: #9fd6ea; -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; margin-top: 0.1rem; }
.car-bars { display: grid; gap: 0.45rem; margin-top: 0.6rem; }
/* A train's next switch: A the left-hand track, D the right, the one it's set for lit. */
.car-switch { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.35rem; margin-top: 0.45rem; }
.car-switch .sw-mid { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.car-switch .sw-mid b { font: 400 0.7rem/1 var(--arcade); letter-spacing: 0.1em; text-transform: uppercase; color: #9fd6ea; -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
.car-switch .sw-mid i { font: 700 0.72rem var(--mono); font-style: normal; color: var(--frost); text-shadow: var(--ts); margin-top: 0.12rem; }
.car-switch .sw-way { display: flex; align-items: center; gap: 0.3rem; opacity: 0.55; transition: opacity 0.2s ease, transform 0.2s var(--ease); }
.car-switch .sw-r { justify-content: flex-end; }
.car-switch .sw-way em { font: 400 0.66rem/1 var(--arcade); font-style: normal; text-transform: uppercase; color: var(--frost-2); -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; white-space: nowrap; }
.car-switch .sw-way kbd { min-width: 1.2rem; height: 1.2rem; font-size: 0.72rem; }
.car-switch .sw-way.on { opacity: 1; transform: scale(1.06); }
.car-switch .sw-way.on em { color: var(--frost); }
.car-switch.set .sw-way.on em { color: var(--signal); }
.car-switch.set .sw-way.on kbd { background: linear-gradient(180deg, #fffbe2, var(--signal) 50%, #d99a10); color: var(--signal-ink); }
.car-end { text-align: center; margin-top: 0.4rem; font: 700 0.72rem var(--mono); color: var(--frost); text-shadow: var(--ts); }
.car-end b { font: 400 0.8rem/1 var(--arcade); color: #f4f1e8; -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
.car-end.near, .car-end.near b { color: var(--flare); animation: blink 0.5s ease-in-out infinite alternate; }
.cb { display: grid; grid-template-columns: 1.2rem 1fr 3rem; align-items: center; gap: 0.55rem; }
.cb-ico { width: 1.2rem; height: 1.2rem; color: var(--frost); filter: var(--icon-ink); }
.cb-bar { height: 0.55rem; border-radius: 0.28rem; background: linear-gradient(180deg, #05080a, #141b20); box-shadow: 0 0 0 1.5px var(--outline); overflow: hidden; }
.cb-bar i { display: block; height: 100%; transform-origin: left; transition: transform 0.3s ease; }
.cb.fuel .cb-bar i { background: linear-gradient(180deg, #fffbe2, var(--signal) 40%, #c98508); }
.cb.chp .cb-bar i { background: linear-gradient(180deg, #f4ffd8, #b6d06e 35%, #6f8f2c); }
.cb b { font: 400 0.8rem/1 var(--arcade); text-align: right; color: #f4f1e8; -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
.cb.low .cb-bar i { background: linear-gradient(180deg, #ffd9cf, var(--flare) 40%, #9c140a); animation: blink 0.5s ease-in-out infinite alternate; }
.cb.low b, .cb.low .cb-ico { color: var(--flare); }

/* ---------------------------------------------------------------- dead */
.wasted { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; pointer-events: none; }
.ws-t { font: 400 clamp(3.2rem, 10vw, 8.2rem)/1 'Bungee', var(--display); letter-spacing: 0.04em; text-transform: uppercase; transform-origin: 50% 50%; --ink: #160202; --ink-w: 0.12em; --grad: linear-gradient(180deg, #ffdcd2 8%, #ff7c5e 45%, #ff3b1f 52%, #8e1208 100%); filter: drop-shadow(0 0.5rem 2rem rgba(0, 0, 0, 0.75)); }

/* ---------------------------------------------------------------- prompt, marker, banner */
.prompt {
  position: absolute; left: 50%; bottom: calc(var(--gutter) + 6rem); transform: translateX(-50%); isolation: isolate; display: flex; align-items: center; gap: 0.7rem;
  max-width: min(32rem, calc(100vw - 2 * (var(--gutter) + 22.6rem))); min-width: 0; padding: 0.3rem 0.6rem;
}
/* The same plate as the chip at things in the world: one language for the action key. */
.prompt { padding: 0.24rem 0.8rem 0.24rem 0.26rem; border-radius: 0.5rem; background: linear-gradient(180deg, rgba(27, 37, 44, 0.95), rgba(9, 14, 17, 0.95)); box-shadow: 0 0 0 2px var(--outline), inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 0 1px rgba(233, 230, 220, 0.1), 0 0.4rem 1rem rgba(0, 0, 0, 0.5); gap: 0.5rem; }
.prompt::before { display: none; }
.pr-key { position: relative; flex: none; width: 2.15rem; height: 2.15rem; display: grid; place-items: center; }
.pr-key svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.pr-track { fill: none; stroke: rgba(7, 10, 12, 0.85); stroke-width: 4.5; }
.pr-ring { fill: none; stroke: var(--signal); stroke-width: 3; stroke-dasharray: 1 1; stroke-dashoffset: 1; stroke-linecap: round; opacity: 0; }
.prompt.hold .pr-ring { opacity: 1; }
.pr-key kbd { min-width: 1.6rem; height: 1.6rem; font-size: 0.86rem; background: linear-gradient(180deg, #fffbe2, var(--signal) 50%, #d99a10); color: var(--signal-ink); }
.pr-key svg { inset: -0.1rem; width: calc(100% + 0.2rem); height: calc(100% + 0.2rem); }
.pr-key .pr-track { opacity: 0; }
.prompt.hold .pr-track { opacity: 1; }
.pr-text { font: 700 0.95rem/1.15 var(--body); color: #f4f1e8; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65); }

.objmark { position: absolute; left: 0; top: 0; width: 0; height: 0; color: var(--signal); will-change: transform; }
.om-pin { position: absolute; left: -0.6rem; top: -2rem; width: 1.2rem; height: 1.2rem; border-radius: 0.15rem; background: linear-gradient(135deg, #fffbe2, var(--signal) 45%, #d48a06); transform: rotate(45deg); box-shadow: 0 0 0 2px var(--outline), 0 0 1rem rgba(255, 204, 46, 0.55); }
.om-pin::after { content: ''; position: absolute; left: 50%; top: 50%; width: 0.3rem; height: 0.3rem; margin: -0.15rem; background: var(--signal-ink); }
.om-dist { position: absolute; left: 0; top: -0.45rem; transform: translateX(-50%); font: 400 0.82rem/1 var(--arcade); white-space: nowrap; -webkit-text-stroke: 0.18em var(--outline); paint-order: stroke fill; }
.om-arrow { display: none; position: absolute; left: -0.95rem; top: -0.95rem; width: 1.9rem; height: 1.9rem; filter: var(--icon-ink); }
.om-arrow svg { width: 100%; height: 100%; display: block; }
.objmark.edge .om-pin { display: none; }
.objmark.edge .om-arrow { display: block; }
.objmark.edge .om-dist { top: 1.2rem; }
/* The player's own mark (set on the big map): a violet map pin, apart from every other colour. */
.wpmark { color: #e2b8ff; }
.wpmark .om-pin { left: -0.62rem; top: -2.15rem; width: 1.24rem; height: 1.24rem; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: radial-gradient(circle at 60% 40%, #f5e4ff 0 18%, #c77dff 46%, #8240c9 100%); box-shadow: 0 0 0 2px var(--outline), 0 0 1rem rgba(199, 125, 255, 0.55); }
.wpmark .om-pin::after { width: 0.34rem; height: 0.34rem; margin: -0.17rem; border-radius: 50%; background: #fff6ff; box-shadow: 0 0 0 1.5px rgba(40, 10, 60, 0.6); }

/* ---------------------------------------------------------------- what the action key acts on */
/* A chip over it in the world: the key (a pad's round button while one's in use), what it does,
   a tail down to it; a ring round the key fills while it's held. One interaction language: the
   thing itself pulses warm (draw.rs `focus_glow`), the chip names it, nothing else glows. */
.ix { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 2; will-change: transform; }
.ix-chip {
  position: absolute; left: 0; bottom: 0.72rem; transform: translateX(-50%); display: flex; align-items: center; gap: 0.5rem;
  padding: 0.24rem 0.75rem 0.24rem 0.26rem; white-space: nowrap; border-radius: 0.5rem;
  background: linear-gradient(180deg, rgba(27, 37, 44, 0.95), rgba(9, 14, 17, 0.95));
  box-shadow: 0 0 0 2px var(--outline), inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 0 1px rgba(233, 230, 220, 0.1), 0 0.4rem 1rem rgba(0, 0, 0, 0.5);
}
.ix-tip { position: absolute; z-index: -1; left: -0.38rem; top: -1.04rem; width: 0.76rem; height: 0.76rem; transform: rotate(45deg); background: #0b1115; box-shadow: 0 0 0 2px var(--outline); }
.ix.low .ix-chip { bottom: auto; top: 0.72rem; }
.ix.low .ix-tip { top: 0.28rem; background: #1d2830; }
.ix-key { position: relative; flex: none; width: 2.15rem; height: 2.15rem; display: grid; place-items: center; }
.ix-key svg { position: absolute; inset: -0.1rem; width: calc(100% + 0.2rem); height: calc(100% + 0.2rem); transform: rotate(-90deg); overflow: visible; }
.ix-key .pr-track { opacity: 0; }
.ix.busy .ix-key .pr-track, .ix.busy .ix-ring { opacity: 1; }
.ix-k { min-width: 1.6rem; height: 1.6rem; font-size: 0.86rem; background: linear-gradient(180deg, #fffbe2, var(--signal) 50%, #d99a10); color: var(--signal-ink); }
.ix-text { font: 700 0.95rem/1.15 var(--body); color: #f4f1e8; letter-spacing: 0.005em; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65); }
.ix-name { margin-left: -0.15rem; font: 600 0.9rem/1.15 var(--body); color: #cfd3cc; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65); }
.ix-hold { display: none; margin-left: 0.1rem; padding: 0.2rem 0.32rem 0.16rem; border-radius: 0.25rem; font: 400 0.8rem/1 var(--arcade); letter-spacing: 0.06em; text-transform: uppercase; color: var(--signal); background: rgba(255, 204, 46, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 204, 46, 0.4); }
.ix.hold .ix-hold { display: inline-block; }
.ix.busy .ix-text { color: #fff3c4; }
/* The other things near that the key works on: a faint hollow diamond over each, nearer brighter. */
.ix-pips { position: absolute; inset: 0; pointer-events: none; }
.ix-pip { position: absolute; left: 0; top: 0; width: 0; height: 0; transition: opacity 0.3s ease; }
.ix-pip::before { content: ''; position: absolute; left: -0.3rem; top: -0.3rem; width: 0.6rem; height: 0.6rem; border-radius: 0.1rem; transform: rotate(45deg); border: 2px solid #f4f1e8; box-shadow: 0 0 0 1.5px var(--outline), inset 0 0 0 1.5px var(--outline), 0 1px 3px rgba(0, 0, 0, 0.5); }
.ix-pip::after { content: ''; position: absolute; left: -0.09rem; top: -0.09rem; width: 0.18rem; height: 0.18rem; border-radius: 50%; background: #f4f1e8; }

/* A gamepad's buttons: round faces, the triggers wider with a rounded top. */
kbd.pad { width: 1.6rem; min-width: 1.6rem; padding: 0; border-radius: 50%; }
kbd.trig { min-width: 2.2rem; border-radius: 0.6rem 0.6rem 0.28rem 0.28rem; }
/* The direction pad: a cross with the arm to press lit, not a keyboard arrow. */
kbd.dpk { padding: 0.1rem; }
.dpad { display: block; width: 1.15rem; height: 1.15rem; }
.dpad .dp-body { fill: #2a3238; stroke: #10171b; stroke-width: 0.8; stroke-linejoin: round; }
.dpad .dp-on { fill: var(--signal); }
/* A mouse, drawn like a keycap: its lit button the one to press. */
.mouse { display: block; width: 1.05rem; height: 1.45rem; overflow: visible; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.6)); }
.mouse .ms-body { fill: #ebe5d6; stroke: var(--outline); stroke-width: 1.7; }
.mouse .ms-line { fill: none; stroke: #6a6f6a; stroke-width: 1.1; }
.mouse .ms-btn { fill: var(--signal); stroke: #8a5d05; stroke-width: 0.6; }

/* ---------------------------------------------------------------- the first game's controls card */
/* Docked in the left column under the clock (off the playfield): the few things to know in two
   columns, each ticked off as it's done. A ghost of itself while anything that matters is under it. */
.coach {
  position: relative; isolation: isolate; width: 18rem; padding: 0.45rem 0.55rem 0.55rem;
  border-radius: 0.55rem; background: linear-gradient(180deg, rgba(20, 28, 34, 0.88), rgba(8, 12, 15, 0.88));
  box-shadow: 0 0 0 2px var(--outline), inset 0 0 0 1px rgba(233, 230, 220, 0.1), inset 3px 0 0 rgba(255, 204, 46, 0.85), 0 0.5rem 1.2rem rgba(0, 0, 0, 0.4);
  animation: co-in 0.5s var(--ease) both; transition: opacity 0.35s ease;
}
.coach.faded { opacity: 0.16; }
.coach.out { animation: co-out 0.6s ease-in forwards; }
@keyframes co-in { from { opacity: 0; transform: translateX(-0.8rem); } }
@keyframes co-out { to { opacity: 0; transform: translateX(-0.8rem); } }
.co-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0.1rem 0.15rem 0.4rem 0.25rem; }
.co-title { font: 400 0.84rem/1 var(--arcade); letter-spacing: 0.1em; text-transform: uppercase; color: var(--signal); -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
.co-n { font: 400 0.8rem/1 var(--arcade); color: var(--frost-2); -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
.co-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.22rem 0.3rem; }
.co-list li { position: relative; display: flex; align-items: center; gap: 0.4rem; min-height: 1.95rem; padding: 0.18rem 1.15rem 0.18rem 0.3rem; border-radius: 0.35rem; background: rgba(233, 230, 220, 0.045); box-shadow: inset 0 0 0 1px rgba(233, 230, 220, 0.07); transition: background 0.3s ease; }
.co-keys { flex: none; display: flex; align-items: center; gap: 0.1rem; transition: opacity 0.3s ease; }
.co-keys kbd { min-width: 1.2rem; height: 1.3rem; padding: 0 0.2rem; font-size: 0.8rem; }
.co-ms .mouse { width: 0.95rem; height: 1.32rem; }
.co-lab { min-width: 0; font: 700 0.8rem/1.1 var(--body); color: var(--frost); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); transition: opacity 0.3s ease; }
.co-tick { position: absolute; right: 0.15rem; top: 50%; width: 0.95rem; height: 0.95rem; margin-top: -0.475rem; padding: 0.12rem; border-radius: 50%; color: var(--signal-ink); background: linear-gradient(180deg, #fffbe2, var(--signal) 50%, #d99a10); box-shadow: 0 0 0 1.5px var(--outline); opacity: 0; transform: scale(0.4); transition: opacity 0.2s ease, transform 0.35s cubic-bezier(0.2, 1.8, 0.4, 1); }
.co-tick .ico { width: 100%; height: 100%; }
.co-list li.done { background: rgba(255, 204, 46, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 204, 46, 0.3); }
.co-list li.done .co-keys, .co-list li.done .co-lab { opacity: 0.45; }
.co-list li.done .co-tick { opacity: 1; transform: none; }
/* No room for the whole card (a short screen, a large HUD): no header, slimmer rows. */
.coach.compact { padding: 0.35rem 0.45rem; }
.coach.compact .co-head { display: none; }
.coach.compact .co-list { gap: 0.15rem 0.25rem; }
.coach.compact .co-list li { min-height: 1.6rem; padding-top: 0.06rem; padding-bottom: 0.06rem; }
.co-lab { white-space: nowrap; }
/* A pad's buttons kept to the keycaps' size here, so the words beside them stay on one line. */
.co-keys kbd.pad { width: 1.3rem; min-width: 1.3rem; height: 1.3rem; }
.co-keys kbd.trig { min-width: 1.6rem; }


/* Big moments across the screen, in the arcade type. */
.banner { position: absolute; left: var(--lane, 20.5rem); right: var(--lane, 20.5rem); top: 24%; display: flex; flex-direction: column; align-items: center; text-align: center; container-type: inline-size; }
/* Big moments sit in the lane between the HUD's columns, sized to it (no collisions on any screen). */
:root { --lane: 20.5rem; }
.banner-ico { width: 2.5rem; height: 2.5rem; margin-bottom: 0.45rem; filter: var(--icon-ink); }
.banner-title { max-width: 100%; font: 400 clamp(1.7rem, 8.4cqi, 4.6rem)/1.04 var(--arcade); letter-spacing: 0.04em; text-transform: uppercase; text-wrap: balance; color: #f4f1e8; -webkit-text-stroke: 0.1em var(--outline); paint-order: stroke fill; text-shadow: 0 0.07em 0 rgba(0, 0, 0, 0.45), 0 0.3rem 2rem rgba(0, 0, 0, 0.6); }
.banner-sub { margin-top: 0.65rem; font-size: 1.08rem; font-weight: 700; color: var(--frost); max-width: min(40ch, 100%); text-wrap: balance; text-shadow: var(--ts); }
.banner.small .banner-title { font-size: 0.95rem; letter-spacing: 0.3em; color: var(--signal); -webkit-text-stroke: 0.18em var(--outline); }
.banner.small .banner-sub { margin-top: 0.3rem; font: 400 clamp(1.5rem, 7cqi, 2.7rem)/1.05 var(--arcade); letter-spacing: 0.03em; text-transform: uppercase; color: #f4f1e8; max-width: none; -webkit-text-stroke: 0.12em var(--outline); paint-order: stroke fill; text-shadow: 0 0.07em 0 rgba(0, 0, 0, 0.45); }
.banner.day .banner-ico, .banner.day .banner-title { color: #ffd98a; }
.banner.night .banner-ico, .banner.night .banner-title { color: #a9bbf0; }
.banner.danger .banner-ico, .banner.danger .banner-title { color: var(--flare); }
.banner.level .banner-ico, .banner.level .banner-title { color: var(--signal); }
.banner.good .banner-ico, .banner.good .banner-title { color: var(--signal); }
/* The dawn storm: the biggest words of the night, fire-orange on a red glow. */
.banner.storm .banner-ico { width: 3rem; height: 3rem; color: var(--flare); }
.banner.storm .banner-title { font-size: clamp(2rem, 8.6cqi, 6rem); color: #ffb24a; text-shadow: 0 0.07em 0 rgba(0, 0, 0, 0.5), 0 0 2.6rem rgba(255, 70, 20, 0.7), 0 0 0.6rem rgba(255, 120, 40, 0.5); }
.banner.storm .banner-sub { color: #ffe2d6; }

.fps { position: absolute; left: 50%; top: 0.3rem; transform: translateX(-50%); font: 700 0.8rem var(--mono); color: var(--lichen); text-shadow: var(--ts); }
.debug { position: absolute; left: 50%; bottom: 0.3rem; transform: translateX(-50%); font: 0.7rem var(--mono); color: rgba(255, 255, 255, 0.7); text-shadow: var(--ts); }

.sleepfade { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem; background: rgba(4, 7, 14, 0.86); animation: fadein 1s ease; }
.sl-ico { width: 2.6rem; height: 2.6rem; color: #a9bbf0; filter: var(--icon-ink); }
.sl-title { font: 400 1rem var(--arcade); letter-spacing: 0.3em; text-transform: uppercase; color: #a9bbf0; -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
.sl-time { font: 400 4.4rem/1 var(--arcade); color: #f4f1e8; font-variant-numeric: tabular-nums; -webkit-text-stroke: 0.1em var(--outline); paint-order: stroke fill; }
.sl-sub { font-size: 0.95rem; font-weight: 600; color: var(--frost-2); }
@keyframes fadein { from { opacity: 0; } }

/* ---------------------------------------------------------------- the night's report */
/* Dawn after a night: GTA-style big words in sunrise gold, the night in six tiles, what was won or lost. */
.dawn { position: absolute; left: 50%; top: 17%; z-index: 2; transform: translateX(-50%); width: min(54rem, calc(100vw - 2 * var(--gutter))); display: flex; flex-direction: column; align-items: center; gap: 0.5rem; text-align: center; pointer-events: none; isolation: isolate; container-type: inline-size; }
/* The report has the screen: the world dims behind it and the HUD steps back (the radio stays: Maja speaks). */
.play.report::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse 75% 62% at 50% 36%, rgba(5, 8, 10, 0.42) 0%, rgba(5, 8, 10, 0.72) 70%, rgba(3, 5, 6, 0.86) 100%); animation: fadein 0.9s ease both; }
.play.report > .tl, .play.report > .top-mid, .play.report > .tr, .play.report > .notes, .play.report > .br, .play.report > .left-stack > .kitbox, .play.report > .prompt, .play.report > .objmark, .play.report > .ix, .play.report > .ix-pips, .play.report > .coach { opacity: 0.14; filter: saturate(0.4); }
.play.report > .left-stack { z-index: 3; }
.dw-glow { position: absolute; left: 50%; top: 4.2rem; width: 140%; height: 15rem; transform: translate(-50%, -50%); z-index: -1; background: radial-gradient(ellipse 50% 50% at 50% 55%, rgba(255, 186, 72, 0.36) 0%, rgba(255, 120, 40, 0.14) 46%, rgba(255, 120, 40, 0) 72%); }
.dw-kick { display: flex; align-items: center; gap: 0.55rem; font: 400 0.95rem/1 var(--arcade); letter-spacing: 0.32em; text-transform: uppercase; color: #ffd98a; -webkit-text-stroke: 0.18em var(--outline); paint-order: stroke fill; }
.dw-ico { width: 1.7rem; height: 1.7rem; color: #ffd98a; filter: var(--icon-ink); }
.dw-ico svg { width: 100%; height: 100%; display: block; }
.dw-title { max-width: 100%; font: 400 clamp(2rem, 7.4cqi, 5.6rem)/1 var(--arcade); letter-spacing: 0.03em; text-transform: uppercase; --ink: #1a0c02; --ink-w: 0.13em; --grad: linear-gradient(180deg, #fffbe2 6%, #ffe36e 38%, #ffb52c 52%, #e2600c 100%); filter: drop-shadow(0 0.35rem 1.4rem rgba(0, 0, 0, 0.7)) drop-shadow(0 0 2.2rem rgba(255, 170, 50, 0.32)); }
.dw-sub { font-size: 1.06rem; font-weight: 700; color: var(--frost); max-width: min(46ch, 100%); text-wrap: balance; text-shadow: var(--ts); }
.dw-tiles { width: 100%; display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: 0.5rem; margin-top: 0.7rem; }
.dw-tiles .bt { grid-template-columns: 1fr; grid-template-rows: auto auto auto; justify-items: center; row-gap: 0.25rem; padding: 0.6rem 0.4rem 0.55rem; text-align: center; }
.dw-tiles .bt-icon { grid-row: auto; width: 1.55rem; height: 1.55rem; }
.dw-tiles .bt-label { white-space: normal; line-height: 1.2; font-size: 0.8rem; }
.dw-tiles .bt.good .bt-icon { color: var(--lichen); }
.dw-tiles .bt.worn .bt-icon { color: var(--dusk); }
.dw-tiles .bt.worn .bt-val { color: #ffd8a6; }
.dw-tiles .bt.bad .bt-icon, .dw-tiles .bt.bad .bt-val { color: var(--flare); }
.dw-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 0.4rem; }
.bb.loot { background: linear-gradient(180deg, #ffe36e, #e09a12 55%, #9a5a06); color: #241602; text-shadow: none; }
.bb.loot b { color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45); }
.bb.storm { background: linear-gradient(180deg, #ff9a52, #d1400f 55%, #8e1f08); }
.bb.lost { background: linear-gradient(180deg, #ff6a4a, #a3170a); }
.bb.note { background: linear-gradient(180deg, #2c3842, #151d23); color: var(--frost-2); }
/* A night the dead got in: the same report, in ash and blood instead of gold. */
.dawn.fell .dw-title { --ink: #160202; --grad: linear-gradient(180deg, #ffe2d8 6%, #ff8a6a 38%, #ff3d1f 54%, #8e1208 100%); filter: drop-shadow(0 0.35rem 1.4rem rgba(0, 0, 0, 0.75)) drop-shadow(0 0 2.2rem rgba(255, 50, 20, 0.3)); }
.dawn.fell .dw-glow { background: radial-gradient(ellipse 50% 50% at 50% 55%, rgba(200, 40, 20, 0.32) 0%, rgba(120, 20, 10, 0.12) 46%, rgba(120, 20, 10, 0) 72%); }
.dawn.fell .dw-kick, .dawn.fell .dw-ico { color: #ffb29e; }
.dawn.in .dw-glow { animation: dw-sun 2.6s cubic-bezier(.2,.7,.2,1) both; }
.dawn.in .dw-kick { animation: dw-rise 0.6s 0.15s var(--ease) both; }
.dawn.in .dw-title { animation: dw-slam 0.8s cubic-bezier(.3,.6,.3,1) both; }
.dawn.in .dw-sub { animation: dw-rise 0.6s 0.5s var(--ease) both; }
.dawn.in .dw-badges { animation: board-pop 0.45s 1.15s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.dawn.out { animation: dw-out 0.7s ease-in forwards; }
@keyframes dw-slam { from { opacity: 0; transform: scale(2.6); } 50% { opacity: 1; transform: scale(0.94); } 72% { transform: scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes dw-rise { from { opacity: 0; transform: translateY(0.5rem); } to { opacity: 1; transform: none; } }
@keyframes dw-sun { from { opacity: 0; transform: translate(-50%, -20%) scale(0.6, 0.3); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes dw-out { to { opacity: 0; transform: translateX(-50%) translateY(-0.9rem); } }
@media (max-width: 760px) {
  .dawn { top: 14%; }
  .dw-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Where the guide light points when it isn't the errand: a road-sign tag over the pin. */
.om-note { position: absolute; left: 0; top: -3.7rem; transform: translateX(-50%); padding: 0.32rem 0.6rem 0.28rem; border-radius: 0.3rem; white-space: nowrap; font: 400 0.8rem/1 var(--arcade); letter-spacing: 0.06em; text-transform: uppercase; color: var(--signal-ink); background: linear-gradient(180deg, #fffbe2, var(--signal) 55%, #d99a10); box-shadow: 0 0 0 2px var(--outline), 0 3px 6px rgba(0, 0, 0, 0.45); animation: nudge 1.6s ease-in-out infinite; }
.objmark.edge .om-note { top: 2.5rem; }
.objmark[data-side="l"] .om-note { transform: translateX(-1.2rem); }
.objmark[data-side="r"] .om-note { transform: translateX(calc(-100% + 1.2rem)); }

/* The fade through black between the game's moments (respawn, waking, a new game, the title). */
.curtain { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; opacity: 0; pointer-events: none; background: radial-gradient(ellipse 90% 80% at 50% 50%, #070b0e 0%, #020304 70%, #000 100%); }
.curtain.on { pointer-events: auto; cursor: default; }
.ct-note { font: 400 0.9rem/1 var(--arcade); letter-spacing: 0.34em; text-transform: uppercase; color: var(--frost-2); -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }

/* ---------------------------------------------------------------- crosshair */
.reticle { --gap: 6px; position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 3; color: var(--frost); will-change: transform; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 3px rgba(0, 0, 0, 0.5)); }
.rt-svg { position: absolute; left: -20px; top: -20px; width: 40px; height: 40px; overflow: visible; transform: rotate(-90deg); }
.rt-track, .rt-ring, .rt-melee { fill: none; }
.rt-track { stroke: rgba(233, 230, 220, 0.18); stroke-width: 2; opacity: 0; }
.rt-ring { stroke: var(--signal); stroke-width: 2.4; stroke-dasharray: 1 1; stroke-dashoffset: 1; opacity: 0; }
.rt-melee { stroke: currentColor; stroke-width: 1.6; stroke-dasharray: 5.2 3.7; opacity: 0; }
.rt-t { position: absolute; background: currentColor; transition: transform 0.06s linear; }
.rt-u, .rt-d { left: -1px; width: 2px; height: 7px; }
.rt-l, .rt-r { top: -1px; width: 7px; height: 2px; }
.rt-u { top: -7px; transform: translateY(calc(var(--gap) * -1)); }
.rt-d { top: 0; transform: translateY(var(--gap)); }
.rt-l { left: -7px; transform: translateX(calc(var(--gap) * -1)); }
.rt-r { left: 0; transform: translateX(var(--gap)); }
.rt-dot { position: absolute; left: -1.5px; top: -1.5px; width: 3px; height: 3px; background: currentColor; border-radius: 50%; }
.rt-label { position: absolute; left: 14px; top: 10px; font: 800 0.85rem/1 var(--display); letter-spacing: 0.04em; white-space: nowrap; }
.reticle[data-state='melee'] .rt-t { display: none; }
/* The weapon held down: the crosshair faint and opened up until right mouse raises it. */
.reticle.lowered { opacity: 0.4; --gap: 14px; }
.reticle[data-state='melee'] .rt-melee { opacity: 0.9; }
.reticle[data-state='reload'] .rt-track, .reticle[data-state='reload'] .rt-ring { opacity: 1; }
.reticle[data-state='reload'] .rt-t { opacity: 0.35; }
.reticle[data-state='low'] .rt-label { color: var(--dusk); }
.reticle[data-state='dry'] { color: var(--signal); }
.reticle[data-state='empty'] { color: var(--flare); }
.reticle[data-state='empty'] .rt-dot { display: none; }
.reticle[data-state='empty'] .rt-u { transform: translateY(calc(var(--gap) * -1)) rotate(45deg); }
.reticle[data-state='empty'] .rt-d { transform: translateY(var(--gap)) rotate(45deg); }
.reticle[data-state='empty'] .rt-l { transform: translateX(calc(var(--gap) * -1)) rotate(45deg); }
.reticle[data-state='empty'] .rt-r { transform: translateX(var(--gap)) rotate(45deg); }
/* How to raise the gun, at the sights: after a click with it held down, or while the dead come
   and the habit isn't there yet. The crosshair stays faint behind it; the sign doesn't. */
.rt-hint { position: absolute; left: 0; top: 1.55rem; transform: translateX(calc(-50% + var(--rhx, 0px))); display: none; align-items: center; gap: 0.42rem; padding: 0.22rem 0.6rem 0.22rem 0.32rem; border-radius: 0.45rem; white-space: nowrap; background: linear-gradient(180deg, rgba(27, 37, 44, 0.95), rgba(9, 14, 17, 0.95)); box-shadow: 0 0 0 2px var(--outline), inset 0 0 0 1px rgba(255, 204, 46, 0.4), 0 0.3rem 0.8rem rgba(0, 0, 0, 0.45); }
.reticle.hint .rt-hint { display: flex; animation: rh-in 0.22s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.reticle.hint-up .rt-hint { top: auto; bottom: 1.55rem; }
.reticle.lowered.hint { opacity: 1; }
.reticle.lowered.hint > .rt-svg, .reticle.lowered.hint > .rt-t, .reticle.lowered.hint > .rt-dot, .reticle.lowered.hint > .rt-label { opacity: 0.4; }
.rh-key .mouse { width: 1.15rem; height: 1.6rem; }
.reticle.hint .ms-btn { animation: rh-btn 0.75s ease-in-out infinite alternate; }
.rh-t { font: 700 0.85rem/1 var(--body); color: #f4f1e8; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.rh-t b { margin-right: 0.18rem; font: 400 0.82rem/1 var(--arcade); letter-spacing: 0.06em; text-transform: uppercase; color: var(--signal); -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
@keyframes rh-in { from { opacity: 0; transform: translateX(calc(-50% + var(--rhx, 0px))) translateY(-0.3rem) scale(0.85); } }
@keyframes rh-btn { from { fill: var(--signal); } to { fill: #fff6c8; } }


/* ================================================================ full map */
.fullmap { position: absolute; inset: 0; z-index: 4; display: grid; grid-template-columns: 1fr 18rem; pointer-events: auto; background: rgba(6, 10, 13, 0.97); animation: fadein 0.2s ease; }
.fm-stage { position: relative; margin: var(--gutter) 0 var(--gutter) var(--gutter); min-width: 0; min-height: 0; overflow: hidden; cursor: grab; border-radius: 0.5rem; box-shadow: 0 0 0 3px var(--outline), 0 0 0 4.5px rgba(233, 230, 220, 0.16); }
.fm-stage.drag { cursor: grabbing; }
.fm-stage canvas { display: block; width: 100%; height: 100%; }
.fm-side { display: flex; flex-direction: column; gap: 1.2rem; padding: calc(var(--gutter) + 0.4rem) var(--gutter); overflow: auto; }
.fm-head { margin: 0; font: 400 2.2rem/1 var(--arcade); letter-spacing: 0.03em; text-transform: uppercase; color: #f4f1e8; -webkit-text-stroke: 0.1em var(--outline); paint-order: stroke fill; text-shadow: 0 0.07em 0 rgba(0, 0, 0, 0.45); }
.fm-obj { padding: 0.8rem 0.9rem; border-radius: 0.45rem; background: rgba(255, 204, 46, 0.08); box-shadow: 0 0 0 2px var(--outline), inset 0 0 0 1px rgba(255, 204, 46, 0.4); }
.fm-obj-step { display: block; font: 400 0.8rem var(--arcade); letter-spacing: 0.06em; color: var(--signal); }
.fm-obj-title { display: block; margin-top: 0.35rem; font: 400 1.1rem/1.1 var(--arcade); letter-spacing: 0.02em; text-transform: uppercase; color: #f4f1e8; -webkit-text-stroke: 0.15em var(--outline); paint-order: stroke fill; }
.fm-obj-text { margin: 0.35rem 0 0; font-size: 0.86rem; line-height: 1.45; color: var(--frost-2); }
.fm-legend { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.55rem; font-size: 0.88rem; color: var(--frost-2); }
.fm-legend li { display: flex; align-items: center; gap: 0.65rem; }
.lg { flex: none; display: grid; place-items: center; width: 1.1rem; height: 1.1rem; }
.lg-you { background: #fff; clip-path: polygon(100% 50%, 0 100%, 25% 50%, 0 0); }
.lg-base { background: var(--baltic); border-radius: 50%; color: var(--asphalt); padding: 0.15rem; }
.lg-obj { width: 0.85rem; height: 0.85rem; background: var(--signal); transform: rotate(45deg); }
.lg-wp { width: 0.9rem; height: 0.9rem; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: radial-gradient(circle at 60% 40%, #f5e4ff 0 18%, #c77dff 46%, #8240c9 100%); box-shadow: 0 0 0 1.5px var(--outline); }
.fm-wp { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.7rem 0.8rem; border-radius: 0.45rem; font-size: 0.84rem; line-height: 1.45; color: var(--frost-2); background: rgba(199, 125, 255, 0.06); box-shadow: 0 0 0 2px var(--outline), inset 0 0 0 1px rgba(199, 125, 255, 0.3); }
.fm-wp.on { color: #efdcff; background: rgba(199, 125, 255, 0.13); box-shadow: 0 0 0 2px var(--outline), inset 0 0 0 1px rgba(199, 125, 255, 0.6); }
.fm-wp-ico { flex: none; width: 0.9rem; height: 0.9rem; margin-top: 0.2rem; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: radial-gradient(circle at 60% 40%, #f5e4ff 0 18%, #c77dff 46%, #8240c9 100%); box-shadow: 0 0 0 1.5px var(--outline); }

.lg-loot { width: 0.6rem; height: 0.6rem; background: var(--signal); transform: rotate(45deg); opacity: 0.8; }
.lg-car { width: 0.8rem; height: 0.55rem; background: var(--baltic); }
.lg-z { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--flare); }
.lg-npc { width: 0.65rem; height: 0.65rem; border-radius: 50%; background: #7fd6b5; }
.lg-army, .lg-fallen { width: 0.9rem; height: 0.98rem; background: #6f8c3c; clip-path: polygon(0 0, 100% 0, 100% 56%, 50% 100%, 0 56%); }
.lg-fallen { background: #c9311d; }
.lg-token { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #ff2a4a; box-shadow: 0 0 0 0.18rem rgba(255, 42, 74, 0.35); }
.fm-hint { margin: auto 0 0; font-size: 0.8rem; line-height: 1.7; color: var(--frost-3); }
.fm-hint kbd { min-width: 1.3rem; height: 1.3rem; font-size: 0.8rem; }

/* ================================================================ screens */
.screen { position: absolute; inset: 0; z-index: 5; pointer-events: auto; overflow: auto; animation: fadein 0.4s ease; }
.menu { display: flex; flex-direction: column; gap: 0.7rem; }
.menu.row { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 0.8rem; }
.mbtn {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; min-width: 16rem; padding: 0.75rem 1.15rem 0.72rem; text-align: left; cursor: pointer;
  border: 0; border-radius: 0.5rem; color: #f4f1e8; background: linear-gradient(180deg, #34424d 0%, #1b242b 48%, #10171c 100%);
  box-shadow: 0 0 0 3px var(--outline), inset 0 1.5px 0 rgba(255, 255, 255, 0.2), inset 0 -3px 0 rgba(0, 0, 0, 0.35), 0 0.35rem 0.6rem rgba(0, 0, 0, 0.5);
  transition: transform 0.14s var(--ease), filter 0.14s ease, box-shadow 0.14s ease;
}
.mb-label { font: 400 1.15rem/1 var(--arcade); letter-spacing: 0.05em; text-transform: uppercase; -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
.mb-sub { font-size: 0.8rem; font-weight: 600; color: var(--frost-2); }
.mbtn:hover, .mbtn:focus-visible { transform: translateX(0.25rem); filter: brightness(1.18); outline: none; box-shadow: 0 0 0 3px var(--outline), 0 0 0 5.5px var(--signal), inset 0 1.5px 0 rgba(255, 255, 255, 0.2), inset 0 -3px 0 rgba(0, 0, 0, 0.35), 0 0.35rem 0.8rem rgba(0, 0, 0, 0.55); }
.mbtn.primary { background: linear-gradient(180deg, #ff9f86 0%, #ff4f33 40%, #d4250f 62%, #8e1208 100%); }
.mbtn.primary .mb-sub { color: #fff2ee; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55); }
.mbtn:disabled { opacity: 0.4; cursor: default; transform: none; filter: none; }
.menu.row .mbtn { min-width: 12rem; }

/* Title */
.screen.title { display: grid; grid-template-rows: 1fr auto; background: linear-gradient(90deg, rgba(5, 9, 11, 0.92) 0%, rgba(5, 9, 11, 0.7) 32%, rgba(5, 9, 11, 0.08) 62%, rgba(5, 9, 11, 0) 100%), linear-gradient(0deg, rgba(5, 9, 11, 0.7) 0%, transparent 30%); }
.t-col { align-self: center; display: flex; flex-direction: column; align-items: flex-start; gap: 1.1rem; padding: 0 clamp(1.5rem, 7vw, 7rem); }
.logo { margin: 0; display: flex; align-items: flex-end; gap: 0.08em; font: 400 clamp(3.6rem, 8.6vw, 7.4rem)/0.9 var(--arcade); letter-spacing: 0.02em; color: #f4f1e8; -webkit-text-stroke: 0.1em var(--outline); paint-order: stroke fill; text-shadow: 0 0.07em 0 rgba(0, 0, 0, 0.45), 0 0.6rem 3rem rgba(0, 0, 0, 0.6); }
.logo-z { color: var(--flare); font-size: 1.3em; transform: skewX(-8deg); margin-left: 0.04em; text-shadow: 0 0.07em 0 rgba(0, 0, 0, 0.45), 0 0 3rem rgba(255, 84, 54, 0.4); }
.tagline { margin: 0 0 0.8rem; font-size: 1.15rem; font-weight: 700; color: var(--frost); text-shadow: var(--ts); }
.t-foot { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem clamp(1.5rem, 7vw, 7rem); font-size: 0.8rem; font-weight: 600; color: var(--frost-2); text-shadow: var(--ts); }
.t-coord { font-family: var(--mono); letter-spacing: 0.06em; }

/* Pause */
.screen.pause { display: grid; grid-template-columns: auto minmax(0, 30rem); align-items: center; justify-content: start; gap: clamp(2rem, 6vw, 6rem); padding: 2rem clamp(1.5rem, 7vw, 7rem); background: linear-gradient(90deg, rgba(5, 9, 11, 0.94) 0%, rgba(5, 9, 11, 0.82) 55%, rgba(5, 9, 11, 0.6) 100%); }
.p-col { display: flex; flex-direction: column; gap: 1.2rem; }
.p-title { margin: 0; font: 400 clamp(3rem, 6.6vw, 5rem)/1 var(--arcade); letter-spacing: 0.03em; text-transform: uppercase; color: #f4f1e8; -webkit-text-stroke: 0.1em var(--outline); paint-order: stroke fill; text-shadow: 0 0.07em 0 rgba(0, 0, 0, 0.45); }
.p-side { padding-left: 1.6rem; border-left: 3px solid rgba(255, 204, 46, 0.55); }
.p-when { font: 600 0.82rem var(--mono); color: var(--frost-2); text-shadow: var(--ts); }
.p-step { margin-top: 1.2rem; font: 400 0.8rem var(--arcade); letter-spacing: 0.06em; color: var(--signal); -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
.p-obj { margin: 0.35rem 0 0; font: 400 1.5rem/1.05 var(--arcade); letter-spacing: 0.02em; text-transform: uppercase; color: #f4f1e8; -webkit-text-stroke: 0.14em var(--outline); paint-order: stroke fill; }
.p-text { margin: 0.5rem 0 1.3rem; font-size: 0.95rem; font-weight: 600; line-height: 1.5; color: var(--frost); max-width: 46ch; text-shadow: var(--ts); }
.p-side .stats { justify-content: flex-start; gap: 1rem 1.6rem; }
.p-side .stats b { font-size: 1.5rem; }

/* Stats (pause, death, victory) */
.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 2.2rem; }
.stats div { display: flex; flex-direction: column; align-items: flex-start; }
.stats b { font: 400 2.1rem/1 var(--arcade); font-variant-numeric: tabular-nums; color: #f4f1e8; -webkit-text-stroke: 0.12em var(--outline); paint-order: stroke fill; text-shadow: 0 0.07em 0 rgba(0, 0, 0, 0.4); }
.stats span { margin-top: 0.2rem; font-size: 0.8rem; font-weight: 600; color: var(--frost-2); text-shadow: var(--ts); }

/* Death and victory */
.screen.end { display: grid; place-items: center; padding: 2rem; text-align: center; }
.screen.dead { background: radial-gradient(ellipse at center, rgba(40, 4, 2, 0.6) 0%, rgba(8, 2, 2, 0.94) 75%); animation: fadein 1.4s ease; }
.screen.won { background: radial-gradient(ellipse at 50% 30%, rgba(30, 50, 62, 0.4) 0%, rgba(4, 8, 11, 0.92) 75%); animation: fadein 1.4s ease; }
.end-col { display: flex; flex-direction: column; align-items: center; gap: 1.3rem; max-width: 52rem; }
.end-title { margin: 0; font: 400 clamp(3.2rem, 10vw, 8.2rem)/1 var(--arcade); letter-spacing: 0.04em; text-transform: uppercase; -webkit-text-stroke: 0.1em var(--outline); paint-order: stroke fill; }
.dead .end-title { font: 400 clamp(3.2rem, 10vw, 8.2rem)/1 'Bungee', var(--display); letter-spacing: 0.04em; color: var(--flare); text-shadow: 0 0.1em 0 #160202, 0 0 3rem rgba(255, 50, 20, 0.35); }
.won .end-title { color: var(--signal); text-shadow: 0 0.07em 0 rgba(0, 0, 0, 0.45), 0 0 3rem rgba(255, 204, 46, 0.3); }
.end-text { margin: 0; max-width: 42ch; font-size: 1.1rem; font-weight: 600; line-height: 1.5; color: var(--frost); text-shadow: var(--ts); }
.end .stats { padding: 1rem 0; width: 100%; }
.end .stats div { align-items: center; }
.end-credit { margin: 0; font-size: 0.8rem; color: var(--frost-2); text-shadow: var(--ts); }

/* Controls and settings sheets */
.screen.controls, .screen.settings { display: grid; place-items: center; padding: 1.5rem; background: rgba(5, 9, 11, 0.9); }
.sheet { width: min(56rem, 100%); padding: 1.7rem 2rem 1.8rem; border-radius: 0.7rem; background: linear-gradient(180deg, var(--signal) 0 5px, transparent 5px), linear-gradient(180deg, #131b21, #0b1014); box-shadow: 0 0 0 3px var(--outline), inset 0 0 0 1.5px rgba(233, 230, 220, 0.12), 0 1rem 3rem rgba(0, 0, 0, 0.6); }
.sheet.narrow { width: min(34rem, 100%); }
.sheet-title { margin: 0 0 1.2rem; font: 400 2.3rem/1 var(--arcade); letter-spacing: 0.03em; text-transform: uppercase; color: #f4f1e8; -webkit-text-stroke: 0.1em var(--outline); paint-order: stroke fill; text-shadow: 0 0.07em 0 rgba(0, 0, 0, 0.45); }
.sheet h2 { margin: 0 0 0.6rem; font: 400 0.85rem var(--arcade); letter-spacing: 0.1em; text-transform: uppercase; color: var(--signal); -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
.sheet .menu.row { justify-content: flex-start; margin-top: 1.4rem; }
.key-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.3rem 2.4rem; }
.kr { display: grid; grid-template-columns: 11rem 1fr; align-items: center; gap: 0.8rem; padding: 0.32rem 0; font-size: 0.92rem; color: var(--frost-2); border-bottom: 1px solid rgba(233, 230, 220, 0.06); }
.kk { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; color: var(--frost-3); }
.sheet-note { margin: 1.2rem 0 0; font-size: 0.85rem; color: var(--frost-3); }
.set-group + .set-group { margin-top: 1.4rem; }
.set-row { display: grid; grid-template-columns: 1fr 13rem auto; align-items: center; gap: 1rem; min-height: 2.6rem; padding: 0.3rem 0; border-bottom: 1px solid rgba(233, 230, 220, 0.06); font-size: 0.95rem; }
.set-row label, .set-label { color: var(--frost); }
.set-label small { display: block; margin-top: 0.15rem; font-size: 0.8rem; color: var(--frost-3); }
.set-label small kbd { min-width: 1.1rem; height: 1.1rem; font-size: 0.8rem; padding: 0 0.2rem; }
.set-row:has(.toggle), .set-row:has(.stepper) { grid-template-columns: 1fr auto; }
.set-row output { font: 700 0.85rem var(--mono); min-width: 3.6rem; text-align: right; color: var(--frost-2); white-space: nowrap; }
input[type='range'] { --v: 50%; -webkit-appearance: none; appearance: none; width: 100%; height: 1.6rem; background: transparent; cursor: pointer; }
input[type='range']::-webkit-slider-runnable-track { height: 0.5rem; border-radius: 0.25rem; background: linear-gradient(90deg, var(--signal) var(--v), #05080a var(--v)); box-shadow: 0 0 0 1.5px var(--outline); }
input[type='range']::-moz-range-track { height: 4px; background: linear-gradient(90deg, var(--signal) var(--v), rgba(233, 230, 220, 0.15) var(--v)); }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 1rem; height: 1.4rem; margin-top: calc(0.25rem - 0.7rem); border: 0; border-radius: 0.25rem; background: linear-gradient(180deg, #fff, #d9d3c4); box-shadow: 0 0 0 2px var(--outline), 0 2px 3px rgba(0, 0, 0, 0.5); }
input[type='range']::-moz-range-thumb { width: 0.9rem; height: 1.3rem; background: var(--frost); border: 0; border-radius: 0; }
input[type='range']:focus-visible { outline: none; }
input[type='range']:focus-visible::-webkit-slider-thumb { background: var(--signal); }
.toggle { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.2rem; background: none; border: 0; cursor: pointer; }
.tg-track { position: relative; width: 2.7rem; height: 1.35rem; border-radius: 0.7rem; background: #05080a; box-shadow: 0 0 0 2px var(--outline), inset 0 0 0 1px rgba(233, 230, 220, 0.15); transition: background 0.15s ease; }
.tg-track i { position: absolute; left: 0.2rem; top: 0.2rem; width: 0.95rem; height: 0.95rem; border-radius: 50%; background: linear-gradient(180deg, #fff, #b9b3a4); box-shadow: 0 0 0 1.5px var(--outline); transition: transform 0.18s var(--ease), background 0.15s ease; }
.toggle[aria-checked='true'] .tg-track { background: linear-gradient(180deg, #c98508, var(--signal)); }
.toggle[aria-checked='true'] .tg-track i { transform: translateX(1.32rem); }
.tg-text { min-width: 1.8rem; font: 400 0.8rem var(--arcade); color: var(--frost); text-align: left; -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
.stepper { display: flex; align-items: center; gap: 0.3rem; }
.stepper button { width: 2rem; height: 2rem; padding: 0.45rem; border: 0; border-radius: 0.35rem; background: linear-gradient(180deg, #34424d, #141b20); box-shadow: 0 0 0 2px var(--outline), inset 0 1px 0 rgba(255, 255, 255, 0.18); cursor: pointer; }
.stepper button:hover { filter: brightness(1.25); }
.stepper output { min-width: 3.6rem; text-align: center; font: 400 0.9rem var(--arcade); color: var(--frost); }
.stepper output.radio-out { min-width: 10rem; font: 700 0.86rem var(--body); white-space: nowrap; }
/* Settings in tabs: Ljud, Bild, Kontroller, Gränssnitt. Every change shows at once. */
.sheet.set-sheet { width: min(41rem, 100%); }
.set-tabs { display: flex; flex-wrap: wrap; gap: 0.2rem; margin: -0.3rem 0 0.9rem; box-shadow: inset 0 -2px 0 rgba(233, 230, 220, 0.08); }
.set-tabs button { position: relative; padding: 0.55rem 0.85rem 0.65rem; border: 0; background: none; cursor: pointer; font: 400 0.92rem/1 var(--arcade); letter-spacing: 0.06em; text-transform: uppercase; color: var(--frost-2); -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; transition: color 0.15s ease; }
.set-tabs button:hover { color: #f4f1e8; }
.set-tabs button[aria-selected='true'] { color: var(--signal); }
.set-tabs button[aria-selected='true']::after { content: ''; position: absolute; left: 0.55rem; right: 0.55rem; bottom: 0; height: 3px; border-radius: 2px; background: var(--signal); box-shadow: 0 0 0.6rem rgba(255, 204, 46, 0.55); }
.set-tabs button:focus-visible { outline-offset: -2px; }
/* One height for every tab (the title and the tabs never jump), filled to it. */
.set-panes { height: 21.6rem; overflow-y: auto; scrollbar-width: thin; }
.set-preview { margin-top: 0.7rem; padding: 0.55rem 0.7rem 0.7rem; border-radius: 0.45rem; background: rgba(233, 230, 220, 0.035); box-shadow: inset 0 0 0 1px rgba(233, 230, 220, 0.08); }
.sp-lab { display: block; margin-bottom: 0.55rem; font: 400 0.8rem/1 var(--arcade); letter-spacing: 0.08em; text-transform: uppercase; color: var(--frost-3); }
.sp-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sp-chip { position: relative; left: auto; bottom: auto; transform: none; }
.sp-time { font: 400 1.05rem/1 var(--arcade); color: var(--signal); -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
.sp-time b { font-weight: 400; color: #f4f1e8; margin-right: 0.35rem; }
.set-pane { animation: fadein 0.18s ease; }
.seg { display: inline-flex; gap: 0.2rem; padding: 0.2rem; border-radius: 0.45rem; background: #05080a; box-shadow: 0 0 0 2px var(--outline), inset 0 0 0 1px rgba(233, 230, 220, 0.12); }
.seg button { padding: 0.42rem 0.75rem 0.38rem; border: 0; border-radius: 0.3rem; background: none; cursor: pointer; font: 400 0.8rem/1 var(--arcade); letter-spacing: 0.04em; text-transform: uppercase; color: var(--frost-2); }
.seg button:hover { color: #f4f1e8; }
.seg button[aria-checked='true'] { color: var(--signal-ink); background: linear-gradient(180deg, #fffbe2, var(--signal) 50%, #d99a10); box-shadow: 0 0 0 1.5px var(--outline); }
.set-row:has(.seg), .set-row:has(.set-btn) { grid-template-columns: 1fr auto; }
.set-btn { padding: 0.5rem 0.85rem 0.46rem; border: 0; border-radius: 0.4rem; cursor: pointer; font: 400 0.8rem/1 var(--arcade); letter-spacing: 0.05em; text-transform: uppercase; color: #f4f1e8; background: linear-gradient(180deg, #34424d, #141b20); box-shadow: 0 0 0 2px var(--outline), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.set-btn:hover { filter: brightness(1.25); }
.set-btn:disabled { opacity: 0.5; cursor: default; filter: none; }
.set-keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.4rem; margin: 0.5rem 0 0.2rem; }
.set-keys .kr { grid-template-columns: 7rem 1fr; gap: 0.6rem; min-height: 2.3rem; font-size: 0.85rem; }
.set-keys kbd { min-width: 1.4rem; height: 1.45rem; padding: 0 0.24rem; }
.set-keys .kk { flex-wrap: nowrap; gap: 0.2rem; }
.kk-ms { display: inline-flex; }
.kk-ms .mouse { width: 1.1rem; height: 1.52rem; }
.kk b { font: 700 0.8rem var(--body); color: var(--frost-2); }
@media (max-width: 640px) { .set-keys { grid-template-columns: 1fr; } }


/* ================================================================ workbench */
.screen.bench { display: grid; place-items: center; padding: 1.25rem; background: rgba(4, 7, 9, 0.76); }
.bench-panel {
  width: min(62rem, 100%); max-height: calc(100vh - 2.5rem); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden;
  border-radius: 0.7rem; background: linear-gradient(180deg, var(--signal) 0 5px, transparent 5px), linear-gradient(180deg, #131b21, #0b1014);
  box-shadow: 0 0 0 3px var(--outline), inset 0 0 0 1.5px rgba(233, 230, 220, 0.12), 0 1rem 3rem rgba(0, 0, 0, 0.6);
}
.bench-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.3rem 1.5rem 1rem; border-bottom: 1px solid var(--line); }
.bench-head h1 { margin: 0; font: 400 2.2rem/1 var(--arcade); letter-spacing: 0.03em; text-transform: uppercase; color: #f4f1e8; -webkit-text-stroke: 0.1em var(--outline); paint-order: stroke fill; text-shadow: 0 0.07em 0 rgba(0, 0, 0, 0.45); }
.bench-head p { margin: 0.45rem 0 0; font-size: 0.9rem; color: var(--frost-2); }
.bench-x { width: 2.2rem; height: 2.2rem; padding: 0.5rem; border: 0; border-radius: 0.4rem; background: linear-gradient(180deg, #34424d, #141b20); box-shadow: 0 0 0 2px var(--outline), inset 0 1px 0 rgba(255, 255, 255, 0.18); cursor: pointer; color: var(--frost); }
.bench-x:hover { filter: brightness(1.25); }
.bench-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: 0; }
.bench-list { overflow: auto; padding: 1rem 1.2rem 1.2rem 1.5rem; border-right: 1px solid var(--line); }
.bench-list h2, .bench-detail h2 { margin: 0 0 0.55rem; font: 400 0.82rem var(--arcade); letter-spacing: 0.1em; text-transform: uppercase; color: var(--signal); -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
.bench-list ul { margin: 0 0 1.1rem; padding: 0; list-style: none; display: grid; gap: 0.3rem; }
.bi { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; width: 100%; padding: 0.55rem 0.7rem; text-align: left; cursor: pointer; border: 0; border-radius: 0.4rem; background: linear-gradient(180deg, #1d272e, #12191e); box-shadow: 0 0 0 2px var(--outline), inset 0 1px 0 rgba(255, 255, 255, 0.08); transition: filter 0.12s ease, box-shadow 0.12s ease; }
.bi:hover { filter: brightness(1.2); }
.bi.sel { background: linear-gradient(180deg, #3a3416, #201c0c); box-shadow: 0 0 0 2px var(--outline), 0 0 0 4px var(--signal), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.bi-name { font-weight: 600; font-size: 0.92rem; }
.bi:not(.can):not(.done) .bi-name { color: var(--frost-2); }
.bi.done { opacity: 0.55; }
.bi.made { animation: made 0.7s ease-out; }
@keyframes made { from { background: rgba(182, 208, 110, 0.4); } }
.bi-cost { display: flex; gap: 0.3rem; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 0.2rem; height: 1.45rem; padding: 0 0.35rem 0 0.25rem; border-radius: 0.3rem; background: rgba(233, 230, 220, 0.08); box-shadow: inset 0 0 0 1px rgba(233, 230, 220, 0.12); }
.chip .ico { width: 0.95rem; height: 0.95rem; }
.chip b { font: 400 0.8rem var(--arcade); }
.chip.short { color: var(--flare); background: rgba(255, 84, 54, 0.1); }
.bi-done { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; color: var(--lichen); }
.bi-done .ico { width: 0.95rem; height: 0.95rem; }
.bench-detail { overflow: auto; padding: 1rem 1.5rem 1.2rem 1.2rem; display: flex; flex-direction: column; gap: 1.2rem; }
.stash-grid { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.3rem; }
.stash-grid li { display: grid; grid-template-columns: 1.3rem auto; grid-template-rows: auto auto; column-gap: 0.45rem; align-items: center; padding: 0.45rem 0.55rem; background: rgba(233, 230, 220, 0.04); box-shadow: inset 0 0 0 1px rgba(233, 230, 220, 0.07); }
.sg-ico { grid-row: span 2; width: 1.3rem; height: 1.3rem; color: var(--frost-2); }
.stash-grid b { font: 400 1.1rem/1 var(--arcade); color: #f4f1e8; -webkit-text-stroke: 0.14em var(--outline); paint-order: stroke fill; }
.stash-grid span:last-child { font-size: 0.8rem; color: var(--frost-3); }
.stash-grid li.none { opacity: 0.45; }
.bd { padding: 1rem 1.1rem 1.1rem; border-radius: 0.5rem; background: linear-gradient(180deg, #18212700, #0b1014), rgba(233, 230, 220, 0.03); box-shadow: 0 0 0 2px var(--outline), inset 0 0 0 1px rgba(233, 230, 220, 0.1); }
.bd-name { margin: 0; font: 400 1.35rem/1.05 var(--arcade); letter-spacing: 0.02em; text-transform: uppercase; color: #f4f1e8; -webkit-text-stroke: 0.14em var(--outline); paint-order: stroke fill; }
.bd-desc { margin: 0.35rem 0 0; font-size: 0.92rem; color: var(--frost-2); }
.bd-have { margin: 0.35rem 0 0; font: 500 0.8rem var(--mono); color: var(--baltic); }
.bd-cost { width: 100%; margin-top: 0.9rem; border-collapse: collapse; font-size: 0.88rem; }
.bd-cost th { padding: 0 0 0.35rem; font: 600 0.8rem var(--body); color: var(--frost-3); text-align: right; }
.bd-cost th:first-child { text-align: left; }
.bd-cost td { padding: 0.4rem 0; border-top: 1px solid rgba(233, 230, 220, 0.07); text-align: right; font: 700 0.85rem var(--mono); }
.bd-cost td:first-child { display: flex; align-items: center; gap: 0.45rem; text-align: left; font: 500 0.88rem var(--body); }
.ct-ico { width: 1.1rem; height: 1.1rem; color: var(--frost-2); }
.ct-st { width: 5.5rem; }
.ct-st .ico { width: 1rem; height: 1rem; margin-left: auto; color: var(--lichen); }
.bd-cost tr.short td:nth-child(3), .bd-cost tr.short .ct-st { color: var(--flare); }
.bd-cost tr.short .ct-st { font: 600 0.8rem var(--body); }
.bd-why { margin: 0.7rem 0 0; font-size: 0.85rem; color: var(--frost-2); }
.bd-go { margin-top: 1rem; min-width: 0; width: 100%; align-items: center; }
.bench-foot { display: flex; gap: 1.4rem; padding: 0.7rem 1.5rem; border-top: 1px solid var(--line); font-size: 0.8rem; color: var(--frost-3); }
.bench-foot kbd { min-width: 1.3rem; height: 1.3rem; font-size: 0.8rem; margin-right: 0.2rem; }

/* ================================================================ small screens */
@media (max-height: 760px) {
  .clock { width: 16.5rem; padding: 0.1rem 0.15rem 0; }
  .arc-wrap { margin-top: 0.25rem; }
  .arc { height: 2.6rem; }
  .pack { margin-top: 0.55rem; padding-top: 0.45rem; }
  .mm { width: 12rem; height: 12rem; }
  .car-gauge { width: 10rem; }
}
/* Short screens (a phone on its side): the bulky readouts give way. */
@media (max-height: 520px) {
  .clock .arc-wrap, .clock-note, .clock-place { display: none; }
  .clock { padding: 0.45rem 0.7rem; }
  .pack, .w-slots { display: none; }
  .mm { width: 8.5rem; height: 8.5rem; }
  .car-gauge { width: 7.5rem; }
  .msg-face { width: 3.8rem; height: 3.8rem; }
}
@media (max-width: 1180px) {
  .top-mid { width: min(30rem, calc(100vw - 2 * (var(--gutter) + 17.6rem) - 1.5rem)); }
  .obj-text { font-size: 0.86rem; }
}
@media (max-width: 900px) {
  .fullmap { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .fm-side { flex-direction: row; flex-wrap: wrap; gap: 1rem; padding-top: 0.8rem; }
  .fm-legend { grid-template-columns: repeat(3, auto); }
  .screen.pause { grid-template-columns: 1fr; }
  .key-groups { grid-template-columns: 1fr; }
  .bench-cols { grid-template-columns: 1fr; }
}
/* Phones: the corners keep their jobs, everything smaller; the objective drops under them. */
@media (max-width: 640px) {
  :root { --gutter: 0.7rem; }
  .play .kit kbd, .m-key, .m-eat kbd { display: none; }
  .meters { gap: 0.22rem; padding-right: 0; }
  .meter { height: 1.3rem; gap: 0.3rem; }
  .m-ico { width: 1.3rem; height: 1.3rem; }
  .m-bar { width: 6.4rem; height: 0.78rem; }
  .tl { gap: 0.45rem; }
  .clock { width: auto; padding: 0; }
  .clock-day { font-size: 1.1rem; }
  .clock-top { gap: 0.8rem; }
  .clock-time { font-size: 0.95rem; }
  .clock .arc-wrap, .wx { display: none; }
  .clock-note, .clock-place { margin-top: 0.2rem; font-size: 0.8rem; }
  .defence { width: 9rem; }
  .tr { gap: 0.2rem; }
  .score { font-size: 1.45rem; }
  .mult { font-size: 0.95rem; padding-top: 0.2rem; }
  .mult-chain { width: 1.8rem; }
  .hearts { gap: 0.16rem; }
  .hrt { width: 1.2rem; height: 1.1rem; }
  .stam { width: calc(5 * 1.2rem + 4 * 0.16rem); }
  .w-sil { width: 5.6rem; height: 1.8rem; }
  .w-mag { font-size: 1.2rem; }
  .w-res { font-size: 0.8rem; }
  .w-slots { display: none; }
  .ar-ico { width: 1.3rem; height: 1.3rem; }
  .ar-num { font-size: 0.95rem; }
  .notes { width: min(16rem, 80vw); }
  .note { font-size: 0.8rem; }
  .top-mid { top: calc(var(--gutter) + 10rem); width: calc(100vw - 2 * var(--gutter)); }
  .objective { padding: 0.55rem 0.8rem 0.6rem; }
  .obj-title { font-size: 1.15rem; }
  .obj-text { font-size: 0.8rem; line-height: 1.35; }
  .namepop { font-size: 1.1rem; }
  .fz-title { font-size: 1rem; }
  .fz-kills { font-size: 1.9rem; }
  .fz-time { font-size: 1.55rem; }
  .fz-row { gap: 1.1rem; }
  .left-stack { gap: 0.45rem; }
  .msg { width: calc(100vw - 2 * var(--gutter) - 9.6rem); gap: 0.55rem; padding: 0.45rem 0.6rem 0.5rem 0.45rem; }
  .msg-face { width: 3.4rem; height: 3.4rem; }
  .msg-from { font-size: 0.82rem; }
  .msg-text { font-size: 0.86rem; line-height: 1.35; }
  .kitbox { width: calc(100vw - 2 * var(--gutter) - 9.6rem); }
  .lv-row { margin-bottom: 0.4rem; }
  .sk-hint span { display: none; }
  .kit { flex-wrap: wrap; gap: 0.3rem; }
  .kit-item { height: 1.5rem; padding: 0 0.35rem 0 0.25rem; }
  .kit-gap, .kit-sep { display: none; }
  .pack { display: none; }
  .br { flex-direction: column; align-items: flex-end; gap: 0.6rem; }
  .mm { width: 8rem; height: 8rem; margin: 0 0.3rem 0.3rem 0; }
  .car { width: 9rem; padding: 0.4rem 0.6rem 0.55rem; }
  .car-gauge { width: 7rem; }
  .car-speed b { font-size: 1.6rem; }
  .car-name { font-size: 0.85rem; }
  .prompt { bottom: auto; top: 56%; max-width: calc(100vw - 2 * var(--gutter)); }
  .pr-text { font-size: 0.85rem; }
  :root { --lane: var(--gutter); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .lowhp.beat { animation: none; }
  #loading-tip { transform: none; }
}

/* ---------------------------------------------------------------- first person */
/* The sight sits in the middle; the mouse turns the view, so its cursor hides. */
body.fp .reticle { transform: translate3d(50vw, 50vh, 0) !important; }
body.fp canvas#view { cursor: none; }

/* ---------------------------------------------------------------- end-screen score board */
.board { width: min(44rem, 100%); display: flex; flex-direction: column; align-items: center; gap: 0.7rem; padding: 0.6rem 0 1.2rem; }
.board-score { display: flex; flex-direction: column; align-items: center; line-height: 1; animation: board-pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.bs-label { font: 400 1rem/1 var(--arcade); letter-spacing: 0.3em; text-transform: uppercase; color: var(--frost-2); -webkit-text-stroke: 0.16em var(--outline); paint-order: stroke fill; }
.bs-num { margin-top: 0.15rem; font: 400 clamp(3rem, 9vw, 5.2rem)/1 var(--arcade); font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff6c8 0%, #ffd23f 45%, #f08a12 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 0.06em var(--outline); filter: drop-shadow(0 0.06em 0 rgba(0, 0, 0, 0.55)) drop-shadow(0 0 1.2rem rgba(255, 190, 40, 0.35)); }
.board-rank { font: 400 1.3rem/1 var(--arcade); letter-spacing: 0.08em; text-transform: uppercase; color: var(--signal); -webkit-text-stroke: 0.15em var(--outline); paint-order: stroke fill; text-shadow: 0 0.08em 0 rgba(0, 0, 0, 0.45); animation: board-pop 0.45s 0.9s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.board-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; animation: board-pop 0.4s 1.1s ease-out both; }
.bb { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.65rem; border-radius: 0.35rem; font: 400 0.82rem/1 var(--arcade); letter-spacing: 0.04em; text-transform: uppercase; color: #fff; box-shadow: 0 0 0 2px var(--outline), inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 3px 6px rgba(0, 0, 0, 0.45); }
.bb b { font-weight: 400; color: #fff6c8; }
.bb svg { width: 1em; height: 1em; }
.bb.streak { background: linear-gradient(180deg, #5f8cff, #2c4fc4); }
.bb.boss { background: linear-gradient(180deg, #ff6a4a, #b3261a); }
.board-tiles { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; margin-top: 0.4rem; }
.bt { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 0.6rem; align-items: center; padding: 0.6rem 0.75rem; border-radius: 0.45rem;
  background: linear-gradient(180deg, rgba(18, 24, 28, 0.72), rgba(8, 12, 14, 0.82)); box-shadow: 0 0 0 2px var(--outline), inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 10px rgba(0, 0, 0, 0.4);
  animation: board-tile 0.42s calc(0.35s + var(--i) * 0.09s) cubic-bezier(0.2, 1.5, 0.45, 1) both; }
.bt-icon { grid-row: span 2; width: 1.9rem; height: 1.9rem; display: grid; place-items: center; color: var(--signal); filter: drop-shadow(0 0 1px #000) drop-shadow(0 1px 0 #000); }
.bt-icon svg { width: 100%; height: 100%; }
.bt-val { font: 400 1.7rem/1 var(--arcade); font-variant-numeric: tabular-nums; color: #f4f1e8; -webkit-text-stroke: 0.12em var(--outline); paint-order: stroke fill; text-shadow: 0 0.07em 0 rgba(0, 0, 0, 0.4); }
.bt-label { font-size: 0.8rem; font-weight: 600; color: var(--frost-2); text-shadow: var(--ts); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes board-pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes board-tile { from { opacity: 0; transform: translateY(0.6rem) scale(0.85); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .board-tiles { grid-template-columns: repeat(2, 1fr); }
  .bt-val { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  .board-score, .board-rank, .board-badges, .bt, .dawn.in *, .dawn.out { animation: none; }
}

/* ---- Together (coop.js): the lobby, who's in, the names over the others, the downed card. */
.screen.coop { display: grid; align-items: center; padding: 2rem clamp(1.5rem, 7vw, 7rem); background: linear-gradient(90deg, rgba(5, 9, 11, 0.94) 0%, rgba(5, 9, 11, 0.78) 45%, rgba(5, 9, 11, 0.2) 80%, rgba(5, 9, 11, 0) 100%); }
.co-col { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; max-width: 34rem; }
.co-title { margin: 0; font: 400 clamp(2rem, 4.4vw, 3.4rem)/1 var(--arcade); letter-spacing: 0.03em; text-transform: uppercase; color: var(--signal); -webkit-text-stroke: 0.08em var(--outline); paint-order: stroke fill; filter: drop-shadow(0 0.3rem 1rem rgba(0, 0, 0, 0.6)); }
.co-lead { margin: 0; font-size: 1.05rem; font-weight: 600; color: var(--frost); text-shadow: var(--ts); }
.co-me { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: flex-end; }
.co-field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--frost-2); }
.co-field input, .co-code-in { font: 700 1.05rem var(--body); color: var(--frost); background: #05080a; border: 0; border-radius: 0.4rem; padding: 0.6rem 0.8rem; box-shadow: 0 0 0 2px var(--outline), inset 0 0 0 1px var(--line-strong); outline: none; min-width: 13rem; }
.co-field input:focus, .co-code-in:focus { box-shadow: 0 0 0 2px var(--outline), 0 0 0 4px var(--signal); }
.co-coats { display: flex; gap: 0.5rem; }
.co-coat { width: 2.3rem; height: 2.3rem; border-radius: 50%; border: 0; cursor: pointer; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.45), transparent 45%), var(--coat); box-shadow: 0 0 0 2px var(--outline); transition: transform 0.12s var(--ease); }
.co-coat.on { box-shadow: 0 0 0 2px var(--outline), 0 0 0 4.5px var(--signal); transform: scale(1.08); }
.co-join { display: flex; gap: 0.6rem; align-items: stretch; }
.co-code-in { min-width: 0; width: 7.5rem; text-align: center; font: 400 1.6rem/1 var(--arcade); letter-spacing: 0.18em; text-transform: uppercase; }
.co-join .mbtn { min-width: 0; flex: 1; }
.co-status { min-height: 1.3em; margin: 0; font-weight: 700; color: var(--frost); text-shadow: var(--ts); }
.co-status.warn { color: #ff8a6c; }
.co-note { margin: 0; max-width: 30rem; font-size: 0.85rem; color: var(--frost-2); text-shadow: var(--ts); }
.p-coop { margin: -0.4rem 0 1rem; color: var(--frost-2); font-weight: 600; }
.p-coop b { font-family: var(--arcade); color: var(--signal); letter-spacing: 0.12em; }
.coop-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.co-roster { position: absolute; right: var(--gutter); top: calc(var(--gutter) + 9.6rem); min-width: 11rem; padding: 0.5rem 0.7rem; border-radius: 0.45rem; background: var(--panel); box-shadow: 0 0 0 2px var(--outline); font-size: 0.8rem; color: var(--frost); }
.co-roster.in-column { position: static; margin-top: 0.7rem; align-self: flex-end; pointer-events: none; }
.co-roster.hidden, .co-down.hidden { display: none; }
.co-r-head { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.3rem; color: var(--frost-2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.68rem; }
.co-r-head b { font: 400 0.95rem/1 var(--arcade); letter-spacing: 0.14em; color: var(--signal); }
.co-r-head small { margin-left: auto; }
.co-roster ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.co-roster li { display: flex; align-items: center; gap: 0.45rem; }
.co-roster li.me span { font-weight: 800; }
.co-roster li.down span { color: #ff8a6c; }
.co-roster li small { margin-left: auto; color: var(--frost-3); font: 600 0.7rem var(--mono); }
.co-roster i, .co-tag i { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--coat); box-shadow: 0 0 0 1.5px var(--outline); flex: none; }
.co-r-note { margin: 0.35rem 0 0; font-size: 0.68rem; color: var(--frost-3); }
.co-tags { position: absolute; inset: 0; }
.co-tag { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.5rem; border-radius: 1rem; background: rgba(7, 11, 14, 0.72); box-shadow: 0 0 0 1.5px var(--outline); font: 700 0.78rem var(--body); color: var(--frost); white-space: nowrap; will-change: transform; }
.co-tag.down { background: rgba(120, 14, 8, 0.82); }
.co-tag b { color: #ffd0c4; font-size: 0.7rem; letter-spacing: 0.06em; }
.co-down { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0.9rem 1.6rem; border-radius: 0.6rem; background: rgba(60, 6, 4, 0.78); box-shadow: 0 0 0 2.5px var(--outline), 0 0.8rem 2rem rgba(0, 0, 0, 0.5); text-align: center; animation: fadein 0.4s ease; }
.co-down b { font: 400 2.2rem/1 var(--arcade); text-transform: uppercase; color: #ffd8cc; -webkit-text-stroke: 0.08em var(--outline); paint-order: stroke fill; }
.co-down span { font-weight: 700; color: var(--frost); }
