:root {
  --bg: #05060d;
  --text: #cfefff;
  --accent: #0ff;
  --accent-2: #f0f;
  --warn: #ff0;
  --danger: #f33;
  --good: #0f8;
  --shadow: rgba(0,255,255,0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: #000;
  color: var(--text);
  font-family: 'Courier New', 'Consolas', monospace;
  overflow: hidden;
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ---- FULLSCREEN STAGE / 16:9 LETTERBOX FRAME ---- */
#stage {
  position: fixed;
  inset: 0;
  background: #000;
}

#frame {
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0,255,255,0.15) inset;
}

canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  background: #000;
  z-index: 1;
}

/* ---- CRT FILTER ---- */
#crt {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.2s;
}
#crt.crt-on {
  opacity: 1;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0,0,0,0.20) 0px,
      rgba(0,0,0,0.20) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.6) 100%);
  mix-blend-mode: multiply;
  animation: crt-flicker 4s infinite;
}
#crt.crt-on::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,0,0,0.04), transparent 30%, transparent 70%, rgba(0,0,255,0.04));
  pointer-events: none;
}
@keyframes crt-flicker {
  0%, 100% { filter: brightness(1); }
  3% { filter: brightness(1.04); }
  6% { filter: brightness(0.97); }
  9% { filter: brightness(1.02); }
}

.flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}

/* ---- FLOATING HUD ---- */
.hud {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  font-family: 'Courier New', 'Consolas', monospace;
  color: var(--text);
  transition: opacity 0.5s ease;
  /* strong black outline so HUD reads over any background */
  text-shadow:
    -1px -1px 0 #000, 1px -1px 0 #000,
    -1px  1px 0 #000, 1px  1px 0 #000,
    -2px  0   0 #000, 2px  0   0 #000,
     0   -2px 0 #000, 0    2px 0 #000,
     0 0 6px rgba(0,0,0,0.95);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: clamp(10px, 2vh, 22px) clamp(12px, 2vw, 26px);
}

.hud-tl {
  top: 0;
  left: 0;
  align-items: flex-start;
  text-align: left;
  background: linear-gradient(135deg, rgba(0,0,0,0.55) 0%, transparent 65%);
  min-width: 180px;
}

.hud-tr {
  top: 0;
  right: 0;
  align-items: flex-end;
  text-align: right;
  background: linear-gradient(225deg, rgba(0,0,0,0.55) 0%, transparent 65%);
  min-width: 220px;
}

.hud-bottom {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  text-align: center;
  background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, transparent 100%);
  width: clamp(220px, 28vw, 360px);
  padding-bottom: clamp(12px, 2vh, 22px);
}

.hud-pilot {
  bottom: clamp(10px, 2vh, 22px);
  left: clamp(10px, 2vw, 22px);
  align-items: flex-start;
  text-align: left;
  background: linear-gradient(45deg, rgba(0,0,0,0.45) 0%, transparent 70%);
  font-size: clamp(10px, 1.2vw, 13px);
  color: var(--accent);
  transition: opacity 1.4s ease-out;
}
.hud-pilot.fading { opacity: 0; }
.hud-pilot .label { color: var(--warn); margin-bottom: 4px; }
.hud-pilot .hint { line-height: 1.5; }

.hud .label {
  font-size: clamp(9px, 1vw, 11px);
  letter-spacing: 2px;
  color: var(--accent);
}
.hud .label.dim { opacity: 0.6; }
.hud .label.small-cap { opacity: 0.55; margin-top: 4px; }

.hud .value {
  font-size: clamp(20px, 2.4vw, 32px);
  font-weight: bold;
  letter-spacing: 1px;
  line-height: 1;
}
.hud .value.small { font-size: clamp(13px, 1.4vw, 18px); }
.hud .value.alt { color: var(--warn); }
.hud .value.combo {
  color: var(--accent-2);
  font-size: clamp(28px, 3.2vw, 44px);
  letter-spacing: 3px;
}

