/* ===================================================================
   CATCH PROTOCOL — SpaceX-webcast clean theme
   Near-black canvas, thin uppercase labels, light tabular telemetry,
   restrained blue accent. Big SPEED / ALTITUDE readout anchors the HUD.
   =================================================================== */

:root {
  --bg: #04060c;
  --ink: #eef3fb;
  --ink-dim: rgba(221, 230, 245, 0.58);
  --ink-faint: rgba(221, 230, 245, 0.32);
  --accent: #5ad1ff;
  --accent-warm: #ff9d3c;
  --good: #5effa8;
  --warn: #ffd24d;
  --bad: #ff5d6c;
  --line: rgba(150, 180, 225, 0.16);
  --line-soft: rgba(150, 180, 225, 0.1);
  --panel: rgba(10, 16, 30, 0.55);
  --sans: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cond: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "tnum" 1;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#app { position: fixed; inset: 0; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.screen { position: absolute; inset: 0; }
.hidden { display: none !important; }

.overlay {
  display: flex;
  overflow-y: auto;
  background:
    radial-gradient(1200px 760px at 50% -12%, rgba(40, 86, 170, 0.16), transparent 62%),
    rgba(3, 5, 11, 0.9);
  backdrop-filter: blur(3px);
}

/* ===================== MAIN MENU ===================== */
.menu-inner { width: min(900px, 92vw); text-align: center; margin: auto; padding: 2rem 0; }

.title {
  font-family: var(--cond);
  font-size: clamp(40px, 8.4vw, 88px);
  font-weight: 600;
  letter-spacing: 0.16em;
  margin: 0;
  line-height: 0.94;
}
.title-accent { color: var(--accent); margin-left: 0.28em; font-weight: 400; }
.subtitle {
  color: var(--ink-faint); letter-spacing: 0.42em; font-weight: 500;
  font-size: clamp(9px, 1.8vw, 12px); margin: 16px 0 40px;
}

.mode-cards { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.mode-card {
  flex: 1 1 280px;
  max-width: 340px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 24px 22px;
  color: var(--ink);
  font-family: var(--sans);
  cursor: pointer;
  text-align: left;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.mode-card:hover, .mode-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(90, 209, 255, 0.7);
  background: rgba(16, 26, 46, 0.62);
  outline: none;
}
.mode-card-icon { font-size: 22px; color: var(--accent); opacity: 0.9; }
.mode-card-name {
  font-family: var(--cond); font-size: 24px; font-weight: 600;
  letter-spacing: 0.06em; margin: 10px 0 8px;
}
.mode-card-desc { color: var(--ink-dim); font-size: 13.5px; line-height: 1.55; min-height: 62px; font-weight: 400; }
.mode-card-hs {
  margin-top: 16px; font-size: 11px; color: var(--ink-faint);
  letter-spacing: 0.16em; text-transform: uppercase;
}
.mode-card-hs span { color: var(--ink); font-weight: 600; }

/* ----- free-flight conditions (weather / time / wind) ----- */
.free-config {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px 18px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  text-align: left;
}
.cfg-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cfg-label {
  font-family: var(--cond); font-size: 10px; font-weight: 700;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-faint);
  min-width: 58px;
}
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-btn {
  font-family: var(--cond); font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 6px 13px; border-radius: 3px; cursor: pointer;
  background: rgba(150, 180, 225, 0.06); color: var(--ink-dim);
  border: 1px solid var(--line-soft);
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.seg-btn:hover { border-color: rgba(90, 209, 255, 0.5); color: var(--ink); }
.seg-btn.active {
  background: rgba(90, 209, 255, 0.16); color: var(--accent);
  border-color: rgba(90, 209, 255, 0.55);
}
.cfg-slider { display: flex; align-items: center; gap: 12px; flex: 1 1 220px; min-width: 200px; }
.cfg-range { flex: 1; accent-color: var(--accent); height: 4px; cursor: pointer; }
.cfg-val {
  font-family: var(--cond); font-size: 12px; color: var(--ink);
  letter-spacing: 0.08em; min-width: 56px; white-space: nowrap;
}
.cfg-val .cfg-num { color: var(--accent); font-variant-numeric: tabular-nums; }
.cfg-hint {
  font-size: 10px; color: var(--ink-faint); letter-spacing: 0.04em;
  font-style: italic;
}

/* ----- section headers (CAREER / FREE FLIGHT) ----- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 8px 2px 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.section-title {
  font-family: var(--cond); font-size: 13px; font-weight: 700;
  letter-spacing: 0.32em; text-transform: uppercase; color: var(--ink);
}
.section-meta {
  font-family: var(--cond); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-faint);
}
.section-meta #career-progress { color: var(--accent); }

/* ----- career level grid ----- */
.level-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 30px;
}
.level-chip {
  position: relative;
  display: flex; flex-direction: column; gap: 7px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 11px 12px 12px;
  color: var(--ink);
  font-family: var(--sans);
  text-align: left;
  cursor: pointer;
  min-height: 104px;
  transition: transform 0.13s ease, border-color 0.13s ease, background 0.13s ease;
}
.level-chip:hover:not(.locked), .level-chip:focus-visible:not(.locked) {
  transform: translateY(-3px);
  border-color: rgba(90, 209, 255, 0.7);
  background: rgba(16, 26, 46, 0.62);
  outline: none;
}
.level-chip.locked { cursor: not-allowed; opacity: 0.5; }
.level-chip.complete { border-color: rgba(94, 255, 168, 0.4); }

.chip-top { display: flex; align-items: center; justify-content: space-between; }
.chip-num {
  font-family: var(--cond); font-size: 17px; font-weight: 700;
  letter-spacing: 0.06em; color: var(--ink-dim);
}
.level-chip.complete .chip-num { color: var(--good); }
.chip-stars { font-size: 11px; letter-spacing: 1px; color: var(--ink-faint); white-space: nowrap; }
.chip-stars .on { color: var(--warn); }
.chip-lock { font-size: 13px; color: var(--ink-faint); }

.chip-name {
  font-family: var(--cond); font-size: 13.5px; font-weight: 600;
  letter-spacing: 0.03em; line-height: 1.1; color: var(--ink);
}
.chip-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.badge {
  font-family: var(--cond); font-size: 9px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 2px;
  background: rgba(150, 180, 225, 0.1); color: var(--ink-dim);
  border: 1px solid var(--line-soft);
}
.badge-mode { background: rgba(90, 209, 255, 0.14); color: var(--accent); border-color: rgba(90, 209, 255, 0.3); }
.badge-wx { background: rgba(255, 157, 60, 0.12); color: var(--accent-warm); border-color: rgba(255, 157, 60, 0.28); }
.badge-fuel { background: rgba(255, 93, 108, 0.12); color: var(--bad); border-color: rgba(255, 93, 108, 0.28); }
.badge-tut { background: rgba(94, 255, 168, 0.12); color: var(--good); border-color: rgba(94, 255, 168, 0.3); }

@media (max-width: 720px) {
  .level-grid { grid-template-columns: repeat(2, 1fr); }
}

.menu-controls {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px 24px;
  text-align: left;
}
.controls-title {
  color: var(--ink-faint); letter-spacing: 0.28em; font-size: 10px;
  font-weight: 600; text-transform: uppercase; margin-bottom: 14px;
}
.controls-grid {
  display: grid;
  grid-template-columns: minmax(150px, max-content) 1fr;
  gap: 9px 20px;
  font-size: 13px;
  align-items: center;
}
.controls-grid > div:nth-child(odd) { color: var(--ink); }
.controls-grid > div:nth-child(even) { color: var(--ink-dim); }
.dim { color: var(--ink-faint); }

kbd {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 8px;
  font-family: var(--cond);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.menu-foot { color: var(--ink-faint); font-size: 12px; margin-top: 24px; letter-spacing: 0.04em; }

/* ===================== HUD ===================== */
#hud { pointer-events: none; }

.hud-side { position: absolute; top: 0; padding: 22px 24px; }
.hud-tl { left: 0; padding-left: 62px; } /* clear the fixed mute button in the corner */
.hud-tr { right: 0; text-align: right; min-width: 220px; }

.tel-row { display: flex; gap: 10px; align-items: baseline; margin: 5px 0; }
.hud-tr .tel-row { justify-content: flex-end; }
.tel-k {
  font-family: var(--cond); color: var(--ink-faint); font-size: 10px;
  font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; min-width: 46px;
}
.tel-v {
  color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums;
  font-size: 15px; min-width: 52px; text-align: right;
}
.tel-u { color: var(--ink-faint); font-size: 10px; letter-spacing: 0.04em; }

.hud-mode {
  font-family: var(--cond); color: var(--ink); letter-spacing: 0.18em;
  font-size: 13px; font-weight: 600; text-transform: uppercase; margin-bottom: 4px;
  opacity: 0.92;
}
.hud-objective {
  font-family: var(--sans); color: var(--accent); font-size: 11px;
  letter-spacing: 0.06em; margin-bottom: 14px; opacity: 0.9; max-width: 220px;
  margin-left: auto;
}

.gauge { margin: 10px 0; width: 188px; margin-left: auto; }
.gauge-top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--cond); font-size: 10px; letter-spacing: 0.2em;
  font-weight: 600; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 5px;
}
.gauge-top span:last-child { color: var(--ink); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.gauge-track {
  width: 100%; height: 4px;
  background: rgba(255, 255, 255, 0.08); border-radius: 2px; overflow: hidden;
}
.gauge-fill { height: 100%; width: 100%; background: var(--ink); transition: width 0.08s linear; }
.gauge-fill.throttle { background: var(--accent-warm); }
.gauge-fill.low { background: var(--bad); }

.hud-autopilot {
  color: var(--good); font-family: var(--cond); font-size: 11px;
  letter-spacing: 0.2em; font-weight: 600; margin-top: 14px; animation: blink 1.2s steps(2) infinite;
}
.wind { margin-top: 14px; }

/* catch status pill */
.hud-catch {
  position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
  text-align: center;
}
.hud-catch-status {
  font-family: var(--cond); font-size: 13px; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-dim);
  padding: 7px 18px; border: 1px solid var(--line); border-radius: 3px;
  background: rgba(8, 12, 22, 0.5); display: inline-block;
}
.hud-catch-status.armed { color: var(--warn); border-color: rgba(255, 210, 77, 0.4); }
.hud-catch-status.good { color: var(--good); border-color: rgba(94, 255, 168, 0.45); }
.hud-catch-status.bad { color: var(--bad); border-color: rgba(255, 93, 108, 0.45); }

