/* 1.9 game HUD: in-arena score, round cooldown pads, revive and ad screens. */
:root { --hud-ink: #eafffa; --hud-dim: #8ea7b8; --mint: #b0f6d5; }

/* The sector strip and arena note move into the in-arena HUD. */
.sector-strip, #mode { display: none !important; }
.arena-note { bottom: 6px; justify-content: flex-end; opacity: .55; }

/* ---------- In-arena HUD ---------- */
.hud {
  position: absolute; inset: 0 0 auto; z-index: 1;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px;
  padding: 8px 10px 22px;
  background: linear-gradient(#050c17d9, #050c1700);
  pointer-events: none; color: var(--hud-ink);
  font-variant-numeric: tabular-nums;
}
html:not(.in-run) .hud { visibility: hidden; }
.hud-score { display: flex; flex-direction: column; line-height: 1; }
.hud-score b {
  display: inline-block; transform-origin: left center;
  font-size: clamp(24px, 6.4vw, 34px); font-weight: 800; letter-spacing: -.02em;
  color: #fff; text-shadow: 0 0 14px #5ff5cf88, 0 2px 0 #0a3a32;
}
.hud-score span { margin-top: 3px; font-size: 9px; font-weight: 700; letter-spacing: .14em; color: var(--mint); }
.hud-score i { font-style: normal; color: #4f6a78; }
.hud-score em { font-style: normal; color: #ffe08a; }
.hud-level { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding-top: 2px; }
.hud-level strong { font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.hud-level span {
  max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 8.5px; letter-spacing: .12em; color: var(--hud-dim); font-weight: 700;
}
.hud-bar { position: relative; display: block; width: clamp(80px, 26vw, 150px); height: 3px; border-radius: 3px; background: #ffffff1c; overflow: hidden; }
.hud-bar i { position: absolute; inset: 0; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, #69f2c9, #84bcff, #d2a9ff); }
.hud-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.hud-hull {
  font-size: 9px; font-weight: 800; letter-spacing: .1em; color: #ffcf9a;
  padding: 3px 6px; border: 1px solid #ffbd7a66; border-radius: 99px; background: #2a1a0c99;
}
.hud-hull:empty { display: none; }
.hud-pause {
  display: none; pointer-events: auto; width: 36px; height: 36px; padding: 0;
  border: 1px solid #ffffff2e; border-radius: 50%; background: #0b1726b3; color: var(--hud-ink);
}
.hud-pause svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }

/* Boss panel sits below the HUD. */
.boss-panel { top: 50px !important; }
.boss-panel.apex { top: 23% !important; }

/* ---------- Compact (phone / narrow) layout: give the arena the space ---------- */
@media (max-width: 799px), (max-aspect-ratio: 5/4) {
  .web-app #statsBoard, .native-app #statsBoard { display: none !important; }
  .hud-pause { display: grid; place-items: center; }
  html.in-run .compact-tools { display: none !important; }
  .web-app .compact-tools { flex-wrap: nowrap; gap: 6px; }
  .web-app #testBadgeHome { order: 0; flex: 0 1 auto; flex-basis: auto; min-width: 0; }
  #testBadgeHome .test-badge { font-size: 8px; padding: 2px 6px; }
}
.native-app .hud-pause { display: grid; place-items: center; }
.native-app.in-run .compact-tools { display: none !important; }

/* ---------- Desktop rail stats: score first ---------- */
.rail-right #statsBoard .stat-score { grid-column: 1 / -1; }
.rail-right #statsBoard .stat-score strong { font-size: clamp(28px, 3vw, 40px) !important; color: #fff; text-shadow: 0 0 16px #5ff5cf66; }
.rail-right #statsBoard .stat-best strong { color: #ffe08a; }
#statsBoard .stat-time strong { color: #b3c6da; }

/* ---------- Action dock: round arcade pads ---------- */
#compactActions {
  display: flex; align-items: flex-end; gap: clamp(8px, 3vw, 16px);
  padding: 8px clamp(10px, 4vw, 18px) calc(8px + env(safe-area-inset-bottom));
  border: 0; background: linear-gradient(#0a142200, #050b14);
}
#compactActions .pad {
  --accent: #b0f6d5; --charge: 100%;
  position: relative; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 0; min-height: 0; margin: 0; padding: 0; overflow: visible;
  border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--accent);
  opacity: 1; touch-action: none; -webkit-user-select: none; user-select: none;
}
#compactActions .pad::after { display: none; }
#compactActions .weapon { --accent: #94dbff; }
#compactActions .singularity { --accent: var(--special-accent, #d8b6ff); }
#compactActions .fire { --accent: #b0f6d5; margin-left: auto; }
.pad-disc {
  position: relative; display: grid; place-items: center;
  width: clamp(54px, 15vw, 64px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 32%, color-mix(in srgb, var(--accent) 26%, #0e1b2c), #07101c 72%);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 40%, transparent), inset 0 -4px 8px #0008, 0 4px 0 #02060c;
  transition: transform .06s ease-out, box-shadow .15s;
}
.pad-disc::before {
  /* Cooldown ring: fills clockwise as the ability reloads. */
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  background: conic-gradient(var(--accent) var(--charge), #ffffff14 0);
  -webkit-mask: radial-gradient(farthest-side, #0000 calc(100% - 3.5px), #000 calc(100% - 3px));
          mask: radial-gradient(farthest-side, #0000 calc(100% - 3.5px), #000 calc(100% - 3px));
}
#compactActions .fire .pad-disc { width: clamp(70px, 20vw, 84px); }
#compactActions .fire .pad-disc::before { background: var(--accent); opacity: .55; }
#compactActions .action-symbol {
  width: 46%; height: 46%; padding: 0; border-radius: 0; background: none;
  stroke-width: 1.9; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 60%, transparent));
}
.pad-time {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: clamp(15px, 4.4vw, 19px); font-weight: 800; color: #fff; text-shadow: 0 1px 3px #000;
  font-variant-numeric: tabular-nums;
}
.pad-time:empty { display: none; }
.pad.cooling .action-symbol, .pad.active-power .action-symbol { opacity: .28; }
.pad-label {
  display: block; font-size: 9px; font-weight: 800; letter-spacing: .12em; line-height: 1.15;
  text-align: center; white-space: nowrap; color: var(--accent);
}
.pad-label small { display: block; margin-top: 2px; font-size: 7.5px; font-weight: 700; letter-spacing: .08em; color: var(--hud-dim); }
#compactActions .singularity .pad-label > span { display: inline; }
#compactActions .pad:disabled { cursor: default; opacity: 1; }
#compactActions .pad:disabled .pad-label { opacity: .75; }
html:not(.in-run) #compactActions .pad { opacity: .45; }

/* Ready: pulsing glow so the player notices without reading text. */
#compactActions .pad.charged .pad-disc {
  box-shadow: inset 0 0 0 1.5px var(--accent), inset 0 -4px 8px #0008, 0 4px 0 #02060c,
    0 0 18px color-mix(in srgb, var(--accent) 55%, transparent);
  animation: pad-ready 1.4s ease-in-out infinite;
}
#compactActions .pad.active-power .pad-disc {
  box-shadow: inset 0 0 0 2px #fff, 0 0 22px color-mix(in srgb, var(--accent) 70%, transparent);
}
@keyframes pad-ready { 50% { box-shadow: inset 0 0 0 1.5px var(--accent), inset 0 -4px 8px #0008, 0 4px 0 #02060c, 0 0 28px color-mix(in srgb, var(--accent) 80%, transparent); } }

/* Instant press feedback (the class is set from the input loop, not :active). */
#compactActions .pad:not(:disabled):active .pad-disc,
#compactActions .fire.pressed .pad-disc { transform: translateY(3px) scale(.95); box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 24px color-mix(in srgb, var(--accent) 45%, transparent), 0 1px 0 #02060c; }
#compactActions .fire.pressed .pad-disc::before { opacity: 1; }

.dock-info { flex: 1 1 auto; min-width: 0; align-self: center; text-align: center; }
#loadout {
  display: inline-block; max-width: 100%; line-height: 1.5;
  font-size: 8.5px; letter-spacing: .12em; font-weight: 700; color: #6f8597;
}
.touch-ui #compactHelp { display: none !important; }
#compactHelp { padding: 2px 12px 8px; font-size: 9px; color: #6f8597; background: none; }

@media (max-width: 360px) {
  #compactActions { gap: 6px; }
  .dock-info { display: none; }
}
@media (max-height: 520px) {
  .pad-disc { width: 46px; }
  #compactActions .fire .pad-disc { width: 58px; }
  .pad-label small { display: none; }
}

/* ---------- Overlay buttons for revive ---------- */
.overlay.revive-menu h2 { color: #ffd2d8; }
.overlay.revive-menu #overline { color: #ff9bab; }
.overlay.revive-menu .primary { background: #ffd36e !important; border-color: #ffe7a6 !important; color: #2a1a00 !important; box-shadow: 0 3px #a8771b, 0 0 26px #ffd36e44; font-weight: 800; }
.overlay.revive-menu .primary::before { content: "▶"; margin-right: 9px; font-size: 11px; }
.overlay.revive-menu .primary:disabled { opacity: .6; }
#retryRun { margin-top: 12px; }

/* ---------- Ad break layer (test ad today, real network later) ---------- */
.ad-break {
  position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 16px;
  background: #02060dee;
}
.ad-card {
  width: min(420px, 100%); padding: 18px; border-radius: 16px; text-align: center;
  background: #0d1828; border: 1px solid #2f4a5f; box-shadow: 0 24px 80px #000a;
}
.ad-card h3 { margin: 0 0 12px; font-size: 18px; }
.ad-frame {
  display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 10px;
  border: 1px dashed #4a6378; color: #8ea7b8; font-size: 12px;
  background: repeating-linear-gradient(45deg, #101f31 0 12px, #0d1a2a 12px 24px);
}
.ad-timer { margin: 12px 0; font-size: 13px; color: #c6d6e4; font-variant-numeric: tabular-nums; }
.ad-actions { display: flex; gap: 10px; justify-content: center; }
.ad-actions button { min-width: 120px; height: 44px; border-radius: 9px; }
.ad-actions .primary:disabled { opacity: .45; }

/* ---------- Garage test tools ---------- */
.test-tools label { display: flex; align-items: center; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  #compactActions .pad.charged .pad-disc { animation: none; }
  .pad-disc { transition: none; }
}

/* Menus: keep the dock's space but hide the pads, and round the arena on desktop. */
html.menu-home #compactActions { visibility: hidden; }
@media (min-width: 800px) and (min-aspect-ratio: 5/4) {
  .web-app .field { border-top: 1px solid #3a796f !important; border-radius: 11px !important; }
  .rail-right #statsBoard .stat-time { grid-column: 1 / -1; }
}

/* Boss fights: the boss panel carries the title, so keep the top centre clear for the boss. */
.hud.boss { background: none; }
.hud.boss .hud-level { visibility: hidden; }

/* =====================  1.9 visual pass 2: fewer words, clearer icons  ===================== */

/* --- HUD --- */
.hud { --fleet: #b0f6d5; padding-bottom: 26px; }
.hud-score b { font-size: clamp(26px, 7vw, 36px); }
.hud-best { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 10px !important; letter-spacing: .04em !important; color: #ffe08a !important; }
.hud-best svg { width: 11px; height: 11px; fill: #ffe08a; }
.hud-best em { font-style: normal; font-weight: 800; }
.hud-level strong { font-size: 11px; letter-spacing: .22em; color: #fff; }
.hud-bar { width: clamp(70px, 24vw, 140px); height: 4px; background: #ffffff18; box-shadow: inset 0 0 0 1px #ffffff10; }
.hud-bar i { background: linear-gradient(90deg, color-mix(in srgb, var(--fleet) 55%, #fff), var(--fleet)); box-shadow: 0 0 8px var(--fleet); }
.hud-bar::after { /* boss marker at the end of the wave bar */
  content: ""; position: absolute; right: -1px; top: -2px; width: 8px; height: 8px; transform: rotate(45deg);
  background: #ff7b93; box-shadow: 0 0 6px #ff7b93; }
.hud-bar { overflow: visible; }
.hud-bar > i { border-radius: 3px; }
.hud-hull { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border-radius: 50%; }
.hud-hull svg { width: 16px; height: 16px; fill: none; stroke: #ffcf9a; stroke-width: 2; stroke-linejoin: round; }
.hud-hull[hidden] { display: none; }

/* --- Boss bar: compact, centred in the HUD row --- */
.boss-panel {
  top: 8px !important; width: min(52%, 260px) !important; padding: 0 !important;
  border: 0 !important; background: none !important; box-shadow: none !important;
}
.boss-panel.apex { top: 8px !important; }
.boss-caption { justify-content: center !important; gap: 6px !important; margin-bottom: 4px !important; font-size: 9px !important; }
.boss-caption strong { flex: 0 1 auto !important; color: #fff; letter-spacing: .16em !important; text-shadow: 0 0 10px var(--boss-color); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#bossRank { font-size: 8px; padding: 2px 4px !important; }
#bossRank:empty { display: none; }
#bossHealthText, #bossAttack { display: none !important; }
.boss-panel .boss-health-track { height: 5px !important; background: #ffffff18 !important; box-shadow: inset 0 0 0 1px #ffffff12; border-radius: 4px; }
.boss-panel #bossHealth { box-shadow: 0 0 10px var(--boss-color); }

/* --- Action pads: icon only, key hint chip on desktop --- */
#compactActions { align-items: center; padding-top: 10px; }
#compactActions .weapon { --accent: #ffc35a; }
#compactActions .singularity { --accent: #d6a6ff; }
#compactActions .singularity .action-symbol { color: var(--special-accent, #d6a6ff); }
.pad-label, .dock-info { display: none !important; }
.pad-key {
  position: absolute; right: -6px; bottom: -4px; min-width: 18px; padding: 2px 5px; border-radius: 6px;
  font: 800 9px "Neon Sans", sans-serif; font-style: normal; letter-spacing: .04em; color: #0a1220;
  background: var(--accent); box-shadow: 0 2px 0 #0007;
}
#compactActions .fire .pad-key { right: 50%; transform: translateX(50%); bottom: -7px; }
.touch-ui .pad-key { display: none; }
#compactActions .pad:focus { outline: none; }
#compactActions .pad:focus-visible .pad-disc { outline: 2px solid #fff; outline-offset: 5px; }
#compactActions .fire { margin-left: auto; }
#compactActions .pad.cooling .pad-disc { filter: saturate(.6); }

/* --- Overlay / menus --- */
.overlay .orb { width: 92px; height: 92px; border: 0; background: none; box-shadow: none; margin-bottom: 14px; }
.orb-art { width: 100%; height: 100%; border-radius: 22px; box-shadow: 0 0 0 1px #b0f6d533, 0 10px 40px #0009, 0 0 40px #5ff5cf22; }
.revive-menu .orb, .panel-menu .orb { display: none; }
.home-menu #message { color: #8ea7b8 !important; font-size: 11px !important; letter-spacing: .06em; }
#overline:empty { display: none; }
.overlay h2 { letter-spacing: -.01em; }

/* --- Garage: fewer words --- */
.garage .shop-header { padding-bottom: 12px; margin-bottom: 12px; }
.garage .shop-test-note { padding: 5px 9px; font-size: 9px; letter-spacing: .1em; display: inline-block; }
.garage-preview { height: 210px; }
.garage h3#garageShipName { margin: 12px 0 8px; font-size: 22px; }
.spec-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.spec-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px 5px 6px; border-radius: 99px;
  background: #13212e; border: 1px solid #2c4252; font-size: 12px; color: #e5edf5;
}
.chip-icon { width: 16px; height: 16px; fill: none; stroke: #93e9df; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.garage-role { display: flex; align-items: center; gap: 8px; margin: 10px 0 12px !important; color: #e5edf5 !important; font-size: 13px !important; }
.garage-role b { color: var(--special); }
.garage-role span { margin-left: auto; padding: 3px 8px; border-radius: 99px; background: #13212e; color: #a9bcc9; font-size: 11px; font-variant-numeric: tabular-nums; }
.garage-role span::before { content: "⟳ "; }
.role-icon { width: 22px; height: 22px; fill: none; stroke: var(--special); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fleet-tile { position: relative; }
.fleet-tile strong { font-size: 10px; }
.tile-status { position: absolute; top: 5px; right: 6px; font-size: 9px; font-weight: 800; }
.tile-status.on { color: #0a1220; background: var(--accent); border-radius: 50%; width: 16px; height: 16px; display: grid; place-items: center; }
.tile-status.cost { color: #ffe08a; }
.tile-status.cost::after { content: " ◈"; }
.weapon-path { margin: 12px 0 14px !important; }
.weapon-stage { padding: 6px 2px !important; }
.weapon-stage small { margin-top: 0 !important; font-weight: 700; }
.upgrade-row { display: grid !important; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px !important; padding: 11px 0 !important; }
.upgrade-row strong { font-size: 13px; }
.upgrade-row small { margin-top: 2px !important; font-size: 10px !important; color: #7f98a8 !important; }
.upgrade-row button { flex: none !important; min-width: 86px; min-height: 36px !important; }
.pips { display: inline-flex; gap: 4px; }
.pips i { width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); border: 1px solid #4c6a7c; }
.pips i.on { background: #b0f6d5; border-color: #b0f6d5; box-shadow: 0 0 6px #b0f6d588; }
.system-icon { color: #93e9df; }
.test-tools { gap: 6px 14px !important; align-items: center; }
.test-tools button { flex: 0 0 auto !important; padding: 5px 14px !important; }
.garage #shopNotice { min-height: 18px !important; margin: 8px 0 0 !important; font-size: 12px; }

/* Desktop rail: score and best only; level and time live in the arena HUD. */
.rail-right #statsBoard .status, .rail-right #statsBoard .stat-time { display: none !important; }
.rail-right #statsBoard .stat-best { grid-column: 1 / -1; }
.rail-right #statsBoard .stat-best strong { font-size: clamp(18px, 2vw, 26px) !important; }
.equipped-summary img { width: 44px !important; height: 44px !important; }

/* =====================  1.9 visual pass 3: hex action pads, garage layout  ===================== */

/* Duotone glyphs: pads use a bolder fill than menus. */
.f { fill: currentColor; fill-opacity: var(--glyph-fill, .3); stroke: none; }

/* --- Action pads: hexagonal, reload shown as an energy level rising inside --- */
#compactActions { gap: clamp(10px, 3.5vw, 18px); padding: 10px clamp(12px, 4vw, 20px) calc(10px + env(safe-area-inset-bottom)); }
#compactActions .weapon { --accent: #ffbf4d; --deep: #3a2306; }
#compactActions .singularity { --accent: #c99bff; --deep: #24113f; }
#compactActions .fire { --accent: #6ff2cf; --deep: #072a26; }
#compactActions .pad { --glyph-fill: .95; filter: drop-shadow(0 3px 0 #02060c); transition: filter .2s, transform .07s ease-out; }
#compactActions .pad .pad-disc {
  width: clamp(56px, 15.5vw, 66px); aspect-ratio: .88; border-radius: 0; background: none !important;
  box-shadow: none !important; animation: none !important; transition: none; filter: none !important;
}
#compactActions .fire .pad-disc { width: clamp(76px, 21vw, 90px); }
#compactActions .pad .pad-disc::before,
#compactActions .pad .pad-disc::after {
  content: ""; position: absolute; inset: 0; border-radius: 0; opacity: 1; -webkit-mask: none; mask: none;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
/* Rim */
#compactActions .pad .pad-disc::before {
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 90%, #fff), color-mix(in srgb, var(--accent) 45%, #000));
}
/* Core: dark glass with the energy level filling from the bottom */
#compactActions .pad .pad-disc::after {
  inset: 2.5px;
  background:
    radial-gradient(circle at 50% 30%, #ffffff1c, transparent 60%),
    linear-gradient(to top,
      color-mix(in srgb, var(--accent) 42%, var(--deep)) 0 var(--charge),
      #070d18 var(--charge) 100%);
}
#compactActions .pad .action-symbol, #compactActions .pad .pad-time { position: relative; z-index: 1; }
#compactActions .pad .action-symbol {
  width: 48%; height: 48%; color: #fff; stroke: color-mix(in srgb, var(--accent) 70%, #fff); stroke-width: 1.4;
  filter: drop-shadow(0 0 5px var(--accent));
}
#compactActions .singularity .action-symbol { color: var(--special-accent, #fff); }
#compactActions .pad .pad-key { z-index: 2; }
/* Ready: bright core and a breathing glow */
#compactActions .pad.charged { filter: drop-shadow(0 3px 0 #02060c) drop-shadow(0 0 6px var(--accent)); animation: hex-ready 1.6s ease-in-out infinite; }
#compactActions .pad.charged .pad-disc::after { background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--accent) 55%, #fff0), var(--deep) 75%); }
@keyframes hex-ready { 0%, 100% { filter: drop-shadow(0 3px 0 #02060c) drop-shadow(0 0 5px var(--accent)); } 50% { filter: drop-shadow(0 3px 0 #02060c) drop-shadow(0 0 13px var(--accent)); } }
/* Reloading: dim icon, big countdown */
#compactActions .pad.cooling .action-symbol { opacity: .22; filter: none; }
#compactActions .pad.cooling .pad-disc::before { filter: saturate(.35) brightness(.7); }
/* Active power: draining energy with moving stripes */
#compactActions .pad.active-power .pad-disc::after {
  background:
    repeating-linear-gradient(-45deg, #ffffff14 0 4px, transparent 4px 9px),
    linear-gradient(to top, color-mix(in srgb, var(--accent) 70%, var(--deep)) 0 var(--charge), #070d18 var(--charge) 100%);
  background-size: 18px 18px, auto;
  animation: hex-stripes .6s linear infinite;
}
#compactActions .pad.active-power .action-symbol { opacity: .3; }
@keyframes hex-stripes { to { background-position: 18px 0, 0 0; } }
.pad-time { font-size: clamp(16px, 4.6vw, 20px) !important; text-shadow: 0 0 6px #000, 0 1px 2px #000 !important; }
/* Fire: always-full energy core and a crosshair; press = flash */
#compactActions .fire .pad-disc::after { background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 40%, var(--deep)), #061219 72%) !important; }
#compactActions .fire.pressed, #compactActions .pad:not(:disabled):active { transform: translateY(2px) scale(.95); }
#compactActions .fire.pressed .pad-disc::after { background: radial-gradient(circle at 50% 45%, #ffffffcc, var(--accent) 35%, var(--deep) 80%) !important; }
#compactActions .fire.pressed .action-symbol { color: #062a24; filter: none; }
#compactActions .pad:not(:disabled):active .pad-disc, #compactActions .fire.pressed .pad-disc { transform: none; }
html:not(.in-run) #compactActions .pad { opacity: .5; animation: none; }
@media (max-height: 520px) {
  #compactActions .pad .pad-disc { width: 48px; }
  #compactActions .fire .pad-disc { width: 62px; }
}
@media (prefers-reduced-motion: reduce) {
  #compactActions .pad.charged, #compactActions .pad.active-power .pad-disc::after { animation: none; }
}

/* --- Garage --- */
.garage-body { grid-template-areas: "show work" "fleet fleet"; align-items: start; }
.garage-showcase { grid-area: show; }
.garage-workbench { grid-area: work; }
.garage-fleet { grid-area: fleet; }
.garage-fleet .fleet-label { margin-top: 0 !important; }
.garage .garage-fleet .ship-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 700px) {
  .garage-body { grid-template-areas: "show" "fleet" "work"; }
  .garage .garage-fleet .ship-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.garage .shop-close { display: grid; place-items: center; padding: 0; }
.garage .shop-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.weapon-stage { gap: 3px; }
.weapon-icon { width: 38px !important; height: 38px !important; margin: 2px 0 !important; overflow: visible; }
.wi-glow { fill: var(--energy); opacity: .22; }
.wi-body { fill: var(--energy); }
.wi-core { fill: #fff; }
.wi-ring { fill: none; stroke: var(--energy); stroke-width: 1.2; stroke-dasharray: 3 3; opacity: .8; }
.wi-spark { fill: none; stroke: var(--energy); stroke-width: 1.6; stroke-linecap: round; }
.weapon-stage:not([data-active=true]):not([data-done=true]) .weapon-icon { opacity: .75; filter: saturate(.7); }
.weapon-stage[data-active=true] .weapon-icon { filter: drop-shadow(0 0 6px var(--energy)); }
.chip-icon .f { fill-opacity: .3; }

/* Hull plating badge sits beside FIRE: Q E on the left, hull + FIRE on the right. */
.hull-badge {
  position: relative; display: grid; place-items: center; margin-left: auto; align-self: center;
  width: clamp(38px, 10.5vw, 44px); aspect-ratio: .88; color: #ffcf9a; opacity: .35; transition: opacity .2s, filter .2s;
}
.hull-badge::before, .hull-badge::after {
  content: ""; position: absolute; inset: 0; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.hull-badge::before { background: linear-gradient(160deg, #ffd9ad, #8a5a2a); }
.hull-badge::after { inset: 2px; background: radial-gradient(circle at 50% 35%, #4a2e12, #140b05 75%); }
.hull-badge svg { position: relative; z-index: 1; width: 56%; height: 56%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; --glyph-fill: .6; }
.hull-badge:not(.owned) { opacity: .18; filter: grayscale(1); }
.hull-badge.owned { opacity: .45; }
.hull-badge.owned.on { opacity: 1; filter: drop-shadow(0 0 7px #ffb766aa); }
html:not(.in-run) .hull-badge { visibility: hidden; }
#compactActions .fire { margin-left: 0 !important; }
.weapon-icon { width: 48px !important; height: 42px !important; }
.weapon-icon { width: 48px !important; height: 52px !important; }
.weapon-icon { height: 58px !important; }

/* It's a game: nothing on screen is selectable or draggable (form controls excepted). */
html, body, body * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img, canvas, svg { -webkit-user-drag: none; user-drag: none; }
input, select, textarea { -webkit-user-select: auto; user-select: auto; }
::selection { background: transparent; }

/* ---------- Ad layer is a modal dialog so it sits above the garage and rewards ---------- */
dialog.ad-break { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; padding: 16px; color: #e5edf5; background: #02060dee; }
dialog.ad-break:not([open]) { display: none; }
dialog.ad-break[open] { display: grid; place-items: center; }
dialog.ad-break::backdrop { background: #02060d; }
.ad-frame span { font-size: 28px; font-weight: 800; letter-spacing: .2em; opacity: .5; }

/* ---------- Rewards ---------- */
.reward-button { position: relative; display: inline-flex !important; gap: 8px; }
.reward-button .menu-icon { width: 20px; height: 20px; fill: none; stroke: #ffd36e; stroke-width: 1.7; stroke-linejoin: round; --glyph-fill: .45; color: #ffd36e; }
.reward-dot { position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%; background: #ff5c7a; box-shadow: 0 0 0 2px #0b1424, 0 0 10px #ff5c7a; animation: dot-pulse 1.4s ease-in-out infinite; }
.reward-dot[hidden] { display: none; }
@keyframes dot-pulse { 50% { transform: scale(1.25); } }
.garage.rewards { width: min(540px, 96vw) !important; }
.rewards-body { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.reward-card { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 14px; background: linear-gradient(160deg, #142536, #0c1726); border: 1px solid #2c4559; }
.reward-card header { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.reward-card.daily { grid-column: 1 / -1; }
.reward-card.daily header { color: #ffd36e; }
.reward-icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; --glyph-fill: .45; }
.login-track { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
.login-day { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; border-radius: 10px; background: #0b1522; border: 1px solid #263b4c; }
.login-day .coin-mark { width: 22px; height: 22px; }
.login-day.big .coin-mark { width: 28px; height: 28px; filter: drop-shadow(0 0 6px #ffd46788); }
.login-day b { font-size: 13px; color: #ffe08a; }
.login-day small { font-size: 9px; color: #6f8597; font-weight: 700; letter-spacing: .08em; }
.login-day.got { opacity: .45; }
.login-day.got::after { content: "✓"; position: absolute; top: 3px; right: 5px; font-size: 10px; color: #b0f6d5; font-weight: 800; }
.login-day.now { border-color: #ffd36e; background: #2a2210; box-shadow: 0 0 14px #ffd36e44; }
.reward-card.coins header { font-size: 22px; color: #ffe08a; font-weight: 800; }
.reward-card.coins .coin-mark { width: 30px; height: 30px; }
.reward-card.ship { flex-direction: row; align-items: center; flex-wrap: wrap; }
.reward-card.ship .reward-claim { flex-basis: 100%; }
.reward-ship { width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 0 8px #ffc08455); }
.ship-track { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ship-track strong { font-size: 13px; color: #ffc084; }
.ship-track small { font-size: 10px; color: #8ea7b8; font-weight: 700; }
.track { display: block; height: 6px; border-radius: 4px; background: #ffffff14; overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #ff9b54, #ffc084); box-shadow: 0 0 8px #ffc084; }
.reward-card.ship.owned { opacity: .6; }
.garage .reward-claim { margin-top: auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; border-radius: 10px; background: #ffd36e; border-color: #ffe7a6; color: #2a1a00; font-weight: 800; }
.garage .reward-claim:hover:not(:disabled) { background: #ffe08a; border-color: #fff1c4; }
.garage .reward-claim svg { width: 14px; height: 14px; fill: currentColor; }
.garage .reward-claim.done { background: #18242f; border-color: #2c3e4c; color: #7f98a8; opacity: 1; }
.rewards-notice { min-height: 18px; margin: 12px 0 0; text-align: center; color: #ffe08a !important; font-weight: 700; font-size: 13px !important; }
@media (max-width: 420px) { .rewards-body { grid-template-columns: 1fr; } }
.reward-card header { justify-content: flex-start !important; } .reward-card.coins header { justify-content: space-between !important; }

/* =====================  Menus: blurred live background, wordmark, chest  ===================== */
.overlay.home-menu, .overlay.panel-menu {
  background: radial-gradient(ellipse at 50% 40%, #0b1a2c66, #040a14d9 75%) !important;
  -webkit-backdrop-filter: blur(7px) saturate(1.2); backdrop-filter: blur(7px) saturate(1.2) !important;
}
.home-menu .orb, .home-menu #overline, .home-menu #message { display: none !important; }
.home-menu h2 {
  display: block !important; margin: 0 0 26px; font-size: clamp(40px, 11vw, 64px); font-weight: 800; font-style: italic;
  line-height: .9; letter-spacing: -.035em; text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 0%, #b1ffe1 45%, #49d6b0 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px #49d6b066) drop-shadow(0 3px 0 #0b3a32);
}
.home-menu .home-buttons { margin-top: 10px; }

/* Reward chest: top-right of the menu, idles, and wiggles with a red dot when something is waiting. */
.chest-button { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 10px; z-index: 4; width: 76px; height: 76px; padding: 0; border: 0; background: none; cursor: pointer; }
.overlay:not(.home-menu) .chest-button { display: none; }
.chest { position: relative; z-index: 1; width: 100%; height: 100%; overflow: visible; animation: chest-bob 2.8s ease-in-out infinite; filter: drop-shadow(0 4px 6px #0008); }
.chest-lid, .chest-base { transform-box: view-box; }
.chest-lid { transform-origin: 10px 29px; }
.chest-glow { opacity: .35; transition: opacity .3s; }
.chest-sparks { opacity: 0; }
.chest-rays { position: absolute; inset: -8px; border-radius: 50%; opacity: 0;
  background: repeating-conic-gradient(#ffd36e40 0 9deg, transparent 9deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 70%); mask: radial-gradient(circle, #000 25%, transparent 70%); }
.chest-button.ready .chest-rays { opacity: 1; animation: chest-spin 9s linear infinite; }
.chest-button.ready .chest-glow { opacity: 1; animation: chest-glow 1.6s ease-in-out infinite; }
.chest-button.ready .chest { animation: chest-bob 2.8s ease-in-out infinite, chest-wiggle 3.4s ease-in-out infinite; }
.chest-button.ready .chest-lid { animation: chest-lid 3.4s ease-in-out infinite; }
.chest-button.ready .chest-sparks { animation: chest-sparks 1.7s ease-in-out infinite; }
.chest-button.ready .chest-gem { animation: chest-gem 1.2s ease-in-out infinite; }
.chest-button .reward-dot { top: 4px; right: 4px; z-index: 2; width: 14px; height: 14px; }
.chest-button:active .chest { transform: scale(.92); }
@keyframes chest-bob { 50% { translate: 0 -3px; } }
@keyframes chest-wiggle { 0%, 70%, 100% { rotate: 0deg; } 74% { rotate: -7deg; } 78% { rotate: 6deg; } 82% { rotate: -4deg; } 86% { rotate: 2deg; } }
@keyframes chest-lid { 0%, 70%, 92%, 100% { transform: none; } 76%, 86% { transform: translateY(-3px) rotate(-7deg); } }
@keyframes chest-spin { to { rotate: 360deg; } }
@keyframes chest-glow { 50% { opacity: .55; } }
@keyframes chest-sparks { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
@keyframes chest-gem { 50% { filter: brightness(1.6); } }
@media (prefers-reduced-motion: reduce) { .chest-button * { animation: none !important; } }

/* =====================  Settings: game switches and segmented pickers  ===================== */
.game-settings { display: flex; flex-direction: column; gap: 14px; width: min(330px, 100%); margin: 18px 0 6px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: #d8ede8; font-size: 15px; font-weight: 700; }
.game-settings .switch {
  position: relative; width: 64px; height: 32px; padding: 0; border-radius: 99px; font-size: 0; color: transparent;
  border: 1px solid #2f4a5a; background: #0b1622; box-shadow: inset 0 2px 6px #0009; transition: background .2s, border-color .2s;
}
.game-settings .switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(#e5edf5, #8ea7b8); box-shadow: 0 2px 4px #0008; transition: transform .2s cubic-bezier(.3,1.4,.5,1), background .2s;
}
.game-settings .switch[aria-pressed="true"] { background: linear-gradient(90deg, #1c6b58, #2fb48e); border-color: #6ff2cf; box-shadow: inset 0 2px 6px #0006, 0 0 12px #6ff2cf55; }
.game-settings .switch[aria-pressed="true"]::after { transform: translateX(32px); background: linear-gradient(#ffffff, #c8fff0); }
.segments { display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; background: #0b1622; border: 1px solid #2f4a5a; box-shadow: inset 0 2px 6px #0009; }
.segments button {
  min-width: 48px; height: 32px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: #8ea7b8;
  font: 800 13px "Neon Sans", sans-serif; transition: background .15s, color .15s;
}
.segments button[aria-pressed="true"] { color: #062a24; background: linear-gradient(#b1ffe1, #49d6b0); box-shadow: 0 2px 0 #1b6b58, 0 0 10px #49d6b055; }
.segments button:not([aria-pressed="true"]):hover { color: #d8ede8; }

/* =====================  About  ===================== */
.about-panel { width: min(340px, 100%); margin: 16px 0 6px; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.about-game { display: flex; align-items: center; gap: 12px; }
.about-game img { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 0 0 1px #b0f6d533, 0 6px 20px #0008; }
.about-game strong { display: block; font-size: 18px; color: #fff; }
.about-game span { font-size: 12px; color: #8ea7b8; }
.about-credits { margin: 0; padding: 12px 14px; border-radius: 12px; background: #0b1622cc; border: 1px solid #263b4c; display: grid; gap: 8px; }
.about-credits div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.about-credits dt { color: #8ea7b8; }
.about-credits dd { margin: 0; color: #e5edf5; font-weight: 700; }
.about-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.about-links a {
  display: grid; place-items: center; min-height: 40px; padding: 6px 8px; border-radius: 10px; text-align: center;
  font-size: 12px; font-weight: 700; color: #b1ffe1; text-decoration: none; background: #102737; border: 1px solid #2e5a61;
}
.about-links a:hover { background: #183747; }
.about-links a:last-child { color: #8ea7b8; }
.panel-menu h2 { margin-bottom: 0; }

/* =====================  Display font: Apex Fall Display (original, angular)  ===================== */
@font-face { font-family: "Apex Fall Display"; src: url("fonts/NeonDodgeDisplay.ttf") format("truetype"); font-weight: 400 900; font-display: block; }
:root { --display: "Apex Fall Display", "Neon Sans", sans-serif; }
.hud, .boss-caption, .pad-time, .pad-key, #compactActions .pad-key,
.overlay h2, .overlay #overline, .overlay .primary, .overlay .menu-button, .set-row > span, .segments button,
.garage h2, .garage h3, .garage .eyebrow, .fleet-label, .fleet-tile strong, .upgrade-row strong, .spec-chip b, .garage-role b,
.weapon-stage small, .garage button, .reward-card header, .login-day b, .login-day small, .ship-track strong, .ship-track small,
.about-game strong, .ad-card h3, .ad-card .eyebrow, .rewards-notice, #shopNotice, .rail-right #statsBoard strong, .rail-right #statsBoard .label {
  font-family: var(--display) !important; letter-spacing: .06em;
}
.hud-score b { letter-spacing: .02em; }
.overlay h2 { letter-spacing: .04em; }
.home-menu h2 { letter-spacing: .02em; font-size: clamp(34px, 9.5vw, 56px); }
.overlay .primary, .overlay .menu-button { font-size: 13px !important; letter-spacing: .14em; }
.shop-trigger, .test-badge, .equipped-summary strong, .about-links a { font-family: var(--display) !important; letter-spacing: .06em; }
.hud.spectrum .hud-bar i { background: linear-gradient(90deg, #df9dff, #ffd478, #80deff, #ff9bab); box-shadow: 0 0 8px #c9b8ff; }


/* Keep the Android pad lighting steady between charge changes to avoid a paint each frame. */
.native-app #compactActions .pad.charged {
  animation: none;
  filter: drop-shadow(0 3px 0 #02060c) drop-shadow(0 0 9px var(--accent));
}
.native-app #compactActions .pad.active-power .pad-disc::after { animation: none; }

/* Equal layout for the FPS and graphics pickers on every screen size. */
.game-settings .performance-setting { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.25fr); gap:10px; }
.game-settings .performance-setting .segments { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); width:100%; box-sizing:border-box; }
.game-settings .performance-setting .segments button { min-width:0; width:100%; height:36px; padding:0 4px; }
