/* Tron: Light Cycles — base HUD, overlays, boot tunnel UI, developer HUD (P9.2) */
/* Google Fonts are loaded from index.html (preconnect + stylesheet) — avoid @import blocking */

:root {
  color-scheme: dark;
  --tron-bg: #0a0a0a;
  --tron-grid: #1a1a3e;
  --tron-cyan: #00ffff;
  --tron-orange: #ff6600;
  --tron-dim: rgba(0, 255, 255, 0.35);
  --boot-bar-bg: rgba(0, 40, 60, 0.85);
  --boot-bar-fill: linear-gradient(90deg, #00ffff, #66ffff);
}

.noscript-fallback {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 2rem;
  background: var(--tron-bg);
  color: var(--tron-cyan);
  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.5;
  text-align: center;
  border: 2px solid var(--tron-dim);
  box-sizing: border-box;
}

.noscript-fallback strong {
  font-family: "Orbitron", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--tron-bg);
  color: var(--tron-cyan);
  font-family: "Rajdhani", system-ui, sans-serif;
}

#app-root {
  position: relative;
  width: 100%;
  height: 100%;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

/* P10.3 — desktop / keyboard recommendation (visible after boot; non-interactive) */
.platform-recommendation {
  position: fixed;
  left: 50%;
  bottom: max(8px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 17;
  margin: 0;
  padding: 4px 10px;
  max-width: min(92vw, 28rem);
  font-size: clamp(0.65rem, 1.6vw, 0.75rem);
  letter-spacing: 0.06em;
  text-align: center;
  line-height: 1.3;
  color: rgba(150, 200, 220, 0.62);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  user-select: none;
}

/* BOOT tunnel HTML overlay — warp layers + title + progress on top of tunnel canvas */
.boot-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8vw 10vh;
  pointer-events: none;
  z-index: 20;
  transition:
    opacity 0.45s ease,
    visibility 0.45s;
}

.boot-overlay--hidden {
  opacity: 0;
  visibility: hidden;
}

.boot-overlay__warp {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.boot-overlay__warp-radial {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 88% 70% at 50% 36%, rgba(0, 210, 255, 0.2) 0%, transparent 55%),
    radial-gradient(ellipse 130% 85% at 50% 115%, rgba(0, 25, 55, 0.65) 0%, transparent 48%);
  animation: boot-warp-radial 2.6s ease-in-out infinite;
}

.boot-overlay__warp-streaks {
  position: absolute;
  left: -15%;
  right: -15%;
  top: -30%;
  bottom: -25%;
  transform-origin: 50% 100%;
  transform: perspective(420px) rotateX(56deg) scale(1.02);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 26px,
    rgba(0, 240, 255, 0.065) 26px,
    rgba(0, 240, 255, 0.065) 28px
  );
  animation: boot-warp-streaks 0.95s linear infinite;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 78%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 78%, transparent 100%);
}

@keyframes boot-warp-radial {
  0%,
  100% {
    opacity: 0.88;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes boot-warp-streaks {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 112px;
  }
}

.boot-overlay__title {
  position: absolute;
  top: 12vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  font-size: clamp(1.25rem, 4vw, 2.75rem);
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  color: var(--tron-cyan);
  text-shadow:
    0 0 12px rgba(0, 255, 255, 0.9),
    0 0 32px rgba(0, 180, 255, 0.5);
  white-space: nowrap;
  animation: boot-title-warp 2.4s ease-in-out infinite;
}

@keyframes boot-title-warp {
  0%,
  100% {
    filter: brightness(1);
    letter-spacing: 0.35em;
  }
  50% {
    filter: brightness(1.12);
    letter-spacing: 0.38em;
  }
}

.boot-overlay__bar-wrap {
  position: relative;
  z-index: 2;
  width: min(520px, 88vw);
  height: 10px;
  border-radius: 999px;
  background: var(--boot-bar-bg);
  border: 1px solid var(--tron-dim);
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.25);
  overflow: hidden;
}

.boot-overlay__bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--boot-bar-fill);
  box-shadow: 0 0 14px rgba(102, 255, 255, 0.85);
  transition: width 0.12s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .boot-overlay__warp-radial,
  .boot-overlay__warp-streaks,
  .boot-overlay__title {
    animation: none;
  }
}

.nitro-speed-lines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 12;
  opacity: 0;
  transition: opacity 0.06s linear;
  background: linear-gradient(
    90deg,
    rgba(0, 255, 255, 0.42) 0%,
    transparent 10%,
    transparent 90%,
    rgba(0, 255, 255, 0.42) 100%
  );
  mix-blend-mode: screen;
}

