/* AstraMiner 2: Deep Haul styles. Kit tokens (--rr-*) and the fit shell
   come from assets/ui.css (vendored). Game palette: cold blue + amber. */

:root {
  --am2-bg: #070b14;
  --am2-panel: #0f1828;
  --am2-line: #1f3150;
  --am2-ink: #dce8f7;
  --am2-muted: #8aa0bd;
  --am2-blue: #4fb3ff;
  --am2-amber: #ffb547;
  --am2-danger: #ff5a4f;
  --rr-bg: var(--am2-bg);
  --rr-panel: var(--am2-panel);
  --rr-panel-line: var(--am2-line);
  --rr-ink: var(--am2-ink);
  --rr-muted: var(--am2-muted);
  --rr-accent: var(--am2-amber);
  --rr-accent-soft: rgba(255, 181, 71, 0.14);
  --rr-focus: var(--am2-blue);
}

body { background: var(--am2-bg); }

/* Wrapper: the fit shell fills the window on a phone; on a wide window the
   kit's centred column (ui.css, P067) narrows the shell and this background
   paints either side. */
.game-wrapper { position: fixed; inset: 0; background: var(--am2-bg); overflow: hidden; }

/* No text selection, callouts or double-tap zoom on game UI. */
.game-scroll {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

.menu-bar .menu-title { font-weight: 800; letter-spacing: 0.04em; }
/* Pause only means something during a dive. T569: the pause button moved
   from the bar into the stage (top left, under the HUD row); the pause
   screen keeps volume, Settings and Abandon dive. */
.game-shell:not([data-screen="stage"]) #btn-pause { display: none; }
#btn-pause.stage-pause {
  position: absolute;
  top: 44px;
  left: calc(8px + var(--rr-inset-left));
  z-index: 3;
  background: rgba(8, 10, 18, 0.55);
}

/* Screens share one flex slot; one visible at a time. Each pads its sides
   and bottom by the kit inset tokens; the stage is full bleed. */
.screen {
  flex: 1 1 auto;
  min-height: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--rr-space-3);
  text-align: center;
  position: relative;
  padding: 16px calc(16px + var(--rr-inset-right)) calc(16px + var(--rr-inset-bottom)) calc(16px + var(--rr-inset-left));
}
.screen.visible { display: flex; }

.screen-head { width: 100%; max-width: 420px; display: flex; align-items: baseline; justify-content: space-between; gap: var(--rr-space-2); }
.screen-head h1, .screen-head h2 { margin: 0; letter-spacing: 0.06em; text-transform: uppercase; }
.credits { margin: 0; color: var(--am2-amber); font-weight: 800; font-variant-numeric: tabular-nums; }
.tagline { color: var(--am2-muted); margin: 0; }

.btn.big { min-height: 56px; min-width: 200px; font-size: 1.2rem; letter-spacing: 0.08em; text-transform: uppercase; }
#pause .btn, #debrief .btn, #settings .btn { min-height: 48px; }
#settings .screen-head .btn { min-height: 44px; padding: 0 var(--rr-space-4); }
.dispatch { color: var(--am2-muted); font-style: italic; margin: 0; }

/* Dive stage: canvas fills it; HUD floats at the top; deck pads itself. */
#stage { padding: 0; justify-content: stretch; align-items: stretch; touch-action: none; }
#am2-canvas { display: block; flex: 1 1 auto; width: 100%; min-height: 0; touch-action: none; }
#dive-hud {
  position: absolute;
  top: 8px;
  left: calc(8px + var(--rr-inset-left));
  right: calc(8px + var(--rr-inset-right));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--rr-space-2);
  pointer-events: none;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}
