/* [THE_VAULT] // HANGAR // fullscreen flight protocol + liquid glass HUD */

/* ===== FULLSCREEN: no page scroll + no pinch/double-tap zoom ===== */
html:has(body.hangar-fullscreen),
body.hangar-fullscreen {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  /* critical: blocks browser double-tap zoom and pinch on iOS/Android */
  touch-action: none;
  -ms-touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
body.hangar-fullscreen {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  cursor: crosshair;
  /* iPhone home indicator / notched tablets */
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
/* inputs must remain selectable/typable */
body.hangar-fullscreen input,
body.hangar-fullscreen textarea {
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
}
body.hangar-fullscreen .bg-grid,
body.hangar-fullscreen .bg-noise,
body.hangar-fullscreen .bg-vignette { position: fixed; }

/* Compact nav */
.hangar-nav {
  position: sticky; top: 0; flex: 0 0 auto;
  padding: 10px 16px !important;
  height: auto;
}
.hangar-nav .nav-links,
.hangar-nav .nav-toggle,
.hangar-nav .nav-status { display: none !important; }
.hangar-nav-mid {
  flex: 1; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.hangar-nav-title {
  font-size: 11px; font-weight: 800; letter-spacing: 0.2em;
  color: var(--signal);
}
.hangar-pilot-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  color: #5dff3a; border: 1px solid rgba(93,255,58,0.35);
  padding: 2px 8px; background: rgba(93,255,58,0.06);
}
.hangar-pilot-chip .pilot-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #5dff3a;
  box-shadow: 0 0 8px #5dff3a;
}
.hangar-nav-actions { display: flex; align-items: center; gap: 10px; }
.btn-lb {
  font-family: var(--font-mono); font-size: 10px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 8px 12px; cursor: pointer;
  background: var(--signal); color: var(--void);
  border: 1px solid var(--signal);
}
.btn-lb:hover { box-shadow: 0 0 16px var(--signal-50); }
.nav-exit {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--text-primary); text-decoration: none;
  border: 1px solid var(--border); padding: 7px 10px;
}
.nav-exit:hover { border-color: var(--signal); color: var(--signal); }

#game-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 8px 12px 12px;
  overflow: hidden;
}
#game-shell {
  width: min(960px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  min-height: 0;
}

/* ===== HUD // liquid glass + high contrast ===== */
#hud {
  flex: 0 0 auto;
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: nowrap;
  background: rgba(12, 12, 12, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255, 179, 0, 0.2);
  border-bottom: none;
  padding: 8px 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.hud-item { display: flex; flex-direction: column; min-width: 52px; }
.hud-lbl {
  font-size: 10px; letter-spacing: 0.18em; color: #b0b0b0; font-weight: 700;
}
.hud-val {
  font-size: 18px; font-weight: 800; color: #ffc933; letter-spacing: 0.04em;
  text-shadow: 0 0 12px rgba(255,179,0,0.35);
}
#hud-lives { color: #ff4d6d; letter-spacing: 2px; text-shadow: 0 0 10px rgba(255,31,79,0.4); }
#hud-scrap { color: #5dff3a; text-shadow: 0 0 10px rgba(57,255,20,0.35); }

/* Heat / overload bar */
.hud-heat-item { min-width: 72px; position: relative; }
.hud-heat-bar {
  height: 3px; margin-top: 3px; background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,100,120,0.25); overflow: hidden;
}
#hud-heat-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ffb300, #ff4d6d);
  transition: width 0.12s linear;
  box-shadow: 0 0 8px rgba(255,31,79,0.45);
}
#hud-heat-wrap.hot #hud-heat { color: #ff6b88; animation: heat-pulse 0.6s ease-in-out infinite; }
#hud-heat-wrap.overload #hud-heat { color: #ff1f4f; }
#hud-heat-wrap.overload .hud-heat-bar { border-color: #ff1f4f; }
#hud-heat-wrap.overload #hud-heat-fill {
  width: 100% !important;
  background: #ff1f4f;
  animation: heat-pulse 0.35s linear infinite;
}
@keyframes heat-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