.cycle-hud {
  position: fixed;
  left: max(16px, env(safe-area-inset-left, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 18;
  max-width: min(520px, 92vw);
  padding: 10px 14px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(200, 240, 255, 0.9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  background: rgba(4, 12, 22, 0.58);
  border: 1px solid rgba(0, 255, 255, 0.18);
  border-radius: 8px;
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.cycle-hud__row--speed {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
  font-family: "Orbitron", sans-serif;
  font-size: 1.05rem;
}

.cycle-hud__speed {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.cycle-hud__unit {
  font-size: 0.72rem;
  opacity: 0.65;
  font-family: "Rajdhani", sans-serif;
}

.cycle-hud__trail-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid rgba(0, 255, 255, 0.2);
  font-size: 0.95rem;
}

.cycle-hud__trail {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.cycle-hud__trail--tile-hit {
  color: #ff4466;
  text-shadow: 0 0 8px rgba(255, 60, 90, 0.85);
}

.cycle-hud__timer-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid rgba(0, 255, 255, 0.2);
  font-size: 0.95rem;
}

.cycle-hud__timer {
  font-weight: 600;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.nitro-bar-strip {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
}

.nitro-bar-strip--empty-flash {
  filter: drop-shadow(0 0 6px rgba(255, 60, 60, 0.95));
}

.nitro-bar-seg {
  width: 14px;
  height: 22px;
  border-radius: 3px;
  border: 1px solid rgba(0, 255, 255, 0.35);
  background: linear-gradient(180deg, rgba(0, 255, 255, 0.92), rgba(0, 120, 180, 0.35));
  box-shadow:
    0 0 8px rgba(0, 255, 255, 0.55),
    inset 0 0 6px rgba(255, 255, 255, 0.35);
  transition:
    opacity 0.12s ease,
    filter 0.12s ease;
}

.nitro-bar-seg--empty {
  opacity: 0.28;
  background: rgba(20, 40, 55, 0.65);
  box-shadow: none;
  border-color: rgba(0, 255, 255, 0.12);
}

.nitro-bar-seg--recharge {
  opacity: 0.55;
  filter: saturate(0.65);
}

/* H1 — equippable slot: icon + subtle E (plan HUD spec) */
.cycle-hud__equip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  min-height: 1.5rem;
}

.cycle-hud__equip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  font-size: 1.1rem;
  line-height: 1;
  color: rgba(200, 230, 255, 0.45);
  text-shadow: 0 0 6px rgba(0, 200, 255, 0.25);
  transition:
    color 0.12s ease,
    filter 0.12s ease;
}

.cycle-hud__equip-icon--shield {
  color: rgba(180, 120, 255, 0.95);
  text-shadow:
    0 0 10px rgba(200, 100, 255, 0.75),
    0 0 18px rgba(120, 40, 200, 0.45);
  filter: drop-shadow(0 0 4px rgba(204, 0, 255, 0.55));
}

.cycle-hud__equip-icon--queued {
  opacity: 0.72;
  filter: saturate(0.85);
}

.cycle-hud__equip-e {
  font-family: "Orbitron", sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid rgba(0, 255, 255, 0.22);
  color: rgba(160, 220, 255, 0.35);
  background: rgba(0, 30, 45, 0.35);
  opacity: 0.45;
  transition:
    opacity 0.12s ease,
    color 0.12s ease,
    border-color 0.12s ease;
}

.cycle-hud__equip-e--active {
  opacity: 0.92;
  color: rgba(200, 255, 255, 0.92);
  border-color: rgba(0, 255, 255, 0.42);
  background: rgba(0, 50, 70, 0.45);
}

/* P9.4 — corner minimap (arena aspect ratio, tile trails + obstacles + pickups) */
.hud-minimap-wrap {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 18;
  padding: 6px;
  pointer-events: none;
  background: rgba(4, 12, 22, 0.45);
  border: 1px solid rgba(0, 255, 255, 0.16);
  border-radius: 8px;
  backdrop-filter: blur(5px);
}

.hud-minimap-wrap canvas {
  display: block;
}

/* P7.5 — first-visit controls overlay (lobby) */
.controls-overlay {
  position: fixed;
  inset: 0;
  z-index: 38;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: min(24px, 4vw);
  background: rgba(4, 6, 14, 0.72);
  backdrop-filter: blur(8px);
}

.controls-overlay[hidden] {
  display: none !important;
}

.controls-overlay__panel {
  width: min(440px, 100%);
  max-height: min(88vh, 640px);
  overflow: auto;
  padding: 1.35rem 1.5rem 1.5rem;
  border: 1px solid rgba(0, 255, 255, 0.28);
  border-radius: 4px;
  background: linear-gradient(165deg, rgba(12, 22, 38, 0.96), rgba(6, 10, 18, 0.98));
  box-shadow:
    0 0 0 1px rgba(0, 200, 255, 0.06),
    0 0 48px rgba(0, 80, 120, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.controls-overlay__title {
  margin: 0 0 0.35rem;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-align: center;
  color: var(--tron-cyan);
  text-shadow:
    0 0 14px rgba(0, 255, 255, 0.75),
    0 0 32px rgba(0, 100, 180, 0.35);
}

.controls-overlay__lead {
  margin: 0 0 1rem;
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.4;
  color: rgba(160, 210, 235, 0.88);
}

.controls-overlay__grid {
  margin: 0 0 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.controls-overlay__row {
  display: grid;
  grid-template-columns: minmax(7rem, 38%) 1fr;
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.92rem;
  line-height: 1.35;
}

.controls-overlay__row dt {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: rgba(120, 240, 255, 0.95);
}

.controls-overlay__row dd {
  margin: 0;
  color: rgba(200, 225, 245, 0.9);
}

.controls-overlay__row kbd,
.controls-overlay__lead kbd {
  display: inline-block;
  padding: 0.12em 0.45em;
  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 0.88em;
  border: 1px solid rgba(0, 255, 255, 0.35);
  border-radius: 3px;
  background: rgba(0, 30, 45, 0.65);
  color: rgba(200, 255, 255, 0.95);
}

.controls-overlay__btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.65rem 1rem;
  font-family: "Orbitron", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  cursor: pointer;
  color: #0a1620;
  background: linear-gradient(180deg, #66ffff, #00a8c8);
  border: 1px solid rgba(0, 255, 255, 0.45);
  border-radius: 2px;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.controls-overlay__btn:hover {
  filter: brightness(1.06);
}

.controls-overlay__btn:focus-visible {
  outline: 2px solid rgba(0, 255, 255, 0.85);
  outline-offset: 2px;
}

/* X1 / P7.6 — pause menu (arena + lobby) */
.pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 36;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: min(24px, 4vw);
  background: rgba(2, 4, 12, 0.78);
  backdrop-filter: blur(10px);
}

.pause-overlay[hidden] {
  display: none !important;
}

.pause-overlay__panel {
  width: min(460px, 100%);
  max-height: min(92vh, 720px);
  overflow: auto;
  padding: 1.35rem 1.5rem 1.5rem;
  border: 1px solid rgba(0, 255, 255, 0.22);
  border-radius: 4px;
  background: linear-gradient(165deg, rgba(10, 18, 32, 0.97), rgba(4, 8, 16, 0.99));
  box-shadow:
    0 0 0 1px rgba(0, 200, 255, 0.05),
    0 0 40px rgba(0, 60, 100, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.pause-overlay__title {
  margin: 0 0 0.5rem;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.05rem, 2.8vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.38em;
  text-indent: 0.38em;
  text-align: center;
  color: var(--tron-cyan);
  text-shadow:
    0 0 12px rgba(0, 255, 255, 0.7),
    0 0 28px rgba(0, 100, 180, 0.35);
}

.pause-overlay__lead {
  margin: 0 0 1.25rem;
  text-align: center;
  font-size: 0.86rem;
  line-height: 1.45;
  color: rgba(160, 210, 235, 0.88);
}

.pause-overlay__lead kbd {
  display: inline-block;
  padding: 0.12em 0.45em;
  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 0.9em;
  border: 1px solid rgba(0, 255, 255, 0.35);
  border-radius: 3px;
  background: rgba(0, 30, 45, 0.65);
  color: rgba(200, 255, 255, 0.95);
}

.pause-overlay__settings {
  margin: 0 0 1.1rem;
  border: 1px solid rgba(0, 255, 255, 0.15);
  border-radius: 3px;
  background: rgba(0, 12, 24, 0.45);
}

.pause-overlay__settings-summary {
  padding: 0.55rem 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  color: rgba(160, 220, 245, 0.95);
}

.pause-overlay__settings-summary::-webkit-details-marker {
  display: none;
}

.pause-overlay__settings[open] .pause-overlay__settings-summary {
  border-bottom: 1px solid rgba(0, 255, 255, 0.12);
}

.pause-settings {
  padding: 0.65rem 0.85rem 0.85rem;
}

.pause-settings__heading {
  margin: 0.35rem 0 0.4rem;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(100, 180, 210, 0.75);
}

.pause-settings__heading:first-child {
  margin-top: 0;
}

.pause-settings__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  color: rgba(190, 230, 250, 0.92);
}

.pause-settings__row span:first-child {
  flex: 0 0 4.5rem;
}

.pause-settings__row input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--tron-cyan);
}

.pause-settings__row--check {
  justify-content: flex-start;
  gap: 0.5rem;
}

.pause-settings__row--check input {
  accent-color: var(--tron-cyan);
}

.pause-overlay__actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pause-overlay__btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.62rem 1rem;
  font-family: "Orbitron", sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  cursor: pointer;
  border-radius: 2px;
  border: 1px solid rgba(0, 255, 255, 0.4);
  transition: filter 0.12s ease;
}

.pause-overlay__btn--primary {
  color: #0a1620;
  background: linear-gradient(180deg, #66ffff, #00a8c8);
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.28);
}

.pause-overlay__btn--danger {
  color: rgba(255, 220, 200, 0.95);
  background: linear-gradient(180deg, rgba(90, 28, 28, 0.95), rgba(40, 12, 12, 0.98));
  border-color: rgba(255, 100, 80, 0.45);
  box-shadow: 0 0 14px rgba(180, 40, 30, 0.25);
}

.pause-overlay__btn:hover {
  filter: brightness(1.07);
}

.pause-overlay__btn:focus-visible {
  outline: 2px solid rgba(0, 255, 255, 0.85);
  outline-offset: 2px;
}

.state-banner {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  border: 1px solid var(--tron-dim);
  background: rgba(10, 10, 20, 0.82);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  z-index: 15;
}

.state-banner--hidden {
  display: none;
}

/** Hub welcome / arena tips — ~3/5 down the viewport (third horizontal fifth) */
#lobby-placeholder.state-banner {
  bottom: auto;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: min(36rem, calc(100vw - 40px));
  text-align: center;
  z-index: 20;
  line-height: 1.45;
}

.derez-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(80, 0, 20, 0.45), rgba(5, 5, 12, 0.92));
}

.derez-overlay[hidden] {
  display: none !important;
}

.derez-overlay__title {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: #ff4466;
  text-shadow:
    0 0 20px rgba(255, 60, 90, 0.95),
    0 0 48px rgba(180, 0, 40, 0.55);
}

.derez-overlay__sub {
  margin: 0;
  max-width: 28rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(220, 200, 210, 0.88);
}

.level-complete-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0, 60, 80, 0.35), rgba(5, 8, 18, 0.88));
}