.hud-row { line-height: 1.15; }
.hud-row.inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.hud-tr .hud-row.inline { justify-content: flex-end; }

.hud-meter {
  height: 6px;
  width: clamp(120px, 14vw, 180px);
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--accent);
  margin: 4px 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 6px rgba(0,0,0,0.8);
}
.hud-meter.big { height: 10px; }
.hud-meter.combo-meter { width: 100%; }

.meter-fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  transition: width 0.15s linear, background 0.2s;
}
.meter-fill.hp-fill { background: linear-gradient(90deg, var(--good), var(--warn), var(--danger)); }
.meter-fill.shield-fill { background: linear-gradient(90deg, #08f, #0ff); box-shadow: 0 0 6px #0ff; }
.meter-fill.combo-fill { background: linear-gradient(90deg, var(--accent-2), var(--warn)); }
.meter-fill.missile-fill {
  background: linear-gradient(90deg, #f80, #ff0, #fff);
  box-shadow: 0 0 6px #f80;
}

.pwr-dots {
  display: inline-flex;
  gap: 3px;
}
.pwr-dots .dot {
  width: 8px; height: 8px;
  border: 1px solid var(--accent);
  background: transparent;
  display: inline-block;
}
.pwr-dots .dot.on { background: var(--accent); box-shadow: 0 0 4px var(--accent); }

/* Combo tier flair */
.value.combo.tier-1 { color: var(--warn); }
.value.combo.tier-2 { color: var(--danger); text-shadow:
    -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000,
    0 0 10px var(--danger); }
.value.combo.tier-3 {
  color: #fff;
  text-shadow:
    -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000,
    0 0 8px var(--warn), 0 0 16px var(--danger);
  animation: combo-flame 0.4s infinite alternate;
}
@keyframes combo-flame {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

/* ---- OVERLAYS ---- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(0, 0, 20, 0.92);
  z-index: 10;
  padding: clamp(14px, 3vh, 32px);
  gap: 8px;
}

.overlay .title {
  font-size: clamp(32px, 6vw, 64px);
  color: var(--warn);
  text-shadow: 3px 3px 0 var(--accent-2), 6px 6px 0 #00f;
  letter-spacing: 4px;
  animation: pulse 1.2s infinite alternate;
  margin-bottom: 6px;
}
.overlay .title.danger {
  color: var(--danger);
  text-shadow: 3px 3px 0 #800, 6px 6px 0 #400;
}
.overlay .tag {
  font-size: clamp(12px, 1.4vw, 18px);
  color: var(--accent);
  letter-spacing: 2px;
}
.overlay .tag.dim { color: rgba(255,255,255,0.55); font-size: clamp(11px, 1.2vw, 14px); }

.overlay .controls {
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.overlay .controls p {
  font-size: clamp(11px, 1.1vw, 14px);
  color: var(--text);
  letter-spacing: 1px;
}
.overlay .controls .dim { color: rgba(255,255,255,0.5); margin-top: 4px; }

.overlay .pause-controls {
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed rgba(0,255,255,0.35);
  padding: 12px 18px;
  border-radius: 4px;
  margin-bottom: 10px;
}

/* Tutorial layout */
.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  width: min(820px, 92vw);
  margin: 14px 0 18px;
  text-align: left;
}
.tutorial-section {
  background: rgba(0, 0, 0, 0.45);
  border: 1px dashed rgba(0,255,255,0.35);
  padding: 12px 14px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tutorial-section .section-title {
  color: var(--warn);
  letter-spacing: 2px;
  font-weight: bold;
  font-size: clamp(11px, 1.1vw, 13px);
  margin-bottom: 4px;
}
.tutorial-section p {
  font-size: clamp(10px, 1vw, 12px);
  color: var(--text);
  line-height: 1.5;
}
.tutorial-section p.dim { opacity: 0.6; font-size: clamp(9px, 0.9vw, 11px); }
.pu {
  display: inline-block;
  width: 18px; height: 18px;
  text-align: center;
  font-weight: bold;
  border: 1px solid;
  margin-right: 4px;
  font-size: 11px;
  line-height: 16px;
}
.pu-p { color: #f0f; border-color: #f0f; }
.pu-b { color: #ff0; border-color: #ff0; }
.pu-h { color: #0f0; border-color: #0f0; }
.pu-s { color: #0ff; border-color: #0ff; }

.key {
  display: inline-block;
  background: rgba(255,255,0,0.12);
  border: 1px solid var(--warn);
  color: var(--warn);
  padding: 1px 6px;
  margin: 0 2px;
  font-weight: bold;
  border-radius: 2px;
  min-width: 14px;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.04); }
}

/* Buttons: hollow cyan default, solid magenta when focused or hovered */
button {
  margin-top: 6px;
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  padding: 10px 24px;
  font-family: inherit;
  font-size: clamp(12px, 1.3vw, 16px);
  cursor: pointer;
  letter-spacing: 2px;
  font-weight: bold;
  text-shadow: 1px 1px 0 #000;
  box-shadow: none;
  transition: transform 0.08s, background 0.12s, color 0.12s,
              border-color 0.12s, box-shadow 0.12s;
  min-width: 220px;
  outline: none;
}
button:hover, button.focused {
  background: var(--accent-2);
  color: #fff;
  border-color: var(--warn);
  box-shadow: 0 0 24px var(--accent-2), inset 0 0 12px rgba(255,255,255,0.15);
  transform: translateY(-1px);
}
button.primary {
  font-size: clamp(13px, 1.4vw, 17px);
  padding: 12px 28px;
}
button.ghost {
  font-size: clamp(11px, 1.1vw, 13px);
  padding: 8px 18px;
  min-width: 200px;
}

.hidden { display: none !important; }
.fade-target { transition: opacity 1.4s ease-out; }

#newRecord {
  color: var(--warn);
  font-size: clamp(14px, 1.6vw, 20px);
  text-shadow: 0 0 10px var(--warn);
  animation: pulse 0.6s infinite alternate;
}
#newRecord.hidden { display: none !important; }

/* ---- DIEGETIC MENU STATE ----
   When the body has .menu-state, the gameplay HUD is invisible and the
   start overlay is repositioned to a left-side panel that fades into
   transparency on the right so the bobbing ship remains visible. */
body.menu-state .hud,
body.transitioning .hud {
  opacity: 0;
  pointer-events: none;
}

body.menu-state #startScreen {
  background: transparent;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  padding: 4vh 4vw;
}
/* Left-panel gradient — dark on the left, transparent on the right where
   the ship bobs. Sits behind the menu UI content so text stays readable. */
body.menu-state #startScreen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 20, 0.92) 0%,
    rgba(0, 0, 20, 0.78) 35%,
    rgba(0, 0, 20, 0.30) 60%,
    transparent 78%
  );
  pointer-events: none;
  z-index: 0;
}
body.menu-state #startScreen > * {
  position: relative;
  z-index: 1;
  max-width: min(440px, 50%);
}
body.menu-state #startScreen .controls {
  align-items: flex-start;
  text-align: left;
}
body.menu-state #startScreen .controls p { text-align: left; }
body.menu-state #startScreen button {
  align-self: flex-start;
}