#loadout-bar {
  flex: 0 0 auto;
  min-height: 26px;
  background: rgba(17, 17, 17, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 179, 0, 0.15);
  border-top: none; border-bottom: none;
  padding: 5px 10px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
  font-size: 10px; letter-spacing: 0.06em; color: #c8c8c8;
  max-height: 48px; overflow: hidden;
}
#loadout-bar:empty::before { content: 'LOADOUT // EMPTY'; color: #888; }
.loadout-chip {
  border: 1px solid #555; padding: 2px 7px; color: #f0f0f0;
  background: #050505; font-weight: 700;
}
.loadout-chip.t1 { border-color: #888; color: #e0e0e0; }
.loadout-chip.t2 { border-color: #ffb300; color: #ffc933; }
.loadout-chip.t3 { border-color: #5dff3a; color: #5dff3a; }
.loadout-chip.t4 { border-color: #ff4d6d; color: #ff6b88; }
.loadout-chip.combo {
  border-color: #ffb300; background: rgba(255,179,0,0.15);
  color: #ffc933; font-weight: 800;
}

#canvas-wrap {
  position: relative; flex: 1 1 auto; min-height: 0;
  border: 2px solid #ffb300; background: #020202;
  display: flex; align-items: center; justify-content: center;
  container-type: size;
  /* dead zones around letterboxed canvas still receive move via wrap listener */
  touch-action: none;
}
#canvas-wrap.shake { animation: hangar-shake 0.28s linear; }
#canvas-wrap.hit-flash::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 4;
  background: radial-gradient(circle at 50% 70%, transparent 25%, rgba(255, 31, 79, 0.35) 100%);
  animation: hit-fade 0.35s ease-out forwards;
}
@keyframes hangar-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 1px); }
  40% { transform: translate(3px, -2px); }
  60% { transform: translate(-2px, -1px); }
  80% { transform: translate(2px, 2px); }
}
@keyframes hit-fade { to { opacity: 0; } }

#game-canvas {
  /* Keep 900×560 aspect // no portrait squash on phones / iPads */
  display: block;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 900 / 560;
  height: 100%;
  width: auto;
  background: radial-gradient(circle at 50% 28%, #121212, #010101 70%);
  cursor: crosshair;
  touch-action: none;
}
@supports (width: 1cqw) {
  #game-canvas {
    width: min(100cqw, calc(100cqh * 900 / 560));
    height: min(100cqh, calc(100cqw * 560 / 900));
  }
}

/* ===== OVERLAYS // no outer page scroll; panel may scroll inside ===== */
.game-overlay {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 12px; overflow: hidden;
}
.ov-box {
  text-align: center; max-width: 440px; width: 100%; margin: auto;
  padding: 16px 14px; max-height: 100%; overflow-y: auto;
  background: rgba(10, 10, 10, 0.78);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid rgba(255, 179, 0, 0.22);
  box-shadow: 0 0 0 1px rgba(255,179,0,0.12), 0 20px 60px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.1);
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.ov-box-wide { max-width: 520px; }
.ov-box-chest { max-width: min(720px, 100%); text-align: left; }
.ov-start { max-width: 540px; text-align: left; }
.ov-start h2 { text-align: left; margin-bottom: 6px; }
.ov-tag {
  font-size: 11px; letter-spacing: 0.22em; color: #ffc933;
  margin-bottom: 10px; font-weight: 800;
}
.ov-box h2 {
  font-family: var(--font-display); font-size: clamp(24px, 5vw, 40px); font-weight: 700;
  color: #f2f2f2; margin-bottom: 10px; line-height: 1.05;
}
.ov-lead {
  font-size: 13px; color: #b8b8b8; line-height: 1.5; margin: 0 0 16px;
}
.ov-box p.ov-sub {
  font-size: 13px; color: #c4c4c4; margin: 10px 0; line-height: 1.55;
}