.hud-guidance {
  position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%);
  text-align: center; font-family: var(--cond); font-size: 14px; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--warn);
  text-shadow: 0 0 16px rgba(255, 210, 77, 0.4);
}

/* signature bottom-centre telemetry */
.hud-tele {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 30px;
}
.tele-block { text-align: center; min-width: 132px; }
.tele-label {
  font-family: var(--cond); font-size: 11px; font-weight: 600;
  letter-spacing: 0.34em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 2px;
}
.tele-num {
  display: flex; align-items: baseline; justify-content: center; gap: 7px;
  color: var(--ink); line-height: 1;
}
.tele-num span {
  font-size: clamp(34px, 6vw, 56px); font-weight: 300;
  font-variant-numeric: tabular-nums; letter-spacing: 0.01em;
}
.tele-num i { font-style: normal; font-size: 13px; color: var(--ink-dim); letter-spacing: 0.06em; }
.tele-div { width: 1px; height: 46px; background: var(--line); }

@keyframes blink { 50% { opacity: 0.3; } }

/* ===================== RESULTS ===================== */
.results-inner {
  width: min(560px, 92vw);
  background: rgba(8, 12, 24, 0.7);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 36px 38px;
  text-align: center;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.6);
}
.result-banner {
  font-family: var(--cond); font-size: clamp(28px, 6vw, 46px); font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.result-banner.good { color: var(--good); }
.result-banner.ok { color: var(--warn); }
.result-banner.bad { color: var(--bad); }
.result-sub { color: var(--ink-dim); margin: 10px 0 18px; letter-spacing: 0.02em; font-size: 14px; }

.result-level {
  font-family: var(--cond); font-size: 11px; font-weight: 700;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 12px;
}
.result-stars { display: flex; justify-content: center; gap: 14px; margin: 4px 0 22px; }
.result-stars .star {
  font-size: 34px; line-height: 1; color: rgba(150, 180, 225, 0.22);
  transition: color 0.25s ease, transform 0.25s ease, text-shadow 0.25s ease;
}
.result-stars .star.on {
  color: var(--warn);
  text-shadow: 0 0 18px rgba(255, 210, 77, 0.6);
  transform: translateY(-2px) scale(1.08);
}

.result-score { display: flex; align-items: baseline; justify-content: center; gap: 14px; margin-bottom: 24px; }
.result-score-label { color: var(--ink-faint); font-family: var(--cond); font-size: 11px; letter-spacing: 0.3em; font-weight: 600; }
#result-score-value { font-size: 48px; font-weight: 300; color: var(--ink); font-variant-numeric: tabular-nums; }
.result-best { color: var(--accent); font-family: var(--cond); font-size: 11px; letter-spacing: 0.16em; font-weight: 600; }

.result-breakdown { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; text-align: left; font-size: 13px; margin-bottom: 28px; }
.result-breakdown .rb-label { color: var(--ink-dim); }
.result-breakdown .rb-value { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.result-breakdown .rb-sep { grid-column: 1 / -1; height: 1px; background: var(--line); margin: 5px 0; }

.result-buttons { display: flex; gap: 12px; justify-content: center; }
.btn {
  font-family: var(--cond); font-size: 13px; letter-spacing: 0.14em; font-weight: 600; text-transform: uppercase;
  padding: 12px 26px; border-radius: 3px; cursor: pointer;
  background: transparent; color: var(--ink); border: 1px solid var(--line);
  transition: transform 0.1s ease, border-color 0.1s ease, background 0.1s ease;
}
.btn:hover { transform: translateY(-2px); border-color: rgba(90, 209, 255, 0.7); }
.btn-primary { background: var(--accent); color: #04121c; border-color: var(--accent); }
.btn-primary:hover { box-shadow: 0 10px 30px rgba(90, 209, 255, 0.3); }

/* ===================== TUTORIAL (flight school) ===================== */
#tutorial { pointer-events: none; }

/* cinematic letterbox shading — gradient, not solid, so the HUD beneath
   stays readable while the scene dims toward the screen edges */
.tut-bar {
  position: absolute; left: 0; right: 0; height: 110px;
  transition: transform 0.45s cubic-bezier(0.22, 0.8, 0.3, 1);
}
.tut-bar-top {
  top: 0; transform: translateY(-101%);
  background: linear-gradient(rgba(1, 3, 8, 0.85), rgba(1, 3, 8, 0));
}
.tut-bar-bot {
  bottom: 0; transform: translateY(101%);
  background: linear-gradient(rgba(1, 3, 8, 0), rgba(1, 3, 8, 0.85));
}
#tutorial.cine .tut-bar-top, #tutorial.cine .tut-bar-bot { transform: translateY(0); }

/* instruction card */
.tut-card {
  position: absolute; left: 50%; bottom: 96px;
  transform: translate(-50%, 14px);
  width: min(520px, calc(100vw - 32px));
  background: rgba(8, 13, 26, 0.84);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  padding: 14px 20px 14px;
  text-align: left;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.35s ease, border-color 0.25s ease;
  backdrop-filter: blur(6px);
}
#tutorial.cine .tut-card { opacity: 1; transform: translate(-50%, 0); }

.tut-head { display: flex; justify-content: space-between; align-items: baseline; }
.tut-stepnum {
  font-family: var(--cond); font-size: 11px; font-weight: 600;
  letter-spacing: 0.2em; color: var(--accent); font-variant-numeric: tabular-nums;
}
.tut-tag { font-family: var(--cond); font-size: 10px; letter-spacing: 0.26em; color: var(--ink-faint); }
.tut-title {
  font-family: var(--cond); font-size: 19px; font-weight: 600;
  letter-spacing: 0.08em; margin: 8px 0 6px;
}
.tut-text { color: var(--ink-dim); font-size: 13.5px; line-height: 1.55; }
.tut-keys { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tut-verb {
  font-family: var(--cond); font-size: 10px; font-weight: 600;
  letter-spacing: 0.22em; color: var(--ink-faint);
}
.tut-kbd {
  display: inline-block; padding: 4px 10px; border-radius: 3px;
  font-family: var(--cond); font-size: 12px; font-weight: 600; letter-spacing: 0.1em;
  color: var(--accent); background: rgba(90, 209, 255, 0.1);
  border: 1px solid rgba(90, 209, 255, 0.45);
  animation: tutKey 1.3s ease-in-out infinite;
}
@keyframes tutKey {
  50% { box-shadow: 0 0 14px rgba(90, 209, 255, 0.35); background: rgba(90, 209, 255, 0.18); }
}

/* completion check, flashed before the card advances */
.tut-check {
  position: absolute; top: 10px; right: 14px;
  color: var(--good); font-size: 18px; font-weight: 700;
  opacity: 0; transform: scale(0.4);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.tut-card.done { border-left-color: var(--good); }
.tut-card.done .tut-check { opacity: 1; transform: scale(1); }

/* spotlight pulse on the HUD readout a step is talking about */
.tut-spot { position: relative; }
.tut-spot::after {
  content: ""; position: absolute; inset: -6px -8px;
  border: 1px solid rgba(90, 209, 255, 0.65); border-radius: 4px;
  box-shadow: 0 0 18px rgba(90, 209, 255, 0.25), inset 0 0 12px rgba(90, 209, 255, 0.08);
  animation: tutSpot 1.1s ease-in-out infinite;
  pointer-events: none;
}
@keyframes tutSpot { 50% { opacity: 0.45; } }

/* non-blocking toast (final approach nudge) */
.tut-toast {
  position: absolute; left: 50%; bottom: 28%; transform: translateX(-50%);
  text-align: center; font-family: var(--cond); font-size: 14px; font-weight: 600;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent);
  text-shadow: 0 0 16px rgba(90, 209, 255, 0.4);
  white-space: nowrap;
}

.tut-skip {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  pointer-events: auto; cursor: pointer;
  font-family: var(--cond); font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; color: var(--ink-dim);
  background: var(--panel); border: 1px solid var(--line); border-radius: 3px;
  padding: 8px 14px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tut-skip:hover { color: var(--ink); border-color: rgba(150, 180, 225, 0.4); }
.tut-skip kbd { margin-left: 4px; }

@media (hover: none) and (pointer: coarse) {
  .tut-card { bottom: 150px; }
  .tut-skip kbd { display: none; }
}

/* ===================== AUDIO MUTE ===================== */
.btn-mute {
  position: absolute; top: 14px; left: 14px; z-index: 50;
  width: 38px; height: 38px; padding: 0; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer; border-radius: 4px;
  color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(4px);
  transition: transform 0.1s ease, border-color 0.1s ease, opacity 0.15s ease;
  opacity: 0.65;
}
.btn-mute:hover { opacity: 1; transform: translateY(-1px); border-color: rgba(90, 209, 255, 0.7); }
.btn-mute.muted { color: var(--ink-faint); }

/* ===================== SETTINGS ===================== */
/* gear lives in the main menu's top-right corner (mirrors the mute button) */
.btn-settings {
  position: absolute; top: 14px; right: 14px; z-index: 50;
  width: 38px; height: 38px; padding: 0; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; border-radius: 4px;
  color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(4px);
  transition: transform 0.25s ease, border-color 0.12s ease, opacity 0.15s ease;
  opacity: 0.7;
}
.btn-settings:hover { opacity: 1; transform: rotate(60deg); border-color: rgba(90, 209, 255, 0.7); }

#settings { z-index: 60; }
.settings-inner {
  width: min(540px, 92vw);
  margin: auto;
  background: rgba(8, 12, 24, 0.88);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px 30px 30px;
  text-align: left;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.6);
}
.settings-head { display: flex; align-items: center; justify-content: space-between; }
.settings-title {
  font-family: var(--cond); font-size: 24px; font-weight: 600;
  letter-spacing: 0.16em; margin: 0;
}
.settings-close {
  width: 32px; height: 32px; flex: none; border-radius: 3px; cursor: pointer;
  background: transparent; color: var(--ink-dim); border: 1px solid var(--line);
  font-size: 13px; line-height: 1;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.settings-close:hover { color: var(--ink); border-color: rgba(90, 209, 255, 0.6); }

.settings-section { margin-top: 22px; }
.settings-section-title {
  font-family: var(--cond); font-size: 10px; font-weight: 700;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--ink-faint);
  padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--line-soft);
}
.settings-hint {
  font-size: 11px; color: var(--ink-faint); letter-spacing: 0.02em;
  margin: 12px 0 0; font-style: italic;
}
.settings-hint kbd { font-style: normal; padding: 1px 6px; }

.keybinds { display: flex; flex-direction: column; gap: 7px; }
.keybind-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.keybind-name { font-family: var(--sans); font-size: 13.5px; color: var(--ink-dim); }
.keybind-key {
  min-width: 144px; text-align: center;
  font-family: var(--cond); font-size: 12px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 8px 14px; border-radius: 3px; cursor: pointer;
  background: rgba(150, 180, 225, 0.06); color: var(--ink);
  border: 1px solid var(--line);
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.keybind-key:hover { border-color: rgba(90, 209, 255, 0.6); color: var(--accent); }
.keybind-key.listening {
  color: var(--warn); border-color: rgba(255, 210, 77, 0.6);
  background: rgba(255, 210, 77, 0.1); animation: blink 1s steps(2) infinite;
}

.settings-reset { margin-top: 16px; padding: 9px 18px; font-size: 11px; }
.settings-actions { display: flex; justify-content: flex-end; margin-top: 26px; }

/* ===================== MOBILE TOUCH ===================== */
.touch-controls { position: absolute; inset: 0; pointer-events: none; }
.touch-cluster { position: absolute; bottom: 26px; display: flex; gap: 14px; pointer-events: auto; }
.touch-left { left: 22px; }
.touch-right { right: 22px; align-items: flex-end; }
.touch-btn {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(10, 16, 30, 0.7); border: 1px solid var(--line);
  color: var(--ink); font-family: var(--cond); font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em; line-height: 1.2;
  -webkit-user-select: none; user-select: none;
}
.touch-btn:active { background: rgba(90, 209, 255, 0.28); border-color: var(--accent); }
.touch-thrust { width: 90px; height: 90px; }
.touch-catch { background: rgba(94, 255, 168, 0.18); border-color: rgba(94, 255, 168, 0.5); }

@media (hover: none) and (pointer: coarse) {
  .menu-controls { display: none; }
  .hud-tele { bottom: 120px; }
}