.level-complete-overlay[hidden] {
  display: none !important;
}

.level-complete-overlay__title {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.4rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  color: #66ffff;
  text-shadow:
    0 0 18px rgba(0, 255, 255, 0.85),
    0 0 40px rgba(0, 120, 200, 0.45);
}

.level-complete-overlay__coins {
  margin: 0;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: rgba(180, 255, 255, 0.95);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.level-complete-overlay__bonus {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.9rem;
  color: rgba(140, 220, 255, 0.82);
}

.level-complete-overlay__hint {
  margin: 0.5rem 0 0;
  max-width: 22rem;
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgba(180, 200, 220, 0.78);
}

/* P7.2 — tunnel destinations (garage / architect) until full showroom + editor */
.tron-destination {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(0, 40, 70, 0.5), rgba(6, 8, 16, 0.96));
  border: 1px solid rgba(0, 255, 255, 0.22);
  box-shadow:
    inset 0 0 60px rgba(0, 200, 255, 0.08),
    0 0 40px rgba(0, 0, 0, 0.6);
}

.tron-destination--hidden[hidden],
.tron-destination[hidden] {
  display: none !important;
}

.tron-destination__title {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  color: var(--tron-cyan);
  text-shadow:
    0 0 14px rgba(0, 255, 255, 0.75),
    0 0 36px rgba(0, 140, 200, 0.4);
}