/* Phase-A fade: the start overlay tweens its alpha to 0 over 0.3s while
   the ship still bobs in place. After the fade, hideAll() removes it. */
.overlay.fading-out {
  opacity: 0;
  transition: opacity 0.3s ease-out;
  pointer-events: none;
}

/* ---- SETTINGS OVERLAY ---- */
.settings-keybinds {
  margin: 8px 0;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed rgba(0,255,255,0.25);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  max-width: 480px;
}
.settings-keybinds .dim {
  font-size: clamp(10px, 1vw, 12px);
  color: rgba(255,255,255,0.5);
  letter-spacing: 1px;
}

/* ---- WATERMARKS ---- */
.watermark {
  position: absolute;
  bottom: 7px;
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: clamp(8px, 0.85vw, 10px);
  letter-spacing: 2px;
  color: var(--accent);
  opacity: 0.28;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  text-shadow:
    -1px -1px 0 #000, 1px -1px 0 #000,
    -1px  1px 0 #000, 1px  1px 0 #000;
  z-index: 11;
}
.watermark-l { left: 10px; }
.watermark-r { right: 10px; }

/* ---- TUTORIAL STEP CALLOUT ---- */
.tut-callout {
  position: absolute;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 20, 0.90);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 10px 24px;
  text-align: center;
  z-index: 6;
  min-width: 280px;
  max-width: 520px;
  pointer-events: none;
  box-shadow: 0 0 14px rgba(0,255,255,0.2);
  animation: tut-pulse 2s ease-in-out infinite;
}
@keyframes tut-pulse {
  0%, 100% { opacity: 0.88; }
  50%       { opacity: 1; }
}
.tut-step-label {
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--warn);
  margin-bottom: 5px;
}
.tut-msg {
  font-size: clamp(12px, 1.3vw, 15px);
  color: var(--text);
  letter-spacing: 1px;
  line-height: 1.55;
  white-space: pre-line;
}
.tut-hint {
  margin-top: 7px;
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(0,255,255,0.5);
}