/* Clearance / pilot panel */
.clearance-panel {
  border: 1px solid rgba(255,179,0,0.28);
  background: rgba(0,0,0,0.45);
  padding: 14px 14px 12px;
  margin-bottom: 14px;
}
.clearance-panel.is-cleared {
  border-color: rgba(93,255,58,0.35);
}
.clearance-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; gap: 10px;
}
.clr-code {
  font-size: 10px; font-weight: 800; letter-spacing: 0.16em; color: #ffc933;
}
.clr-status {
  font-size: 10px; font-weight: 800; letter-spacing: 0.12em;
  color: #888; border: 1px solid #444; padding: 2px 8px;
}
.clr-status.ok { color: #5dff3a; border-color: rgba(93,255,58,0.4); }
.clr-hint {
  font-size: 11px; color: #9a9a9a; line-height: 1.45; margin: 0 0 12px;
}
.clr-fields { display: grid; gap: 6px; margin-bottom: 12px; }
.clr-label {
  font-size: 10px; font-weight: 800; letter-spacing: 0.14em; color: #888;
  margin-top: 4px;
}
.clr-fields input,
#capture-form input {
  width: 100%; background: #050505; border: 2px solid #555;
  color: #fff; font-family: var(--font-mono); font-size: 15px;
  padding: 11px 12px; outline: none; box-sizing: border-box;
}
.clr-fields input:focus,
#capture-form input:focus { border-color: #ffc933; }
.clr-fields input::placeholder,
#capture-form input::placeholder { color: #666; }
.clr-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.clr-actions .btn { width: 100%; font-size: 11px !important; padding: 12px 10px !important; }
.clr-msg {
  margin: 10px 0 0; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  color: #5dff3a;
}
.clr-msg.err { color: #ff6b88; }

.start-brief {
  border: 1px solid #333; background: rgba(12,12,12,0.7);
  padding: 10px 12px; margin-bottom: 14px;
}
.brief-row {
  display: grid; grid-template-columns: 72px 1fr; gap: 10px;
  font-size: 11px; color: #b0b0b0; line-height: 1.4;
  padding: 5px 0; border-top: 1px solid #222;
}
.brief-row:first-child { border-top: none; padding-top: 0; }
.brief-row .bk {
  font-weight: 800; letter-spacing: 0.08em; color: #ffc933;
}
.brief-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid #222;
  font-size: 10px; color: #888; letter-spacing: 0.06em;
}
.brief-legend span { display: inline-flex; align-items: center; gap: 4px; }
.btn-flight { width: 100%; margin-top: 4px; }