.hud-cell {
  position: relative;
  min-width: 72px;
  background: linear-gradient(180deg, rgba(20, 30, 52, 0.88), rgba(7, 11, 20, 0.88));   /* T211: opaque enough to read without a backdrop blur (a blur re-samples the live canvas every frame) */
  border: 1px solid rgba(120, 160, 220, 0.28);
  border-radius: 12px;
  padding: 5px 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.hud-cell:first-child { color: var(--am2-amber); }
.hud-cell.alert { color: #ffd37a; overflow: hidden; }
.hud-cell.alert.warm { color: #ffb15a; border-color: rgba(255, 150, 60, 0.5); }
.hud-cell.alert.hot { color: var(--am2-danger); border-color: rgba(255, 90, 79, 0.6); }
.hud-cell.alert.alarm { color: #ff3b30; border-color: rgba(255, 60, 50, 0.9); }

/* Game feel (T181): pickup pop on the Haul pill (two identical keyframe sets are alternated so the animation restarts
   without a reflow), Alert glow that grows with the --alert variable (0..1) set from JS, and the shake clip. */
#stage { overflow: hidden; }
#am2-canvas { transform-origin: 50% 50%; }
#dive-deck { position: relative; z-index: 2; }
.hud-cell.pop-a { animation: am2-pop-a 0.22s ease-out; }
.hud-cell.pop-b { animation: am2-pop-b 0.22s ease-out; }
@keyframes am2-pop-a { 0% { transform: scale(1); } 35% { transform: scale(1.16); box-shadow: 0 0 16px rgba(255, 181, 71, 0.75); } 100% { transform: scale(1); } }
@keyframes am2-pop-b { 0% { transform: scale(1); } 35% { transform: scale(1.16); box-shadow: 0 0 16px rgba(255, 181, 71, 0.75); } 100% { transform: scale(1); } }
.hud-cell.alert { --alert: 0; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 calc(var(--alert) * 20px) rgba(255, 90, 60, calc(var(--alert) * 0.85)); }
.hud-cell.alert.hot.alarm { animation: am2-alert-alarm 0.42s ease-in-out infinite; }
/* T211: the endless pulses animate only opacity and transform (the compositor runs them, no repaint a frame):
   a warm veil (::after) brightens the cell instead of filter: brightness(). */
.hud-cell.alert::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: rgba(255, 150, 120, 0.3); opacity: 0; }
.hud-cell.alert.hot::after { animation: am2-veil 0.9s ease-in-out infinite; }
.hud-cell.alert.hot.alarm::after { background: rgba(255, 170, 140, 0.45); animation-duration: 0.42s; }
@keyframes am2-veil { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
@keyframes am2-alert-alarm { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) {
  .hud-cell.pop-a, .hud-cell.pop-b, .hud-cell.alert.hot, .hud-cell.alert.alarm, .hud-cell.alert.hot.alarm, .hud-cell.alert.hot::after { animation: none; }
}
/* T215: Sensors perks in the Alert cell. Icons and an arrow only, never digits. The wave icons are 10 x 10 SVG glyphs; the trend arrow points up
   (Alert rising, warm) or down (falling, cool). Static: nothing animates, so reduced motion needs no override. */
.hud-intel { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; vertical-align: middle; }
.hud-intel[hidden], .hud-wave[hidden], .hud-trend[hidden] { display: none; }
.hud-wave { display: inline-flex; align-items: center; gap: 2px; }
.hud-wave .wi { width: 14px; height: 14px; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.9)); }
.hud-trend { width: 12px; height: 12px; fill: #ff8a5a; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.9)); }
.hud-trend[data-dir="down"] { fill: #7fd8ff; transform: rotate(180deg); }
.alert-meter { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.1); }
.alert-fill, .alert-meter b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb547, #ff5a4f); box-shadow: 0 0 8px rgba(255, 120, 70, 0.8); transition: width 0.25s linear; }
/* T216: the depth floor: the part of the live Alert fill the Alert can never fall back under, drawn darker (the floor is never above the live fill) */
.alert-meter b { position: absolute; left: 0; top: 0; }
.alert-meter b.alert-floor { background: #a3212b; box-shadow: none; }
#dive-deck {
  flex: none;
  display: flex;
  gap: var(--rr-space-3);
  justify-content: space-between;
  padding: 10px calc(12px + var(--rr-inset-right)) calc(10px + var(--rr-inset-bottom)) calc(12px + var(--rr-inset-left));
  background: var(--am2-panel);
  border-top: 1px solid var(--am2-line);
}
.deck-btn { min-height: 56px; flex: 1; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.deck-btn.burn { flex: 2; background: var(--am2-amber); color: #1a1205; }

/* Gadget button (T170): icon over a short name, a conic cooldown sweep, a draining bar while the effect runs, a pop when ready again. */
.deck-btn.gadget { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 6px; min-width: 0;
  background: linear-gradient(180deg, #1c3a60, #10223c); color: #cfe9ff; border: 1px solid rgba(79, 179, 255, 0.5); box-shadow: inset 0 1px 0 rgba(180, 220, 255, 0.18); touch-action: manipulation; --cd: 0; --on: 0; }
.deck-btn.gadget .gico { width: 22px; height: 22px; color: #7fd0ff; filter: drop-shadow(0 0 5px rgba(79, 179, 255, 0.7)); }
.gb-ico { display: flex; }
.gb-name { font-size: 0.68rem; line-height: 1; letter-spacing: 0.08em; white-space: nowrap; }
.deck-btn.gadget::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; background: conic-gradient(rgba(4, 8, 16, 0.5) calc(var(--cd) * 360deg), transparent 0); }
.gb-ico, .gb-name { position: relative; z-index: 1; }
.deck-btn.gadget.cooling::before { opacity: 1; }
.deck-btn.gadget.cooling { color: #9db2d2; border-color: rgba(79, 179, 255, 0.25); }
.deck-btn.gadget.cooling .gico { color: #6f8db8; filter: none; }
.gb-cd { position: absolute; top: 3px; right: 6px; font-size: 0.78rem; line-height: 1; font-weight: 900; color: #fff; text-shadow: 0 0 6px #000, 0 1px 2px #000; pointer-events: none; font-variant-numeric: tabular-nums; }
.gb-cd:empty { display: none; }
.gb-bar { position: absolute; left: 6px; right: 6px; bottom: 3px; height: 3px; border-radius: 2px; background: #9fe0ff; box-shadow: 0 0 8px #6fd0ff; transform-origin: left center; transform: scaleX(0); pointer-events: none; }
.deck-btn.gadget.active .gb-bar { transform: scaleX(var(--on)); }
.deck-btn.gadget.active { box-shadow: 0 0 20px rgba(111, 208, 255, 0.7), inset 0 0 14px rgba(111, 208, 255, 0.35); border-color: #9fe0ff; }
.deck-btn.gadget.ready { box-shadow: 0 0 12px rgba(79, 179, 255, 0.35), inset 0 1px 0 rgba(180, 220, 255, 0.18); }
.deck-btn.gadget.pop { animation: am2-gad-pop 0.7s ease-out; }
@keyframes am2-gad-pop { 0% { transform: scale(1); filter: brightness(1); } 25% { transform: scale(1.1); filter: brightness(1.7); box-shadow: 0 0 28px 6px rgba(130, 215, 255, 0.95); } 100% { transform: scale(1); filter: brightness(1); } }
.deck-btn.gadget.none { background: rgba(12, 20, 34, 0.7); color: #55688a; border: 1px dashed rgba(90, 120, 170, 0.4); box-shadow: none; opacity: 0.8; }
.deck-btn.gadget.none .gb-name { font-size: 0.62rem; letter-spacing: 0.06em; }
@media (prefers-reduced-motion: reduce) { .deck-btn.gadget.pop { animation: none; } }

/* BURN UP (T166): a hold. The white-hot fill (--burn, 0..1 from AM2_ui) grows while it is held; the button pulses
   when the hold is full and goes hot while the ship is burning home. */
.deck-btn.burn { position: relative; overflow: hidden; touch-action: manipulation; }
.deck-btn.burn::before { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(90deg, #ffe7a8, #fffaf0); transform-origin: left center; transform: scaleX(var(--burn, 0)); pointer-events: none; }
.deck-btn.burn > span { position: relative; z-index: 1; }
.deck-btn.burn.holding { box-shadow: 0 0 22px rgba(255, 200, 100, 0.65); }
.deck-btn.burn::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit; background: rgba(255, 246, 220, 0.2); box-shadow: inset 0 0 18px 4px rgba(255, 220, 140, 0.95); opacity: 0; }
.deck-btn.burn.pulse { box-shadow: 0 0 18px 3px rgba(255, 181, 71, 0.55); }   /* a static halo: no per-frame cost */
.deck-btn.burn.pulse::after { animation: am2-veil 0.72s ease-in-out infinite; }   /* T211: a composited inner glow (was an animated box-shadow and filter) */
.deck-btn.burn.burning { background: #ff7a33; color: #fff; box-shadow: 0 0 26px rgba(255, 120, 50, 0.8); }
.deck-btn.burn.burning::before { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .deck-btn.burn.pulse::after { animation: none; opacity: 1; } }
/* A full hold: the Haul pill turns red (colour only, no extra number). */
.hud-cell.full { color: #ff7d6e; border-color: rgba(255, 90, 79, 0.7); background: linear-gradient(180deg, rgba(70, 20, 24, 0.82), rgba(20, 8, 12, 0.82)); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45), 0 0 14px rgba(255, 70, 60, 0.45); }

/* The one-line hint banner over the field, under the HUD; it fades in and out. */
/* T172: the Hive Queen's slim boss bar under the HUD (no number: a bar, a lagging damage trail and notches where the phases change) and her name banner. */
.boss-bar { position: absolute; z-index: 2; top: 50px; left: 50%; width: min(66%, 300px); height: 9px; transform: translateX(-50%); border-radius: 999px; overflow: hidden; background: rgba(18, 6, 12, 0.82); border: 1px solid rgba(255, 110, 140, 0.55); box-shadow: 0 0 14px rgba(255, 60, 100, 0.35), 0 2px 8px rgba(0, 0, 0, 0.6); pointer-events: none; }
.boss-bar[hidden] { display: none; }
.boss-bar b { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transform-origin: left center; }
#boss-trail { background: rgba(255, 226, 190, 0.85); }
#boss-fill { background: linear-gradient(90deg, #8a1230, #ff3d63 60%, #ff8a9e); box-shadow: 0 0 10px rgba(255, 60, 100, 0.8); }
.boss-bar[data-phase="3"] #boss-fill { background: linear-gradient(90deg, #a4150f, #ff6a1f 60%, #ffd070); }
#boss-fill::after { content: ""; position: absolute; inset: 0; background: rgba(255, 236, 190, 0.4); opacity: 0; }
.boss-bar[data-phase="3"] #boss-fill::after { animation: am2-veil 0.7s ease-in-out infinite alternate; }   /* T211: was filter: brightness() */
.boss-ticks { position: absolute; inset: 0; z-index: 2; background: linear-gradient(90deg, transparent calc(33.33% - 1px), rgba(255, 235, 240, 0.8) calc(33.33% - 1px), rgba(255, 235, 240, 0.8) calc(33.33% + 1px), transparent calc(33.33% + 1px), transparent calc(66.66% - 1px), rgba(255, 235, 240, 0.8) calc(66.66% - 1px), rgba(255, 235, 240, 0.8) calc(66.66% + 1px), transparent calc(66.66% + 1px)); }
.boss-on .relic-bar { top: 66px; }
.boss-banner { position: absolute; z-index: 4; top: 30%; left: 50%; margin: 0; width: max-content; max-width: calc(100% - 24px); transform: translate(-50%, 0) scale(1.35); color: #ffe9ee; font-weight: 900; font-size: clamp(1.7rem, 9vw, 3rem); letter-spacing: 0.3em; text-indent: 0.3em; text-transform: uppercase; text-shadow: 0 0 22px rgba(255, 50, 90, 0.95), 0 0 48px rgba(255, 30, 70, 0.7), 0 3px 10px rgba(0, 0, 0, 0.9); opacity: 0; pointer-events: none; transition: opacity 0.5s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1), letter-spacing 1.2s ease; }
.boss-banner.show { opacity: 1; transform: translate(-50%, 0) scale(1); letter-spacing: 0.22em; }
@media (prefers-reduced-motion: reduce) { .boss-banner, .boss-banner.show { transition: opacity 0.2s linear; } .boss-bar[data-phase="3"] #boss-fill::after { animation: none; } }

.hint { position: absolute; z-index: 3; top: 60px; left: 50%; max-width: calc(100% - 32px); margin: 0; padding: 7px 16px; border-radius: 999px; background: rgba(8, 14, 28, 0.84); border: 1px solid rgba(79, 179, 255, 0.5); color: var(--am2-ink); font-weight: 700; font-size: 0.95rem; text-align: center; white-space: nowrap; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); box-shadow: 0 0 18px rgba(79, 179, 255, 0.28), 0 2px 10px rgba(0, 0, 0, 0.5); opacity: 0; transform: translate(-50%, -6px); transition: opacity 0.45s ease, transform 0.45s ease; pointer-events: none; }
.hint.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 380px) { .hint { font-size: 0.86rem; padding: 6px 12px; } }

/* Debrief (T166): BANKED amber or LOST red, the count-up total, depth and best, the Heart line, one dispatch line. */
#debrief [hidden] { display: none !important; }
#debrief { gap: var(--rr-space-3); background: radial-gradient(120% 70% at 50% 8%, rgba(79, 179, 255, 0.1), transparent 60%); }
#debrief h2 { margin: 0; font-size: clamp(2.3rem, 13vw, 3.6rem); font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; color: var(--am2-amber); text-shadow: 0 0 26px rgba(255, 181, 71, 0.55), 0 3px 0 rgba(0, 0, 0, 0.55); animation: am2-title-in 0.55s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
#debrief[data-outcome="lost"] h2 { color: var(--am2-danger); text-shadow: 0 0 26px rgba(255, 90, 79, 0.55), 0 3px 0 rgba(0, 0, 0, 0.55); }
.debrief-total { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: min(280px, 100%); padding: 14px 26px 12px; border: 1px solid rgba(255, 181, 71, 0.38); border-radius: 18px; background: linear-gradient(180deg, rgba(34, 26, 14, 0.82), rgba(12, 14, 22, 0.88)); box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 220, 160, 0.14), 0 0 34px rgba(255, 181, 71, 0.12); }
#debrief[data-outcome="lost"] .debrief-total { border-color: rgba(255, 90, 79, 0.4); background: linear-gradient(180deg, rgba(40, 16, 18, 0.82), rgba(14, 10, 16, 0.88)); box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 170, 160, 0.12), 0 0 34px rgba(255, 90, 79, 0.12); }
.debrief-total .k, .score-cell .k { color: var(--am2-muted); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.debrief-total .big { color: var(--am2-amber); font-size: clamp(2.6rem, 15vw, 4.1rem); font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; text-shadow: 0 0 22px rgba(255, 181, 71, 0.5); }
#debrief[data-outcome="lost"] .debrief-total .big { color: #ff8a7e; text-shadow: 0 0 22px rgba(255, 90, 79, 0.45); }
#debrief.done .debrief-total .big { animation: am2-total-pop 0.35s ease-out; }
.debrief-weapon { color: var(--am2-muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.85; }
.debrief-sub { color: var(--am2-muted); font-size: 0.9rem; font-weight: 600; }
.score-grid { display: flex; gap: var(--rr-space-3); width: 100%; max-width: 420px; justify-content: center; }
.score-cell { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 8px; border: 1px solid var(--am2-line); border-radius: 14px; background: var(--am2-panel); }
.score-cell .v { display: flex; flex-direction: column; align-items: center; gap: 3px; white-space: nowrap; color: var(--am2-ink); font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.newbest { margin-left: 0; padding: 2px 7px; border-radius: 6px; background: var(--am2-amber); color: #1a1205; font-size: 0.62rem; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; vertical-align: middle; box-shadow: 0 0 12px rgba(255, 181, 71, 0.6); }
.debrief-heart { margin: 0; color: #ff8aa0; font-weight: 900; letter-spacing: 0.2em; text-transform: uppercase; text-shadow: 0 0 16px rgba(255, 60, 90, 0.75); }
.debrief-heart::before { content: "\2665  "; }
.debrief-heart::after { content: "  \2665"; }
.debrief-unlock { margin: 0; padding: 7px 14px; border: 1px solid rgba(255, 181, 71, 0.7); border-radius: 12px; background: linear-gradient(180deg, rgba(60, 44, 18, 0.9), rgba(24, 18, 10, 0.9)); color: var(--am2-amber); font-weight: 900; font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; text-align: center; text-shadow: 0 0 14px rgba(255, 181, 71, 0.7); box-shadow: 0 0 22px rgba(255, 181, 71, 0.3), inset 0 1px 0 rgba(255, 225, 170, 0.2); }
.debrief-unlock[hidden] { display: none; }
/* T172: the campaign-complete line: the same banner turned pale and cold (the Hive is quiet), a slow crimson breath behind it. */
.debrief-unlock.final { font-size: 0.95rem; letter-spacing: 0.24em; color: #f6e4ea; border-color: rgba(255, 120, 150, 0.65); background: linear-gradient(180deg, rgba(58, 18, 32, 0.92), rgba(18, 8, 16, 0.94)); text-shadow: 0 0 18px rgba(255, 90, 130, 0.75); box-shadow: 0 0 26px rgba(255, 70, 110, 0.35), inset 0 1px 0 rgba(255, 180, 200, 0.2); }
#debrief.revealed .debrief-unlock.final { animation: am2-rise 0.6s ease-out 1.0s both; }
/* T211: the endless glows are a pseudo-element halo whose opacity breathes (compositor only); the element keeps the resting glow. */
.debrief-unlock.final, #btn-dive, .btn.danger.armed { position: relative; isolation: isolate; }
.debrief-unlock.final::after, #btn-dive::after, .btn.danger.armed::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; }
.debrief-unlock.final::after { box-shadow: 0 0 40px rgba(255, 70, 110, 0.65); }
#debrief.revealed .debrief-unlock.final::after { animation: am2-veil 3.2s ease-in-out 1.6s infinite; }
#debrief .dispatch { max-width: 360px; line-height: 1.35; }
#debrief.revealed .score-grid, #debrief.revealed .debrief-heart, #debrief.revealed .dispatch, #debrief.revealed #btn-debrief-back { animation: am2-rise 0.5s ease-out both; }
#debrief.revealed .score-grid { animation-delay: 0.55s; }
#debrief.revealed .debrief-heart { animation-delay: 0.8s; }
#debrief.revealed .debrief-unlock { animation: am2-rise 0.5s ease-out 1.0s both, am2-unlock-glow 2.2s ease-in-out 1.5s 2; }
#debrief.revealed .dispatch { animation-delay: 1.05s; }
#debrief.revealed #btn-debrief-back { animation-delay: 1.3s; }
@keyframes am2-title-in { 0% { opacity: 0; transform: scale(1.5); letter-spacing: 0.4em; } 100% { opacity: 1; transform: scale(1); letter-spacing: 0.14em; } }
@keyframes am2-unlock-glow { 0%, 100% { box-shadow: 0 0 22px rgba(255, 181, 71, 0.3), inset 0 1px 0 rgba(255, 225, 170, 0.2); } 50% { box-shadow: 0 0 36px rgba(255, 181, 71, 0.75), inset 0 1px 0 rgba(255, 225, 170, 0.35); } }
@keyframes am2-fresh-row { 0% { box-shadow: 0 0 0 rgba(255, 181, 71, 0); } 25%, 70% { box-shadow: 0 0 26px rgba(255, 181, 71, 0.85), inset 0 0 18px rgba(255, 181, 71, 0.28); } 100% { box-shadow: 0 0 10px rgba(255, 181, 71, 0.25); } }
@keyframes am2-rise { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes am2-total-pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  #debrief h2, #debrief.revealed .debrief-unlock, #debrief.revealed .debrief-unlock.final, #debrief.revealed .debrief-unlock.final::after, .rock-row.fresh, #debrief.revealed .score-grid, #debrief.revealed .debrief-heart, #debrief.revealed .dispatch, #debrief.revealed #btn-debrief-back, #debrief.done .debrief-total .big, .deck-btn.burn.pulse { animation: none; }
  .hint { transition: opacity 0.2s linear; transform: translate(-50%, 0); }
}

/* Bottom nav: three tabs, only on the meta screens. */
#nav {
  flex: none;
  display: none;
  gap: var(--rr-space-2);
  padding: 8px calc(12px + var(--rr-inset-right)) calc(8px + var(--rr-inset-bottom)) calc(12px + var(--rr-inset-left));
  background: var(--am2-panel);
  border-top: 1px solid var(--am2-line);
}
.game-shell[data-screen="hangar"] #nav,
.game-shell[data-screen="upgrades"] #nav,
.game-shell[data-screen="records"] #nav,
.game-shell[data-screen="settings"] #nav { display: flex; }
.nav-btn {
  flex: 1;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--am2-muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.nav-btn.active { color: var(--am2-amber); background: var(--rr-accent-soft); }
.nav-btn:focus-visible { outline: 2px solid var(--rr-focus); outline-offset: 2px; }


/* ================= Meta screens (T169): Hangar, Upgrades, Records, Settings =================
   Cold blue briefing room with amber accents. Every meta screen is a fixed-height flex column that never scrolls. */
#menu-bg {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; display: none;
  background:
    radial-gradient(120% 55% at 50% 122%, rgba(255, 181, 71, 0.2), transparent 62%),
    radial-gradient(circle at 50% 128%, #0a1220 0 40%, rgba(255, 181, 71, 0.35) 40.4%, transparent 41.5%),
    radial-gradient(90% 60% at 18% 0%, rgba(79, 179, 255, 0.13), transparent 62%),
    linear-gradient(180deg, #0a1426 0%, #070b14 70%);
}
.game-shell[data-screen="hangar"] #menu-bg, .game-shell[data-screen="upgrades"] #menu-bg, .game-shell[data-screen="records"] #menu-bg,
.game-shell[data-screen="settings"] #menu-bg, .game-shell[data-screen="debrief"] #menu-bg { display: block; }
.screen { z-index: 1; }
#stage { z-index: 1; }
#hangar, #upgrades, #records, #settings { justify-content: flex-start; gap: 10px; padding-top: 8px; padding-bottom: 12px; }
@keyframes am2-screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
#hangar.visible, #upgrades.visible, #records.visible, #settings.visible { animation: am2-screen-in 0.24s ease-out both; }
@media (prefers-reduced-motion: reduce) { #hangar.visible, #upgrades.visible, #records.visible, #settings.visible { animation: none; } }

.screen-head { min-height: 40px; align-items: center; }
.screen-head h1, .screen-head h2 { font-size: 1.15rem; color: var(--am2-ink); text-shadow: 0 0 18px rgba(79, 179, 255, 0.35); }
.credits { font-size: 1.35rem; padding: 3px 14px; border-radius: 999px; background: rgba(255, 181, 71, 0.1); border: 1px solid rgba(255, 181, 71, 0.4); box-shadow: 0 0 18px rgba(255, 181, 71, 0.12); text-shadow: 0 0 14px rgba(255, 181, 71, 0.5); }
.credits.spend { animation: am2-spend 0.5s ease-out; }
@keyframes am2-spend { 0% { transform: scale(1); } 25% { transform: scale(1.12); box-shadow: 0 0 26px rgba(255, 181, 71, 0.7); color: #fff1cf; } 100% { transform: scale(1); } }
.ico { display: block; flex: none; }

/* Hangar */
.hangar-body { flex: 1 1 auto; min-height: 0; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 10px; }
.rock-chart, .upgrade-list { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 420px; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.rock-chart { flex: 1 1 auto; }
.rock-item { position: relative; flex: 1 1 0; min-height: 44px; max-height: 78px; display: flex; }
.rock-item:not(:last-child)::after { content: ""; position: absolute; left: 24px; top: 50%; height: calc(100% + 6px); width: 2px; background: linear-gradient(180deg, rgba(79, 179, 255, 0.5), rgba(79, 179, 255, 0.12)); }
.rock-row {
  position: relative; z-index: 1; flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0 12px 0 10px;
  font: inherit; color: var(--am2-ink); text-align: left; cursor: pointer; touch-action: manipulation;
  border: 1px solid var(--am2-line); border-radius: 12px; background: linear-gradient(180deg, rgba(20, 32, 54, 0.94), rgba(11, 18, 32, 0.94));
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.09s;
}
.rock-row:active { transform: scale(0.985); }
.rock-row:focus-visible { outline: 2px solid var(--rr-focus); outline-offset: 2px; }
.rock-row.current { border-color: var(--am2-amber); background: linear-gradient(180deg, rgba(40, 34, 24, 0.95), rgba(14, 18, 30, 0.95)); box-shadow: 0 0 20px rgba(255, 181, 71, 0.2), inset 0 1px 0 rgba(255, 225, 170, 0.14); }
.rock-row.fresh { border-color: var(--am2-amber); animation: am2-fresh-row 2.4s ease-out 0.25s 1 both; }
.rock-row.fresh .rock-node { color: #1a1205; background: var(--am2-amber); border-color: var(--am2-amber); box-shadow: 0 0 14px rgba(255, 181, 71, 0.6); }
.rock-row.locked { cursor: not-allowed; opacity: 0.6; background: linear-gradient(180deg, rgba(14, 22, 38, 0.9), rgba(9, 14, 24, 0.9)); }
.rock-node { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 0.85rem; color: var(--am2-blue); border: 2px solid var(--am2-blue); background: #0b1424; box-shadow: 0 0 10px rgba(79, 179, 255, 0.3); }
.rock-row.current .rock-node { color: #1a1205; background: var(--am2-amber); border-color: var(--am2-amber); box-shadow: 0 0 14px rgba(255, 181, 71, 0.6); }
.rock-row.locked .rock-node { color: var(--am2-muted); border-color: #34476a; box-shadow: none; }
.rock-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rock-name { font-weight: 800; font-size: 0.98rem; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rock-sub { color: var(--am2-muted); font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rock-depth { display: block; height: 4px; margin-top: 3px; border-radius: 2px; background: rgba(120, 160, 220, 0.14); overflow: hidden; }
.rock-depth i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--am2-blue), #7fd0ff); }
.rock-row.current .rock-depth i { box-shadow: 0 0 6px rgba(255, 181, 71, 0.7); }
.rock-haz { flex: none; color: var(--am2-blue); opacity: 0.9; }
.rock-row.current .rock-haz { color: var(--am2-amber); }
.rock-state { flex: none; color: #53647f; }
.ico.heart { color: #4a3c4f; }
.ico.heart.lit { color: #ff6f8a; fill: #ff6f8a; filter: drop-shadow(0 0 5px rgba(255, 80, 120, 0.8)); }
.ico.lock { color: #5d6f8d; }
.ico.ok { color: var(--am2-amber); filter: drop-shadow(0 0 5px rgba(255, 181, 71, 0.6)); }
.hangar-side { flex: none; display: flex; flex-direction: column; gap: 8px; }
.rock-pick { margin: 0; min-height: 1.1em; color: var(--am2-muted); font-size: 0.85rem; text-align: center; }
.slot-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }   /* T202: Weapon beside Gadget */
.slot-pair .gadget-slot { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 4px 10px; min-width: 0; }
.slot-pair .slot-v { gap: 6px; font-size: 0.9rem; }
.slot-pair .slot-v { max-width: 100%; }
.slot-pair .slot-v span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.weapon-slot-ico, #weapon-slot .gico { color: var(--am2-amber); filter: drop-shadow(0 0 5px rgba(255, 181, 71, 0.55)); }
.gadget-slot { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 0 14px; border: 1px dashed #3b5580; border-radius: 12px; background: rgba(15, 24, 40, 0.7); color: inherit; font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; user-select: none; }
.gadget-slot.filled { border-style: solid; border-color: rgba(79, 179, 255, 0.55); background: linear-gradient(180deg, rgba(18, 36, 62, 0.94), rgba(10, 20, 36, 0.94)); }
.gadget-slot:active { transform: scale(0.985); }
.gadget-slot:focus-visible { outline: 2px solid var(--rr-focus); outline-offset: 2px; }
.gadget-slot .gico { width: 24px; height: 24px; }
.gadget-slot.filled .slot-v { color: #bfe3ff; }
.slot-k { color: var(--am2-muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.slot-v { display: inline-flex; align-items: center; gap: 8px; color: #6f84a6; font-weight: 700; min-width: 0; }
#btn-dive { width: 100%; min-width: 0; box-shadow: 0 0 20px rgba(255, 150, 60, 0.28), inset 0 1px 0 rgba(255, 235, 200, 0.4); }
#btn-dive::after { box-shadow: 0 0 36px rgba(255, 150, 60, 0.55); animation: am2-veil 2.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { #btn-dive::after { animation: none; } }

/* Upgrades */
.upgrade-list { flex: 1 1 auto; }
.up-row { flex: 1 1 auto; max-height: 92px; min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; text-align: left;
  border: 1px solid var(--am2-line); border-radius: 14px; background: linear-gradient(180deg, rgba(20, 32, 54, 0.94), rgba(11, 18, 32, 0.94)); box-shadow: inset 0 1px 0 rgba(160, 200, 255, 0.06); }
.up-row.maxed { border-color: rgba(255, 181, 71, 0.55); box-shadow: 0 0 16px rgba(255, 181, 71, 0.12); }
.up-top { min-width: 0; }
.up-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.up-top { display: flex; align-items: center; gap: 10px; }
.up-name { white-space: nowrap; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.92rem; }
.pips { display: flex; gap: 3px; }
.pips i { display: block; width: 13px; height: 8px; border-radius: 2px; transform: skewX(-18deg); background: #16233a; border: 1px solid #2c4268; }
.pips i.on { background: linear-gradient(180deg, #ffd27a, #ff9d3a); border-color: #ffcf80; box-shadow: 0 0 8px rgba(255, 170, 70, 0.55); }
.pips i.fill { animation: am2-pip-fill 0.42s ease-out; }
@keyframes am2-pip-fill { 0% { transform: skewX(-18deg) scaleX(0.1); filter: brightness(2.6); box-shadow: 0 0 22px 4px rgba(255, 220, 140, 0.95); } 60% { transform: skewX(-18deg) scaleX(1.25); } 100% { transform: skewX(-18deg) scaleX(1); filter: none; } }
.up-val { margin: 0; color: var(--am2-muted); font-size: 0.78rem; line-height: 1.25; font-variant-numeric: tabular-nums; }
.up-buy { flex: none; min-width: 96px; min-height: 44px; padding: 0 10px; font-size: 0.92rem; font-variant-numeric: tabular-nums; touch-action: manipulation; }
.up-buy:disabled { background: #111b2e; color: #7284a3; border: 1px solid var(--am2-line); cursor: not-allowed; box-shadow: none; }
.up-row.maxed .up-buy:disabled { color: var(--am2-amber); border-color: rgba(255, 181, 71, 0.5); background: rgba(255, 181, 71, 0.08); }
.up-buy:focus-visible { outline: 2px solid var(--rr-focus); outline-offset: 2px; }
/* T202: a maxed track's Mod slot button, the two Mod chips (toggles) and the chosen Mod's line */
.slot-buy { min-width: 112px; }
.up-row.modded { flex-wrap: wrap; max-height: none; flex: 0 0 auto; row-gap: 4px; padding-top: 6px; padding-bottom: 6px; }
.up-row.modded .up-main { flex: 1 1 auto; }
.up-row.maxed .up-top { flex-direction: column; align-items: flex-start; gap: 4px; }
.mod-chips { flex: none; display: flex; gap: 6px; }
.mod-chip { min-width: 74px; max-width: 112px; min-height: 44px; padding: 2px 8px; font: inherit; font-size: 0.74rem; font-weight: 800; line-height: 1.1; letter-spacing: 0.02em; color: var(--am2-muted); background: rgba(15, 24, 40, 0.7); border: 1px solid var(--am2-line); border-radius: 10px; cursor: pointer; touch-action: manipulation; user-select: none; }
.mod-chip.on { color: #1a1205; background: var(--am2-amber); border-color: var(--am2-amber); box-shadow: 0 0 12px rgba(255, 181, 71, 0.35); }
.mod-chip:active { transform: scale(0.97); }
.mod-chip:focus-visible { outline: 2px solid var(--rr-focus); outline-offset: 2px; }
.up-row.modded .up-blurb { flex: 1 0 100%; }
.emitter-row.equipped .up-buy:disabled { color: var(--am2-amber); border-color: rgba(255, 181, 71, 0.5); background: rgba(255, 181, 71, 0.08); }
.emitter-row.locked .gico { color: #5d6f8d; filter: none; }
.emitter-row.locked .up-name { color: var(--am2-muted); }
.emitter-row.owned:not(.equipped) .up-buy { background: rgba(255, 181, 71, 0.08); color: var(--am2-amber); border: 1px solid rgba(255, 181, 71, 0.5); box-shadow: none; }
.gadget-group, .gadget-rows { display: contents; list-style: none; margin: 0; padding: 0; }
.gadget-row { border-color: rgba(79, 179, 255, 0.4); background: linear-gradient(180deg, rgba(18, 36, 62, 0.94), rgba(10, 20, 36, 0.94)); }
.gadget-row .up-name { color: #bfe3ff; }
.gadget-row.owned { border-color: rgba(255, 181, 71, 0.55); box-shadow: 0 0 16px rgba(255, 181, 71, 0.12); }
.gadget-row.owned .gico { color: var(--am2-amber); }
.gico { flex: none; width: 28px; height: 28px; color: var(--am2-blue); filter: drop-shadow(0 0 6px rgba(79, 179, 255, 0.55)); }
.gadget-row.owned .gico { filter: drop-shadow(0 0 6px rgba(255, 181, 71, 0.6)); }
.gadget-row .up-buy { min-width: 96px; }
.gadget-row.owned .up-buy:disabled { color: var(--am2-amber); border-color: rgba(255, 181, 71, 0.5); background: rgba(255, 181, 71, 0.08); }

/* Records (T176): Records tab = three sections of stat cells; Feats tab = twelve paint badges. Both fit the fit shell without scrolling. */
.record-list, .feat-grid { width: 100%; max-width: 420px; min-height: 0; margin: 0; padding: 0; flex: 1 1 auto; }
.record-list { display: flex; flex-direction: column; gap: 7px; justify-content: flex-start; }
.record-list[hidden], .feat-grid[hidden] { display: none; }
.rec-sec h3 { margin: 0 0 4px; font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--am2-muted); }
.rec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.rc { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; min-height: 50px; padding: 5px 9px; border: 1px solid var(--am2-line); border-radius: 10px; background: linear-gradient(180deg, rgba(20, 32, 54, 0.9), rgba(11, 18, 32, 0.9)); text-align: left; }
.rc.rock { border-top: 3px solid var(--rock); }
.rc.locked { opacity: 0.55; }
.rc-k { font-size: 0.62rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--am2-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-v { display: flex; align-items: center; gap: 5px; font-weight: 800; font-size: 0.92rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-v .ico { width: 16px; height: 16px; flex: none; }
.rc.amber { border-color: rgba(255, 181, 71, 0.35); }
.rc.amber .rc-v { color: var(--am2-amber); }
.feat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(0, 120px); gap: 6px; align-content: start; }
.feat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; min-height: 44px; padding: 4px 4px 5px; font: inherit; color: var(--am2-ink); border: 1px solid var(--am2-line); border-radius: 12px; background: linear-gradient(180deg, rgba(20, 32, 54, 0.92), rgba(11, 18, 32, 0.92)); cursor: pointer; touch-action: manipulation; user-select: none; }
.feat:disabled { cursor: default; opacity: 1; }
.feat .sw { width: 34px; height: 42px; flex: none; filter: drop-shadow(0 0 5px rgba(79, 179, 255, 0.35)); }
.feat.locked .sw { filter: grayscale(1) brightness(0.55); }
.feat-name { font-weight: 800; font-size: 0.78rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.feat-line { font-size: 0.62rem; line-height: 1.15; color: var(--am2-muted); text-align: center; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.feat.locked .feat-name { color: var(--am2-muted); }
.feat.earned { border-color: rgba(79, 179, 255, 0.45); }
.feat.earned:active { transform: scale(0.97); }
.feat.on { border-color: var(--am2-amber); box-shadow: 0 0 14px rgba(255, 181, 71, 0.4); }
.feat.on .feat-line { color: var(--am2-amber); font-weight: 800; }
.feat:focus-visible { outline: 2px solid var(--rr-focus); outline-offset: 2px; }
.debrief-feat { margin: 0; padding: 6px 14px; border: 1px solid rgba(111, 227, 255, 0.6); border-radius: 12px; background: linear-gradient(180deg, rgba(14, 44, 60, 0.92), rgba(8, 18, 30, 0.92)); color: #8ff0ff; font-weight: 900; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; text-align: center; white-space: pre-line; text-shadow: 0 0 12px rgba(111, 227, 255, 0.6); box-shadow: 0 0 20px rgba(80, 200, 255, 0.28); }
.debrief-feat[hidden] { display: none; }
#debrief.revealed .debrief-feat { animation: am2-rise 0.5s ease-out 1.3s both; }
@media (prefers-reduced-motion: reduce) { #debrief.revealed .debrief-feat { animation: none; } }
.lb-pre { margin-right: 0.28em; }   /* the button is a flex box: the space inside the span would collapse */

/* Settings */
.settings-grid { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 10px; }
#settings .audio-panel { display: flex; flex-direction: column; gap: var(--rr-space-2); text-align: left; background: rgba(15, 24, 40, 0.88); }
.kv { display: flex; justify-content: space-between; font-weight: 700; }
.note { margin: 0; color: var(--am2-muted); font-size: 0.8rem; text-align: center; }
.btn.danger { color: #ff8a7e; border-color: rgba(255, 90, 79, 0.5); }
.btn.danger.armed { background: var(--am2-danger); color: #fff; border-color: #ff9a90; }
.btn.danger.armed::after { box-shadow: 0 0 22px 2px rgba(255, 90, 79, 0.7); animation: am2-veil 0.7s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .btn.danger.armed::after { animation: none; } }

/* T175: the Hangar's two tabs (Rocks | Modes, shown once Rock 1's Heart is home) and the two mode cards (the Abyss, the Daily Dive) */
.hangar-tabs { display: flex; gap: 6px; margin-right: auto; }
.hangar-tabs[hidden] { display: none; }
.tab-btn { min-width: 74px; min-height: 44px; padding: 0 14px; font: inherit; font-size: 0.92rem; font-weight: 800; letter-spacing: 0.05em; color: var(--am2-muted); background: rgba(15, 24, 40, 0.7); border: 1px solid var(--am2-line); border-radius: 12px; cursor: pointer; touch-action: manipulation; user-select: none; transition: color 0.15s, background 0.15s, box-shadow 0.15s; }
.tab-btn.on { color: #1a1205; background: var(--am2-amber); border-color: var(--am2-amber); box-shadow: 0 0 14px rgba(255, 181, 71, 0.35); }
.tab-btn:active { transform: scale(0.97); }
.tab-btn:focus-visible { outline: 2px solid var(--rr-focus); outline-offset: 2px; }
.screen-head.tabbed { min-height: 44px; }
.screen-head.tabbed h1, #upgrades .screen-head.tabbed h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rock-chart.modes { justify-content: flex-start; gap: 10px; }
.rock-chart.modes .rock-item { max-height: 210px; }
.mode-note { display: none; color: var(--am2-muted); font-size: 0.74rem; line-height: 1.25; margin-top: 4px; opacity: 0.85; }
@media (min-height: 701px) { .mode-note { display: block; } }
.rock-chart.modes .rock-item::after { display: none; }
.rock-row.mode { gap: 12px; padding: 0 14px 0 12px; }
.mode .rock-node { width: 42px; height: 42px; font-size: 1.5rem; }
.mode .rock-node .ico { width: 24px; height: 24px; }
.mode .rock-name { font-size: 1.12rem; }
.mode-stat { font-weight: 900; font-size: 1rem; letter-spacing: 0.03em; white-space: nowrap; color: var(--am2-amber); text-shadow: 0 0 12px rgba(255, 181, 71, 0.35); }
.rock-row.mode.locked .mode-stat { color: var(--am2-muted); text-shadow: none; }
.mode .rock-sub { white-space: normal; line-height: 1.25; margin-top: 2px; }
.mode .rock-depth { height: 5px; margin-top: 6px; }
.rock-row.mode.fresh-day:not(.current) { border-color: rgba(255, 181, 71, 0.55); }
.mode .rock-haz .ico { width: 26px; height: 26px; }
/* Bottom nav polish */
#nav { position: relative; z-index: 2; box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35); }
.nav-btn { position: relative; transition: color 0.15s, background 0.15s; }
.nav-btn.active::before { content: ""; position: absolute; left: 22%; right: 22%; top: -9px; height: 2px; border-radius: 2px; background: var(--am2-amber); box-shadow: 0 0 10px rgba(255, 181, 71, 0.8); }

/* Short phones in portrait (360x640 and smaller): tighter rows so every meta screen fits */
@media (max-height: 700px) {
  #hangar, #upgrades, #records, #settings { gap: 8px; padding-top: 6px; }
  .screen-head { min-height: 36px; }
  .credits { font-size: 1.2rem; }
  .rock-item { max-height: 52px; }
  .up-name { font-size: 0.84rem; letter-spacing: 0.04em; }
  .pips { gap: 3px; }
  .pips i { width: 13px; }
  .rock-sub { font-size: 0.68rem; line-height: 1.1; }
  .rock-depth { display: none; }   /* the sub line already carries the depth */
  .mode .rock-depth { display: block; }
  .up-row { padding: 6px 8px 6px 12px; gap: 8px; }
  .up-val { font-size: 0.72rem; line-height: 1.18; }
  .up-buy { min-width: 88px; }
}



/* ================= Relics (T171) =================
   The pick overlay sits over the frozen dive (the stage stays visible under it, dimmed and blurred): three cards, each a badge, the name
   and the one-line effect, one tap or the keys 1 to 3. The held-relic badges are a small row under the HUD. Card colour comes from --rc. */
#relic {
  position: absolute; inset: 0; z-index: 6; flex: none; justify-content: center; gap: 14px;
  background: radial-gradient(120% 70% at 50% 62%, rgba(255, 190, 90, 0.1), rgba(3, 6, 14, 0) 60%), linear-gradient(180deg, rgba(8, 14, 28, 0.1), rgba(6, 10, 22, 0.34) 55%, rgba(4, 7, 16, 0.52));
  -webkit-backdrop-filter: blur(2px) brightness(1.25) saturate(1.1); backdrop-filter: blur(2px) brightness(1.25) saturate(1.1);
}
#relic.opening { animation: am2-relic-in 0.28s ease-out both; }
@keyframes am2-relic-in { from { opacity: 0; } to { opacity: 1; } }
.relic-head { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.relic-head h2 { margin: 0; font-size: 1.5rem; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; color: #ffd98a; text-shadow: 0 0 22px rgba(255, 200, 90, 0.7), 0 2px 0 rgba(0, 0, 0, 0.6); }
.relic-sub { margin: 0; color: #a9bbd6; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); font-size: 0.82rem; letter-spacing: 0.04em; }
.relic-cards { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 420px; }
.relic-card {
  --rc: 255, 214, 112;
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 96px; padding: 10px 14px 10px 10px; text-align: left; cursor: pointer;
  color: var(--am2-ink); font: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  border: 1.5px solid rgba(var(--rc), 0.6); border-radius: 18px;
  background: linear-gradient(135deg, rgba(var(--rc), 0.18), rgba(12, 16, 28, 0.94) 55%), #0c1220;
  box-shadow: 0 0 22px rgba(var(--rc), 0.22), 0 8px 24px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: am2-relic-card 0.5s cubic-bezier(0.2, 1.3, 0.4, 1) both; animation-delay: calc(0.08s + var(--i, 0) * 0.09s);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
@keyframes am2-relic-card { from { opacity: 0; transform: translateY(18px) scale(0.94); } to { opacity: 1; transform: none; } }
.relic-card:hover, .relic-card:focus-visible { transform: translateY(-2px) scale(1.015); border-color: rgba(var(--rc), 1); box-shadow: 0 0 34px rgba(var(--rc), 0.5), 0 8px 24px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.2); outline: none; }
.relic-card:active { transform: scale(0.975); }
.rc-ico { flex: none; display: grid; place-items: center; width: 72px; height: 72px; filter: drop-shadow(0 0 10px rgba(var(--rc), 0.7)); }
.relic-ico { display: block; }
.rc-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rc-name { font-size: 1.15rem; font-weight: 900; letter-spacing: 0.04em; color: #fff; text-shadow: 0 0 14px rgba(var(--rc), 0.8); }
.rc-desc { font-size: 0.9rem; line-height: 1.25; color: #c4d3e8; }
.rc-key { position: absolute; top: 7px; right: 10px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border-radius: 6px; font-size: 0.7rem; font-weight: 900; color: rgba(var(--rc), 1); background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(var(--rc), 0.5); }
.relic-bar { position: absolute; z-index: 2; top: 48px; left: calc(8px + var(--rr-inset-left)); display: flex; gap: 4px; max-width: calc(100% - 16px); flex-wrap: wrap; pointer-events: none; }
.relic-bar[hidden] { display: none; }
.rb-badge { --rc: 255, 214, 112; display: grid; place-items: center; width: 28px; height: 28px; filter: drop-shadow(0 0 5px rgba(var(--rc), 0.65)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8)); transition: opacity 0.3s, filter 0.3s; }
.rb-badge.fresh { animation: am2-badge-pop 0.7s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.rb-badge.spent { opacity: 0.35; filter: grayscale(0.9) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8)); }
@keyframes am2-badge-pop { 0% { transform: scale(2.2); opacity: 0; } 50% { transform: scale(0.9); opacity: 1; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { #relic.opening, .relic-card, .rb-badge.fresh { animation: none; } .relic-card { transition: none; } }
@media (max-height: 700px) {
  #relic { gap: 8px; }
  .relic-head h2 { font-size: 1.25rem; }
  .relic-sub { font-size: 0.74rem; }
  .relic-cards { gap: 8px; }
  .relic-card { min-height: 88px; gap: 12px; padding: 8px 12px 8px 8px; }
  .rc-ico { width: 64px; height: 64px; }
  .rc-ico .relic-ico { width: 64px !important; height: 64px !important; }
  .rc-name { font-size: 1.05rem; }
  .rc-desc { font-size: 0.82rem; }
}

/* T176: the busiest Debrief (Heart or new Rock, plus a FEAT toast) tightens up so Back to Hangar stays on screen on every viewport */
#debrief[data-crowd] { gap: var(--rr-space-2); }
#debrief[data-crowd] h2 { font-size: clamp(1.7rem, 9vw, 2.3rem); }
#debrief[data-crowd] .debrief-total { padding: 7px 22px 6px; }
#debrief[data-crowd] .debrief-total .big { font-size: clamp(2rem, 11vw, 2.8rem); }
#debrief[data-crowd] .score-cell { padding: 5px 8px; }
#debrief[data-crowd] .dispatch { font-size: 0.8rem; line-height: 1.25; }


/* P035 twin sticks: a ring and knob under each active thumb (AM2_ui places them), ghosts on the first dive. Never takes a pointer. */
#sticks { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.stick { position: absolute; left: 0; top: 0; width: 104px; height: 104px; margin: -52px 0 0 -52px; border-radius: 50%; opacity: 0;
  border: 2px solid rgba(150, 195, 255, 0.4); background: radial-gradient(circle, rgba(20, 40, 72, 0.05), rgba(20, 40, 72, 0.32)); transition: opacity 0.15s; }
.stick b { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  background: rgba(165, 205, 255, 0.55); box-shadow: 0 0 12px rgba(110, 170, 255, 0.55); }
.stick.r { border-color: rgba(255, 190, 110, 0.45); }
.stick.r b { background: rgba(255, 196, 120, 0.6); box-shadow: 0 0 12px rgba(255, 160, 80, 0.55); }
.stick.r.armed { border-color: #9fe0ff; }
.stick.r.armed b { background: rgba(159, 224, 255, 0.8); box-shadow: 0 0 16px rgba(111, 208, 255, 0.8); }
.stick.on { opacity: 1; }
.stick.ghost { opacity: 0.4; }
.deck-btn.gadget.armed { border-color: #9fe0ff; color: #e9f8ff; box-shadow: 0 0 22px rgba(111, 208, 255, 0.85), inset 0 0 16px rgba(111, 208, 255, 0.45); }
@media (prefers-reduced-motion: reduce) { .stick { transition: none; } }