.tron-destination__body {
  margin: 0;
  max-width: 26rem;
  font-size: 1.05rem;
  line-height: 1.45;
  color: rgba(180, 230, 255, 0.88);
}

.tron-destination__btn {
  margin-top: 0.5rem;
  padding: 0.55rem 1.4rem;
  font-family: "Orbitron", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  cursor: pointer;
  color: #0a1620;
  background: linear-gradient(180deg, #66ffff, #00a8c8);
  border: 1px solid rgba(0, 255, 255, 0.5);
  border-radius: 2px;
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.35);
}

.tron-destination__btn:hover {
  filter: brightness(1.08);
}

/* P7.3 — garage: full-viewport overlay; showroom visible through gradient; return bar pinned to bottom */
.tron-destination--garage {
  inset: 0;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100%;
  justify-content: flex-start;
  align-items: stretch;
  padding: 0;
  text-align: center;
  background: linear-gradient(
    180deg,
    rgba(4, 8, 16, 0.92) 0%,
    rgba(4, 8, 16, 0.42) 38%,
    rgba(4, 8, 16, 0.12) 62%,
    transparent 85%
  );
  border: none;
  box-shadow: none;
  pointer-events: none;
}

.tron-destination--garage .tron-destination__title,
.tron-destination--garage .tron-destination__body,
.tron-destination--garage .garage-return-bar {
  pointer-events: auto;
}

.tron-destination--garage .tron-destination__body {
  max-width: 32rem;
  font-size: 0.92rem;
  color: rgba(170, 220, 255, 0.9);
}

/* P7.4 — garage UI: full width content rail; scrolls above fixed return bar */
.tron-destination--garage .garage-chrome {
  pointer-events: auto;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.85rem 1.25rem 0.5rem;
  padding-right: max(1.25rem, env(safe-area-inset-right));
  padding-left: max(1.25rem, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  box-sizing: border-box;
}

.tron-destination--garage .garage-return-bar {
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(0deg, rgba(3, 6, 14, 0.94) 0%, rgba(3, 6, 14, 0.72) 55%, transparent 100%);
  border-top: 1px solid rgba(0, 255, 255, 0.14);
  pointer-events: auto;
}

.tron-destination__btn--garage-return {
  margin-top: 0;
  min-width: min(22rem, 92vw);
  max-width: 28rem;
}

.tron-destination--garage .tron-destination__title {
  margin-bottom: 0.15rem;
}

.garage-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: center;
  font-size: 0.82rem;
  line-height: 1.35;
  color: rgba(160, 220, 255, 0.92);
  font-variant-numeric: tabular-nums;
}

.garage-stats__item {
  display: inline-flex;
  gap: 0.35rem;
  align-items: baseline;
}

.garage-stats__item--coins {
  align-items: center;
  gap: 0.4rem;
}

.garage-stats__coin-wrap {
  display: flex;
  align-items: center;
  line-height: 0;
}

.garage-stats__label {
  opacity: 0.72;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.garage-stats__value {
  font-family: "Orbitron", sans-serif;
  font-weight: 600;
  color: #7efff0;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.35);
}

.garage-grid {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  gap: 0.35rem 0.75rem;
  align-items: start;
  text-align: left;
}

.garage-grid__spacer {
  min-width: min(240px, 22vw);
  pointer-events: none;
}

@media (max-width: 900px) {
  .garage-grid {
    grid-template-columns: 1fr;
  }

  .garage-grid__spacer {
    display: none;
  }

  .garage-panel--upgrades {
    width: 100%;
    max-width: 20rem;
  }
}

.garage-panel {
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 255, 255, 0.16);
  background: rgba(4, 10, 22, 0.55);
  box-shadow: inset 0 0 24px rgba(0, 80, 120, 0.12);
}

.garage-panel--colors {
  padding: 0.35rem 0.35rem;
  width: fit-content;
  max-width: none;
}

.garage-panel--upgrades {
  padding: 0.45rem 0.5rem;
  width: min(248px, 32vw);
  max-width: 100%;
}