@media (max-width: 520px) {
  .clr-actions { grid-template-columns: 1fr; }
  .brief-row { grid-template-columns: 64px 1fr; }
}
.ov-box p.ov-sub b { color: #fff; font-weight: 800; }
.hi-amber { color: #ffc933 !important; }
.hi-green { color: #5dff3a !important; }
.hi-red { color: #ff6b88 !important; }
.ov-box p.ov-sub.granted { color: #5dff3a; font-weight: 700; }
.ov-controls { font-size: 11px !important; color: #b8b8b8 !important; }
.ov-score {
  font-size: 22px; font-weight: 800; color: #ffc933; letter-spacing: 0.08em;
  margin: 10px 0 14px; text-align: center;
  text-shadow: 0 0 18px rgba(255,179,0,0.4);
}

.legend-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  vertical-align: middle; margin-right: 2px; border: 1px solid #fff;
}
.legend-dot.white { background: #e8e8e8; }
.legend-dot.red { background: #ff1f4f; border-color: #ff8aa0; }
.legend-dot.amber { background: #ffb300; box-shadow: 0 0 8px #ffb300; border-color: #ffe08a; }

/* ===== CHEST UI ===== */
.chest-hero {
  display: flex; align-items: center; gap: 14px; margin-bottom: 12px;
  border-bottom: 1px solid #333; padding-bottom: 12px;
}
.chest-star {
  width: 52px; height: 52px; flex: 0 0 auto;
  display: grid; place-items: center;
  font-size: 28px; color: #050505; font-weight: 900;
  background: radial-gradient(circle at 40% 35%, #ffe08a, #ffb300 55%, #c47f00);
  border: 2px solid #fff3c4;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  filter: drop-shadow(0 0 12px rgba(255,179,0,0.7));
  line-height: 1;
}
.chest-star { /* star is the shape; hide glyph if clip works */
  font-size: 0;
}
.chest-star::before {
  content: '';
  width: 100%; height: 100%;
}
.chest-layout {
  display: grid; grid-template-columns: 1fr 168px; gap: 14px; align-items: start;
}
.chest-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-bottom: 10px; flex-wrap: wrap;
}
.shop-scrap {
  font-weight: 800; color: #5dff3a !important; letter-spacing: 0.1em;
  font-size: 15px; margin: 0 !important;
  text-shadow: 0 0 12px rgba(57,255,20,0.35);
}
.shop-scrap span { font-size: 20px; }
.btn-reroll {
  padding: 10px 14px !important; font-size: 11px !important;
  border-color: #ffc933 !important; color: #ffc933 !important;
}
.btn-reroll:disabled {
  opacity: 0.4; cursor: not-allowed;
}

.shop-offers {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 12px;
}
.shop-card {
  background: linear-gradient(180deg, #141414 0%, #0a0a0a 100%);
  border: 2px solid #4a4a4a; padding: 12px 10px;
  display: flex; flex-direction: column; gap: 7px; min-height: 168px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  position: relative; overflow: hidden;
}
.shop-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: #666;
}
.shop-card.t1::before { background: #aaa; }
.shop-card.t2::before { background: #ffb300; }
.shop-card.t3::before { background: #5dff3a; }
.shop-card.t4::before { background: #ff4d6d; box-shadow: 0 0 12px #ff4d6d; }
.shop-card:hover {
  border-color: #ffc933; transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,179,0,0.2);
}
.shop-card.affordable { cursor: pointer; }
.shop-card.locked { opacity: 0.5; filter: grayscale(0.3); }
.shop-card.bought { border-color: #5dff3a; opacity: 0.65; pointer-events: none; }
.shop-card.sold {
  border-color: #444; opacity: 0.55; pointer-events: none;
  background: rgba(20,20,20,0.6);
}
.shop-card.sold .shop-card-name { color: #888; }
.shop-card-effect {
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  color: #ffc933; line-height: 1.35; margin: 4px 0 6px;
  padding: 4px 6px; border: 1px solid rgba(255,179,0,0.25);
  background: rgba(255,179,0,0.06);
}
.shop-restock-hint {
  font-size: 10px; letter-spacing: 0.08em; color: #9a9a9a;
  margin: 0 0 10px; line-height: 1.4;
}
.shop-card-icon {
  width: 36px; height: 36px; margin: 0 auto 2px;
  display: grid; place-items: center;
  border: 1px solid #555; background: #050505;
  font-size: 16px; font-weight: 900; color: #ffc933;
}
.shop-card.t3 .shop-card-icon { color: #5dff3a; border-color: #5dff3a; }
.shop-card.t4 .shop-card-icon { color: #ff6b88; border-color: #ff4d6d; }
.shop-card-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tier-chip {
  font-size: 10px; font-weight: 800; letter-spacing: 0.12em; padding: 2px 6px; border: 1px solid;
}
.tier-chip.t1 { color: #ddd; border-color: #888; background: #222; }
.tier-chip.t2 { color: #050505; border-color: #ffb300; background: #ffb300; }
.tier-chip.t3 { color: #050505; border-color: #5dff3a; background: #5dff3a; }
.tier-chip.t4 { color: #fff; border-color: #ff4d6d; background: #ff1f4f; }
.unique-badge { font-size: 9px; letter-spacing: 0.1em; color: #ff6b88; font-weight: 800; }
.shop-card-name {
  font-size: 12px; font-weight: 800; letter-spacing: 0.05em; color: #fff; text-align: center;
}
.shop-card-desc {
  font-size: 11px; color: #c8c8c8; line-height: 1.4; flex: 1; text-align: center;
}
.shop-card-tags { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.tag-chip {
  font-size: 9px; letter-spacing: 0.08em; padding: 2px 5px;
  border: 1px solid #555; color: #ddd; background: #1a1a1a; font-weight: 700;
}
.shop-card-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; border-top: 1px solid #333; padding-top: 7px;
}
.shop-card-cost { font-weight: 800; color: #5dff3a; letter-spacing: 0.06em; font-size: 12px; }
.shop-card-lvl { color: #bbb; font-weight: 700; }
.near-link { font-size: 10px; color: #ffc933; letter-spacing: 0.06em; text-align: center; font-weight: 700; }

.shop-loadout {
  display: flex; flex-wrap: wrap; gap: 5px; min-height: 22px;
  padding-top: 8px; border-top: 1px solid #333;
  font-size: 10px; color: #bbb;
}

.chest-stats {
  background: #0c0c0c; border: 1px solid #444; padding: 12px 10px;
  position: sticky; top: 0;
}
.stats-title {
  font-size: 10px; letter-spacing: 0.18em; color: #ffc933; font-weight: 800;
  margin-bottom: 10px; border-bottom: 1px solid #333; padding-bottom: 6px;
}
.stats-body { display: grid; gap: 6px; font-size: 11px; }
.stat-row {
  display: flex; justify-content: space-between; gap: 8px;
  color: #c8c8c8; border-bottom: 1px solid #222; padding-bottom: 4px;
}
.stat-row b { color: #fff; font-weight: 800; }
.stat-row .up { color: #5dff3a; }

/* Livery */
.livery-panel {
  text-align: left; margin: 14px 0 16px; padding: 12px;
  border: 1px solid #444; background: #0c0c0c;
}
.livery-head {
  font-size: 11px; letter-spacing: 0.12em; color: #bbb; margin-bottom: 10px; font-weight: 700;
}
.livery-head span { color: #5dff3a; font-weight: 800; }
.livery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px;
}
.skin-card {
  border: 2px solid #444; background: #050505; padding: 10px 6px;
  cursor: pointer; text-align: center; font-size: 10px; letter-spacing: 0.06em;
  color: #ccc; transition: border-color 0.15s, box-shadow 0.15s; font-weight: 700;
}
.skin-card:hover { border-color: #ffc933; color: #fff; }
.skin-card.active {
  border-color: #ffc933; color: #ffc933;
  box-shadow: 0 0 0 1px rgba(255,179,0,0.35), inset 0 0 20px rgba(255,179,0,0.08);
}
.skin-card.locked { opacity: 0.65; }
.skin-card .skin-cost { display: block; margin-top: 5px; color: #5dff3a; font-weight: 800; }
.skin-card .skin-swatch {
  width: 34px; height: 34px; margin: 0 auto 6px; border: 2px solid;
  clip-path: polygon(50% 0%, 100% 100%, 50% 72%, 0% 100%);
}

.run-breakdown {
  text-align: left; font-size: 12px; color: #c8c8c8;
  border: 1px solid #444; background: #0c0c0c; padding: 10px 12px;
  margin: 0 0 12px; line-height: 1.65; letter-spacing: 0.03em;
}
.run-breakdown b { color: #fff; }
.run-breakdown .combo-line { color: #ffc933; }

.combo-toast {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 12; max-width: 92%;
  background: rgba(0,0,0,0.95); border: 2px solid #ffb300;
  color: #ffc933; font-family: var(--font-mono); font-size: 12px; font-weight: 800;
  letter-spacing: 0.12em; padding: 10px 16px; text-align: center;
  box-shadow: 0 0 28px rgba(255,179,0,0.45); pointer-events: none;
  animation: toast-in 0.25s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

#capture-form input { margin-bottom: 10px; }

/* Dual-stick style: left pad = MOVE zone hint, right = FIRE/DASH */
#mobile-controls {
  display: none;
  position: absolute; inset: 0; z-index: 5;
  pointer-events: none;
  touch-action: none;
}
#mobile-controls .mc-zone {
  position: absolute; bottom: 12px; pointer-events: none;
  font-size: 9px; letter-spacing: 0.14em; font-weight: 800;
  color: rgba(255, 201, 51, 0.35); font-family: var(--font-mono);
  text-transform: uppercase;
}
#mobile-controls .mc-zone-move { left: 16px; }
#mobile-controls .mc-zone-fire { right: 16px; bottom: 88px; }
#mobile-controls .mc-btns {
  position: absolute;
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  right: max(14px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: row; gap: 10px; align-items: flex-end;
  pointer-events: auto;
  touch-action: none;
  z-index: 6;
}
#fire-btn, #dash-btn {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(255,179,0,0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid #ffc933; color: #ffc933;
  font-family: var(--font-mono); font-weight: 800; font-size: 11px; letter-spacing: 0.05em;
  cursor: pointer; box-shadow: 0 0 16px rgba(255,179,0,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#fire-btn:active, #fire-btn.held {
  background: rgba(255,179,0,0.35);
  box-shadow: 0 0 28px rgba(255,179,0,0.55), inset 0 0 12px rgba(255,179,0,0.4);
  transform: scale(0.94);
}
#dash-btn {
  border-color: #5dff3a; color: #5dff3a; background: rgba(57,255,20,0.1);
  box-shadow: 0 0 16px rgba(57,255,20,0.2), inset 0 1px 0 rgba(255,255,255,0.12);
  width: 56px; height: 56px; font-size: 10px;
}
#dash-btn:active {
  background: rgba(57,255,20,0.28);
  transform: scale(0.94);
}

/* ===== LIVE LEADERBOARD DRAWER ===== */
.lb-backdrop {
  position: fixed; inset: 0; z-index: 180;
  background: rgba(0,0,0,0.55); border: none; padding: 0; margin: 0;
  cursor: pointer;
}
.lb-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 190;
  width: min(380px, 92vw);
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-left: 2px solid #ffb300;
  transform: translateX(105%);
  transition: transform 0.25s ease;
  display: flex; flex-direction: column;
  box-shadow: -16px 0 48px rgba(0,0,0,0.65), inset 1px 0 0 rgba(255,255,255,0.06);
  overflow: hidden;
  touch-action: pan-y;
}
.lb-drawer.open { transform: translateX(0); }
.lb-drawer-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 16px 16px 10px; border-bottom: 1px solid #333; flex: 0 0 auto;
}
.lb-live {
  font-size: 11px; font-weight: 800; letter-spacing: 0.16em; color: #5dff3a;
  display: flex; align-items: center; gap: 8px;
}
.lb-pulse {
  width: 8px; height: 8px; border-radius: 50%; background: #5dff3a;
  box-shadow: 0 0 10px #5dff3a; animation: blink 1.2s ease-in-out infinite;
}
.lb-close {
  background: transparent; border: 1px solid #555; color: #fff;
  font-size: 16px; width: 36px; height: 36px; cursor: pointer;
  font-family: var(--font-mono);
}
.lb-close:hover { border-color: #ffc933; color: #ffc933; }
#leaderboard-list {
  flex: 1 1 auto; overflow-y: auto; border: none; background: transparent;
  -webkit-overflow-scrolling: touch;
}
.lb-row {
  display: grid; grid-template-columns: 40px 1fr max-content; gap: 10px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid #2a2a2a; font-size: 13px;
}
.lb-row .lb-rank { color: #aaa; font-weight: 800; }
.lb-row:nth-child(1) .lb-rank { color: #ffc933; }
.lb-row:nth-child(2) .lb-rank { color: #e8e8e8; }
.lb-row:nth-child(3) .lb-rank { color: #d4924a; }
.lb-row .lb-name { color: #f0f0f0; font-weight: 700; letter-spacing: 0.03em; word-break: break-word; }
.lb-row .lb-score { color: #5dff3a; font-weight: 800; }
.lb-empty {
  padding: 32px 20px; text-align: center; color: #aaa; font-size: 13px;
}
.lb-hint {
  flex: 0 0 auto; padding: 12px 16px; margin: 0;
  font-size: 11px; color: #999; border-top: 1px solid #333; line-height: 1.45;
}
.lb-drawer .section-tag { margin: 0; border: none; padding: 0; color: #ffc933; }

.run-reset-note {
  margin-top: 12px; padding: 10px 12px;
  border: 1px dashed rgba(255, 31, 79, 0.45);
  color: #ff6b88; font-size: 11px; letter-spacing: 0.06em; line-height: 1.4;
  background: rgba(255, 31, 79, 0.06);
}

@media (max-width: 720px) {
  .hangar-nav-title { display: none; }
  .chest-layout { grid-template-columns: 1fr; }
  .shop-offers { grid-template-columns: 1fr; }
  .chest-stats { position: static; }
  .ov-box h2 { font-size: 26px; }
  #hud { flex-wrap: wrap; gap: 6px 12px; padding: 6px 10px; }
  .hud-val { font-size: 14px; }
  .hud-item { min-width: 44px; }
  #loadout-bar { max-height: 36px; font-size: 9px; }
  /* overlays fill stage; still no page scroll */
  .game-overlay { padding: 8px; }
  #fire-btn, #dash-btn { width: 64px; height: 64px; font-size: 10px; }
  #dash-btn { width: 52px; height: 52px; }
  #mobile-controls .mc-zone { font-size: 8px; bottom: max(10px, env(safe-area-inset-bottom, 0px)); }
  #capture-form input { font-size: 16px; } /* iOS zoom-on-focus guard */
  .ov-box { max-height: min(100%, 92dvh); }
  #game-stage { padding: 6px 8px 10px; }
}

/* Short landscape phones / foldables // keep HUD compact, controls clear of notches */
@media (max-height: 480px) and (orientation: landscape) {
  .hangar-nav { padding: 6px 10px !important; }
  #hud { padding: 4px 8px; gap: 4px 8px; }
  .hud-val { font-size: 12px; }
  .hud-lbl { font-size: 8px; }
  #loadout-bar { display: none; }
  #fire-btn, #dash-btn { width: 52px; height: 52px; font-size: 9px; }
  #dash-btn { width: 44px; height: 44px; }
  #game-stage { padding: 4px 8px 8px; }
  .ov-box { padding: 10px 12px; }
}

/* iPad / tablet mid widths // chest shop readable */
@media (min-width: 721px) and (max-width: 1100px) {
  .shop-offers { grid-template-columns: 1fr 1fr; }
  #hud { gap: 8px 14px; }
}