/* ---- ABILITY COOLDOWN BAR ---- */
.meter-fill.ability-fill {
  background: linear-gradient(90deg, #a0f, #f0f, #fff);
  box-shadow: 0 0 6px #f0f;
}

/* ---- HANGAR / SHOP ---- */
.hangar-coins {
  font-size: clamp(14px, 1.6vw, 20px);
  color: #fc0;
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(255,204,0,0.5);
  margin-bottom: 8px;
}

.hangar-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  width: min(700px, 90vw);
  margin: 8px 0;
  align-items: start;
}

.hangar-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hangar-ship-btn {
  min-width: 0 !important;
  width: 100%;
  padding: 6px 10px !important;
  font-size: clamp(10px, 1vw, 12px) !important;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hangar-ship-btn.selected {
  background: var(--accent-2);
  color: #fff;
  border-color: var(--warn);
  box-shadow: 0 0 16px var(--accent-2);
}
.ship-name { letter-spacing: 1px; }
.ship-name.locked { opacity: 0.5; }
.ship-price { color: #fc0; font-size: 10px; }
.ship-equipped { color: var(--good); font-size: 9px; letter-spacing: 1px; }

.hangar-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
}
.hangar-canvas {
  image-rendering: pixelated;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(0,255,255,0.15);
  background: rgba(0,0,0,0.4);
}

.hangar-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-label {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--accent);
}
.stat-bar {
  height: 6px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.15);
  position: relative;
  overflow: hidden;
}
.stat-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.hangar-desc {
  font-size: clamp(9px, 1vw, 11px);
  color: rgba(255,255,255,0.5);
  letter-spacing: 1px;
  white-space: pre-line;
  text-align: center;
  margin-top: 6px;
  line-height: 1.5;
}

#hangarAction:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================
   PHASE 3 — MOBILE / TOUCH CONTROLS
   ============================================ */

/* Global touch overrides */
.touch-device {
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Hide keyboard hints on touch devices */
.touch-device .hud-pilot { display: none !important; }
.touch-device .settings-keybinds { display: none !important; }

/* ---- VIRTUAL JOYSTICK ---- */
.touch-joy-area {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 900;
  pointer-events: none; /* area itself doesn't block; touches are handled globally */
}
.touch-device .touch-joy-area {
  display: block;
}

.touch-joy-ring {
  position: fixed;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 2px solid rgba(0, 255, 255, 0.35);
  background: rgba(0, 255, 255, 0.06);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 901;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.15), inset 0 0 8px rgba(0, 255, 255, 0.08);
}