.garage-panel__heading {
  margin: 0 0 0.45rem;
  font-family: "Orbitron", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(120, 220, 255, 0.88);
}

.garage-panel--colors .garage-panel__heading {
  margin-bottom: 0.25rem;
}

.garage-panel__heading--sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.garage-panel--upgrades .garage-panel__heading {
  margin-bottom: 0.35rem;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
}

.garage-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0.65rem;
}

.garage-swatches--rail {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 6px;
  margin-bottom: 0;
  align-items: center;
}

.garage-swatches--rail .garage-swatch {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  border-radius: 3px;
  flex-shrink: 0;
}

.garage-swatch__tag {
  position: absolute;
  right: -5px;
  bottom: -5px;
  z-index: 2;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 1px 3px 1px 2px;
  font-size: 0.52rem;
  font-weight: 800;
  color: #1a0805;
  background: linear-gradient(180deg, #ffe9a3, #e0a820);
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.4);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.garage-swatch__tag .neon-coin-icon {
  width: 10px;
  height: 10px;
}

.garage-swatch__tag-val {
  margin-left: 1px;
}

.garage-swatches:last-child {
  margin-bottom: 0;
}

.garage-swatch {
  position: relative;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    inset 0 0 12px rgba(255, 255, 255, 0.12);
  transition:
    transform 0.08s ease,
    box-shadow 0.12s ease;
}

.garage-swatch:hover:not(:disabled) {
  transform: scale(1.06);
  box-shadow:
    0 0 0 1px rgba(0, 255, 255, 0.45),
    0 0 14px rgba(0, 255, 255, 0.35);
}

.garage-swatch:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.garage-swatch--selected {
  border-color: #ffffff;
  box-shadow:
    0 0 0 2px rgba(0, 255, 255, 0.75),
    0 0 18px rgba(0, 255, 255, 0.45);
}

.garage-swatch--exotic-police {
  background-color: #0c0812;
  background-image: linear-gradient(
    118deg,
    #ff2222 0%,
    #ff2222 42%,
    #2244ff 58%,
    #2244ff 100%
  );
}

.garage-swatch--exotic-aurora {
  background-color: #0a1018;
  background-image: linear-gradient(
    128deg,
    #00fff2 0%,
    #7a40ff 42%,
    #ff2088 78%,
    #00ccff 100%
  );
  background-size: 160% 160%;
}

.garage-swatch--exotic-prism {
  background-color: #0c0a14;
  background-image: conic-gradient(
    from 200deg at 50% 45%,
    #ff00aa,
    #ffee00,
    #00ffee,
    #8866ff,
    #ff00aa
  );
}

.garage-swatch--locked {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    inset 0 0 12px rgba(255, 255, 255, 0.08),
    inset 0 0 0 32px rgba(0, 0, 0, 0.42);
}

.garage-swatch--locked.garage-swatch--selected {
  box-shadow:
    0 0 0 2px rgba(0, 255, 255, 0.75),
    0 0 18px rgba(0, 255, 255, 0.45),
    inset 0 0 0 32px rgba(0, 0, 0, 0.32);
}

.garage-upgrades {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.garage-upgrade-row {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  padding: 0.28rem 0.35rem;
  border-radius: 4px;
  background: rgba(0, 20, 40, 0.35);
  border: 1px solid rgba(0, 200, 255, 0.12);
}

.garage-upgrade-row__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.garage-upgrade-row__title {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  color: rgba(200, 240, 255, 0.95);
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 0.35rem;
}

.garage-upgrade-row__val {
  font-size: 0.56rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(200, 240, 255, 0.95);
  text-align: right;
  line-height: 1.25;
  max-width: 62%;
  flex-shrink: 0;
}

.garage-upgrade-row__body {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.garage-upgrade-row__bar-container {
  flex: 1;
  height: 7px;
  background: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.05) 4px,
    rgba(0, 0, 0, 0.6) 4px,
    rgba(0, 0, 0, 0.6) 8px
  );
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  border-radius: 2px;
  overflow: hidden;
}

.garage-upgrade-row__bar-current {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: #2b2b36;
  border-right: 1px solid rgba(0, 0, 0, 0.5);
}

.garage-upgrade-row__bar-upgrade {
  position: absolute;
  top: 0;
  bottom: 0;
  background: #ff3333;
  box-shadow: 0 0 8px rgba(255, 51, 51, 0.6);
}

.garage-upgrade-row__btn {
  flex: 0 0 auto;
  padding: 0.22rem 0.38rem;
  font-family: "Orbitron", sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: #e8fbff;
  background: linear-gradient(180deg, #0f1c28, #070d14);
  border: 1px solid rgba(0, 255, 240, 0.55);
  border-radius: 3px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  box-shadow:
    0 0 10px rgba(0, 255, 240, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.garage-upgrade-row__price {
  color: #ffe9a4;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.garage-upgrade-row__btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  filter: grayscale(0.35);
}

.garage-upgrade-row__btn:not(:disabled):hover {
  filter: brightness(1.12);
  border-color: rgba(0, 255, 240, 0.85);
}

.neon-coin-icon {
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  object-fit: contain;
  vertical-align: middle;
}

.neon-coin-icon--header {
  width: 20px;
  height: 20px;
}

/* P6.1 — editor: keep Three.js canvas visible; chrome bar at top */
.tron-destination--editor {
  inset: 0 0 auto 0;
  height: auto;
  min-height: unset;
  justify-content: flex-start;
  padding: 0.85rem 1.25rem 1rem;
  background: linear-gradient(
    180deg,
    rgba(6, 10, 20, 0.92) 0%,
    rgba(6, 10, 20, 0.55) 70%,
    transparent 100%
  );
  border-bottom: 1px solid rgba(0, 255, 255, 0.2);
  pointer-events: none;
}

.tron-destination--editor .tron-destination__title,
.tron-destination--editor .tron-destination__body,
.tron-destination--editor .tron-destination__btn,
.tron-destination--editor .tron-destination__toolbar {
  pointer-events: auto;
}

.tron-destination__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.tron-destination__btn--ghost {
  background: transparent;
  border: 1px solid rgba(0, 255, 255, 0.45);
  color: rgba(180, 240, 255, 0.95);
}

.tron-destination__btn--ghost:hover {
  border-color: rgba(0, 255, 255, 0.75);
  background: rgba(0, 60, 80, 0.35);
}

/* P6.7 — export validation message */
.editor-export-error {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #ff8a8a;
  max-width: 42rem;
}

/* P6.5 — new level dialog (arena size at creation; immutable afterward) */
.editor-new-level-dialog {
  max-width: min(26rem, 92vw);
  padding: 0;
  border: 1px solid rgba(0, 255, 255, 0.35);
  border-radius: 6px;
  background: linear-gradient(165deg, rgba(8, 14, 28, 0.98) 0%, rgba(4, 8, 18, 0.99) 100%);
  color: rgba(200, 230, 255, 0.95);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
}

.editor-new-level-dialog::backdrop {
  background: rgba(0, 4, 12, 0.72);
  backdrop-filter: blur(2px);
}

.editor-new-level-dialog__form {
  padding: 1.15rem 1.25rem 1.2rem;
}

.editor-new-level-dialog__title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #7ee8ff;
}

.editor-new-level-dialog__lead {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(170, 210, 240, 0.88);
}

.editor-new-level-dialog__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}

.editor-new-level-dialog__label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(140, 190, 230, 0.9);
}

.editor-new-level-dialog__label input {
  padding: 0.45rem 0.55rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 200, 255, 0.35);
  background: rgba(0, 20, 40, 0.65);
  color: #e8f8ff;
  font-size: 1rem;
}

