:root { --ink: #ece4cf; --dim: #9b927e; --amber: #e2a72e; --red: #ff4a3a; --cyan: #7ff0ff; --panel: rgba(18, 16, 15, 0.86); --line: #5a5144; }
html, body { margin: 0; height: 100%; background: #17161a; color: var(--ink); overflow: hidden;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; -webkit-user-select: none; user-select: none; touch-action: none; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  /* keep bottom UI clear of floating mobile browser toolbars (Arc, Safari) */
  padding: env(safe-area-inset-top) 16px calc(env(safe-area-inset-bottom) + 72px); }
.screen[hidden], [hidden] { display: none !important; }
h1 { margin: 0; font-size: clamp(48px, 13vw, 120px); line-height: 0.85; letter-spacing: 0.04em; text-align: center; font-weight: 900;
  color: var(--ink); text-shadow: 4px 4px 0 #000, -1px -1px 0 #000, 0 0 0 transparent; font-style: italic; }
h2 { margin: 0; font-size: 22px; letter-spacing: 0.2em; }
.foot { margin: 0; color: var(--dim); font-size: 12px; text-shadow: 1px 1px 0 #000; }
button { font: inherit; color: inherit; cursor: pointer; }
button.big { font-size: 18px; font-weight: 800; letter-spacing: 0.18em; padding: 14px 36px; border: 2px solid #000; border-radius: 0;
  background: var(--amber); color: #1a1408; box-shadow: 4px 4px 0 #000; }
button.big:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }
button.ghost { background: none; border: 0; color: var(--dim); letter-spacing: 0.15em; padding: 10px; text-decoration: underline; }
#title .big { animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.55; } }

/* garage */
#garage { align-items: flex-end; justify-content: center; padding-right: max(16px, env(safe-area-inset-right)); }
.g-panel { width: min(400px, 100%); background: var(--panel); border: 2px solid var(--line); box-shadow: 6px 6px 0 #000; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.g-panel header { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--line); padding-bottom: 8px; }
#credits { color: var(--amber); font-size: 13px; }
.to-lab { margin-left: auto; margin-right: 12px; color: var(--cyan); font-size: 12px; letter-spacing: 0.12em; text-decoration: none; }
.slot { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; align-items: stretch; min-height: 50px; background: #1a1714; border: 1px solid var(--line); font-size: 12px; }
.slot-mid { min-width: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; padding: 4px 2px; text-align: center; }
.slot label { color: var(--dim); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; }
.slot label i { font-style: normal; margin-left: 5px; padding: 0 3px; font-size: 9px; color: #1a1408; background: var(--dim); }
.slot i.t-1h, .slot i.t-2h { font-style: normal; font-weight: 900; font-size: 11px; padding: 0 4px; margin-left: 4px; } .slot i.t-1h { background: #4a4440; color: var(--ink); } .slot i.t-2h { background: #ff7a3a; color: #000; }
.slot label i.t-blade { background: var(--cyan); } .slot label i.t-gun { background: var(--amber); } .slot label i.t-shield { background: #b8c4cc; }
.slot span { max-width: 100%; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.slot button { height: auto; min-height: 48px; background: #2a2622; border: 0; color: var(--amber); font-size: 13px; }
.slot.fixed span { color: var(--dim); font-size: 11px; }
.slot button:disabled { color: #4a443c; }
.slot button:active { background: var(--amber); color: #000; }
#gstats { display: flex; flex-direction: column; gap: 4px; border-top: 2px solid var(--line); padding-top: 8px; }
.stat { display: grid; grid-template-columns: 74px 1fr 84px; align-items: center; gap: 8px; font-size: 12px; }
.stat label { color: var(--dim); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.stat i { height: 8px; background: #2a2622; border: 1px solid #000; }
.stat s { display: block; height: 100%; background: var(--cyan); }
.stat em { font-style: normal; text-align: right; }
.stat.bad s { background: var(--red); } .stat.bad em { color: var(--red); }
.overweight { margin: 0; color: var(--red); font-size: 12px; animation: blink 0.8s steps(2) infinite; }
#sortie { align-self: stretch; }
@media (max-aspect-ratio: 1/1) {
  /* (phone: a compact panel docked low, leaving the top of the screen to the mech) */
  #garage { align-items: center; justify-content: flex-end; padding-bottom: calc(env(safe-area-inset-bottom) + 14px); }
  .g-panel { padding: 8px 10px; gap: 5px; }
  .g-panel header { padding-bottom: 5px; }
  .g-panel h2 { font-size: 17px; }
  .slot { font-size: 11px; min-height: 44px; }
  .slot button { min-height: 42px; }
  .slot-mid { padding: 2px; gap: 1px; }
  #slots { gap: 4px; }
  .g-panel header .to-lab { font-size: 11px; margin-right: 8px; }
  #gstats { gap: 2px; padding-top: 5px; }
  #sortie { padding-top: 10px; padding-bottom: 10px; }
}

/* hud */
#hud { position: fixed; inset: 0; pointer-events: none; text-shadow: 2px 2px 0 #000; z-index: 3; } /* above the touch pad, so PAUSE and TAKE stay tappable */
#hud .bars { position: absolute; left: max(14px, env(safe-area-inset-left)); top: calc(env(safe-area-inset-top) + 12px); display: flex; flex-direction: column; gap: 6px; }
#hud .bars > div { display: grid; grid-template-columns: 26px min(46vw, 240px) auto; align-items: center; gap: 8px; font-size: 12px; }
#hud .bars i { height: 10px; background: rgba(0, 0, 0, 0.6); border: 1px solid #000; }
#hud .bars s { display: block; height: 100%; background: var(--ink); transition: width 0.1s linear; }
#hud .en s { background: var(--cyan); }
#hud .jt s { background: #ff9a3a; } /* (the jet fuel: orange like the rockets) */
#hud .jt i { height: 6px; }
#hud .low s { background: var(--red); animation: blink 0.5s steps(2) infinite; }
#hud em { font-style: normal; font-size: 14px; font-weight: 800; }
#hud .wave { position: absolute; top: calc(env(safe-area-inset-top) + 14px); right: 62px; font-size: 12px; letter-spacing: 0.12em; color: var(--amber); }
#hud .wave.hurry { color: var(--red); animation: blink 0.5s steps(2) infinite; }
/* the rival's bar: its name over a wide red bar, top centre */
#boss { position: absolute; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + 70px); width: min(60vw, 420px); text-align: center; }
#boss b { display: block; font-size: 12px; letter-spacing: 0.14em; color: var(--red); margin-bottom: 4px; }
#boss i { display: block; height: 8px; background: rgba(0, 0, 0, 0.6); border: 1px solid #000; }
#boss s { display: block; height: 100%; background: var(--red); transition: width 0.1s linear; }
#pausebtn { pointer-events: auto; position: absolute; top: calc(env(safe-area-inset-top) + 6px); right: max(10px, env(safe-area-inset-right)); width: 40px; height: 34px;
  background: rgba(0, 0, 0, 0.5); border: 1px solid var(--line); font-weight: 900; }
#callout { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font-size: clamp(22px, 6vw, 44px); font-weight: 900; font-style: italic;
  letter-spacing: 0.12em; color: var(--ink); text-shadow: 3px 3px 0 #000; opacity: 0; transition: opacity 0.2s; }
#callout.pop { animation: pop 0.25s steps(3); }
@keyframes pop { from { transform: scaleY(0.2); } }
.legend { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; margin: 0; font-size: 11px; color: var(--dim); letter-spacing: 0.08em; }
.legend b { color: var(--ink); margin-left: 10px; }
body.touch .legend { display: none; }

/* touch pad */
#pad { position: fixed; inset: 0; display: none; touch-action: none; }
body.touch[data-screen="play"] #pad { display: block; }
.stick-zone { position: absolute; left: 0; top: 30%; bottom: calc(env(safe-area-inset-bottom) + 112px); width: 55%; }
.ring.idle, .knob.idle { opacity: 0.35; }
/* the strafe slider, under the stick: a track with a thumb that springs back to the middle */
.slider { position: absolute; left: max(16px, env(safe-area-inset-left)); bottom: calc(env(safe-area-inset-bottom) + 40px);
  width: min(calc(100vw - 214px), 280px); /* (room for the JUMP pill on the right) */ touch-action: none; }
.slider .track { position: relative; height: 54px; border: 2px solid #000; background: rgba(30, 26, 22, 0.7); box-shadow: 3px 3px 0 #000; }
.slider .ticks { position: absolute; left: 22px; right: 22px; top: 50%; height: 2px; transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, rgba(236, 228, 207, 0.4) 0 2px, transparent 2px 25%); }
.slider .thumb { position: absolute; top: 5px; bottom: 5px; width: 40px; left: calc(var(--u, 0.5) * (100% - 40px));
  background: rgba(236, 228, 207, 0.8); border: 2px solid #000; transition: left 0.12s; }
.slider.active .thumb { background: var(--amber); transition: none; }
.slider span { position: absolute; left: 0; right: 0; top: -18px; text-align: center; font-size: 11px; letter-spacing: 0.2em; white-space: nowrap; color: var(--dim); text-shadow: 1px 1px 0 #000; }
.ring, .knob { position: absolute; left: 0; top: 0; display: none; pointer-events: none; border-radius: 50%; }
.ring { width: 120px; height: 120px; margin: -60px 0 0 -60px; border: 2px solid rgba(236, 228, 207, 0.5); background: rgba(0, 0, 0, 0.25); }
.knob { width: 52px; height: 52px; margin: -26px 0 0 -26px; background: rgba(236, 228, 207, 0.75); border: 2px solid #000; }
#pad button { position: absolute; border: 2px solid #000; border-radius: 50%; background: rgba(30, 26, 22, 0.7); color: var(--ink);
  font-weight: 900; font-size: 11px; letter-spacing: 0.08em; box-shadow: 3px 3px 0 #000; touch-action: none; }
#pad button.on { background: var(--amber); color: #000; transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
.b-slash, .b-shoot { width: 78px; height: 78px; bottom: calc(env(safe-area-inset-bottom) + 96px); font-size: 12px !important; border-color: var(--amber) !important; }
/* (the hand buttons: the same size side by side, left hand on the left; the shoulder gun's on top) */
.b-slash { right: max(18px, env(safe-area-inset-right)); }
.b-shoot { right: calc(max(18px, env(safe-area-inset-right)) + 86px); }
.b-shoulder { width: 66px; height: 66px; right: calc(max(18px, env(safe-area-inset-right)) + 49px); bottom: calc(env(safe-area-inset-bottom) + 184px); font-size: 11px !important; letter-spacing: 0 !important; }
/* (the grabber arms' own button: GRAB by something to lift, THROW while holding it) */
#pad .b-grab { width: 66px; height: 66px; right: calc(max(18px, env(safe-area-inset-right)) + 49px); bottom: calc(env(safe-area-inset-bottom) + 262px); font-size: 11px; letter-spacing: 0; border-color: #ff9a3a; }
.b-shoulder small { display: block; font-size: 9px; opacity: 0.85; margin-top: 2px; }
.b-shoulder.on { background: rgba(226, 167, 46, 0.35) !important; }
.b-shoulder.empty small { color: #ff6a5a; }
.b-boost { width: 64px; height: 64px; right: calc(max(18px, env(safe-area-inset-right)) + 124px); bottom: calc(env(safe-area-inset-bottom) + 184px); }
/* (2026-12-03, his ask: jump at the bottom, easier to reach) a wide pill under the two hand buttons */
#pad .b-jump { width: 164px; height: 54px; border-radius: 27px; right: max(18px, env(safe-area-inset-right)); bottom: calc(env(safe-area-inset-bottom) + 30px); font-size: 12px; }

/* pause / result */
#pause, #result { background: rgba(10, 9, 8, 0.72); }
#r-body { width: min(320px, 100%); border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); padding: 8px 0; }
#r-body p { display: flex; justify-content: space-between; margin: 6px 0; font-size: 14px; }
#r-body span { color: var(--dim); }
#r-body .net b { color: var(--amber); }
/* the mission grade (2026-11-28) */
#r-body .grade { display: flex; align-items: center; gap: 14px; margin: 4px 0 8px; }
#r-body .grade b { font-size: 64px; line-height: 1; font-weight: 900; font-style: italic; color: var(--ink); text-shadow: 3px 3px 0 #000; }
#r-body .grade span { font-size: 12px; letter-spacing: 0.12em; color: var(--dim); }
#r-body .g-S b { color: var(--amber); }
#r-body .g-A b { color: var(--cyan); }
#r-body .g-F b { color: var(--red); }
#r-body .gl { font-size: 12px; margin: 3px 0; }
#r-body .gl .up { color: var(--cyan); }
#r-body .gl .down { color: var(--red); }

#errline { position: fixed; left: 0; right: 0; top: 0; z-index: 99999; background: #a00; color: #fff;
  font: 12px/1.3 monospace; padding: 4px 8px; white-space: pre-wrap; pointer-events: none; }

@media (max-width: 560px) {
  #hud .wave { top: calc(env(safe-area-inset-top) + 56px); left: max(14px, env(safe-area-inset-left)); right: auto; }
  #boss { top: calc(env(safe-area-inset-top) + 82px); width: 72vw; }
  #hud .bars > div { grid-template-columns: 26px calc(100vw - 150px) auto; }
}

/* cockpit HUD */
#crosshair { display: none; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 2px solid rgba(236, 228, 207, 0.6); border-radius: 50%; }
#crosshair::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; background: var(--amber); }
#minimap { position: absolute; right: max(10px, env(safe-area-inset-right)); top: calc(env(safe-area-inset-top) + 48px); width: 120px; height: 120px; border: 2px solid #000; box-shadow: 3px 3px 0 #000; image-rendering: pixelated; }
#take { pointer-events: auto; position: absolute; left: 50%; top: calc(50% + 34px); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 18px; border: 2px solid #000; background: var(--amber); color: #1a1408;
  font-weight: 800; font-size: 13px; letter-spacing: 0.12em; box-shadow: 4px 4px 0 #000; text-shadow: none; z-index: 2; }
#take b { font-size: 14px; letter-spacing: 0.04em; }
#take small { font-size: 11px; font-weight: 600; opacity: 0.8; }
body.touch #take small { display: none; }
@media (max-width: 560px) { #minimap { top: calc(env(safe-area-inset-top) + 80px); width: 96px; height: 96px; } }
body.smooth #view { image-rendering: auto; }
.g-panel header .ps1-toggle, .g-panel header .cam-toggle, .g-panel header .camy-toggle { margin-left: 10px; padding: 2px 6px; font-size: 11px; letter-spacing: 0.08em; }

/* hit feedback: red edge flash when you're hit, the hit counter, damage numbers */
#hurt { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(200, 20, 10, 0.75) 100%); }
#dmgs { position: absolute; inset: 0; overflow: hidden; }
.dmg { position: absolute; left: 0; top: 0; opacity: 0; font-weight: 900; font-size: 18px; color: #ffe08a; text-shadow: 2px 2px 0 #000; will-change: transform; }
.dmg.big { font-size: 28px; color: #fff; text-shadow: 2px 2px 0 #c8361e, 4px 4px 0 #000; }
#combo { position: absolute; right: max(16px, env(safe-area-inset-right)); top: calc(env(safe-area-inset-top) + 180px); opacity: 0; transition: opacity 0.2s;
  font-weight: 900; font-style: italic; letter-spacing: 0.1em; font-size: 14px; color: var(--ink); text-align: right; }
#combo b { display: block; font-size: 40px; line-height: 1; color: var(--amber); }
#combo.pop b { animation: pop 0.18s steps(3); }
/* phone held sideways: a compact panel that scrolls, so SORTIE is always reachable */
@media (min-aspect-ratio: 1/1) and (max-height: 520px) {
  #garage { padding-top: calc(env(safe-area-inset-top) + 8px); padding-bottom: calc(env(safe-area-inset-bottom) + 8px); }
  .g-panel { max-height: 100%; overflow-y: auto; padding: 8px 10px; gap: 4px; }
  .g-panel h2 { font-size: 16px; }
  .slot { min-height: 44px; }
  .slot button { min-height: 42px; }
  #gstats { gap: 1px; padding-top: 4px; }
  #sortie { padding-top: 8px; padding-bottom: 8px; position: sticky; bottom: 0; flex-shrink: 0; }
}

/* garage tabs and the COLOUR tab */
.g-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.g-tabs button { height: 30px; background: #2a2622; border: 1px solid var(--line); color: var(--dim); font-weight: 900; font-size: 12px; letter-spacing: 0.14em; }
.g-tabs button.on { background: var(--amber); color: #1a1408; border-color: #000; }
.g-tab { display: flex; flex-direction: column; gap: 4px; }
#slots { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } /* (two columns: a shorter panel, more mech) */
#swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
#swatches button { display: flex; height: 34px; padding: 3px; gap: 2px; background: #1a1714; border: 2px solid var(--line); }
#swatches button i { flex: 1; }
#swatches button i:last-child { flex: 0 0 22%; }
#swatches button.on { border-color: var(--amber); box-shadow: 0 0 0 1px #000; }
.paint-name { margin: 6px 0 0; font-size: 11px; letter-spacing: 0.16em; color: var(--dim); }
.colour { display: grid; grid-template-columns: 74px 1fr 76px; align-items: center; gap: 8px; font-size: 12px; }
.colour span { color: var(--dim); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.colour input { width: 100%; height: 30px; padding: 0; border: 1px solid var(--line); background: #1a1714; cursor: pointer; }
.colour input::-webkit-color-swatch-wrapper { padding: 2px; }
.colour input::-webkit-color-swatch { border: 0; }
.colour em { font-style: normal; text-align: right; font-size: 12px; }
@media (max-aspect-ratio: 1/1) {
  .g-tabs button { height: 28px; }
  #swatches button { height: 28px; }
  .colour input { height: 26px; }
}

/* dash speed lines: thin streaks round the edge, clear in the middle */
#speed { position: absolute; inset: 0; opacity: 0;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(236, 228, 207, 0.55) 0deg 0.6deg, transparent 0.6deg 7deg);
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 38%, #000 80%); mask-image: radial-gradient(ellipse at center, transparent 38%, #000 80%); }

/* stage picker */
.stage-pick { display: grid; grid-template-columns: 36px 1fr 36px; gap: 4px; align-items: stretch; border-top: 2px solid var(--line); padding-top: 8px; }
.stage-pick button { background: #2a2622; border: 1px solid var(--line); color: var(--amber); font-size: 12px; }
.stage-pick button:active { background: var(--amber); color: #000; }
/* (the arena's three missions, under the stage picker) */
.mission-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin-top: 4px; }
.mission-pick button { background: #2a2622; border: 1px solid var(--line); color: var(--ink); font-size: 11px; font-weight: 900; letter-spacing: 0.04em; padding: 6px 4px; line-height: 1.2; }
.mission-pick button small { display: block; font-weight: 400; font-size: 11px; color: var(--dim); letter-spacing: 0; }
.mission-pick button.on { background: var(--amber); color: #000; border-color: #000; }
.mission-pick button.on small { color: #3a2a10; }
#stage-name { min-width: 0; overflow: hidden; text-align: center; font-weight: 900; letter-spacing: 0.12em; font-size: 13px; line-height: 1.25; }
#stage-name b { color: var(--amber); margin-right: 4px; }
#stage-name i { font-style: normal; color: #5aff8a; }
#stage-name small { display: block; font-weight: 400; letter-spacing: 0.04em; font-size: 10px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-aspect-ratio: 1/1) { .stage-pick { padding-top: 5px; } }

/* the finisher's letterbox: black bars close in from top and bottom */
#cine { position: absolute; inset: 0; pointer-events: none; }
#cine::before, #cine::after { content: ''; position: absolute; left: 0; right: 0; height: 0; background: #000; transition: height 0.25s ease-out; }
#cine::before { top: 0; } #cine::after { bottom: 0; }
#cine.on::before, #cine.on::after { height: 11vh; }
/* (2026-11-30) a portrait finisher: the touch controls fade so the cinematic shows (input is the finisher's anyway) */
#pad { transition: opacity 0.25s; }
@media (orientation: portrait) { body:has(#cine.on) #pad { opacity: 0.12; } }
/* a perfect dodge: a cold blue tint closing in from the edges while the world slows */
#dodge { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.2s; box-shadow: inset 0 0 22vmin rgba(90, 170, 255, 0.55); background: rgba(60, 120, 220, 0.08); }
#dodge.on { opacity: 1; }
/* low AP: a red alarm pulsing at the screen edge */
#alarm { position: absolute; inset: 0; pointer-events: none; opacity: 0; box-shadow: inset 0 0 18vmin rgba(255, 40, 30, 0.6); }
body.low-ap[data-screen="play"] #alarm { animation: alarm 1.1s ease-in-out infinite; }
@keyframes alarm { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.85; } }
.leg-trait { margin: 4px 0 0; font-size: 11px; letter-spacing: 0.06em; color: var(--dim); }

/* (2026-11-29) weight you can read: a load meter over the slots, each card's own weight */
#gload { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; font-size: 11px; padding: 4px 6px; background: #1a1714; border: 1px solid var(--line); }
#gload label { color: var(--dim); letter-spacing: 0.12em; }
#gload i { height: 8px; background: #2a2622; border: 1px solid #000; position: relative; }
#gload s { display: block; height: 100%; background: var(--cyan); }
#gload em { font-style: normal; white-space: nowrap; }
#gload.over s { background: var(--red); } #gload.over em { color: var(--red); }
#gload.near s { background: var(--amber); }
.slot small { font-size: 9px; color: var(--dim); letter-spacing: 0.06em; white-space: nowrap; }
.slot small.cap { color: var(--cyan); }
.wt-list { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 11px; margin: 4px 0 0; }
.wt-list span { color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; }
.wt-list b { text-align: right; font-weight: 400; }
.wt-list .tot { color: var(--amber); border-top: 1px solid var(--line); padding-top: 2px; }
.combo-list { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 11px; margin: 6px 0 0; border-top: 1px solid var(--line); padding-top: 4px; }
.combo-list label { grid-column: 1 / -1; color: var(--amber); letter-spacing: 0.08em; }
.combo-list span { color: var(--dim); }
.combo-list b { text-align: right; font-weight: 400; }
/* garage zoom: + / − over the free view (wheel and pinch work too) */
.g-zoom { position: absolute; left: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.g-zoom button { width: 40px; height: 40px; background: #2a2622cc; border: 1px solid var(--line); color: var(--amber); font-size: 20px; line-height: 1; }
.g-zoom button:active { background: var(--amber); color: #000; }

/* PILOTS mode (2026-11-30): the garage screen with a pilot list in place of the parts tabs */
.pm { display: none; }
body.pilot-mode .gm { display: none; }
body.pilot-mode .pm { display: inline; }
#pilots { display: none; }
body.pilot-mode #pilots { display: block; }
body.pilot-mode .g-tabs, body.pilot-mode .g-tab, body.pilot-mode .overweight, body.pilot-mode .to-lab { display: none !important; }
.to-mode { font-size: 11px; padding: 3px 8px; letter-spacing: 0.08em; }
.pl-grid { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 48px; gap: 4px; max-height: calc(5 * 48px + 4 * 4px); overflow-y: auto; } /* (2026-11-30: at most five rows, so the robot stays in view) */
@media (max-width: 520px) { .pl-grid { grid-template-columns: repeat(3, 1fr); } }
.pl-grid button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 5px 7px; min-height: 48px; overflow: hidden; font-size: 11px; letter-spacing: 0.06em; text-align: left; background: var(--panel2, rgba(255,255,255,0.04)); border: 1px solid var(--line); color: inherit; }
.pl-grid button b { color: var(--dim); font-weight: 400; font-size: 11px; }
.pl-grid button small { color: var(--dim); font-size: 11px; }
.pl-grid button.on { border-color: var(--amber); color: var(--amber); }
.pl-card { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; }
.pl-card h3 { margin: 0 0 2px; font-size: 15px; letter-spacing: 0.1em; display: flex; justify-content: space-between; align-items: baseline; }
.pl-card h3 small { color: var(--amber); font-size: 11px; }
.pl-card > p { margin: 0 0 6px; font-size: 11px; color: var(--dim); }
.pl-wpn { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; margin-bottom: 6px; }
.pl-wpn i { font-style: normal; font-size: 11px; margin-left: 4px; padding: 1px 3px; border: 1px solid var(--line); color: var(--dim); }
#title #pl-btn { animation: none; margin-top: 12px; }

/* (2026-11-30, "make the garage more compact, see the character bigger") the parts tab split into FRAME /
   WEAPONS, tighter cards, and a fold button that drops the panel to a slim bar (the camera re-fits) */
.g-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.g-sub button { height: 30px; background: #1a1714; border: 1px solid var(--line); color: var(--dim); font-size: 11px; font-weight: 800; letter-spacing: 0.14em; }
.g-sub button.on { color: var(--amber); border-color: var(--amber); }
.g-panel { padding: 10px 12px; gap: 7px; }
.slot { min-height: 44px; }
.slot button { min-height: 44px; }
.slot-mid { padding: 2px; gap: 1px; }
.g-fold { margin-left: 8px; padding: 6px 9px; min-height: 32px; background: #2a2622; border: 1px solid var(--line); color: var(--amber); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; }
.g-fold .fol { display: none; }
body.g-folded .g-fold .fol { display: inline; } body.g-folded .g-fold .unf { display: none; }
body.g-folded .g-panel > :not(header):not(.stage-pick):not(.mission-pick):not(#sortie) { display: none !important; }
body.g-folded .g-panel header { border-bottom: 0; padding-bottom: 0; }
body.g-folded .g-panel header #credits, body.g-folded .g-panel header .ps1-toggle, body.g-folded .g-panel header .cam-toggle, body.g-folded .g-panel header .camy-toggle { display: none; }
.g-panel header { position: relative; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-right: 74px; }
.g-panel header .g-fold { position: absolute; right: 0; top: -2px; margin: 0; }
.g-panel header .to-lab, .g-panel header .to-mode, .g-panel header .ps1-toggle, .g-panel header .cam-toggle, .g-panel header .camy-toggle { white-space: nowrap; margin-left: 0; }
body.g-folded .g-panel { position: fixed; box-sizing: border-box; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); width: min(340px, calc(100% - 32px)); }

/* ---- WAR mode (2026-11-30, war.js): morale, KO count, the musou gauge and button ---- */
#war-hud { display: none; position: absolute; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + 40px); width: min(56vw, 380px); text-align: center; pointer-events: none; }
body.war #war-hud { display: block; }
#war-hud .morale { height: 7px; background: #b8402a; border: 1px solid #000; }
#war-hud .morale i { display: block; height: 100%; background: #3a7aff; transition: width 0.3s; }
#war-hud .ko { display: block; margin: 4px 0; font-size: 14px; letter-spacing: 0.14em; color: #ece4cf; text-shadow: 0 1px 0 #000; }
#war-hud .musou { position: relative; height: 9px; margin: 0 auto; width: 70%; background: rgba(0, 0, 0, 0.6); border: 1px solid #000; }
#war-hud .musou i { display: block; height: 100%; background: #c88a20; }
#war-hud .musou span { position: absolute; left: 0; right: 0; top: 15px; font-size: 11px; letter-spacing: 0.16em; color: #c88a20; }
#war-hud .musou.ready i { background: #ffd040; animation: musou-pulse 0.6s infinite alternate; }
#war-hud .musou.ready span { color: #ffd040; }
#war-hud .musou.on i { background: #ff7a20; }
@keyframes musou-pulse { from { filter: brightness(1); } to { filter: brightness(1.7); } }
body.war #boss { top: calc(env(safe-area-inset-top) + 92px); }
#pad .b-musou { right: max(18px, env(safe-area-inset-right)); bottom: calc(env(safe-area-inset-bottom) + 300px); width: 84px; height: 84px; background: rgba(200, 138, 32, 0.85); color: #1a1408; font-weight: bold; animation: musou-pulse 0.6s infinite alternate; }
#war-btn { align-self: stretch; margin-top: 6px; }
body.pilot-mode #war-btn, body.g-folded #war-btn { }
#war-log { display: none; position: absolute; left: max(14px, env(safe-area-inset-left)); top: calc(env(safe-area-inset-top) + 64px); max-width: 44vw; pointer-events: none; font-size: 11px; letter-spacing: 0.06em; color: #ece4cf; text-shadow: 0 1px 0 #000; }
body.war #war-log { display: block; }
#war-log p { margin: 2px 0; opacity: 0.85; }
#war-log p:last-child { opacity: 1; color: #ffd040; }
/* (portrait / narrow: the war HUD stacks under the AP, EN and objective lines instead of over them) */
@media (max-width: 700px), (orientation: portrait) {
  #war-hud { top: calc(env(safe-area-inset-top) + 80px); width: min(62vw, 300px); left: max(14px, env(safe-area-inset-left)); transform: none; text-align: left; }
  #war-hud .musou { margin: 0; width: 100%; }
  #war-log { top: calc(env(safe-area-inset-top) + 142px); max-width: 60vw; }
  body.war #boss { top: calc(env(safe-area-inset-top) + 200px); }
}

/* ---- home screen (2026-12-02, his ask, after bdafighter): the hero on the turntable, its name huge behind
   it (in 3D), the modes along the bottom in a snap row; tap the hero to edit it ---- */
#home { pointer-events: auto; }
#home .h-top { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: calc(env(safe-area-inset-top) + 12px) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
#home .h-logo { font-weight: 900; font-size: 18px; letter-spacing: 0.14em; line-height: 1; color: var(--ink); }
#home .h-logo b { display: block; color: var(--amber); }
#home .h-tools { display: flex; gap: 6px; align-items: center; }
#home .h-tools button { font-size: 11px; padding: 7px 10px; }
.h-credits { font-weight: 900; font-size: 12px; color: var(--amber); letter-spacing: 0.08em; margin-right: 4px; }
#home .h-mid { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 132px); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
#home .h-swap { pointer-events: auto; font-size: 12px; font-weight: 900; padding: 8px 14px; background: rgba(23, 22, 26, 0.88); border: 1px solid var(--amber); color: var(--amber); }
#home .h-hint { margin: 0; font-size: 12px; letter-spacing: 0.18em; color: var(--dim); }
#home .modes { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 16px); display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 max(16px, env(safe-area-inset-left)); justify-content: center; scrollbar-width: none; }
#home .modes::-webkit-scrollbar { display: none; }
#home .modes > * { flex: 0 0 auto; width: min(220px, 62vw); scroll-snap-align: center; text-align: left; padding: 14px 16px; background: rgba(30, 26, 22, 0.88); border: 1px solid var(--line); color: var(--ink); text-decoration: none; display: block; }
#home .modes > * b { display: block; font-size: 16px; letter-spacing: 0.12em; }
#home .modes > * small { display: block; font-size: 12px; color: var(--dim); margin-top: 4px; letter-spacing: 0.04em; }
#home .modes > .on { background: var(--amber); color: #000; border-color: #000; }
#home .modes > .on small { color: #3a2a10; }
@media (max-width: 720px) { #home .modes { justify-content: flex-start; } }
/* ---- the sortie screen: arena and mission, then LAUNCH (a panel like the garage's) ---- */
#missions .m-panel { position: absolute; right: max(16px, env(safe-area-inset-right)); bottom: calc(env(safe-area-inset-bottom) + 16px); width: min(380px, calc(100vw - 32px)); background: rgba(23, 22, 26, 0.94); border: 2px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 8px; pointer-events: auto; }
#missions .m-panel header { display: flex; align-items: center; gap: 10px; }
#missions .m-panel header h2 { margin: 0; flex: 1; font-size: 15px; letter-spacing: 0.16em; }
#missions .m-back { font-size: 11px; padding: 7px 10px; }
#missions .m-desc { margin: 0; font-size: 13px; line-height: 1.45; color: var(--dim); min-height: 3em; }
#missions .stage-pick { border-top: 0; padding-top: 0; }
@media (max-aspect-ratio: 1/1) { #missions .m-panel { left: 16px; right: 16px; width: auto; } }
/* ---- garage: FRAME and WEAPONS merged into 2 x 2 pages that snap sideways ---- */
#slots { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0; scrollbar-width: thin; }
#slots .slot-page { flex: 0 0 100%; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 6px; scroll-snap-align: start; padding-right: 2px; }
.g-done { font-size: 11px; font-weight: 900; padding: 6px 10px; background: var(--amber); color: #000; border: 1px solid #000; margin-right: 6px; }
#slot-dots { display: flex; justify-content: center; gap: 6px; margin-top: 6px; }
#slot-dots i { width: 7px; height: 7px; background: #4a4440; display: block; }
#slot-dots i.on { background: var(--amber); }
/* BRAWL storm (2026-12-04): the screen's edges glow red as you near the storm, fully once you're in it */
#stormglow { position: fixed; inset: 0; pointer-events: none; opacity: 0; box-shadow: inset 0 0 70px 22px rgba(255, 50, 40, 0.75); transition: opacity 0.2s; z-index: 1; }
/* the lock readout over the locked foe: name, metres, AP (2026-12-04) */
#lockinfo { position: absolute; left: 0; top: 0; pointer-events: none; display: grid; grid-template-columns: auto auto; gap: 2px 8px; align-items: baseline; padding: 4px 8px; background: rgba(12, 10, 10, 0.72); border: 1px solid #ff4a3a; color: #ffd6cf; font-size: 12px; font-weight: 900; letter-spacing: 0.04em; white-space: nowrap; margin-top: -6px; }
#lockinfo.gun { border-color: #ffb347; color: #ffe3b8; }
#lockinfo em { font-style: normal; font-weight: 700; color: #fff; }
#lockinfo i { grid-column: 1 / -1; display: block; height: 4px; background: rgba(0, 0, 0, 0.6); }
#lockinfo s { display: block; height: 100%; background: #ff4a3a; }
#lockinfo.gun s { background: #ffb347; }
/* BEACONS: the score and A-E chips under the objective line (2026-12-04) */
#beacons { position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 34px); transform: translateX(-50%); display: flex; align-items: center; gap: 5px; pointer-events: none; }
#beacons i { width: 24px; height: 24px; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 13px; color: #fff; border: 1px solid #000; background: #6a6a6a; }
#beacons i.p { background: #3a6ad8; } #beacons i.e { background: #d0382a; } #beacons i.c { outline: 2px solid #fff; }
#beacons b { font-size: 15px; font-weight: 900; min-width: 34px; text-align: center; text-shadow: 1px 1px 0 #000; }
#beacons b.ps { color: #7fb0ff; } #beacons b.es { color: #ff8a7a; }
/* (2026-12-04, his notes: "the start button looks too high", then "the logo at the bottom as well so the
   character doesn't look clipped") the name, PRESS START and the tagline sit together near the bottom; the
   mech is framed whole in the space above them (main.js garageFrame frames the title on #title h1) */
#title { justify-content: flex-end; padding-bottom: calc(env(safe-area-inset-bottom) + 7vh); box-sizing: border-box; }
