:root {
    /* Salvage: rust and oxide, not the Original's dusty gold */
    --ink: #f2e2d2;
    --ink-dim: #b89e8a;
    --panel: rgba(24, 14, 10, 0.88);
    --panel-2: rgba(46, 24, 16, 0.94);
    --line: rgba(242, 214, 190, 0.14);
    --accent: #d8642a;
    --accent-2: #f2a466;
    --good: #7fd36a;
    --bad: #ff5a42;
    --blue: #6ac8ff;
    --font: "Bahnschrift", "Segoe UI", system-ui, sans-serif;
    --display: "Bahnschrift Condensed", "Impact", "Haettenschweiler", "Arial Narrow", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #120e0a; color: var(--ink); font-family: var(--font); user-select: none; }
#app, #app canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
/* a HUD part a first run hasn't been told about yet: it fades in when it is (hud.js) */
.later { opacity: 0 !important; visibility: hidden; }
#h-press-wrap, #h-weapons, #h-threat { transition: opacity 0.8s; }

/* ---------------- HUD ---------------- */
#hud { position: fixed; inset: 0; pointer-events: none; text-shadow: 0 1px 2px #000, 0 0 6px rgba(0,0,0,.6); }
.hud-tl { position: absolute; left: 18px; top: 16px; width: 360px; }
/* the hull: big, labelled, colour-coded; a hit flashes and shakes it, a pale chip trails the loss */
.hull { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.hull-lbl { font-family: var(--display); font-size: 20px; letter-spacing: 2px; color: #cfe8a8; width: 54px; }
.hull .bar.hp { flex: 1; height: 30px; margin: 0; border-width: 2px; border-color: rgba(200,240,170,.5); }
.hull .bar.hp span { font-size: 15px; letter-spacing: 1px; }
.hull .bar .fill.chip { background: rgba(255,240,200,.85); transition: none; }
.hull.mid .hull-lbl { color: #ffd060; }
.hull.mid .bar.hp { border-color: rgba(255,210,100,.6); }
.hull.mid .bar.hp .fill:not(.shield):not(.chip) { background: linear-gradient(#ffd060, #c88a1a); }
.hull.crit .hull-lbl { color: #ff5a3a; animation: blink .7s infinite; }
.hull.crit .bar.hp { border-color: #ff4a2a; box-shadow: 0 0 12px rgba(255,60,30,.7); animation: critglow .8s ease-in-out infinite; }
.hull.hit .bar.hp { animation: hullhit .3s; }
.hull.hit .bar.hp::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.55); animation: hitflash .3s forwards; }
@keyframes hullhit { 0% { transform: translateX(0); } 20% { transform: translateX(-5px); } 45% { transform: translateX(4px); } 70% { transform: translateX(-2px); } 100% { transform: translateX(0); } }
@keyframes hitflash { to { opacity: 0; } }
@keyframes critglow { 0%, 100% { box-shadow: 0 0 6px rgba(255,60,30,.5); } 50% { box-shadow: 0 0 18px rgba(255,60,30,.95); } }
.hull-warn { display: none; margin: -2px 0 6px 62px; font-size: 12px; font-weight: 800; letter-spacing: 1.5px; color: #ff6a4a; animation: blink .9s infinite; }
.hull-warn.show { display: block; }
#hud:has(.hull.crit) .vignette { animation: critvig 1.4s ease-in-out infinite; }
@keyframes critvig { 0%, 100% { opacity: .15; } 50% { opacity: .45; } }
.veh-name { font-family: var(--display); font-size: 22px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.bar { position: relative; height: 20px; background: rgba(0,0,0,.55); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: linear-gradient(#e85a3a, #a8301c); transition: width .12s; }
.bar.hp .fill { background: linear-gradient(#8fe06a, #3f9a2c); }
.bar.hp.low .fill:not(.shield):not(.chip) { background: linear-gradient(#ff6a4a, #b0261a); }
.bar .fill.shield { background: linear-gradient(rgba(120,210,255,.85), rgba(60,140,230,.85)); width: 0; }
.bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; letter-spacing: .5px; }
.bar.nitro { height: 12px; }
.bar.nitro .fill { background: linear-gradient(#7fd8ff, #2a7ac8); }
.bar.nitro span { font-size: 9px; }
.bar.ability { height: 16px; width: 200px; }
.bar.ability .fill { background: linear-gradient(#8a7a5a, #5a4a32); transition: none; }
.bar.ability.ready .fill { background: linear-gradient(#ffd060, #d08a20); }
.bar.ability.ready { box-shadow: 0 0 8px rgba(255,190,80,.55); }
.bar.ability span { font-size: 10px; }

.hud-tc { position: absolute; left: 50%; top: 24px; transform: translateX(-50%); text-align: center; }
.time { font-family: var(--display); font-size: 34px; line-height: 1; }
.threat { font-size: 12px; letter-spacing: 2px; color: var(--accent-2); margin-top: 2px; }
.compass { margin-top: 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; letter-spacing: 1px; color: #9ff09a; }
.compass .arrow { width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 22px solid #9ff09a; filter: drop-shadow(0 0 4px #000); }
.compass.boss { color: #ff5a3a; }
.compass.target { color: #ffd060; }
.compass.target .arrow { border-bottom-color: #ffd060; }
.compass.boss .arrow { border-bottom-color: #ff3a2a; }
.compass.bossrun { animation: bossrun 0.34s ease-in-out infinite alternate; }
@keyframes bossrun { from { transform: scale(1); filter: none; } to { transform: scale(1.22); filter: drop-shadow(0 0 8px #ff3a2a); } }

.hud-tr { position: absolute; right: 18px; top: 14px; text-align: right; }
.money { font-family: var(--display); font-size: 38px; color: var(--accent-2); line-height: 1; }
.money.bump { animation: bump .25s; }
.bank { font-size: 12px; color: var(--ink-dim); letter-spacing: .3px; margin-top: 2px; }
.bank b { color: var(--accent-2); }
.bank.bump { animation: bump .25s; }
.kills .scrap { color: var(--accent-2); }
@keyframes bump { 50% { transform: scale(1.12); } }
.kills, .dist { font-size: 13px; color: var(--ink-dim); letter-spacing: 1px; }
/* what Haven asked for today, under the load line; the Radio's signals under the compass */
.req { margin-top: 6px; font-size: 12px; letter-spacing: 1px; color: var(--ink); max-width: 330px; margin-left: auto; padding: 3px 8px; border-right: 3px solid var(--accent-2); background: linear-gradient(270deg, rgba(20,14,8,.55), rgba(20,14,8,0)); }
.req .lab { color: var(--accent-2); font-size: 10px; letter-spacing: 2px; }
.req b { color: #ffd890; }
.req.met { border-right-color: #7fd36a; }
.req.met b { color: #9ff09a; }
.radio { margin-top: 6px; font-size: 11px; letter-spacing: 1px; color: #8fdcff; text-shadow: 0 1px 3px #000; }
.radio div { line-height: 1.5; }
.radio i { font-style: normal; margin-right: 5px; filter: saturate(.6); }

/* progress to Haven, along the top */
.progress { position: absolute; left: 50%; top: 7px; transform: translateX(-50%); width: min(560px, 46vw); height: 8px; }
.progress .track { position: absolute; inset: 0; border-radius: 4px; border: 1px solid rgba(0,0,0,.6); box-shadow: 0 1px 4px rgba(0,0,0,.6); opacity: .9; }
.progress .fin { position: absolute; top: 0; bottom: 0; right: 0; width: 9.4%; border-radius: 0 4px 4px 0; background: repeating-linear-gradient(135deg, rgba(200,40,20,.85) 0 4px, rgba(90,10,6,.85) 4px 8px); }
.progress .car { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--accent-2); border: 2px solid #2a1a08; box-shadow: 0 0 6px rgba(255,200,90,.8); }
.progress .gtick { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1.5px; background: #9ff09a; border-radius: 1px; box-shadow: 0 0 4px #000; }
.progress .flag { position: absolute; right: -4px; top: 11px; font-family: var(--display); font-size: 11px; letter-spacing: 1px; color: #ffd890; }
.progress .pkm { position: absolute; left: 0; top: 11px; font-size: 10px; letter-spacing: 1px; color: var(--ink-dim); }

/* fuel gauge, bottom centre */
.hud-bc { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; gap: 14px; align-items: flex-end; text-align: center; filter: drop-shadow(0 2px 4px rgba(0,0,0,.7)); }
.hud-bc .gauge { position: relative; }
.hud-bc svg { display: block; }
.hud-bc .g-arc { fill: none; stroke: rgba(0,0,0,.55); stroke-width: 12; }
.hud-bc .g-red { fill: none; stroke: #c8442c; stroke-width: 12; }
.hud-bc .g-ticks line { stroke: var(--ink); stroke-width: 2.5; }
.hud-bc .g-lbl { fill: var(--ink); font: 700 13px var(--font); }
.hud-bc .g-name { fill: var(--ink-dim); font: 700 9px var(--font); letter-spacing: 2px; }
.hud-bc .g-needle { stroke: #ff8a3a; stroke-width: 3.5; stroke-linecap: round; transform-origin: 80px 80px; transition: transform .25s; }
.hud-bc .g-cap { fill: #2a2622; stroke: #ff8a3a; stroke-width: 2; }
.hud-bc .g-txt { margin-top: -4px; font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--ink-dim); }
.hud-bc .gauge.low .g-red { animation: blink .6s infinite; }
.hud-bc .gauge.low .g-txt { color: #ff7a5a; }
/* ability pressure gauge: the arc fills amber to red, MAX lights up red when it is ready */
.hud-bc .g-fillarc { fill: none; stroke: #e0a040; stroke-width: 8; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .2s; }
.hud-bc .press .g-needle { stroke: #ffd060; }
.hud-bc .press .g-cap { stroke: #ffd060; }
.hud-bc .g-max { height: 20px; font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: 4px; line-height: 20px; color: #ff3a24; visibility: hidden; text-shadow: 0 0 8px rgba(255,40,20,.8), 0 1px 2px #000; }
.hud-bc .press.max .g-max { visibility: visible; animation: blink .9s infinite; }
.hud-bc .press.max .g-fillarc { stroke: #ff4a2a; }
.hud-bc .press.max .g-needle { stroke: #ff4a2a; animation: needlebuzz .12s infinite; }
.hud-bc .press.max .g-cap { stroke: #ff4a2a; }
.hud-bc .press.max .g-txt { color: #ffd8a0; }
@keyframes needlebuzz { 0%, 100% { transform: rotate(90deg); } 50% { transform: rotate(87deg); } }
.hud-bc .gauge:not(.press) .g-max { display: none; }

.hud-bl { position: absolute; left: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 4px; }
.wslot { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.45); border: 1px solid var(--line); border-radius: 3px; padding: 4px 8px; font-size: 13px; min-width: 250px; }
.wslot .key { color: var(--ink-dim); font-size: 11px; width: 14px; }
.wslot .nm { flex: 1; }
.wslot .lv { color: var(--accent-2); font-size: 11px; }
.wslot.empty { color: var(--ink-dim); font-style: italic; }
.wslot.crew { border-color: rgba(106,200,255,.3); }
.wslot.crew .key { color: var(--blue); }
.gearline { font-size: 11px; color: var(--ink-dim); margin-top: 2px; max-width: 360px; }

.hud-br { position: absolute; right: 18px; bottom: 16px; text-align: right; }
#h-map { display: block; margin: 0 0 6px auto; width: 180px; height: 180px; border-radius: 50%; box-shadow: 0 4px 18px rgba(0,0,0,.55); }
.status { display: flex; gap: 6px; justify-content: flex-end; font-size: 11px; font-weight: 700; letter-spacing: 1px; min-height: 18px; }
.status span { padding: 2px 7px; border-radius: 2px; }
.surf { background: rgba(0,0,0,.5); color: var(--ink-dim); }
.surf.dirt { color: #d8b880; }
.surf.mud { color: #1a1208; background: #8a6a3a; }
.surf.water { color: #0a1a22; background: #6ab0d0; }
.surf.snow { color: #1a2028; background: #e8eef2; }
.surf.air { color: #1a1208; background: var(--accent-2); }
.status .warn { background: #c8442c; color: #fff; animation: blink 1s infinite; }
.status .warn.tip { background: #ff6a20; font-size: 1.15em; animation: blink 0.25s infinite; }
.status .warn.tow { background: #3a5a2a; animation: none; }
@keyframes blink { 50% { opacity: .55; } }
.speed { font-family: var(--display); font-size: 44px; line-height: 1; }
.speed small { font-size: 14px; margin-left: 4px; color: var(--ink-dim); }

.boss { position: absolute; left: 50%; top: 132px; transform: translateX(-50%); width: min(520px, 70vw); text-align: center; }
.boss .name { font-family: var(--display); font-size: 18px; letter-spacing: 3px; color: #ff8a6a; }
.boss .bar { height: 12px; }
.boss .bar .fill { background: linear-gradient(#ff5a3a, #8a1a10); }

/* up in the sky above the road ahead (where the tip box goes: they never show together), not over the stretch the monsters
   come down; under the Behemoth's bar while one is loose */
.announce { position: absolute; left: 0; right: 0; top: clamp(148px, 17%, 220px); text-align: center; text-shadow: 0 2px 12px rgba(0,0,0,.7); font-family: var(--display); font-size: 56px; letter-spacing: 4px; opacity: 0; transition: opacity .3s; }
.announce.show { opacity: 1; }
body:has(#h-boss:not(.hidden)) .announce { top: clamp(184px, 20%, 240px); }
.announce small { display: block; font-family: var(--font); font-size: 16px; letter-spacing: 2px; color: var(--ink-dim); }
.announce.danger { color: #ff7a5a; }
.announce.good { color: #a8f08a; }

.vignette { position: absolute; inset: 0; box-shadow: inset 0 0 160px 40px rgba(220, 20, 10, 0.85); opacity: 0; transition: opacity .08s; }

#floaters { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.floater { position: absolute; left: 0; top: 0; font-weight: 700; font-size: 14px; color: var(--accent-2); text-shadow: 0 1px 2px #000; white-space: nowrap; will-change: transform, opacity; }
.floater.big { font-size: 24px; color: #fff0a0; }
.floater.bad { color: #ff7a5a; }
.floater.info { color: #bfe8ff; font-size: 13px; }

/* ---------------- Screens ---------------- */
#screens { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.screen { position: absolute; inset: 0; pointer-events: auto; display: flex; align-items: center; justify-content: center; }
.screen.dim { background: radial-gradient(ellipse at center, rgba(10,8,6,.55), rgba(10,8,6,.88)); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 22px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.6); max-height: 92vh; overflow: auto; }
h1.title { font-family: var(--display); font-size: clamp(54px, 9vw, 108px); letter-spacing: 6px; margin: 0; line-height: .9; color: var(--accent-2); text-shadow: 0 4px 0 #6a3a10, 0 10px 30px rgba(0,0,0,.8); }
.subtitle { letter-spacing: 3px; color: var(--ink-dim); margin: 10px 0 26px; font-size: 14px; }
.menu-wrap { text-align: center; }
.menu-col { display: flex; flex-direction: column; gap: 10px; align-items: center; }
button { font-family: var(--font); font-size: 15px; font-weight: 700; letter-spacing: 1px; color: #1a1208; background: var(--accent); border: 0; border-radius: 4px; padding: 10px 18px; cursor: pointer; transition: transform .06s, background .12s; }
button:hover:not(:disabled) { background: var(--accent-2); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { background: #4a443c; color: #8a8274; cursor: not-allowed; }
button.big { font-size: 20px; padding: 14px 40px; min-width: 260px; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.ghost:hover:not(:disabled) { background: rgba(255,255,255,.08); }
button.sm { font-size: 12px; padding: 5px 9px; }
button.danger { background: #c8442c; color: #fff; }
/* confirmation dialog over a screen */
.confirm { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background: rgba(8,6,4,.72); }
.confirm-box { max-width: 460px; border-color: #c8442c; box-shadow: 0 0 30px rgba(200,68,44,.35); }
.confirm-box h2 { font-family: var(--display); font-size: 28px; letter-spacing: 2px; margin: 0 0 10px; color: #ff7a5a; }
.confirm-text { font-size: 14px; line-height: 1.45; color: var(--ink); }
.confirm-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.mode-pick { display: flex; gap: 10px; margin: 6px 0 4px; }
.mode-card { width: 220px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 5px; background: rgba(0,0,0,.35); cursor: pointer; }
.mode-card.sel { border-color: var(--accent); background: rgba(240,160,48,.14); }
.mode-card b { display: block; font-size: 15px; margin-bottom: 4px; color: var(--accent-2); }
.mode-card span { font-size: 12px; color: var(--ink-dim); line-height: 1.35; }
.scrap { color: #9fd6ff; font-weight: 700; }
.controls { display: grid; grid-template-columns: auto auto; gap: 6px 22px; font-size: 14px; text-align: left; }
.controls .bind { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.controls kbd { display: inline-block; min-width: 22px; text-align: center; padding: 2px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; background: rgba(255,255,255,.06); font-family: var(--font); font-size: 12px; }
.stats-grid { display: grid; grid-template-columns: auto auto; gap: 6px 30px; font-size: 16px; margin: 16px 0; text-align: left; }
.stats-grid b { color: var(--accent-2); text-align: right; }
/* daily road / shared road */
.road-card { display: flex; align-items: center; gap: 14px; width: min(520px, 92vw); box-sizing: border-box; padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; background: rgba(0,0,0,.35); text-align: left; }
.road-card.link { border-color: var(--accent); background: rgba(240,160,48,.14); }
.road-card .info { flex: 1; font-size: 12px; color: var(--ink-dim); line-height: 1.4; }
.road-card .info b { display: block; font-size: 15px; letter-spacing: 1px; color: var(--accent-2); margin-bottom: 2px; }
.road-line { font-size: 13px; color: var(--ink-dim); margin: 6px 0 -4px; }
.road-line button { margin-left: 6px; }
.over-title { font-family: var(--display); font-size: 64px; letter-spacing: 4px; color: #ff6a4a; margin: 0; }

/* perks */
.perk-list { display: flex; flex-direction: column; gap: 8px; min-width: 460px; margin: 14px 0; }
.perk { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; background: rgba(0,0,0,.3); text-align: left; }
.perk .info { flex: 1; }
.perk .info b { display: block; }
.perk .info span { font-size: 12px; color: var(--ink-dim); }
.pips { display: flex; gap: 3px; }
.pip { width: 10px; height: 10px; border-radius: 2px; background: rgba(255,255,255,.12); }
.pip.on { background: var(--accent); }

/* ---------------- Shop ---------------- */
.shop { width: min(1180px, 96vw); height: min(760px, 94vh); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.shop header { display: flex; align-items: center; gap: 18px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.shop header h1 { font-family: var(--display); font-size: 34px; letter-spacing: 3px; margin: 0; color: var(--accent-2); }
.shop header .cash { font-family: var(--display); font-size: 32px; color: var(--accent-2); margin-left: auto; }
.shop header .note { font-size: 12px; color: var(--good); }
.shop .cols { flex: 1; display: grid; grid-template-columns: 400px 1fr; min-height: 0; }
.shop section { overflow: auto; padding: 14px 18px; }
.shop section.loadout { border-right: 1px solid var(--line); background: rgba(0,0,0,.18); }
.shop h2 { font-family: var(--display); font-size: 24px; letter-spacing: 1px; margin: 0 0 6px; }
.shop h3 { font-size: 12px; letter-spacing: 2px; color: var(--ink-dim); margin: 16px 0 6px; text-transform: uppercase; font-weight: 600; }
.vstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 10px; font-size: 12px; color: var(--ink-dim); margin: 6px 0 8px; }
.vstats b { color: var(--ink); }
.row { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 4px; margin-bottom: 5px; background: rgba(0,0,0,.25); font-size: 13px; }
/* the name and stats keep ~190px; when the buttons would squeeze them, the buttons drop to a line of their own */
.row { flex-wrap: wrap; }
.row .nm { flex: 1 1 190px; min-width: 0; }
.row .nm small { display: block; color: var(--ink-dim); font-size: 11px; }
.row.empty { color: var(--ink-dim); font-style: italic; }
.tag { font-size: 9px; letter-spacing: 1px; font-weight: 700; padding: 2px 5px; border-radius: 2px; background: #6a4a1a; color: #ffd890; margin-right: 4px; vertical-align: 1px; }
.tag.main { background: #a8301c; color: #fff; }
.tag.gear { background: #2a5a7a; color: #cfe8ff; }
.tag.def { background: #3a6a3a; color: #d8ffd0; }
.tag.crew { background: #24506a; color: #bfe8ff; }
.tag.new { background: #ffd040; color: #2a1604; margin-left: 6px; }
.tag.lock { background: #3a3632; color: #a89c88; margin-left: 6px; }
.card.locked { opacity: .55; }
.card.fresh { border-color: #ffd040; box-shadow: 0 0 10px rgba(255,208,64,.35); }
.hint-line.lockline { color: #c8b890; font-weight: 700; }
.newnote { color: #ffd040; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.tabs button.on { background: var(--accent); color: #1a1208; border-color: var(--accent); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.card { border: 1px solid var(--line); border-radius: 5px; padding: 12px; background: rgba(0,0,0,.3); display: flex; flex-direction: column; gap: 6px; }
.card .ttl { font-weight: 700; font-size: 16px; }
.card .desc { font-size: 12px; color: var(--ink-dim); line-height: 1.35; flex: 1; }
.card .st { font-size: 11px; color: var(--ink); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.card .st span b { color: var(--accent-2); }
.card .why { font-size: 11px; color: var(--bad); min-height: 14px; }
.card .why.note { color: var(--ink-dim); }
.tag.best { background: #5ad06a; color: #0e2410; }
.card.best { border-color: #5ad06a; box-shadow: 0 0 0 1px #5ad06a55 inset; }
/* one bar for how hard a gun hits, and a word on what it's for (the numbers are on hover) */
.card .pow { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-dim); }
.card .pow i { flex: 1; height: 6px; background: #ffffff14; border-radius: 3px; overflow: hidden; }
.card .pow i b { display: block; height: 100%; background: var(--accent-2); border-radius: 3px; }
.card .pow em { font-style: normal; color: var(--ink); white-space: nowrap; }
.card.veh { flex-direction: row; gap: 12px; }
.card.veh .vbody { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.card.cur { border-color: var(--good); }
.card.sold { opacity: .45; }
.reroll { margin-top: 12px; display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--ink-dim); }
.price { font-variant-numeric: tabular-nums; }
.hpbar { height: 10px; background: rgba(0,0,0,.5); border-radius: 2px; overflow: hidden; margin: 4px 0 8px; border: 1px solid var(--line); }
.hpbar div { height: 100%; background: linear-gradient(#8fe06a, #3f9a2c); }
.svc { display: flex; gap: 6px; flex-wrap: wrap; }
.gpu-warn { max-width: 520px; padding: 10px 14px; margin: -4px 0 6px; border: 1px solid #c8442c; border-radius: 6px; background: rgba(120,30,16,.55); color: #ffd8c8; font-size: 13px; line-height: 1.45; text-align: left; }
.gpu-warn b { color: #fff; }
.hint-line { font-size: 12px; color: var(--ink-dim); margin-top: 6px; line-height: 1.4; }

/* ram combo */
.combo { position: absolute; right: 22px; top: 42%; text-align: right; }
.combo .cn { font-family: var(--display); font-size: 64px; line-height: .9; color: #ff9a4a; text-shadow: 0 2px 0 #5a1a08, 0 0 18px rgba(255,120,40,.5); }
.combo .cn.bump { animation: bump .2s; }
.combo .cl { font-size: 12px; letter-spacing: 2px; color: var(--ink); margin-top: 2px; }
.combo .cl span { color: var(--accent-2); margin-left: 6px; }
.combo .cbar { width: 170px; height: 4px; margin: 6px 0 0 auto; background: rgba(0,0,0,.5); border-radius: 2px; overflow: hidden; }
.combo .cbar div { height: 100%; background: linear-gradient(90deg, #ff5a2a, #ffcf6a); }
.combo .ctags { font-size: 13px; font-weight: 700; letter-spacing: 2px; color: #bfe8ff; margin-top: 4px; min-height: 16px; }

/* settings */
.settings .set-h { font-size: 11px; letter-spacing: 2px; color: var(--ink-dim); margin: 14px 0 6px; text-transform: uppercase; font-weight: 600; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 5px 0; font-size: 14px; }
.set-row > span:first-child { width: 150px; color: var(--ink); }
.set-row input[type=range] { flex: 1; accent-color: var(--accent); }
.set-row b { width: 46px; text-align: right; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.set-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }

/* gamepad focus ring */
.pad-focus { outline: 3px solid var(--accent-2) !important; outline-offset: 3px; box-shadow: 0 0 18px rgba(255,207,106,.45); }

#fps { position: fixed; right: 210px; bottom: 6px; font: 600 11px var(--font); color: #9ff09a; background: rgba(0,0,0,.5); padding: 2px 8px; border-radius: 3px; z-index: 30; pointer-events: none; }
.hpbar.fuelbar div { background: linear-gradient(#e8b040, #a87018); }
.bar.fuel { height: 14px; }
.bar.fuel .fill { background: linear-gradient(#e8b040, #a87018); }
.bar.fuel.low .fill { background: linear-gradient(#ff6a3a, #a8261a); animation: blink 0.8s infinite; }
.bar.fuel span { font-size: 10px; }
.evhint { position: absolute; left: 50%; bottom: 124px; transform: translateX(-50%); font-size: 15px; font-weight: 700; letter-spacing: 1px; color: #ffe8b0; background: rgba(0,0,0,.45); padding: 6px 14px; border-radius: 3px; opacity: 0; transition: opacity .2s; white-space: nowrap; }
.evhint.show { opacity: 1; }
.tipbox { position: absolute; left: 50%; top: 150px; transform: translate(-50%, -8px); width: max-content; max-width: min(720px, 92vw); display: flex; gap: 14px; align-items: flex-start; font-size: 21px; line-height: 1.3; font-weight: 600; color: #f2e6cc; background: rgba(12,9,6,.78); border: 1px solid rgba(255,190,90,.45); border-left: 4px solid #ffb040; padding: 11px 18px; border-radius: 3px; opacity: 0; transition: opacity .3s, transform .3s; }
.tipbox b { color: #ffb040; font-family: var(--display); font-size: 24px; line-height: 1.15; letter-spacing: 1px; white-space: nowrap; }
.tipbox.show { opacity: 1; transform: translate(-50%, 0); }
/* a warning another driver left on their wreck (world/playerWrecks.js); click or tap appreciates it */
.warnbox { position: absolute; left: 50%; top: 214px; transform: translate(-50%, -8px); max-width: 520px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #e8f2f8; background: rgba(8,12,16,.8); border: 1px solid rgba(150,210,255,.35); border-left: 3px solid #8fd0ff; padding: 7px 16px; border-radius: 3px; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; cursor: pointer; }
.warnbox b { font-family: var(--display); font-size: 20px; letter-spacing: 1px; color: #cfe9ff; }
.warnbox span { font-size: 12px; color: #9fb6c6; letter-spacing: .5px; }
.warnbox.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.warnbox.done span { color: #8fd0ff; }
/* the warning composer on a daily's death screen: its own framed panel in the warning blue */
.warn-row { margin: 14px auto 10px; max-width: 540px; padding: 12px 18px 16px; border: 1px solid rgba(143,208,255,.6); border-radius: 6px; background: linear-gradient(rgba(34,66,96,.55), rgba(12,22,34,.55)); box-shadow: 0 0 22px rgba(143,208,255,.16), inset 0 0 18px rgba(143,208,255,.1); }
.warn-head { font-family: var(--display); font-size: 15px; letter-spacing: 2px; text-transform: uppercase; color: #8fd0ff; }
.warn-text { font-family: var(--display); font-size: 30px; letter-spacing: 1px; color: #eef8ff; margin: 6px 0 12px; text-shadow: 0 0 14px rgba(143,208,255,.5); }
.warn-ctl { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.warn-pick { display: flex; align-items: center; gap: 10px; }
.warn-pick span { font-size: 14px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: #cfe9ff; min-width: 62px; }
button.warn-arrow, button.warn-leave { background: #8fd0ff; color: #0b1620; }
button.warn-arrow:hover:not(:disabled), button.warn-leave:hover:not(:disabled) { background: #c2e7ff; }
button.warn-arrow { font-size: 20px; line-height: 1; padding: 11px 17px; min-width: 54px; }
button.warn-leave { font-size: 17px; padding: 12px 30px; }
.status .crew { background: #2a5a7a; color: #cfe8ff; }
.card.mod { border-color: rgba(127,211,106,.45); background: rgba(60,100,50,.18); }
.cards.mods { margin-bottom: 6px; }
.st .topheavy b { color: #ff8a50; }
.dist .haven { color: #ffd070; }
.diff-row { display: flex; gap: 8px; justify-content: center; }
.diff-row button.on { outline: 2px solid #ffd070; }
.won-title { font-family: var(--display); font-size: 52px; letter-spacing: 4px; color: #ffd070; margin: 0 0 6px; text-shadow: 0 0 18px rgba(255,190,80,.6); }
/* the barrel-step upgrade and an affordable vehicle: bright and pulsing, never mistaken for disabled */
.row button[data-tier]:not([disabled]) { background: linear-gradient(#ffe070, #ffb020); color: #2a1604; border-color: #fff0a0; animation: glowpulse 1.4s ease-in-out infinite; }
.row button[data-tier][disabled] { opacity: .45; }
/* the tab glows only when something there is affordable; just unlocked but too dear: a quiet tag */
.tabs button .tab-new { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; opacity: .7; margin-left: 4px; }
.tabs button.glow { background: linear-gradient(#ffe070, #ffb020); color: #2a1604; border-color: #fff0a0; animation: glowpulse 1.4s ease-in-out infinite; }
/* end-of-run scrap card and the glowing Workshop buttons */
.ws-card { margin: 4px 0 16px; padding: 12px 14px; border: 1px solid #3a5a70; border-radius: 6px; background: rgba(20,40,56,.55); text-align: left; }
.ws-card.ready { border-color: #9fd6ff; box-shadow: 0 0 18px rgba(120,200,255,.25); }
.ws-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--display); font-size: 20px; letter-spacing: 2px; color: #cfe8ff; }
.ws-head b { font-size: 30px; }
.ws-sub { font-size: 12px; color: var(--ink-dim); margin: 2px 0 8px; line-height: 1.4; }
.ws-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid rgba(159,214,255,.15); }
.ws-info { flex: 1; }
.ws-info small { display: block; font-size: 12px; color: var(--ink-dim); }
.ws-lv { font-size: 12px; color: #9fd6ff; }
.ws-next { font-size: 14px; }
.ws-next small { display: block; font-size: 12px; color: var(--ink-dim); margin-top: 4px; }
.ws-bar { height: 8px; margin-top: 6px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.ws-bar div { height: 100%; background: linear-gradient(90deg, #4a90c0, #9fd6ff); }
button.ws-buy, button.ws-glow { background: linear-gradient(#c8ecff, #6ab8f0); color: #08202e; border: 1px solid #e0f4ff; animation: scrappulse 1.4s ease-in-out infinite; }
@keyframes scrappulse { 0%, 100% { box-shadow: 0 0 6px 1px rgba(120,200,255,.5); } 50% { box-shadow: 0 0 16px 4px rgba(150,215,255,.9); } }
button.ws-glow .scrap { color: #08202e; }
@keyframes glowpulse { 0%, 100% { box-shadow: 0 0 6px 1px rgba(255,200,60,.55); } 50% { box-shadow: 0 0 16px 4px rgba(255,210,80,.95); } }
.wslot .click { color: #ffa040; font-size: 0.85em; margin-left: 4px; }

/* ---------------- loading screen (shader warm-up) ---------------- */
#loading { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 12vh; gap: 14px; background: #120e0a; transition: opacity .5s; overflow: hidden; }
/* the intro clip (assets/intro.mp4, see index.html), darkened toward the title at the bottom */
#loading .ld-shots { position: absolute; inset: 0; background: #120e0a center / cover no-repeat url(assets/intro.jpg); }
#loading .ld-shots video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#loading .ld-shots::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(10,8,6,.25), rgba(10,8,6,.15) 45%, rgba(10,8,6,.88)); }
#loading #ld-cap { position: absolute; left: 6%; bottom: 7%; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink); text-shadow: 0 1px 4px #000; z-index: 1; opacity: 0; transition: opacity .4s; }
#loading #ld-cap.on { opacity: 1; }
#loading .ld-skip { position: absolute; right: 6%; bottom: 7%; z-index: 2; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-dim); text-shadow: 0 1px 4px #000; opacity: 0; transition: opacity .4s; }
#loading .ld-skip.on { opacity: 1; animation: ld-pulse 1.6s ease-in-out .4s infinite; }
@keyframes ld-pulse { 50% { opacity: .45; } }
#loading .ld-title, #loading .ld-sub, #loading .ld-bar { position: relative; z-index: 2; }
#loading.done { opacity: 0; pointer-events: none; }
#loading .ld-title { font-family: var(--display); font-size: clamp(48px, 8vw, 96px); letter-spacing: 6px; line-height: .9; color: var(--accent-2); text-shadow: 0 4px 0 #6a3a10, 0 10px 30px rgba(0,0,0,.8); }
/* (under the bar: what's loading, index.html dmLoad; one line high whatever it says, so the bar never moves) */
#loading .ld-sub { min-height: 1.4em; max-width: 90vw; font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--ink-dim); text-align: center; text-shadow: 0 1px 4px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) { #loading .ld-sub { font-size: 11px; letter-spacing: 2px; } }
#loading .ld-bar { position: relative; width: min(320px, 70vw); height: 5px; margin-top: 6px; overflow: hidden; background: rgba(243,234,216,.14); border-radius: 3px; box-shadow: 0 1px 6px rgba(0,0,0,.6); }
/* (the fill grows from the left: dmLoad gives each step a transition, which the browser runs on its own layer) */
#loading .ld-bar div { position: absolute; inset: 0; background: var(--accent); border-radius: 3px; transform: scaleX(0); transform-origin: left center; }
.auto-tag { font-size: 11px; color: #9fd6ff; font-weight: 400; margin-left: 6px; }

/* ---- touch controls (phones / tablets) */
body.touch { touch-action: manipulation; -webkit-user-select: none; -webkit-touch-callout: none; }
body.touch #app, body.touch #app canvas { touch-action: none; }
#touch { position: fixed; inset: 0; pointer-events: none; z-index: 6; display: none; }
#touch.show { display: block; }
#touch > * { pointer-events: auto; touch-action: none; }
.t-steer { position: absolute; left: 2vw; bottom: 3vh; width: min(36vw, calc(50vw - 175px)); max-width: 420px; height: 26vh; min-height: 110px; border-radius: 18px; background: rgba(10,8,6,.22); border: 1px solid rgba(255,230,190,.18); }
.t-track { position: absolute; left: 10%; right: 10%; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: rgba(255,230,190,.25); }
.t-knob { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: rgba(255,200,110,.45); border: 2px solid rgba(255,230,190,.7); }
.t-l, .t-r { position: absolute; top: 50%; transform: translateY(-50%); font-size: 26px; color: rgba(255,230,190,.45); }
.t-l { left: 5%; } .t-r { right: 5%; }
.t-btn { position: absolute; border-radius: 50%; border: 2px solid rgba(255,230,190,.55); background: rgba(10,8,6,.35); color: #f4e4c4; font-weight: 800; letter-spacing: 1px; padding: 0; }
.t-btn.down { background: rgba(255,170,60,.55); }
.t-brake { right: 3vw; bottom: 5vh; width: 17vh; height: 17vh; min-width: 84px; min-height: 84px; font-size: 15px; }
.t-nitro { right: calc(3vw + max(17vh, 84px) + 14px); bottom: 4vh; width: 12vh; height: 12vh; min-width: 62px; min-height: 62px; font-size: 12px; background: rgba(30,60,90,.45); }
.t-ability { right: 4vw; bottom: calc(5vh + max(17vh, 84px) + 14px); width: 11vh; height: 11vh; min-width: 58px; min-height: 58px; font-size: 11px; }
.t-winch { right: calc(4vw + max(11vh, 58px) + 14px); bottom: calc(5vh + max(17vh, 84px) + 4px); width: 11vh; height: 11vh; min-width: 58px; min-height: 58px; font-size: 10px; background: rgba(60,50,20,.45); }
/* the winch line, while something's on it: hold IN / OUT */
.t-reelin, .t-reelout { display: none; right: calc(4vw + 2 * max(11vh, 58px) + 26px); width: 8.5vh; height: 8.5vh; min-width: 46px; min-height: 46px; font-size: 10px; background: rgba(60,50,20,.45); }
.t-reelin { bottom: calc(5vh + max(17vh, 84px) + max(11vh, 58px) - 2px); }
.t-reelout { bottom: calc(5vh + max(17vh, 84px) - 6px); }
#touch.towing .t-reelin, #touch.towing .t-reelout { display: block; }
/* beside a wreck: strip it where it lies */
.t-strip { display: none; right: calc(4vw + max(11vh, 58px) + 14px); bottom: calc(5vh + max(17vh, 84px) + max(11vh, 58px) + 18px); width: 11vh; height: 11vh; min-width: 58px; min-height: 58px; font-size: 10px; background: rgba(40,70,30,.5); }
#touch.canstrip .t-strip { display: block; }
.t-pause { left: 12px; top: 74px; width: 44px; height: 44px; border-radius: 10px; font-size: 14px; }
#rotate { position: fixed; inset: 0; z-index: 40; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #120e0a; color: #f4e4c4; font-size: 18px; text-align: center; padding: 20px; }
#rotate div { font-size: 64px; }
@media (orientation: portrait) and (pointer: coarse) { #rotate { display: flex; } }
/* short landscape screens: shrink the HUD and menus to fit */
@media (max-height: 560px) {
    #hud { zoom: .68; }
    .screen { zoom: .7; }
    .screen .panel { max-height: calc(92vh / .7); }
    .screen .shop { height: calc(94vh / .7); width: min(1180px, calc(96vw / .7)); }
    #h-tip { font-size: 24px; max-width: min(900px, 92vw); }
    body.touch #h-tip { top: 128px; }      /* up under the compass, clear of the car and the thumbs */
    body.touch #h-warn { top: auto; bottom: calc(26vh + 84px); }
}
/* touch: the thumbs own the bottom corners, so the map and speed go top-right and the gun list goes */
body.touch .hud-br { top: 96px; bottom: auto; }
body.touch #h-map { width: 120px; height: 120px; }
body.touch .hud-bl { display: none; }

body.touch .hud-bc { zoom: .85; }
.t-ability { background: conic-gradient(rgba(255,200,90,.55) calc(var(--charge, 1) * 360deg), rgba(10,8,6,.35) 0); }
.t-ability.ready { border-color: #ff6a3a; box-shadow: 0 0 14px rgba(255,90,40,.8); }

/* ---- achievements: unlock popup (under the hull bar), gallery, end-screen section, detail view */
#ach-pop { position: fixed; left: 18px; top: 128px; z-index: 30; display: flex; gap: 12px; align-items: center; max-width: 380px; padding: 10px 16px 10px 10px; border-radius: 8px;
    background: linear-gradient(90deg, rgba(30,22,14,.95), rgba(30,22,14,.82)); border: 1px solid rgba(255,208,122,.55); box-shadow: 0 6px 24px rgba(0,0,0,.6), 0 0 18px rgba(255,190,90,.25);
    pointer-events: none; opacity: 0; transform: translateX(-30px); transition: opacity .35s, transform .35s; }
#ach-pop.show { opacity: 1; transform: none; }
#screens:has(.screen) ~ #ach-pop { opacity: 0; }      /* a menu opened while it was up */
#ach-pop .ap-glyph { width: 50px; height: 50px; flex: none; border-radius: 50%; border: 3px solid; display: flex; align-items: center; justify-content: center; font-size: 26px; background: rgba(0,0,0,.4); font-family: "Segoe UI Symbol", var(--font); }
#ach-pop .ap-txt { display: flex; flex-direction: column; line-height: 1.25; }
#ach-pop small { font-size: 10px; font-weight: 800; letter-spacing: 2.5px; color: #ffcf7a; }
#ach-pop b { font-family: var(--display); font-size: 24px; letter-spacing: 1px; color: #f8ead0; }
#ach-pop span { font-size: 12px; color: var(--ink-dim); }
body.touch #ach-pop { top: 126px; left: 70px; }

.ach-gallery { width: min(1060px, 94vw); }
.ag-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.ag-head h2 { font-family: var(--display); font-size: 34px; letter-spacing: 3px; margin: 0; }
.ag-pct { text-align: right; min-width: 220px; }
.ag-pct b { font-family: var(--display); font-size: 22px; }
.ag-bar { height: 8px; margin: 4px 0; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.ag-bar div { height: 100%; background: linear-gradient(90deg, #c8842c, #ffd060); }
.ag-pct small { font-size: 12px; color: var(--ink-dim); }
.ag-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 12px; }
.ag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ag-foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 16px; }
.ach-tile { display: flex; flex-direction: column; padding: 0; text-align: left; border-radius: 6px; overflow: hidden; background: rgba(0,0,0,.35); border: 1px solid var(--line); color: var(--ink); font-weight: 400; letter-spacing: 0; }
button.ach-tile:hover { border-color: #ffcf7a; transform: translateY(-2px); }
.at-img { position: relative; aspect-ratio: 16 / 9; background: radial-gradient(ellipse at 50% 60%, #3a2c1e, #16100b) center / cover no-repeat; display: flex; align-items: center; justify-content: center; }
.at-img.has .at-glyph { position: absolute; right: 8px; bottom: 6px; font-size: 22px; text-shadow: 0 0 6px #000, 0 0 2px #000; }
.at-glyph { font-size: 44px; font-family: "Segoe UI Symbol", var(--font); color: #ffcf7a; }
.at-body { display: flex; flex-direction: column; gap: 3px; padding: 9px 11px 11px; }
.at-body b { font-family: var(--display); font-size: 19px; letter-spacing: 1px; }
.at-body span { font-size: 12px; color: var(--ink-dim); line-height: 1.35; }
.at-body small { font-size: 10px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
.at-body .at-date { color: var(--ink-dim); font-weight: 600; letter-spacing: .5px; text-transform: none; }
.ach-tile.locked { opacity: .62; }
.ach-tile.locked .at-img { background: repeating-linear-gradient(135deg, #1a1410 0 10px, #15100c 10px 20px); }
.ach-tile.locked .at-glyph { color: #4a3e32; filter: blur(.4px); }

.ach-run { margin: 4px 0 14px; padding: 10px 12px; border: 1px solid rgba(255,208,122,.45); border-radius: 6px; background: rgba(40,28,16,.55); text-align: left; }
.ach-run .ar-head { font-family: var(--display); font-size: 17px; letter-spacing: 2px; color: #ffcf7a; margin-bottom: 8px; }
.ach-run .ar-head b { color: #f8ead0; margin-left: 6px; }
.ar-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 300px; overflow: auto; }
.ach-tile.small .at-body span, .ach-tile.small .at-date { display: none; }
.ach-tile.small .at-body b { font-size: 15px; }
.ach-tile.small .at-glyph { font-size: 30px; }
.ach-run.goal { border-color: var(--line); }
.ar-goal { display: flex; align-items: center; gap: 12px; }
.ar-goal .at-glyph { font-size: 30px; }
.ar-goal div { display: flex; flex-direction: column; }
.ar-goal b { font-family: var(--display); font-size: 18px; letter-spacing: 1px; }
.ar-goal span { font-size: 12px; color: var(--ink-dim); }

.ach-modal { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; background: rgba(8,6,4,.8); }
.am-box { width: min(980px, 94vw); padding: 16px; }
.am-media { aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; background: #0d0a07; border-radius: 4px; overflow: hidden; }
.am-card { width: 100%; height: 100%; object-fit: contain; display: block; }
.am-loading { color: var(--ink-dim); font-size: 14px; letter-spacing: 2px; }
.am-info { display: flex; flex-direction: column; gap: 3px; margin: 12px 2px 10px; }
.am-info b { font-family: var(--display); font-size: 26px; letter-spacing: 1.5px; }
.am-info span { font-size: 14px; color: var(--ink); }
.am-info small { font-size: 12px; color: var(--ink-dim); }
.am-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
@media (max-height: 560px) {
    .ag-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
    .am-box { width: min(760px, 120vh); }
}
/* a Behemoth's entrance: bars in, the HUD out, its name across the bottom */
#cine { position: fixed; inset: 0; pointer-events: none; z-index: 8; visibility: hidden; }
body.cine #cine { visibility: visible; }
body.cine #hud, body.cine #touch { opacity: 0; }
body.cine .announce { visibility: hidden; }
#hud { transition: opacity .18s; }
.cine-bar { position: absolute; left: 0; right: 0; height: 12vh; background: #000; transition: transform .28s cubic-bezier(.2,.8,.3,1); }
.cine-bar.top { top: 0; transform: translateY(-100%); }
.cine-bar.bot { bottom: 0; transform: translateY(100%); }
body.cine .cine-bar { transform: none; }
.cine-title { position: absolute; left: 0; right: 0; bottom: 14vh; text-align: center; opacity: 0; transform: scale(1.18); transition: opacity .16s, transform .32s cubic-bezier(.15,.9,.3,1); text-shadow: 0 2px 4px #000, 0 0 26px rgba(0,0,0,.9); }
#cine.roar .cine-title { opacity: 1; transform: none; }
.cine-title b { display: block; font-family: var(--display); font-size: clamp(44px, 9vh, 92px); letter-spacing: .14em; color: #ff5a3a; font-weight: 400; line-height: 1; }
.cine-title span { display: block; margin-top: 6px; font-size: clamp(13px, 2.2vh, 18px); letter-spacing: .1em; color: #e8e0d4; }
/* the death card: what did this to you, and what to do about it */
.panel.over { width: min(560px, calc(100vw - 16px)); box-sizing: border-box; }
/* the credits: one line a thing, its name (a link to where it came from), who made it, and what the game uses it for */
.panel.credits { width: min(640px, calc(100vw - 16px)); box-sizing: border-box; }
.credits h3 { margin: 14px 0 4px; font-size: 12px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-dim); }
.cr-row { display: grid; grid-template-columns: 1.3fr 0.8fr 1.4fr; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 14px; align-items: baseline; }
.cr-row b { font-weight: 700; } .cr-row i { font-style: normal; color: var(--ink-dim); font-size: 13px; }
.cr-row a { color: inherit; text-decoration: underline; text-decoration-color: rgba(255,255,255,.3); text-underline-offset: 3px; }
.cr-row a:hover { text-decoration-color: currentColor; }
@media (max-width: 560px) { .cr-row { grid-template-columns: 1fr 1fr; } .cr-row i { grid-column: 1 / -1; } }
.dc { display: flex; gap: 12px; margin: 12px 0 4px; padding: 10px; text-align: left; background: rgba(120,40,20,.18); border: 1px solid rgba(255,106,74,.45); border-left: 3px solid #ff6a4a; border-radius: 4px; }
.dc-pic { flex: none; width: 92px; height: 92px; border-radius: 3px; overflow: hidden; background: #17110c; box-shadow: inset 0 0 0 1px rgba(255,190,120,.18); }
.dc-pic img { display: block; width: 100%; height: 100%; }
.dc-pic.icon svg { display: block; width: 100%; height: 100%; padding: 18px; box-sizing: border-box; stroke: #ff8a5a; fill: rgba(255,138,90,.14); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.dc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.dc-head b { font-family: var(--display); font-size: 24px; letter-spacing: 1px; color: #ffd0b0; line-height: 1.05; }
.dc-head span { font-size: 13px; font-weight: 700; color: #ff8a5a; }
.dc-stats { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 14px; font-weight: 700; color: var(--accent-2); }
.dc-stats small { margin-right: 4px; font-size: 11px; font-weight: 400; color: var(--ink-dim); }
.dc-tip { font-size: 15px; line-height: 1.25; color: #f6ecd8; }
.dc-second { font-size: 12px; color: var(--ink-dim); }
/* Run it back never scrolls out of reach, however much the death screen has to say */
.menu-col.over-go { position: sticky; bottom: -22px; z-index: 2; margin: 0 -26px -22px; padding: 10px 26px 14px; background: #1a140e; border-top: 1px solid var(--line); }
@media (max-width: 480px) { .panel.over { padding-left: 14px; padding-right: 14px; } .menu-col.over-go { margin: 0 -14px -22px; padding: 10px 14px 14px; } .menu-col.over-go > div { flex-wrap: wrap; justify-content: center; } .dc-pic { width: 64px; height: 64px; } .dc-pic.icon svg { padding: 12px; } .dc-head b { font-size: 20px; } .over-title { font-size: 48px; } }
/* the comms window: who's talking (a painted face on a little screen, ui/commsPortrait.js, in .c-face) and what
   they say, under the hull. Subtitles always: their size is a setting. */
.comms { position: absolute; left: 18px; top: 122px; width: 396px; box-sizing: border-box; display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px 9px 8px; background: rgba(12,9,6,.82); border: 1px solid rgba(143,220,184,.35); border-left: 4px solid #8fdcb8; border-radius: 4px; box-shadow: 0 0 18px rgba(143,220,184,.14); opacity: 0; transition: opacity .15s, top .18s; pointer-events: none; }
.comms.show { opacity: 1; }
.comms.haven { border-left-color: #ffcf6a; border-color: rgba(255,207,106,.35); }
body:has(#ach-pop.show) .comms { top: 210px; }
.c-face { flex: none; width: 128px; height: 96px; border-radius: 3px; overflow: hidden; background: #0e0b08; box-shadow: 0 0 0 1px rgba(143,220,184,.4), 0 0 10px rgba(143,220,184,.12); }
.c-pic { display: block; width: 100%; height: 100%; }
.c-main { flex: 1; min-width: 0; }
.c-head { display: flex; align-items: baseline; gap: 7px; }
.c-head i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #ff5a3a; box-shadow: 0 0 8px #ff5a3a; animation: blink .9s infinite; align-self: center; }
.c-head b { font-family: var(--display); font-size: 20px; letter-spacing: 1.5px; color: #b4f0d2; }
.comms.haven .c-head b { color: #ffe2a0; }
.c-head span { font-size: 10px; font-weight: 800; letter-spacing: 2px; color: var(--ink-dim); }
.c-sub { margin-top: 3px; font-size: 17px; line-height: 1.25; font-weight: 600; color: #f6efdc; }
body[data-subs="s"] .c-sub { font-size: 14px; }
body[data-subs="l"] .c-sub { font-size: 21px; }
.c-keys { display: none; margin-top: 6px; padding: 3px 7px; border-radius: 3px; background: rgba(143,220,184,.14); font-size: 13px; font-weight: 700; letter-spacing: .3px; color: #b4f0d2; }      /* a tip's keys, under the buddy's words */
.c-keys.show { display: inline-block; }
body.touch .comms { left: 66px; }
@media (max-height: 560px) { body.touch .comms { left: 90px; width: 350px; } body.touch #h-announce { top: 37%; } }      /* clear of the banner in the middle */
/* Haven's signal, by the progress bar's flag: it lights up as the station comes into range */
.progress .signal { position: absolute; right: -32px; top: 10px; display: none; align-items: flex-end; gap: 2px; height: 12px; }
.progress .signal.show { display: flex; }
.progress .signal u { width: 3px; background: rgba(255,216,144,.25); }
.progress .signal u:nth-child(1) { height: 4px; } .progress .signal u:nth-child(2) { height: 6px; } .progress .signal u:nth-child(3) { height: 9px; } .progress .signal u:nth-child(4) { height: 12px; }
.progress .signal[data-n="1"] u:nth-child(-n+1), .progress .signal[data-n="2"] u:nth-child(-n+2), .progress .signal[data-n="3"] u:nth-child(-n+3), .progress .signal[data-n="4"] u { background: #ffd890; }

/* ------------------------------------------------------------------ Salvage: Haven's screen */
.shop header .hv-day { font-family: var(--display); font-size: 20px; letter-spacing: 2px; color: var(--ink-dim); line-height: 1; }
.shop header .hv-day b { color: var(--ink); font-size: 26px; }
.shop header .hv-day small { display: block; font-family: var(--font); font-size: 11px; letter-spacing: 1px; color: var(--blue); margin-top: 3px; }
.shop header .cash small { display: block; font-size: 18px; text-align: right; margin-top: 2px; }
.scrap { color: #e8c890; }
.part { color: var(--blue); }
.hv-report { border: 1px solid var(--line); border-left: 4px solid var(--good); border-radius: 4px; padding: 10px 12px; background: rgba(0,0,0,.28); font-size: 13px; line-height: 1.45; color: var(--ink-dim); margin-bottom: 8px; }
.hv-report.died { border-left-color: var(--bad); }
.hv-report.quit { border-left-color: #a89c88; }
.hv-report .hv-h { display: block; font-family: var(--display); font-size: 22px; letter-spacing: 2px; color: var(--ink); margin-bottom: 2px; }
.hv-report b { color: var(--ink); }
.hv-raid { font-size: 12px; padding: 7px 12px; border-radius: 4px; background: rgba(160,40,20,.22); border: 1px solid rgba(255,90,66,.35); color: var(--ink-dim); margin-bottom: 8px; }
.hv-raid b { color: #ff8a6a; letter-spacing: 1px; margin-right: 6px; }
.hv-raid.held { background: rgba(60,120,50,.18); border-color: rgba(127,211,106,.3); }
.hv-raid.held b { color: var(--good); }
.hv-goal { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-dim); margin: 6px 0 2px; }
.hv-goal b { color: var(--ink); }
/* the day's request, and the report's word on yesterday's */
.hv-ask { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-dim); margin: 8px 0 2px; padding: 7px 12px; border-radius: 4px; background: rgba(255,190,90,.08); border: 1px solid rgba(255,190,90,.25); }
.hv-ask b { color: var(--ink); }
.hv-ask .hv-h { color: var(--accent-2); letter-spacing: 1px; margin-right: 6px; }
.hv-asked { font-size: 12px; padding: 6px 12px; border-radius: 4px; color: var(--ink-dim); margin-bottom: 8px; background: rgba(120,100,70,.18); border: 1px solid var(--line); }
.hv-asked > b:first-child { color: #c8b890; letter-spacing: 1px; margin-right: 6px; }
.hv-asked.met { background: rgba(60,120,50,.18); border-color: rgba(127,211,106,.3); }
.hv-asked.met > b:first-child { color: var(--good); }
.hv-map .mk.sig { fill: #6ad8ff; }
/* where to today */
.hv-where .row.on { border-color: rgba(255,208,96,.55); background: rgba(255,208,96,.08); }
.hv-wi { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-right: 6px; border-radius: 50%; border: 1px solid #000; color: #1a1410; font-size: 9px; font-weight: 700; vertical-align: -2px; }
.hv-tgt { color: #ffd060; font-weight: 600; letter-spacing: .5px; text-transform: none; }
.hv-parts { display: flex; gap: 4px; }
.hv-parts i { width: 16px; height: 16px; transform: rotate(45deg); border: 2px solid var(--blue); border-radius: 2px; opacity: .55; }
.hv-parts i.on { background: var(--blue); opacity: 1; box-shadow: 0 0 8px rgba(106,200,255,.7); }
.hv-map { display: block; width: 100%; height: auto; aspect-ratio: 760 / 280; background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: 4px; }
.hv-map .road { fill: none; stroke: #b8ab92; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.hv-map .road.far { stroke: #6a6050; stroke-width: 1.5; opacity: .6; stroke-dasharray: 4 4; }
.hv-map .back { fill: none; stroke: #9a7a50; stroke-width: 1.8; stroke-dasharray: 5 3; }
.hv-map .track { stroke: #5ac8ff; stroke-width: 1.2; stroke-dasharray: 2 2; opacity: .8; }
.hv-map .cross { stroke: #8a8070; stroke-width: 1; stroke-dasharray: 1 3; }
.hv-map .lead { stroke: #c8b890; stroke-width: 1; opacity: .55; }
.hv-map .lead-dot { fill: #c8b890; opacity: .8; }
.hv-dest { cursor: pointer; }
.hv-dest .hit { fill: transparent; }
.hv-dest .dot { stroke: #000; stroke-width: 1.3; transition: transform .12s; transform-box: fill-box; transform-origin: center; }
.hv-dest:hover .dot { transform: scale(1.3); }
.hv-dest .gl { font: 700 11px var(--font); text-anchor: middle; fill: #1a1410; pointer-events: none; }
.hv-dest .lbl { font: 700 11px var(--font); letter-spacing: 1px; text-anchor: middle; fill: #f2e6cc; paint-order: stroke; stroke: #000; stroke-width: 3px; opacity: 0; pointer-events: none; transition: opacity .12s; }
.hv-dest:hover .lbl, .hv-dest.on .lbl { opacity: 1; }
.hv-dest .ring { fill: none; stroke: #ffd060; stroke-width: 2.5; opacity: 0; }
.hv-dest.on .ring { opacity: 1; }
.hv-dest.on .lbl { fill: #ffd060; }
.hv-pick b { color: #ffd060; }
.hv-map .mk { fill: var(--ink-dim); font: 600 10px var(--font); letter-spacing: 1px; }
.hv-map .mk.part { fill: var(--blue); }
.hv-map .km { fill: #8a8070; font: 600 10px var(--font); }
.hv-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 11px; }
.hv-key i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: -6px; }
.hv-b { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.hv-bld .ttl { display: flex; align-items: center; gap: 8px; }
.hv-bld .hv-ic { font-size: 18px; width: 22px; text-align: center; filter: grayscale(.4); }
.hv-bld .pips { margin-left: auto; display: flex; gap: 3px; }
.hv-bld .pip { width: 10px; height: 10px; border-radius: 2px; border: 1px solid var(--line); background: rgba(255,255,255,.04); }
.hv-bld .pip.on { background: var(--accent-2); border-color: var(--accent-2); }
.hv-bld.built { border-color: rgba(255,207,106,.35); }
.hv-bld .desc i { color: var(--ink); font-style: normal; opacity: .8; }
/* Salvage HUD: the road out of Haven, the sun clock, the load */
.progress .flag.home { right: auto; left: -4px; transform: translateX(-100%); color: #ffd890; }
.progress .pgar, .progress .gtick { background: var(--blue) !important; box-shadow: 0 0 6px rgba(106,200,255,.8); }
.time.dusk { color: #ffb060; }
.time.night { color: #9ab0ff; }
.dist .load { color: var(--ink-dim); }
.dist .load.mid { color: #ffcf6a; }
.dist .load.heavy { color: var(--bad); font-weight: 700; }
.kills .part { color: var(--blue); }

/* ------------------------------------------------------------------ Salvage: a rusting world */
h1.title { color: transparent; background: linear-gradient(176deg, #f6b47a 0%, #d8642a 42%, #8a3414 70%, #c8582a 100%); -webkit-background-clip: text; background-clip: text; text-shadow: none; filter: drop-shadow(0 4px 0 #3a160a) drop-shadow(0 10px 24px rgba(0,0,0,.85)); }
#loading { background: radial-gradient(ellipse at 50% 120%, #4a1e0e 0%, #1a0c08 55%, #0e0806 100%); }
#loading .ld-title { color: #e07a3a; text-shadow: 0 3px 0 #3a160a, 0 0 30px rgba(220,100,40,.35); }
#loading .ld-bar > div { background: #d8642a; }
.screen.dim { background: radial-gradient(ellipse at center, rgba(30,14,8,.55), rgba(10,4,2,.85)); }
.won-title { color: #f2a466; text-shadow: 0 0 18px rgba(240,140,70,.55); }
.panel { border-color: rgba(216,100,42,.22); }

/* the Haven map: past a full tank's reach */
.hv-map .pastfuel { fill: #000; opacity: .32; }
.hv-map .fuelline { stroke: #ff9a4a; stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .85; }
.hv-map .mk.fuel { fill: #ffb07a; }
.evhint b.bad, .hv-where b.bad, .hint-line b.bad { color: #ff6a50; }
.evhint b.warn { color: #ffae50; }

.status .hold { background: #3a4a5a; color: #d8e8ff; }
.t-hold { left: 3vw; bottom: calc(3vh + max(26vh, 110px) + 12px); width: 9vh; height: 9vh; min-width: 50px; min-height: 50px; font-size: 10px; background: rgba(40,52,72,.5); }

/* the sky, today's or tomorrow's */
.hv-sky { margin: 8px 0; padding: 8px 12px; border-left: 3px solid #c8a070; background: rgba(200,160,112,.08); font-size: 13px; color: #e8dcc4; }
.hv-sky b { color: #ffd59a; letter-spacing: 1px; margin-right: 6px; }
.hv-ask.rec { border-color: #ff6a3a; align-items: center; }

/* the day's haul, counted up as Haven's screen opens */
.hv-haul { margin: 0 0 10px; padding: 12px 16px; border: 1px solid rgba(255,190,110,.35); background: linear-gradient(90deg, rgba(255,150,60,.16), rgba(255,150,60,.02)); border-radius: 4px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 18px; align-items: center; }
.hv-haul-k { grid-column: 1; font-size: 11px; letter-spacing: 3px; color: #ffcf8a; }
.hv-haul-n { grid-column: 1; font-size: 34px; font-weight: 800; color: #ffd59a; line-height: 1.05; font-variant-numeric: tabular-nums; }
.hv-haul.done .hv-haul-n { animation: haulpop .35s ease-out; }
@keyframes haulpop { 0% { transform: scale(1); } 40% { transform: scale(1.12); color: #fff2d0; } 100% { transform: scale(1); } }
.hv-haul-chips { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-wrap: wrap; gap: 6px; }
.hv-haul .chip { padding: 3px 8px; border-radius: 3px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,220,170,.25); font-size: 12px; color: #f0e2c8; opacity: 0; animation: chipin .3s ease-out forwards; }
.hv-haul .chip.part { border-color: #5ac8ff; color: #bfe8ff; }
.hv-haul .chip.bin { border-color: #6cffb0; color: #c8ffe0; }
@keyframes chipin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ◱ Yard: out of the bay, the yard on its own, and the way back in */
.screen.yardview { background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,.45)); }
.screen.yardview .shop, .screen.yardview .shop.g3 { display: none; }
.yardback { display: none; position: absolute; left: 24px; bottom: 24px; }
.screen.yardview .yardback { display: block; pointer-events: auto; }

/* the cargo card, top right: a row for each thing, an icon and a bar, big enough to read at a glance (its bars are
   .cbar: .gauge is the fuel gauge and the horn's) */
.hud-tr { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.hud-tr .money { font-size: 46px; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
.hud-tr .money::before { content: 'ABOARD'; font-family: inherit; font-size: 12px; letter-spacing: 2.5px; color: var(--ink-dim); margin-right: 10px; vertical-align: middle; text-shadow: none; }
.cargo { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin: 0; letter-spacing: 0; }
.cg-row, .hud-tr .dist, .hud-tr .bank, .hud-tr .req { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 16px; font-weight: 600; color: #f2e4cc; background: rgba(12,8,5,.58); padding: 5px 10px; border-radius: 5px; margin: 0; letter-spacing: .2px; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.hud-tr .ic { width: 20px; height: 20px; flex: none; color: #d8bf98; }
.cg-row.cable { border-right: 4px solid var(--accent-2); }
.cg-row.cable .ic { color: var(--accent-2); }
.cg-row.loud .ic { color: #ff7a56; }
.cg-n { text-transform: capitalize; }
.cg-v { min-width: 44px; text-align: left; font-variant-numeric: tabular-nums; }
.cg-v small { font-size: 12px; color: var(--ink-dim); font-weight: 500; }
.cg-t { max-width: 230px; text-align: right; font-size: 14px; line-height: 1.2; }
.hud-tr .sep { width: 6px; }
.hud-tr .scrap { color: var(--accent-2); }
.hud-tr .bad { color: #ff6a50; } .hud-tr .warn { color: #ffae50; }
.hud-tr .hold { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; letter-spacing: 1px; color: #cfe2ff; background: rgba(58,74,90,.85); padding: 1px 6px 1px 3px; border-radius: 3px; }
.hud-tr .hold .ic { width: 15px; height: 15px; color: #cfe2ff; }
.hud-tr .strip { display: inline-flex; align-items: center; gap: 3px; font-size: 14px; color: #bfe0ff; }
.hud-tr .strip .ic { width: 16px; height: 16px; color: #9fd0ff; }
.slots { display: inline-flex; gap: 3px; }
.slots i { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(255,220,170,.55); border-radius: 2px; }
.slots i.on { background: var(--accent-2); border-color: var(--accent-2); }
.cbar { display: inline-block; width: 92px; height: 10px; background: rgba(255,255,255,.14); border-radius: 3px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); }
.cbar i { display: block; height: 100%; transition: width .25s; border-radius: 3px; }
.cbar.bin i { background: #6cffb0; }
.cbar.noise i { background: #ffc890; }
.cbar.load i { background: #e0cca0; }
.cbar.good i { background: #7fd36a; }
.cbar.warn i { background: #ffae50; }
.cbar.bad i { background: #ff5a3a; }
.cbar.ask i { background: var(--accent-2); }
.hud-tr .req { max-width: none; border-right: 4px solid var(--accent-2); }
.hud-tr .req.met { border-right-color: #7fd36a; }
.hud-tr .req .ok { color: #9ff09a; font-size: 14px; }
.hud-tr .bank.bump { animation: bump .25s; }
/* one panel: every row the card's width, the icon on the left, the bar taking up the middle, the number on the right */
.hud-tr { width: 330px; }
.hud-tr .cargo { align-items: stretch; width: 100%; }
.cg-row, .hud-tr .dist, .hud-tr .bank, .hud-tr .req { justify-content: flex-start; width: 100%; box-sizing: border-box; }
.hud-tr .cbar { flex: 1; width: auto; min-width: 40px; }
.hud-tr .cg-v { text-align: right; min-width: 52px; margin-left: auto; }
.hud-tr .cg-row.cable .cg-n { flex: none; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-tr .bank .sep { flex: 1; }
.hud-tr .bank .cg-v { margin-left: 0; min-width: 0; }
.hud-tr .req .cg-t { flex: 1; text-align: left; }
.hud-tr .req .cbar { flex: none; width: 60px; }
/* touch: a narrower card, and the map beside it rather than under it */
body.touch .hud-tr { width: 262px; }
body.touch .cg-row, body.touch .hud-tr .dist, body.touch .hud-tr .bank, body.touch .hud-tr .req { font-size: 14px; padding: 3px 8px; }
body.touch .hud-tr .money { font-size: 38px; }
body.touch .hud-tr .req .cg-t { font-size: 12.5px; }
body.touch .hud-br { top: 40px; right: 294px; }
body.touch .hud-br .status { flex-wrap: wrap; max-width: 300px; margin-left: auto; }
.hv-sky.news { border-left-color: #6ad8ff; background: rgba(106,216,255,.07); }
.hv-sky.news b { color: #a8e6ff; }
.hv-ask > span { flex: 1; }
.hv-ask > .hv-ic { flex: none; }
.hv-ask .hv-askwhere { display: block; margin-top: 3px; font-size: 12px; color: var(--ink-dim); }
.hv-raid button.sm { margin-left: 6px; vertical-align: baseline; }

/* the night raid (world/raid.js: Raid._ui) */
body.raiding canvas { cursor: none; }
/* the gun's sight (the mouse's pointer, a finger, the pad's sticks): lit over one of them, a flash for a hit, a ring
   for one brought down */
.raid-aim { position: fixed; left: -21px; top: -21px; width: 42px; height: 42px; z-index: 16; pointer-events: none; will-change: transform; }
.raid-aim { --c: rgba(255,230,190,.9); }
.raid-aim::before, .raid-aim::after { content: ""; position: absolute; filter: drop-shadow(0 0 1.5px #000); }
.raid-aim::before { left: 20px; top: 2px; width: 2px; height: 38px; background: linear-gradient(to bottom, var(--c) 0 26%, transparent 26% 74%, var(--c) 74% 100%); }
.raid-aim::after { top: 20px; left: 2px; height: 2px; width: 38px; background: linear-gradient(to right, var(--c) 0 26%, transparent 26% 74%, var(--c) 74% 100%); }
.raid-aim i { position: absolute; inset: 11px; border: 2px solid var(--c); border-radius: 50%; box-shadow: 0 0 4px rgba(0,0,0,.8); transition: border-color .1s, transform .1s; }
.raid-aim.on { --c: #ffa060; }
.raid-aim.on i { transform: scale(.8); }
.raid-aim.hit i { animation: aimhit .12s ease-out; }
.raid-aim.kill i { animation: aimkill .35s ease-out; }
@keyframes aimhit { 0% { border-color: #fff; transform: scale(.65); } 100% { transform: scale(.8); } }
@keyframes aimkill { 0% { border-color: #fff; transform: scale(.6); opacity: 1; } 60% { transform: scale(1.7); opacity: .9; border-color: #ffcf6a; } 100% { transform: scale(.8); opacity: 1; } }
.raid-aim.eye i { animation: aimeye .2s ease-out; }
@keyframes aimeye { 0% { border-color: #fff6a0; transform: scale(.5); box-shadow: 0 0 14px #ffe070; } 100% { transform: scale(.8); } }
.raid-aim i { transform: scale(var(--spread, 1)); }
.raid-aim.on i { transform: scale(calc(var(--spread, 1) * .8)); }
/* the night at the bottom (no box): the walls' holding on the left, the gate's on the right, between them how many more
   the gun has to bring down (live: what would get over if it all ended now) and the wave */
.raid-hud { position: fixed; left: 50%; bottom: 5%; transform: translateX(-50%); z-index: 15; pointer-events: none; display: flex; align-items: flex-end; gap: 22px; width: min(620px, calc(100vw - 32px)); justify-content: space-between; filter: drop-shadow(0 2px 6px rgba(0,0,0,.9)); }
.raid-hud .rh-m { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.raid-hud .rh-m small { font-size: 10px; letter-spacing: 2.5px; color: rgba(243,234,216,.75); }
.raid-hud .rh-gate small { text-align: right; }
.raid-hud .rh-m i { display: block; height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.raid-hud .rh-m b { display: block; height: 100%; background: linear-gradient(90deg, #c8a070, #f0d8a8); transition: width .25s; }
.raid-hud .rh-gate b { margin-left: auto; background: linear-gradient(270deg, #c8a070, #f0d8a8); }
.raid-hud .rh-gate.hit b { background: #ff7a4a; animation: rbpulse .2s ease-in-out infinite alternate; }
.raid-hud .rh-gate.broken small { color: #ff5a3a; }
.raid-hud .rh-mid { display: flex; flex-direction: column; align-items: center; line-height: 1; min-width: 150px; }
.raid-hud .rh-n { display: flex; flex-direction: column; align-items: center; }
.raid-hud .rh-n b { font-family: var(--display); font-size: 44px; color: #ffb07a; letter-spacing: 1px; }
.raid-hud .rh-n small { font-size: 10px; letter-spacing: 2.5px; color: rgba(243,234,216,.8); margin-top: 3px; }
.raid-hud .rh-n.ok b { color: #9ff09a; font-size: 34px; }
.raid-hud.climb .rh-n:not(.ok) b { color: #ff5a3a; animation: rbpulse .35s ease-in-out infinite alternate; }
.raid-hud.climb .rh-n:not(.ok) small { color: #ff8a6a; }
.raid-hud .rh-wave { margin-top: 6px; font-size: 10px; letter-spacing: 3px; color: rgba(243,234,216,.55); }
@keyframes rbpulse { to { transform: scale(1.12); } }
/* the gun, bottom right: rounds in the belt over the spare, its heat, the fresh belt going in */
.raid-gun { position: fixed; right: 22px; bottom: 5%; z-index: 15; pointer-events: none; width: 150px; filter: drop-shadow(0 2px 5px rgba(0,0,0,.9)); }
.raid-gun .rg-belt { text-align: right; line-height: 1; }
.raid-gun .rg-belt b { font-family: var(--display); font-size: 34px; color: #f3ead8; letter-spacing: 1px; }
.raid-gun .rg-belt small { font-size: 13px; color: rgba(243,234,216,.6); margin-left: 4px; }
.raid-gun .rg-heat { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.raid-gun .rg-heat small { font-size: 9px; letter-spacing: 2px; color: rgba(243,234,216,.6); }
.raid-gun .rg-heat i { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.raid-gun .rg-heat b { display: block; height: 100%; background: linear-gradient(90deg, #f0c060, #ff6a2a); }
.raid-gun.hot .rg-heat b { background: #ff4a1a; box-shadow: 0 0 8px #ff4a1a; }
.raid-gun .rg-rl { height: 3px; margin-top: 4px; }
.raid-gun .rg-rl b { display: block; height: 100%; width: 0; background: #9fd8ff; }
.raid-gun::after { content: attr(data-state); display: block; text-align: right; margin-top: 4px; font-size: 11px; letter-spacing: 3px; color: #ff6a3a; font-weight: bold; }
.raid-gun.rl::after { color: #9fd8ff; }
.raid-gun.jam .rg-belt b { color: #ff6a3a; }
/* the nests, top middle: where you are, and where they're climbing (a count, red where you're not) */
.raid-nests { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 16; display: flex; gap: 6px; }
.raid-btn { font: inherit; cursor: pointer; pointer-events: auto; background: rgba(12,10,8,.55); color: rgba(243,234,216,.85); border: 1px solid rgba(243,234,216,.22); border-radius: 4px; padding: 5px 10px; font-size: 12px; letter-spacing: 2px; display: inline-flex; align-items: center; gap: 6px; }
.raid-btn kbd { font: inherit; font-size: 10px; padding: 0 4px; border: 1px solid rgba(243,234,216,.35); border-radius: 3px; color: rgba(243,234,216,.7); }
.raid-nests .nb.on { background: rgba(255,176,106,.25); border-color: #ffb07a; color: #fff; }
.raid-nests .nb i { font-style: normal; color: #ffb07a; font-weight: bold; }
.raid-nests .nb.alarm { border-color: #ff4a2a; animation: nestalarm .45s ease-in-out infinite alternate; }
.raid-nests .nb.alarm i { color: #ff5a3a; }
@keyframes nestalarm { to { background: rgba(255,60,30,.35); } }
/* the fire trench (bottom left) */
.raid-tool { position: fixed; left: 22px; bottom: 5%; z-index: 16; }
.raid-tool em { font-style: normal; font-size: 10px; color: #ffb07a; }
.raid-tool[data-s="burning"] { border-color: #ff8a3a; background: rgba(255,120,40,.3); }
.raid-tool[data-s="used"] { opacity: .45; }
.raid-tbtns { position: fixed; right: 22px; bottom: calc(5% + 90px); z-index: 16; }
/* what's at the wall out of sight: an arrow at the edge pointing to it */
.raid-edges { position: fixed; inset: 0; pointer-events: none; z-index: 15; }
.raid-arrow { position: absolute; left: -9px; top: -7px; width: 0; height: 0; border-left: 18px solid rgba(255,176,106,.85); border-top: 7px solid transparent; border-bottom: 7px solid transparent; filter: drop-shadow(0 0 3px #000); transform-origin: 9px 7px; }
.raid-arrow.hot { border-left-color: #ff4a2a; filter: drop-shadow(0 0 6px #ff2a1a); }
.raid-arrow.run { border-left-color: #9ff09a; }
/* the crew's shouts, the stamp when the walls will hold, the acid on the gun, the gun's flash on the edges */
.raid-sub { position: fixed; left: 50%; bottom: calc(5% + 78px); transform: translateX(-50%); z-index: 16; pointer-events: none; max-width: min(640px, calc(100vw - 32px)); text-align: center; font-size: 15px; color: #f3ead8; text-shadow: 0 1px 3px #000, 0 0 10px #000; opacity: 0; transition: opacity .25s; }
.raid-sub b { font-size: 10px; letter-spacing: 2.5px; color: #ffb07a; margin-right: 6px; }
.raid-sub.show { opacity: 1; }
.raid-stamp { position: fixed; left: 50%; top: 26%; transform: translate(-50%, -50%) rotate(-4deg); z-index: 17; pointer-events: none; font-family: var(--display); font-size: 56px; letter-spacing: 8px; color: #9ff09a; border: 4px solid #9ff09a; padding: 4px 18px; white-space: nowrap; text-shadow: 0 0 22px rgba(127,211,106,.6); box-shadow: 0 0 22px rgba(127,211,106,.3), inset 0 0 18px rgba(127,211,106,.2); opacity: 0; }
.raid-stamp.show { animation: stamp 2.6s ease-out forwards; }
@keyframes stamp { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-4deg) scale(2.2); } 12% { opacity: 1; transform: translate(-50%, -50%) rotate(-4deg) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }
.raid-acid { position: fixed; inset: 0; z-index: 14; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at 30% 70%, rgba(140,230,60,.45), transparent 40%), radial-gradient(ellipse at 70% 30%, rgba(120,210,40,.35), transparent 35%), radial-gradient(ellipse at 55% 85%, rgba(150,240,70,.4), transparent 30%); mix-blend-mode: screen; }
.raid-vig { position: fixed; inset: 0; z-index: 13; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(255,150,60,.22) 85%, rgba(255,120,40,.35)); }
.raid-keys { position: fixed; left: 50%; bottom: 1.6%; transform: translateX(-50%); z-index: 15; pointer-events: none; font-size: 12px; letter-spacing: .5px; color: rgba(243,234,216,.7); text-shadow: 0 1px 3px #000; white-space: nowrap; transition: opacity 1.2s; }
.raid-keys.gone { opacity: 0; }
/* the start: what to do (raid.js _brief): up as the bolt's racked, gone a few seconds into the fight */
.raid-brief { position: fixed; left: 50%; top: max(52px, 10%); transform: translate(-50%, -8px); z-index: 17; pointer-events: none; width: min(620px, calc(100vw - 32px)); padding: 18px 12px 20px; text-align: center; color: #f3ead8; text-shadow: 0 2px 4px #000, 0 0 18px rgba(0,0,0,.9); background: radial-gradient(ellipse at center, rgba(0,0,0,.5), rgba(0,0,0,0) 72%); opacity: 0; transition: opacity .45s, transform .45s; }
.raid-brief.show { opacity: 1; transform: translate(-50%, 0); }
.raid-brief small { display: block; font-size: 11px; letter-spacing: 6px; color: #ff9a5a; margin-bottom: 6px; }
.raid-brief b { display: block; font-family: var(--display); font-size: 46px; font-weight: 700; letter-spacing: 3px; line-height: 1; color: #fff3dc; }
.raid-brief em { display: block; font-style: normal; font-family: var(--display); font-size: 25px; letter-spacing: 2px; line-height: 1.15; color: #ffb07a; margin-top: 3px; }
.raid-brief .rb-k { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; font-size: 12px; letter-spacing: 1.5px; color: rgba(243,234,216,.92); }
.raid-brief .rb-k span { white-space: nowrap; }
.raid-brief .rb-k kbd { font: inherit; font-size: 11px; font-weight: 700; letter-spacing: 1px; padding: 2px 7px; margin-right: 7px; border: 1px solid rgba(243,234,216,.6); border-bottom-width: 2px; border-radius: 4px; background: rgba(0,0,0,.5); color: #fff; }
.raid-brief p { margin: 12px 0 0; font-size: 14px; color: rgba(243,234,216,.88); }
.raid-brief .rb-tw { margin-top: 4px; font-size: 13px; color: #ffcf8a; }
@media (max-width: 700px) {
    .raid-brief { top: 14%; padding: 12px 6px 14px; }
    .raid-brief b { font-size: 31px; letter-spacing: 2px; }
    .raid-brief em { font-size: 18px; }
    .raid-brief .rb-k { gap: 6px 12px; font-size: 11px; margin-top: 12px; }
}
/* the start and the end are a cinema: bars top and bottom, nothing of the fight's screen */
body.raiding::before, body.raiding::after { content: ""; position: fixed; left: 0; right: 0; height: 0; background: #000; z-index: 12; transition: height .6s ease; pointer-events: none; }
body.raiding::before { top: 0; }
body.raiding::after { bottom: 0; }
body.raid-cine::before, body.raid-cine::after { height: 9vh; }
body.raid-cine .raid-hud, body.raid-cine .raid-gun, body.raid-cine .raid-nests, body.raid-cine .raid-tool, body.raid-cine .raid-keys, body.raid-cine .raid-aim, body.raid-cine .raid-edges, body.raid-cine .raid-tbtns { opacity: 0; }
.raid-hud, .raid-gun, .raid-nests, .raid-tool, .raid-aim, .raid-tbtns { transition: opacity .5s; }
/* the night's last word: the stamp of it, the tally under it, and on to the dawn */
.raid-end { position: fixed; left: 0; right: 0; top: 24%; z-index: 17; pointer-events: none; text-align: center; padding: 22px 16px 24px; background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,.66) 22%, rgba(0,0,0,.66) 78%, rgba(0,0,0,0)); animation: raidend .6s ease-out; }
.raid-end .re-h { font-family: var(--display); font-size: 58px; letter-spacing: 10px; color: #d8f0c8; text-shadow: 0 0 30px rgba(127,211,106,.35); animation: raidtitle 1.6s ease-out; }
.raid-end.breach .re-h { color: #ff6a4a; text-shadow: 0 0 30px rgba(255,70,40,.45); }
.raid-end .re-rows { display: inline-grid; grid-template-columns: auto auto auto; gap: 4px 18px; margin-top: 12px; text-align: left; font-size: 14px; }
.raid-end .re-row { display: contents; }
.raid-end .re-row > * { opacity: 0; animation: rerow .4s ease-out forwards; animation-delay: inherit; }
.raid-end .re-row b { font-size: 10px; letter-spacing: 2.5px; color: #ffb07a; align-self: center; }
.raid-end .re-row span { color: #f3ead8; }
.raid-end .re-row small { color: rgba(243,234,216,.6); align-self: center; }
.raid-end .re-l { font-size: 15px; letter-spacing: 1px; color: rgba(243,234,216,.9); margin-top: 12px; opacity: 0; animation: rerow .4s ease-out forwards; }
.raid-end .re-k { margin-top: 10px; font-size: 11px; letter-spacing: 2px; color: rgba(243,234,216,.45); }
@keyframes rerow { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes raidend { from { opacity: 0; } to { opacity: 1; } }
@keyframes raidtitle { from { letter-spacing: 22px; opacity: 0; } to { letter-spacing: 10px; opacity: 1; } }
/* the Haven screen: what's at the gate tonight, the radio's twist; the gate gun's upgrades in the Workshop */
.hv-kit { font-size: 12px; padding: 6px 12px; border-radius: 4px; background: rgba(255,255,255,.04); border: 1px solid rgba(243,234,216,.12); color: var(--ink-dim); margin: -4px 0 8px; }
.hv-kit b { color: #e8c9a0; letter-spacing: 1px; margin-right: 6px; }
.hv-kit.tw { border-color: rgba(255,176,106,.3); }
.card.gg .pips { margin-left: 6px; }
@media (max-width: 700px) {
    .raid-end .re-h { font-size: 34px; letter-spacing: 5px; }
    .raid-end .re-rows { grid-template-columns: auto auto; font-size: 12px; }
    .raid-end .re-row small { display: none; }
    .raid-hud { gap: 10px; bottom: 3%; }
    .raid-hud .rh-n b { font-size: 34px; }
    .raid-gun { right: 12px; width: 110px; bottom: calc(3% + 70px); }
    .raid-tool { left: 12px; bottom: calc(3% + 70px); }
    .raid-stamp { font-size: 30px; letter-spacing: 4px; }
    .raid-nests { top: 10px; }
    .raid-btn { padding: 6px 8px; font-size: 11px; letter-spacing: 1px; }
}
.raid-fade { position: fixed; inset: 0; z-index: 40; background: #000; pointer-events: none; animation: g3out .9s ease-out forwards; }

/* the victory screen: what Haven remembers into the next campaign */
.legacy { margin: 12px 0; padding: 10px 12px; border: 1px solid rgba(255,190,90,.3); border-radius: 6px; background: rgba(255,190,90,.06); text-align: left; }
.legacy > b { letter-spacing: 2px; color: var(--accent-2); }
.legacy-picks { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }

/* ---------------- The 3D garage (ui/shop.js, game/showroom.js) ----------------
   The rig on a turntable in the middle, the boxes round it: what's on the rig on the left, what's for sale on the right,
   the before/after numbers under it. The middle is open (the bay is drawn there); the leader line and the mount pins go
   over everything in .g3-over, unzoomed. */
/* (opacity as well: a HUD part that sets its own visibility, like the horn gauge's MAX, would still show) */
body.in-garage #hud, body.in-garage #touch, body.in-garage #floaters { visibility: hidden; opacity: 0; pointer-events: none; }
/* (and a cinematic's bars and title: a boss reveal or a run's opening never plays over the garage) */
body.in-garage #cine { visibility: hidden; }
.screen.garage { display: block; pointer-events: none; animation: g3in .5s ease-out; }
@keyframes g3in { from { background: #000; } to { background: rgba(0,0,0,0); } }
.g3-fade { position: absolute; inset: 0; background: #000; pointer-events: none; animation: g3out .55s ease-out forwards; }
@keyframes g3out { to { opacity: 0; } }
.screen .shop.g3 { position: absolute; inset: 0; width: auto; height: auto; max-height: none; display: grid; grid-template-columns: minmax(280px, 25%) minmax(0, 1fr) minmax(300px, 28%);
    grid-template-rows: auto minmax(0, 1fr) auto; gap: 0 14px; padding: 0 14px 14px; background: none; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
.shop.g3 > header.g3-top { grid-column: 1 / -1; grid-row: 1; pointer-events: auto; display: flex; align-items: center; gap: 18px; border: 0;
    background: linear-gradient(rgba(8,6,4,.75), rgba(8,6,4,0)); margin: 0 -14px; padding: 10px 18px 14px; }
.shop.g3 > header h1 { font-size: 42px; letter-spacing: 7px; text-shadow: 0 3px 0 #6a3a10, 0 8px 24px rgba(0,0,0,.85); }
.shop.g3 > header .cash { font-size: 38px; text-shadow: 0 2px 12px rgba(0,0,0,.9); }
.shop.g3 > header .note { text-shadow: 0 1px 3px #000; font-size: 13px; }
.shop.g3 section.g3-side { pointer-events: auto; min-height: 0; overflow: auto; padding: 12px 14px 16px; border-radius: 8px; border: 1px solid rgba(255,207,106,.14);
    background: linear-gradient(180deg, rgba(26,20,14,.88), rgba(14,11,8,.82)); box-shadow: 0 14px 40px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.05);
    scrollbar-width: thin; scrollbar-color: #5a4a36 transparent; }
.g3-l { grid-column: 1; grid-row: 2 / 4; }
.g3-r { grid-column: 3; grid-row: 2 / 4; }
.g3-head { font-family: var(--display); font-size: 13px; letter-spacing: 3px; color: var(--ink-dim); margin-bottom: 2px; }
.g3-veh { margin-bottom: 8px; }
.shop.g3 .g3-veh h2 { font-size: 30px; letter-spacing: 1.5px; margin: 0; line-height: 1; color: var(--ink); }
.g3-veh .hint-line { margin-top: 2px; }
.g3-stage { grid-column: 2; grid-row: 2; pointer-events: auto; position: relative; cursor: grab; touch-action: none; min-height: 100px; }
.g3-stage:active { cursor: grabbing; }
.g3-tip { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); padding: 3px 10px; border-radius: 10px; background: rgba(10,8,6,.55); font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; color: rgba(243,234,216,.6); white-space: nowrap; pointer-events: none; }
/* the boxes: a bar down the left in the colour of what they are; the one on show lit up */
.shop.g3 .row.box { position: relative; padding: 8px 10px 8px 13px; border-radius: 6px; border: 1px solid rgba(243,234,216,.1); background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(0,0,0,.22)); transition: border-color .15s, background .15s, box-shadow .15s; }
.shop.g3 .row.box::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--acc, #5a4c3a); }
.shop.g3 .row.box.gun { --acc: #f0a030; }
.shop.g3 .row.box.gear { --acc: #6ab0e0; }
.shop.g3 .row.box.lights { --acc: #ffe070; }
.shop.g3 .row.box.crew { --acc: #6ac8ff; }
.shop.g3 .row.box.svc-box { --acc: #7fd36a; }
.shop.g3 .row.box.empty { --acc: transparent; background: rgba(0,0,0,.18); border-style: dashed; }
.shop.g3 .box.on { border-color: rgba(255,207,106,.8); box-shadow: 0 0 0 1px rgba(255,207,106,.28), 0 0 20px rgba(255,190,80,.2); }
.shop.g3 .row.box.on { background: linear-gradient(90deg, rgba(255,207,106,.16), rgba(0,0,0,.22)); }
.shop.g3 .card.box { transition: border-color .15s, box-shadow .15s; }
.shop.g3 .card.box:hover:not(.on) { border-color: rgba(243,234,216,.28); }
.row .pin { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #ffcf6a; background: #2a2018; border: 1.5px solid #f0a030; }
.row.empty .pin { border-style: dashed; border-color: #6a5a44; color: var(--ink-dim); }
.row .acts { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; flex: none; margin-left: auto; }
.shop.g3 .row.svc-box { flex-direction: column; align-items: stretch; gap: 6px; }
.svc-l { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.svc-l .k { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; color: var(--ink-dim); }
.svc-l .hpbar { margin: 0; }
.svc-l .hint-line { margin: 0; white-space: nowrap; }
.g3-r .tabs { flex-wrap: wrap; }
.g3-r .tabs button { flex: 1 1 auto; padding: 8px 7px; font-size: 12px; letter-spacing: .3px; white-space: nowrap; }      /* (three to a row) */
.g3-r .cards { grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); }
.cards.one, .g3-r .cards.one { grid-template-columns: 1fr; }
.card.veh .vbuy { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 92px; }
/* the before/after panel under the rig */
.g3-compare { grid-column: 2; grid-row: 3; justify-self: center; width: min(600px, 100%); pointer-events: auto; padding: 9px 14px 10px; border-radius: 8px;
    border: 1px solid rgba(255,207,106,.16); background: rgba(14,11,8,.8); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.g3-compare.pv { border-color: rgba(255,207,106,.5); box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 22px rgba(255,190,80,.12); }
.cmp-h { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 14px; white-space: nowrap; overflow: hidden; }
.cmp-h b { overflow: hidden; text-overflow: ellipsis; }
.tag.pv { background: #ffcf6a; color: #2a1604; }
.tag.cur { background: #3a332a; color: var(--ink); }
.cmp-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 20px; }
.cmp { display: grid; grid-template-columns: 70px minmax(30px, 1fr) auto; align-items: center; gap: 8px; font-size: 12px; }
.cmp .k { font-size: 10px; font-weight: 700; letter-spacing: 1.4px; color: var(--ink-dim); white-space: nowrap; }
.cmp i { position: relative; height: 6px; border-radius: 3px; overflow: hidden; background: rgba(255,255,255,.08); }
.cmp i b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #a87020, #ffcf6a); transition: width .25s; }
.cmp i u { position: absolute; top: 0; bottom: 0; }
.cmp i u.up { background: #8fe06a; box-shadow: 0 0 8px rgba(127,211,106,.9); animation: g3up .9s ease-in-out infinite alternate; }
.cmp i u.down { background: repeating-linear-gradient(135deg, #ff5a42 0 3px, #7a2014 3px 6px); }
@keyframes g3up { from { opacity: .55; } to { opacity: 1; } }
.cmp .v { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.cmp .v em { font-style: normal; margin-left: 5px; }
.cmp.up .v em { color: var(--good); }
.cmp.down .v em { color: var(--bad); }
.cmp-chips { display: flex; gap: 16px; margin-top: 8px; font-size: 10px; letter-spacing: 1.3px; color: var(--ink-dim); }
.cmp-chips b { color: var(--ink); font-size: 11px; }
.cmp-chips .up b { color: var(--good); }
.cmp-chips .down b { color: var(--bad); }
/* the Haven tab: the map of the road out where the before/after panel goes (no wider than keeps the rig its room); the
   where-to list and the people as boxes; no mount pins */
.g3-map { grid-column: 2; grid-row: 3; justify-self: center; width: min(780px, 100%, 82vh); pointer-events: auto; padding: 8px 12px 9px; border-radius: 8px;
    border: 1px solid rgba(255,207,106,.16); background: rgba(14,11,8,.8); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.g3-map .cmp-h .hint-line { margin: 0; font-size: 12px; }
.g3-map .hv-map { background: rgba(0,0,0,.32); }
.g3-map .hv-key { margin: 6px 0 0; font-size: 10.5px; }
.g3-over.hv .g3-pins { display: none; }
.shop.g3 .hv-where { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.shop.g3 .hv-where .row.box.on { background: linear-gradient(90deg, rgba(255,208,96,.14), rgba(0,0,0,.22)); }
.shop.g3 .hv-bld.built { border-color: rgba(255,207,106,.35); }
.shop.g3 .g3-l .hv-report:first-of-type { margin-top: 6px; }
/* (the left panel is narrow: the haul's chips go under its number, and a box's button under its words) */
.g3-l .hv-haul { grid-template-columns: 1fr; margin-top: 6px; }
.g3-l .hv-haul-chips { grid-column: 1; grid-row: auto; margin-top: 8px; }
.g3-l .hv-ask { flex-wrap: wrap; }
.g3-l .hv-ask > span:not(.hv-ic) { flex: 1 1 calc(100% - 40px); }
.g3-l .hv-ask > button { margin-left: auto; }
/* the line from the box on show to its part, and the numbered pins on the mounts */
.g3-over { position: absolute; inset: 0; pointer-events: none; }
.g3-lines { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; opacity: 0; transition: opacity .15s; }
.g3-over.lead .g3-lines { opacity: 1; }
.g3-lead { fill: none; stroke: #ffcf6a; stroke-width: 1.8; stroke-dasharray: 7 4; animation: g3dash .8s linear infinite; filter: drop-shadow(0 0 2px rgba(0,0,0,.95)); }
.g3-over.behind .g3-lead { stroke-opacity: .5; }
.g3-dot { fill: #ffcf6a; filter: drop-shadow(0 0 6px rgba(255,190,80,.95)); }
.g3-ring { fill: none; stroke: #ffcf6a; stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: g3ring 1.3s ease-out infinite; }
@keyframes g3dash { to { stroke-dashoffset: -22; } }
@keyframes g3ring { from { transform: scale(.45); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }
.g3-pins { position: absolute; inset: 0; }
.g3-pin { position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 800 11px var(--font); color: #ffcf6a;
    background: rgba(20,14,8,.85); border: 1.5px solid rgba(240,160,48,.95); box-shadow: 0 2px 8px rgba(0,0,0,.7); pointer-events: auto; cursor: pointer; will-change: transform; }
.g3-pin.empty { border-style: dashed; color: var(--ink-dim); border-color: rgba(200,180,150,.7); }
.g3-pin.on { background: #ffcf6a; color: #2a1604; border-color: #fff0c0; box-shadow: 0 0 14px rgba(255,200,90,.95); }
/* narrower screens: slimmer boxes */
@media (max-width: 1180px) {
    .screen .shop.g3 { grid-template-columns: minmax(240px, 27%) minmax(0, 1fr) minmax(250px, 29%); gap: 0 10px; padding: 0 10px 10px; }
    .shop.g3 > header h1 { font-size: 34px; letter-spacing: 5px; }
    .shop.g3 > header .cash { font-size: 30px; }
    .shop.g3 .g3-veh h2 { font-size: 24px; }
    .g3-r .cards { grid-template-columns: 1fr; }
    .cmp-rows { grid-template-columns: 1fr; gap: 3px 20px; }
}
/* a window taller than it is wide: the rig on top, the boxes side by side under it */
@media (max-aspect-ratio: 5/4) {
    .screen .shop.g3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto minmax(200px, 38%) auto minmax(0, 1fr); gap: 8px 10px; }
    .g3-stage { grid-column: 1 / -1; grid-row: 2; }
    .g3-compare, .g3-map { grid-column: 1 / -1; grid-row: 3; }
    .g3-map { width: min(100%, 48vh); }      /* (the panels under it keep their room) */
    .g3-l { grid-column: 1; grid-row: 4; }
    .g3-r { grid-column: 2; grid-row: 4; }
    .cmp-rows { grid-template-columns: 1fr 1fr; gap: 4px 22px; }
}
.cmp .v em small { font-size: 1em; }
/* a short screen (a phone on its side): the boxes are zoomed down with everything else (.screen above); the numbers stay
   two to a line and lose their percentages, so the rig keeps its room */
@media (max-height: 560px) {
    .shop.g3 > header.g3-top { padding: 6px 14px 8px; }
    .g3-tip { display: none; }
    .g3-compare, .g3-map { padding: 6px 12px 7px; }
    .g3-map .hv-key { display: none; }
    .cmp-h { margin-bottom: 4px; }
    .cmp-rows { grid-template-columns: 1fr 1fr; gap: 2px 16px; }
    .cmp { grid-template-columns: 62px minmax(24px, 1fr) auto; }
    .cmp .v em small { display: none; }
    .cmp-chips { margin-top: 4px; }
}
/* (an upgrade's firepower gain on its button, as the Original has it) */
.row button .gain { color: inherit; font-weight: 800; margin-left: 3px; padding: 0 4px; border-radius: 3px; background: rgba(0,0,0,.16); }