.editor-new-level-dialog__label input:focus {
  outline: none;
  border-color: rgba(0, 255, 255, 0.65);
  box-shadow: 0 0 0 2px rgba(0, 255, 255, 0.12);
}

.editor-new-level-dialog__error {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: #ff8899;
}

.editor-new-level-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.editor-new-level-dialog__btn {
  padding: 0.45rem 0.95rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 200, 255, 0.35);
  background: rgba(0, 30, 50, 0.6);
  color: rgba(200, 235, 255, 0.95);
  font: inherit;
  cursor: pointer;
}

.editor-new-level-dialog__btn:hover {
  border-color: rgba(0, 255, 255, 0.55);
  background: rgba(0, 50, 70, 0.55);
}

.editor-new-level-dialog__btn--primary {
  border-color: rgba(0, 255, 255, 0.55);
  background: rgba(0, 90, 110, 0.55);
}

.editor-new-level-dialog__btn--primary:hover {
  background: rgba(0, 120, 140, 0.55);
}

.tron-destination--editor .tron-destination__body {
  max-width: 36rem;
  font-size: 0.9rem;
}

.tron-destination--editor kbd {
  font: inherit;
  padding: 0.1em 0.35em;
  border-radius: 2px;
  border: 1px solid rgba(0, 220, 255, 0.35);
  background: rgba(0, 30, 45, 0.6);
}

.tron-destination__btn--primary {
  border-color: rgba(0, 255, 200, 0.55);
  background: rgba(0, 100, 90, 0.45);
  box-shadow: 0 0 12px rgba(0, 255, 200, 0.12);
}

.tron-destination__btn--primary:hover {
  background: rgba(0, 130, 110, 0.5);
  border-color: rgba(0, 255, 220, 0.75);
}

/* P6.9 — lobby chip after editor play-test */
.editor-return-to-editor {
  position: fixed;
  z-index: 55;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.5rem 0.4rem 0.75rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 255, 200, 0.45);
  background: linear-gradient(165deg, rgba(6, 18, 28, 0.94), rgba(4, 10, 20, 0.92));
  box-shadow:
    0 0 20px rgba(0, 255, 200, 0.12),
    inset 0 0 18px rgba(0, 80, 100, 0.15);
  pointer-events: auto;
}

.editor-return-to-editor[hidden] {
  display: none !important;
}

.editor-return-to-editor__btn {
  margin: 0;
  padding: 0.45rem 1rem;
  font-family: "Orbitron", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(200, 255, 250, 0.98);
  cursor: pointer;
  border: none;
  border-radius: 3px;
  background: rgba(0, 90, 85, 0.55);
  box-shadow: 0 0 14px rgba(0, 255, 200, 0.14);
}

.editor-return-to-editor__btn:hover {
  filter: brightness(1.08);
}

.editor-return-to-editor__dismiss {
  margin: 0;
  padding: 0.15rem 0.45rem;
  line-height: 1;
  font-size: 1.1rem;
  color: rgba(180, 220, 230, 0.85);
  cursor: pointer;
  border: none;
  border-radius: 3px;
  background: transparent;
}