.touch-joy-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,255,255,0.5) 0%, rgba(0,255,255,0.15) 70%);
  border: 1px solid rgba(0, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: transform 0.05s ease-out;
  box-shadow: 0 0 8px rgba(0,255,255,0.3);
}

/* ---- ACTION BUTTONS ---- */
.touch-btn-container {
  display: none;
  position: fixed;
  right: 12px;
  bottom: 16px;
  z-index: 910;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.touch-device .touch-btn-container {
  display: flex;
}

.touch-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1.5px solid rgba(0, 255, 255, 0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, transform 0.08s;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
}

.touch-btn.active {
  background: rgba(0, 255, 255, 0.2);
  border-color: rgba(0, 255, 255, 0.7);
  transform: scale(0.92);
  box-shadow: 0 0 16px rgba(0, 255, 255, 0.35);
}

.touch-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.touch-btn-label {
  font-size: 20px;
  line-height: 1;
  pointer-events: none;
}

.touch-btn-pause {
  width: 42px;
  height: 42px;
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: auto;
}
.touch-btn-pause .touch-btn-label {
  font-size: 16px;
}

.touch-btn-bomb {
  border-color: rgba(255, 80, 0, 0.4);
  box-shadow: 0 0 8px rgba(255, 80, 0, 0.1);
}
.touch-btn-bomb.active {
  border-color: rgba(255, 80, 0, 0.8);
  background: rgba(255, 80, 0, 0.2);
}

.touch-btn-missile {
  border-color: rgba(255, 255, 0, 0.35);
  box-shadow: 0 0 8px rgba(255, 255, 0, 0.1);
}
.touch-btn-missile.active {
  border-color: rgba(255, 255, 0, 0.8);
  background: rgba(255, 255, 0, 0.2);
}

.touch-btn-ability {
  border-color: rgba(255, 0, 255, 0.35);
  box-shadow: 0 0 8px rgba(255, 0, 255, 0.1);
}
.touch-btn-ability.active {
  border-color: rgba(255, 0, 255, 0.8);
  background: rgba(255, 0, 255, 0.2);
}

/* ---- ROTATE-TO-PLAY OVERLAY ---- */
.rotate-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.rotate-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.rotate-icon {
  font-size: 64px;
  animation: rotatePhone 2s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(0,255,255,0.5));
}

.rotate-arrow {
  font-size: 40px;
  color: #0ff;
  animation: spinArrow 2s linear infinite;
  text-shadow: 0 0 12px rgba(0,255,255,0.6);
}

.rotate-text {
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: clamp(16px, 3vw, 24px);
  letter-spacing: 4px;
  color: #0ff;
  text-shadow: 0 0 16px rgba(0,255,255,0.5);
  animation: pulsGlow 1.5s ease-in-out infinite alternate;
}

@keyframes rotatePhone {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(45deg); }
  50% { transform: rotate(90deg); }
  75% { transform: rotate(45deg); }
}

@keyframes spinArrow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulsGlow {
  0% { text-shadow: 0 0 8px rgba(0,255,255,0.3); }
  100% { text-shadow: 0 0 20px rgba(0,255,255,0.8); }
}

/* ---- RESPONSIVE FIXES ---- */
@media (max-width: 768px) {
  .touch-device .overlay {
    padding: 10px;
  }
  .touch-device .overlay .title {
    font-size: clamp(20px, 5vw, 36px);
  }
  .touch-device .overlay button {
    min-width: 120px;
    padding: 8px 16px;
    font-size: clamp(10px, 2vw, 14px);
  }
  .touch-device .hangar-layout {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .touch-device .hangar-canvas {
    width: 100px;
    height: 100px;
  }
}