.editor-return-to-editor__dismiss:hover {
  color: #fff;
  background: rgba(255, 80, 80, 0.2);
}

/* P6.2 — editor palette (six floor categories + wall-objects edge note) */
.editor-palette-shell {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(300px, 42vw);
  z-index: 46;
  display: flex;
  flex-direction: column;
  padding: 4.5rem 0.65rem 0.85rem 0.85rem;
  box-sizing: border-box;
  pointer-events: none;
  border-right: 1px solid rgba(0, 255, 255, 0.16);
  background: linear-gradient(90deg, rgba(4, 10, 20, 0.97) 0%, rgba(4, 10, 20, 0.78) 88%, transparent 100%);
}

.editor-palette-shell.editor-palette {
  pointer-events: auto;
}

.editor-palette {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-height: 100%;
  border-radius: 4px;
  border: 1px solid rgba(0, 220, 255, 0.2);
  background: linear-gradient(165deg, rgba(8, 14, 24, 0.94), rgba(4, 8, 16, 0.92));
  box-shadow:
    0 0 0 1px rgba(0, 200, 255, 0.06),
    inset 0 0 24px rgba(0, 60, 90, 0.15);
}

.editor-palette__header {
  flex-shrink: 0;
  padding: 0.55rem 0.65rem 0.45rem;
  border-bottom: 1px solid rgba(0, 255, 255, 0.12);
}

.editor-palette__header-title {
  display: block;
  font-family: "Orbitron", sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  color: var(--tron-cyan);
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.35);
}

.editor-palette__header-sub {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  line-height: 1.35;
  color: rgba(160, 200, 230, 0.78);
}

.editor-palette__scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.45rem 0.5rem 0.35rem;
}

.editor-palette__cat {
  margin-bottom: 0.65rem;
}

.editor-palette__cat-title {
  margin: 0 0 0.35rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(120, 200, 255, 0.88);
}

.editor-palette__tiles {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.editor-palette__tile {
  margin: 0;
  padding: 0.38rem 0.45rem;
  text-align: left;
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.25;
  color: rgba(200, 230, 255, 0.95);
  cursor: pointer;
  border-radius: 3px;
  border: 1px solid rgba(0, 180, 220, 0.22);
  background: rgba(0, 24, 40, 0.45);
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.editor-palette__tile:hover {
  border-color: rgba(0, 255, 255, 0.38);
  background: rgba(0, 40, 56, 0.55);
}

.editor-palette__tile--active {
  border-color: rgba(0, 255, 255, 0.65);
  background: rgba(0, 56, 72, 0.65);
  box-shadow: 0 0 12px rgba(0, 200, 255, 0.22);
}

.editor-palette__edge {
  flex-shrink: 0;
  padding: 0.5rem 0.55rem 0.55rem;
  border-top: 1px solid rgba(0, 255, 255, 0.12);
  background: rgba(0, 12, 22, 0.5);
}

.editor-palette__edge-title {
  font-family: "Orbitron", sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: rgba(180, 220, 255, 0.9);
  margin-bottom: 0.35rem;
}

.editor-palette__edge-body {
  margin: 0;
  font-size: 0.65rem;
  line-height: 1.4;
  color: rgba(150, 190, 220, 0.88);
}

.editor-palette__edge-body strong {
  color: rgba(200, 240, 255, 0.95);
  font-weight: 600;
}

/* P6.4 — Editor properties (right rail, mirrors plan § Properties panel) */
.editor-props-shell {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(300px, 42vw);
  z-index: 46;
  display: flex;
  flex-direction: column;
  padding: 4.5rem 0.85rem 0.85rem 0.65rem;
  box-sizing: border-box;
  pointer-events: none;
  border-left: 1px solid rgba(0, 255, 255, 0.16);
  background: linear-gradient(270deg, rgba(4, 10, 20, 0.97) 0%, rgba(4, 10, 20, 0.78) 88%, transparent 100%);
}

.editor-props-shell.editor-props {
  pointer-events: auto;
}

.editor-props {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-height: 100%;
  border-radius: 4px;
  border: 1px solid rgba(0, 220, 255, 0.2);
  background: linear-gradient(195deg, rgba(8, 14, 24, 0.94), rgba(4, 8, 16, 0.92));
  box-shadow:
    0 0 0 1px rgba(0, 200, 255, 0.06),
    inset 0 0 24px rgba(0, 60, 90, 0.15);
  font-size: 0.72rem;
  color: rgba(190, 230, 255, 0.92);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.55rem 0.6rem 0.65rem;
}

.editor-props__empty {
  margin: 0.35rem 0 0;
  font-size: 0.7rem;
  line-height: 1.4;
  color: rgba(140, 190, 220, 0.82);
}

.editor-props__inner {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.editor-props__title {
  margin: 0 0 0.15rem;
  font-family: "Orbitron", sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  color: var(--tron-cyan);
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.28);
}

.editor-props__dl {
  margin: 0;
}

.editor-props__row {
  display: grid;
  grid-template-columns: 6.2rem 1fr;
  gap: 0.35rem;
  margin-bottom: 0.28rem;
  align-items: baseline;
}

.editor-props__row dt {
  margin: 0;
  font-size: 0.62rem;
  color: rgba(120, 200, 255, 0.75);
}

.editor-props__row dd {
  margin: 0;
  font-size: 0.68rem;
  color: rgba(210, 235, 255, 0.95);
}

.editor-props__field {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.editor-props__field--slider {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}

.editor-props__label {
  font-size: 0.62rem;
  color: rgba(150, 200, 240, 0.88);
}

.editor-props__input {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.28rem 0.4rem;
  border-radius: 3px;
  border: 1px solid rgba(0, 180, 220, 0.28);
  background: rgba(0, 20, 36, 0.65);
  color: rgba(220, 245, 255, 0.98);
}

.editor-props__input--color {
  max-width: 4rem;
  min-height: 2rem;
  padding: 0.15rem;
  cursor: pointer;
}

.editor-props__range {
  flex: 1;
  min-width: 0;
  accent-color: var(--tron-cyan);
}

.editor-props__range-val {
  width: 1.25rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: rgba(160, 220, 255, 0.95);
}

.editor-props__ro {
  margin: 0;
  font-size: 0.66rem;
  line-height: 1.35;
  color: rgba(160, 200, 230, 0.85);
}

.editor-props__ro strong {
  color: rgba(200, 235, 255, 0.95);
  font-weight: 600;
}

.editor-props__hint {
  font-size: 0.58rem;
  color: rgba(120, 170, 210, 0.75);
}

.editor-props__subhead {
  margin: 0.35rem 0 0.1rem;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(120, 200, 255, 0.78);
}

/* P9.2 — Developer HUD (`.` toggle): live devHud sliders, persists to save */
/* z-index above `.tron-destination` (45), editor shells (46), and editor return chip (55) so it stays usable in Garage / Architect. */
.dev-hud {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  z-index: 60;
  width: min(
    380px,
    calc(
      100vw - max(12px, env(safe-area-inset-left, 0px)) - max(12px, env(safe-area-inset-right, 0px))
    )
  );
  max-height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid rgba(0, 255, 255, 0.28);
  border-radius: 6px;
  background: linear-gradient(165deg, rgba(8, 14, 26, 0.94), rgba(4, 8, 16, 0.97));
  box-shadow:
    0 0 0 1px rgba(0, 200, 255, 0.06),
    0 12px 40px rgba(0, 0, 0, 0.55);
  font-size: 0.78rem;
  color: rgba(190, 230, 255, 0.92);
  pointer-events: auto;
}

.dev-hud[hidden] {
  display: none !important;
}

.dev-hud__header {
  flex-shrink: 0;
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(0, 255, 255, 0.12);
}

.dev-hud__header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dev-hud__reset {
  flex-shrink: 0;
  padding: 5px 10px;
  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(0, 24, 32, 0.95);
  background: linear-gradient(180deg, rgba(0, 255, 255, 0.88), rgba(0, 200, 220, 0.75));
  border: 1px solid rgba(0, 255, 255, 0.45);
  border-radius: 4px;
  cursor: pointer;
}

.dev-hud__reset:hover {
  filter: brightness(1.08);
}

.dev-hud__reset:focus-visible {
  outline: 2px solid rgba(0, 255, 255, 0.85);
  outline-offset: 2px;
}

.dev-hud__title {
  font-family: "Orbitron", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  color: var(--tron-cyan);
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.45);
}

.dev-hud__hint {
  margin-top: 4px;
  font-size: 0.68rem;
  opacity: 0.75;
  line-height: 1.3;
}

.dev-hud__scroll {
  overflow: auto;
  padding: 6px 10px 12px;
  overscroll-behavior: contain;
}

.dev-hud__section {
  border: none;
  margin: 0 0 6px;
  padding: 0;
}

.dev-hud__summary {
  cursor: pointer;
  list-style: none;
  font-family: "Orbitron", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  padding: 6px 4px 4px;
  color: rgba(120, 220, 255, 0.95);
  border-bottom: 1px solid rgba(0, 255, 255, 0.1);
}

.dev-hud__summary::-webkit-details-marker {
  display: none;
}

.dev-hud__row {
  display: grid;
  grid-template-columns: 1fr minmax(0, 52%);
  gap: 8px;
  align-items: center;
  padding: 4px 2px;
  border-radius: 3px;
}

.dev-hud__row:hover {
  background: rgba(0, 40, 60, 0.25);
}

.dev-hud__label {
  line-height: 1.25;
  color: rgba(200, 225, 245, 0.88);
}

.dev-hud__slider-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.dev-hud__range {
  flex: 1;
  min-width: 0;
  accent-color: #00d4e8;
  height: 4px;
}

.dev-hud__val {
  flex-shrink: 0;
  width: 2.75rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  opacity: 0.88;
}

.dev-hud__economy-hint {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.68rem;
  line-height: 1.35;
  opacity: 0.82;
  color: rgba(170, 210, 240, 0.95);
}

.dev-hud__btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dev-hud__grant {
  flex: 1 1 auto;
  min-width: 6.5rem;
  padding: 6px 10px;
  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(0, 24, 32, 0.95);
  background: linear-gradient(180deg, rgba(0, 255, 255, 0.82), rgba(0, 200, 220, 0.68));
  border: 1px solid rgba(0, 255, 255, 0.4);
  border-radius: 4px;
  cursor: pointer;
}

.dev-hud__grant:hover {
  filter: brightness(1.06);
}

.dev-hud__grant:focus-visible {
  outline: 2px solid rgba(0, 255, 255, 0.85);
  outline-offset: 2px;
}

.dev-hud__check {
  width: 1rem;
  height: 1rem;
  accent-color: #00d4e8;
  justify-self: end;
}
