/* ==========================================================
   Delta-V Dilemma — menu UI
   ========================================================== */

:root {
  --bg: #04060d;
  --panel: rgba(14, 22, 42, 0.72);
  --panel-solid: #0b1224;
  --panel-border: rgba(140, 170, 255, 0.16);
  --text: #e8eeff;
  --text-dim: #8d9bc0;

  --accent: #ff7a2f;      /* engine burn */
  --accent-2: #ffb347;
  --select: #4fd1ff;

  --easy: #3ddc97;
  --normal: #4fd1ff;
  --hard: #ffb347;
  --impossible: #ff4d6d;

  --gold: #ffd166;
  --danger: #ff5d73;

  --font-display: 'Orbitron', system-ui, sans-serif;
  --font-body: 'Exo 2', system-ui, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html,
body {
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 60% 50% at 15% 10%, rgba(92, 70, 190, 0.22), transparent 70%),
    radial-gradient(ellipse 50% 40% at 90% 25%, rgba(255, 122, 47, 0.08), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--select);
  outline-offset: 3px;
}

/* ---------- Background ---------- */

#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#earth {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
}

body.is-cinematic {
  background: #000;
}

body.is-cinematic #starfield {
  visibility: hidden;
}

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

kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: none;
}

#app {
  position: relative;
  z-index: 1;
}

/* ---------- Screens ---------- */

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  overflow-x: clip;
  animation: screen-in 0.5s var(--ease-out) both;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Title screen ---------- */

.screen--title {
  padding-top: clamp(56px, 13vh, 150px);
  gap: clamp(40px, 7vh, 72px);
}

.title-block {
  position: relative;
  isolation: isolate;
  text-align: center;
}

.eyebrow {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.game-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.75rem, 10vw, 7rem);
  line-height: 0.98;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  filter: drop-shadow(0 0 28px rgba(255, 122, 47, 0.22));
}

.title-line {
  display: block;
  background: linear-gradient(180deg, #ffffff 25%, #9fb6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.title-line--accent {
  background-image: linear-gradient(180deg, #ffd6a0 0%, var(--accent) 58%, #e2452a 100%);
}

.tagline {
  margin: 20px 0 0;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.title-menu {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(300px, 100%);
}

/* ---------- Buttons ---------- */

.btn {
  padding: 16px 28px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: none;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 0.15s var(--ease-out),
    box-shadow 0.2s,
    background-color 0.2s,
    border-color 0.2s,
    opacity 0.2s;
}

.btn--primary {
  background: linear-gradient(180deg, #ff9d52 0%, var(--accent) 55%, #e8561f 100%);
  color: #1a0b02;
  box-shadow:
    0 8px 30px rgba(255, 122, 47, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn--primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 12px 40px rgba(255, 122, 47, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn--ghost {
  background: rgba(14, 22, 42, 0.55);
  border-color: var(--panel-border);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.btn--ghost:hover {
  transform: translateY(-2px);
  background: rgba(24, 36, 66, 0.75);
  border-color: rgba(140, 170, 255, 0.4);
}

.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.btn--small {
  padding: 12px 20px;
  font-size: 0.8rem;
}

.btn-back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px 10px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.btn-back svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-back:hover {
  color: var(--text);
  border-color: var(--panel-border);
  background: rgba(14, 22, 42, 0.55);
}

/* ---------- Shared top bar ---------- */

.topbar {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.screen-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2.4vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

/* ---------- Mode select ---------- */

.mode-row {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: clamp(16px, 3vw, 32px);
  padding: 32px 0;
}

.mode-card {
  --c: var(--select);
  position: relative;
  flex: 1 1 270px;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 28px;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: var(--panel);
  text-align: left;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition:
    transform 0.2s var(--ease-out),
    border-color 0.2s,
    background-color 0.2s,
    box-shadow 0.25s;
}

.mode-card[data-mode="story"] {
  --c: var(--accent-2);
}

.nasa-reference { margin: 18px 0 0; padding: 12px 14px; border: 1px solid rgba(61, 220, 151, 0.25); border-radius: 10px; background: rgba(61, 220, 151, 0.04); color: var(--text-dim); font-size: 0.82rem; line-height: 1.6; }

.mode-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--c) 45%, transparent);
}

.mode-card[aria-pressed="true"] {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 9%, var(--panel-solid));
  box-shadow:
    0 0 0 1px var(--c),
    0 18px 50px color-mix(in srgb, var(--c) 22%, transparent);
}

.mode-card__icon {
  width: 56px;
  height: 56px;
  margin-bottom: 6px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--c) 25%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--c) 8%, transparent);
  color: var(--c);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mode-card__icon .fill {
  fill: currentColor;
}

.mode-card__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mode-card__desc {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-dim);
}

.mode-card__meta {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c);
}

.mode-card__check {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--panel-border);
  border-radius: 50%;
  transition: background-color 0.2s, border-color 0.2s;
}

.mode-card__check svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--bg);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s, transform 0.2s var(--ease-out);
}

.mode-card[aria-pressed="true"] .mode-card__check {
  background: var(--c);
  border-color: var(--c);
}

.mode-card[aria-pressed="true"] .mode-card__check svg {
  opacity: 1;
  transform: none;
}

/* ---------- Difficulty dock ---------- */

.bottom-dock {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 8px;
}

.dock-label {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.difficulty-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.diff-btn {
  --c: var(--normal);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 10px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: var(--panel);
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition:
    transform 0.15s var(--ease-out),
    border-color 0.2s,
    background-color 0.2s,
    box-shadow 0.25s;
}

.diff-btn[data-difficulty="easy"]       { --c: var(--easy); }
.diff-btn[data-difficulty="normal"]     { --c: var(--normal); }
.diff-btn[data-difficulty="hard"]       { --c: var(--hard); }
.diff-btn[data-difficulty="impossible"] { --c: var(--impossible); }

.diff-btn::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--c);
  opacity: 0.55;
  transition: opacity 0.2s;
}

.diff-btn:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--c) 50%, transparent);
}

.diff-btn[aria-pressed="true"] {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, var(--panel-solid));
  box-shadow:
    0 0 0 1px var(--c),
    0 10px 30px color-mix(in srgb, var(--c) 22%, transparent);
}

.diff-btn[aria-pressed="true"]::before {
  opacity: 1;
}

.diff-btn__label {
  font-family: var(--font-display);
  font-size: clamp(0.8rem, 1.8vw, 1rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c);
}

.diff-btn__sub {
  min-height: 1.3em;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.launch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 10px 10px 20px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(8, 12, 24, 0.65);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.launch-summary {
  margin: 0;
  line-height: 1.4;
  color: var(--text-dim);
}

.launch-summary strong {
  color: var(--text);
  font-weight: 600;
}

.btn--launch {
  flex-shrink: 0;
  min-width: 160px;
  padding: 14px 28px;
}

/* ---------- Briefing (placeholder for gameplay) ---------- */

.briefing {
  flex: 1;
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px 0 clamp(80px, 16vh, 200px);
  text-align: center;
}

.briefing .eyebrow {
  margin: 0;
  color: var(--accent-2);
}

.briefing__location {
  margin: -8px 0 0;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.briefing__objective {
  margin: 0;
  max-width: 60ch;
  font-size: 1.1rem;
  line-height: 1.55;
}

.scenario-code {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.briefing__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.briefing-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.briefing-stats > div {
  padding: 18px 16px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: var(--panel);
}

.briefing-stats dt {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.briefing-stats dd {
  margin: 8px 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

.mission-track {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mission-track li {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  background: var(--panel);
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.mission-track li[aria-current="step"] {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 18px rgba(255, 122, 47, 0.35);
}

.mission-track li.is-done {
  border-color: var(--easy);
  background: var(--easy);
  color: var(--bg);
  font-weight: 800;
}

.coming-soon {
  margin: 0;
  color: var(--text-dim);
}

.briefing__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ---------- Results ---------- */

.screen--results {
  justify-content: center;
}

.results {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px 0 clamp(100px, 20vh, 240px);
  text-align: center;
}

.results__eyebrow {
  margin: 0;
}

.results__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.results[data-outcome="success"] .results__eyebrow { color: var(--easy); }
.results[data-outcome="success"] .results__title { color: var(--gold); text-shadow: 0 0 30px rgba(255, 209, 102, 0.35); }
.results[data-outcome="fail"] .results__eyebrow { color: var(--danger); }

.results__text {
  margin: 0;
  max-width: 48ch;
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--text-dim);
}

/* ---------- Cutscene ---------- */

.screen--cutscene {
  position: relative;
  justify-content: center;
  gap: 16px;
  padding: 68px 16px 20px;
  background: #000;
}

.cutscene-hud {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cutscene-label {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.cutscene-skip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.cutscene-skip:hover {
  color: var(--text);
  border-color: rgba(140, 170, 255, 0.4);
}

.cutscene-stage {
  width: min(760px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 3vh, 28px);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  outline: none;
}

.cutscene-frame {
  position: relative;
  width: min(100%, max(280px, calc((100vh - 380px) * 16 / 9)));
  width: min(100%, max(280px, calc((100dvh - 380px) * 16 / 9)));
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: #05030f;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 60px rgba(79, 120, 255, 0.18);
}

.cutscene-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  transform-origin: 50% 50%;
}

.cutscene-frame[data-pan="1"] canvas { transform-origin: 20% 40%; }
.cutscene-frame[data-pan="2"] canvas { transform-origin: 80% 60%; }

.cutscene-frame.is-entering {
  animation: frame-in 0.5s ease both;
}

.cutscene-frame.is-entering canvas {
  animation: slow-zoom 12s ease-out both;
}

@keyframes frame-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slow-zoom {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}

.cutscene-text {
  width: 100%;
  min-height: calc(1.65em * 4);
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.1vw, 1.25rem);
  line-height: 1.65;
  color: #f2f5ff;
  text-shadow: 0 0 12px rgba(120, 170, 255, 0.25);
}

.cutscene-text .ch { visibility: hidden; }
.cutscene-text .ch.on { visibility: visible; }
.cutscene-text .hl { color: var(--gold); }
.cutscene-text .danger { color: var(--danger); }

.cutscene-caret {
  display: inline-block;
  margin-left: 0.4em;
  font-size: 0.7em;
  color: var(--accent);
  opacity: 0;
}

.cutscene-text.is-done .cutscene-caret {
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
  to { opacity: 1; }
}

.cutscene-footer {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cutscene-nav {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.cutscene-nav:hover {
  color: var(--text);
  border-color: rgba(140, 170, 255, 0.4);
}

.cutscene-nav svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cutscene-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cutscene-dots li {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.18);
  transition: width 0.25s var(--ease-out), background-color 0.25s;
}

.cutscene-dots li.is-past { background: rgba(255, 255, 255, 0.5); }
.cutscene-dots li.is-current { width: 22px; background: var(--accent); }

.cutscene-hint {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ---------- Settings dialog ---------- */

.settings {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  background: var(--panel-solid);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.settings[open] {
  animation: dialog-in 0.25s var(--ease-out) both;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.settings::backdrop {
  background: rgba(2, 4, 10, 0.65);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.settings__header {
  padding: 24px 24px 4px;
}

.settings__header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.settings__body {
  padding: 4px 24px;
}

.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(140, 170, 255, 0.08);
}

label.setting {
  cursor: pointer;
}

.setting__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 500;
}

.setting__hint {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-dim);
}

.range-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range-wrap input[type="range"] {
  width: 150px;
  accent-color: var(--accent);
}

.range-wrap output {
  min-width: 3ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

.switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 26px;
  margin: 0;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: #1c2643;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.switch::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c9d4f5;
  transition: transform 0.2s var(--ease-out), background-color 0.2s;
}

.switch:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.switch:checked::before {
  transform: translateX(20px);
  background: #fff;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: #141c34;
}

.segmented label {
  position: relative;
}

.segmented input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.segmented span {
  display: block;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: background-color 0.2s, color 0.2s;
}

.segmented input:checked + span {
  background: var(--accent);
  color: #1a0b02;
  font-weight: 600;
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--select);
  outline-offset: 2px;
}

.settings__footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px 24px;
}

/* ---------- Lives + flight report ---------- */

.lives-line {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.lives {
  display: inline-flex;
  gap: 3px;
  font-size: 1.15rem;
  line-height: 1;
}

.life { color: #ff4d6d; text-shadow: 0 0 10px rgba(255, 77, 109, 0.5); }
.life--lost { color: rgba(255, 255, 255, 0.18); text-shadow: none; }
.life--shield { color: var(--select); text-shadow: 0 0 10px rgba(79, 209, 255, 0.6); }

.report {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid rgba(255, 93, 115, 0.35);
  border-radius: 14px;
  background: rgba(40, 10, 18, 0.6);
  text-align: left;
}

.report__title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--danger);
}

.report__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  font-size: 0.95rem;
  line-height: 1.45;
}

/* ---------- Build screen ---------- */

.screen--build {
  align-items: stretch;
  gap: 12px;
  height: 100vh;
  height: 100dvh;
  padding: 14px 16px;
}

.build-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.build-top__title { text-align: center; }
.build-top__title .eyebrow { margin: 0 0 2px; font-size: 0.65rem; color: var(--accent-2); }

.build-top__status {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 14px;
}

.hint-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 14px;
  border: 1px solid rgba(255, 209, 102, 0.45);
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.08);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s;
}

.hint-btn:hover:not(:disabled) { background: rgba(255, 209, 102, 0.18); }
.hint-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.hint-btn__count {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--gold);
  color: #1a1202;
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
}

.build-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  gap: 12px;
}

.panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: rgba(9, 14, 30, 0.84);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.panel__title {
  margin: 0;
  padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(140, 170, 255, 0.1);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.parts-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr);
}

.cat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 10px;
  overflow-y: auto;
  border-right: 1px solid rgba(140, 170, 255, 0.1);
}

.cat-btn {
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}

.cat-btn:hover { color: var(--text); background: rgba(140, 170, 255, 0.08); }
.cat-btn[aria-pressed="true"] { color: #04121c; background: var(--select); }

.parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  align-content: start;
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  outline: none;
}

/* Part card: name on top, "?" in the corner, one picture, cost at the bottom. */
.part-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(20, 29, 58, 0.6);
  transition: border-color 0.15s, background-color 0.15s;
}

.part-card:hover { border-color: rgba(140, 170, 255, 0.4); }
.part-card.is-installed { border-color: rgba(61, 220, 151, 0.7); background: rgba(61, 220, 151, 0.08); }
.part-card.is-hinted { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 22px rgba(255, 209, 102, 0.35); }

.part-card__head {
  min-height: 2.3em;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.part-card__name { margin: 2px 0 0 2px; font-size: 0.84rem; font-weight: 700; line-height: 1.15; }

.part-card__info {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(140, 170, 255, 0.35);
  border-radius: 50%;
  background: rgba(140, 170, 255, 0.1);
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}

.part-card__info:hover { color: #04121c; background: var(--select); border-color: var(--select); }

.part-card__pick {
  position: relative;
  display: block;
  width: 100%;
  padding: 4px;
  border: 0;
  border-radius: 10px;
  background: radial-gradient(ellipse at 45% 25%, #20344e 0%, #101e32 55%, #0a1323 100%);
  cursor: pointer;
  transition: transform 0.12s var(--ease-out), filter 0.15s;
}

.part-card__pick:hover { filter: brightness(1.2); }
.part-card__pick:active { transform: scale(0.97); }
.part-card__img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }

.part-card__badge,
.part-card__warn {
  position: absolute;
  top: 5px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
}

.part-card__badge { left: 5px; background: var(--easy); color: #04160e; }
.part-card__warn { right: 5px; background: var(--danger); color: #fff; }

.part-card__foot { min-height: 26px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.part-card__cost { margin-left: 2px; font-family: var(--font-mono); font-size: 0.92rem; font-weight: 700; color: var(--gold); }

/* Details pop-up behind the "?" */
.part-dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  background: var(--panel-solid);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.part-dialog[open] { animation: dialog-in 0.22s var(--ease-out) both; }
.part-dialog::backdrop { background: rgba(2, 4, 10, 0.65); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

.part-dialog__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.part-dialog__close:hover { color: var(--text); border-color: rgba(140, 170, 255, 0.4); }

.part-dialog__img {
  display: block;
  width: 190px;
  max-width: 60%;
  margin: 0 auto 8px;
  padding: 6px;
  border-radius: 14px;
  background: radial-gradient(ellipse at 45% 25%, #20344e 0%, #101e32 55%, #0a1323 100%);
}

.part-dialog__name { margin: 0; text-align: center; font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.08em; text-transform: uppercase; }
.part-dialog__sci { margin: 4px 0 0; text-align: center; font-style: italic; font-size: 0.86rem; color: var(--select); }
.part-dialog__desc { margin: 8px 0 14px; text-align: center; line-height: 1.45; color: var(--text-dim); }
.part-dialog__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.part-dialog__label {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.part-dialog__label--pro { color: var(--easy); }
.part-dialog__label--con { color: var(--danger); }
.part-dialog__list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 0.88rem; line-height: 1.35; }
.part-dialog__list li { position: relative; padding-left: 16px; }
.part-dialog__list li::before { position: absolute; left: 0; font-weight: 700; }
.part-dialog__list--pro li::before { content: '+'; color: var(--easy); }
.part-dialog__list--con li::before { content: '−'; color: var(--danger); }
.part-dialog__needs { margin: 14px 0 0; font-size: 0.86rem; color: var(--accent-2); }

.part-dialog__stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 5px 16px;
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(140, 170, 255, 0.12);
  font-size: 0.86rem;
}

.part-dialog__stats dt { color: var(--text-dim); }
.part-dialog__stats dd { margin: 0; font-family: var(--font-mono); text-align: right; }
.part-dialog__source-status { display: block; margin-top: 2px; font-family: var(--font-body); font-size: 0.68rem; line-height: 1.35; color: var(--text-dim); }
.part-dialog__actions { display: flex; justify-content: center; margin-top: 16px; }
.part-dialog__cost-note { color: var(--text-dim); font-size: 0.77rem; line-height: 1.5; }
.part-evidence { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--panel-border); font-size: 0.8rem; line-height: 1.6; color: var(--text-dim); }
.part-evidence summary { cursor: pointer; color: var(--select); }
.part-evidence p { margin: 10px 0; }
.part-evidence ul { margin: 8px 0; padding-left: 18px; }
.part-evidence li + li { margin-top: 7px; }
.part-evidence a, .nasa-sources a { color: var(--select); text-underline-offset: 3px; }
.data-source-link { padding: 0; border: 0; color: var(--select); background: none; font: inherit; text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.nasa-sources { width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 28px; border: 1px solid var(--panel-border); border-radius: 18px; background: var(--panel-solid); color: var(--text); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55); }
.nasa-sources::backdrop { background: rgba(2, 4, 10, 0.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.nasa-sources h2 { margin: 8px 22px 12px 0; font-family: var(--font-display); font-size: 1.2rem; }
.nasa-sources h3 { margin: 0 0 8px; font-size: 1rem; }
.nasa-sources p { font-size: 0.9rem; line-height: 1.6; color: var(--text-dim); }
.nasa-sources section { padding: 18px 0; border-top: 1px solid var(--panel-border); }
.nasa-sources section > a { font-size: 0.8rem; }
.nasa-sources .nasa-sources__facts { color: var(--text); font-size: 0.83rem; }
.nasa-sources .nasa-sources__note { padding-top: 12px; border-top: 1px solid var(--panel-border); font-size: 0.8rem; }

.part-btn {
  min-width: 30px;
  padding: 5px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(140, 170, 255, 0.1);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.part-btn--add { border-color: transparent; background: var(--accent); color: #1a0b02; }
.part-btn--add:disabled { background: rgba(61, 220, 151, 0.22); color: var(--easy); cursor: default; }
.part-btn:hover:not(:disabled) { filter: brightness(1.15); }

.craft-scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  overflow-y: auto;
}

.craft-canvas {
  flex-shrink: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.gauges { display: grid; gap: 8px; }
.gauge__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.gauge__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.gauge__help {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(140, 170, 255, 0.3);
  border-radius: 50%;
  background: rgba(140, 170, 255, 0.06);
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}

.gauge__help:hover { border-color: var(--select); color: var(--select); background: rgba(79, 209, 255, 0.1); }
.gauge__value { min-width: 0; font-family: var(--font-mono); font-size: 0.76rem; text-align: right; }
.gauge__bar { height: 6px; margin-top: 4px; overflow: hidden; border-radius: 3px; background: rgba(140, 170, 255, 0.14); }
.gauge__bar i { display: block; height: 100%; border-radius: 3px; background: var(--easy); transition: width 0.25s var(--ease-out); }
.gauge--bad .gauge__bar i { background: var(--danger); }
.gauge--bad .gauge__value { color: #ff9aa9; }
.gauge--idle .gauge__value { color: var(--text-dim); }

.gauge-help {
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 28px;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: var(--panel-solid);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.gauge-help::backdrop { background: rgba(2, 4, 10, 0.68); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.gauge-help[open] { animation: dialog-in 0.2s var(--ease-out) both; }
.gauge-help__eyebrow { margin: 0 0 10px; color: var(--select); font-family: var(--font-display); font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; }
.gauge-help__title { margin: 0 24px 16px 0; font-family: var(--font-display); font-size: 1.12rem; }
.gauge-help__desc, .gauge-help__tip { font-size: 0.94rem; line-height: 1.6; }
.gauge-help__desc { color: var(--text-dim); }
.gauge-help__reading { margin: 18px 0; padding: 12px 14px; border: 1px solid var(--panel-border); border-radius: 10px; background: rgba(79, 209, 255, 0.04); }
.gauge-help__reading span { color: var(--text-dim); font-size: 0.76rem; }
.gauge-help__reading p { margin: 5px 0 0; font-family: var(--font-mono); font-size: 0.87rem; overflow-wrap: anywhere; }
.gauge-help__tip { margin: 0 0 20px; }

.mission-data {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid rgba(140, 170, 255, 0.12);
  border-radius: 10px;
  font-size: 0.82rem;
}

.mission-data summary,
.installed__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.mission-data summary { cursor: pointer; }
.mission-data dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 12px; margin: 10px 0 2px; }
.mission-data dt { color: var(--text-dim); }
.mission-data dd { margin: 0; line-height: 1.4; white-space: pre-line; }

.installed { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }

.installed__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 8px;
  border-radius: 8px;
  background: rgba(140, 170, 255, 0.07);
  font-size: 0.82rem;
}

.installed__item--cargo { padding: 7px 8px; color: var(--text-dim); }
.installed__thumb { flex-shrink: 0; width: 34px; height: 26px; object-fit: contain; }
.installed__name { flex: 1; min-width: 0; }
.installed__empty { font-size: 0.82rem; color: var(--text-dim); }

.build-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: rgba(9, 14, 30, 0.9);
}

.build-bar .btn--launch { min-width: 170px; }
.budget { flex-shrink: 0; width: min(320px, 34vw); }
.budget__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: 0.9rem; }
.budget__label { font-family: var(--font-display); font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-dim); }
.budget__bar { height: 8px; margin-top: 6px; overflow: hidden; border-radius: 4px; background: rgba(140, 170, 255, 0.14); }
.budget__bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--easy), var(--gold)); transition: width 0.25s var(--ease-out); }
.budget.is-over .budget__bar i { background: var(--danger); }
.budget.is-over #budget-text { color: #ff9aa9; }
.build-msg { flex: 1; min-width: 0; margin: 0; font-size: 0.88rem; line-height: 1.4; color: var(--text-dim); }
.build-msg.is-hint { color: var(--gold); }

@media (max-width: 900px) {
  .screen--build { height: auto; }
  .build-main { grid-template-columns: 1fr; }
  .parts-body { grid-template-columns: 1fr; }
  .cat-list { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid rgba(140, 170, 255, 0.1); }
  .cat-btn { white-space: nowrap; }
  .parts-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); max-height: 62vh; }
  .build-bar { position: sticky; bottom: 8px; flex-wrap: wrap; background: #0a0f20; }
  .budget { flex: 1; width: auto; min-width: 150px; }
  .build-msg { flex-basis: 100%; }
  .build-top { grid-template-columns: auto 1fr; }
  .build-top__status { grid-column: 1 / -1; justify-self: center; }
}

/* ---------- Level editor ---------- */

.mode-card--create { --c: var(--easy); border-style: dashed; }

.screen--editor { align-items: stretch; gap: 14px; padding: 18px 16px 24px; }
.screen--editor .topbar { margin: 0 auto; }
.editor-list, .editor-form { width: 100%; max-width: 1180px; margin: 0 auto; }

.editor-list,
.editor-panel {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: rgba(9, 14, 30, 0.84);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.editor-list { overflow: hidden; }
.editor-list__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-right: 12px; border-bottom: 1px solid rgba(140, 170, 255, 0.1); }
.editor-list__head .panel__title { border-bottom: 0; }
.level-list { display: grid; gap: 8px; margin: 0; padding: 8px; list-style: none; }
.level-list:empty { display: none; }
.level-row { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--panel-border); border-radius: 12px; background: rgba(20, 29, 58, 0.6); }
.level-row__thumb { flex-shrink: 0; width: 96px; height: 54px; border-radius: 6px; image-rendering: pixelated; }
.level-row__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.level-row__info span { font-size: 0.84rem; color: var(--text-dim); }
.level-badge { padding: 3px 10px; border: 1px solid var(--panel-border); border-radius: 999px; font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-dim); }
.level-badge--ok { border-color: var(--easy); color: var(--easy); }
.editor-empty { margin: 0; padding: 28px 16px; text-align: center; color: var(--text-dim); }

.editor-form { display: flex; flex-direction: column; gap: 12px; }
.editor-steps { display: flex; flex-wrap: wrap; gap: 8px; }
.editor-step-btn { padding: 9px 16px; border: 1px solid var(--panel-border); border-radius: 999px; background: rgba(14, 22, 42, 0.6); color: var(--text-dim); font-weight: 600; cursor: pointer; }
.editor-step-btn b { margin-right: 6px; font-family: var(--font-mono); }
.editor-step-btn[aria-pressed="true"] { border-color: var(--select); background: var(--select); color: #04121c; }
.editor-panel { padding: 14px; }

.slide-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.slide-thumb { position: relative; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 8px; background: none; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.slide-thumb img { display: block; width: 96px; height: 54px; image-rendering: pixelated; }
.slide-thumb[aria-pressed="true"] { border-color: var(--gold); }
.slide-thumb__num { position: absolute; top: 4px; left: 4px; padding: 0 6px; border-radius: 6px; background: rgba(4, 6, 13, 0.8); font-family: var(--font-mono); font-size: 0.7rem; line-height: 1.5; color: var(--text); }
.slide-thumb.is-dragging { opacity: 0.3; }
.slide-thumb.is-drop-before { box-shadow: -4px 0 0 var(--select); }
.slide-thumb.is-drop-after { box-shadow: 4px 0 0 var(--select); }
.slide-strip.is-reordering .slide-thumb { cursor: grabbing; }
.slide-drag-preview { position: fixed; z-index: 100; margin: 0; pointer-events: none; border-color: var(--gold); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6); opacity: 0.95; }
.slide-add { padding: 8px 12px; border: 1px dashed var(--panel-border); border-radius: 8px; background: none; color: var(--text-dim); font-size: 0.84rem; cursor: pointer; }
.slide-add:hover { border-color: rgba(140, 170, 255, 0.5); color: var(--text); }
.slide-add--remove { border-style: solid; }
.slide-order { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 14px; }
.slide-order__position { margin: 0; color: var(--text-dim); font-family: var(--font-mono); font-size: 0.75rem; }
.slide-order__info { display: grid; gap: 4px; }
.slide-order__hint { margin: 0; color: var(--text-dim); font-size: 0.75rem; }
.slide-order__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.slide-move { border-style: solid; background: rgba(140, 170, 255, 0.06); }
.slide-move:disabled { opacity: 0.4; cursor: default; border-color: var(--panel-border); color: var(--text-dim); }

.story-main { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, 1fr); gap: 14px; }
.story-stage { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.editor-canvas { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 8px; image-rendering: pixelated; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); touch-action: none; cursor: grab; }
.layer-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.layer-chip { display: inline-flex; overflow: hidden; border: 1px solid var(--panel-border); border-radius: 999px; }
.layer-chip__name, .layer-chip__remove { padding: 5px 10px; border: 0; background: rgba(140, 170, 255, 0.08); color: var(--text); font-size: 0.8rem; cursor: pointer; }
.layer-chip__name[aria-pressed="true"] { background: var(--gold); color: #1a1202; }
.layer-chip__remove { border-left: 1px solid var(--panel-border); color: var(--text-dim); }
.layer-empty { font-size: 0.84rem; color: var(--text-dim); }

.sprite-size-editor { padding: 12px 14px; border: 1px solid var(--panel-border); border-radius: 10px; background: rgba(20, 29, 58, 0.5); }
.sprite-size-editor__head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; margin-bottom: 8px; }
.sprite-size-editor__head span { color: var(--text-dim); font-size: 0.8rem; }
.sprite-size-editor__controls { display: flex; align-items: center; gap: 12px; }
.sprite-size-editor__controls input { flex: 1; min-width: 0; margin: 0; accent-color: var(--select); cursor: pointer; }
.sprite-size-editor__controls input:disabled { opacity: 0.4; cursor: default; }
.sprite-size-editor__controls output { min-width: 4.5ch; color: var(--gold); font: 700 0.8rem var(--font-mono); text-align: right; }
.sprite-size-editor__reset { padding: 6px 10px; border: 1px solid var(--panel-border); border-radius: 7px; background: rgba(140, 170, 255, 0.08); font-size: 0.8rem; cursor: pointer; }
.sprite-size-editor__reset:hover:not(:disabled) { border-color: var(--select); }
.sprite-size-editor__reset:disabled { color: var(--text-dim); opacity: 0.45; cursor: default; }

.field { min-width: 0; display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; }
.field__label, .palette__title { font-family: var(--font-display); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-dim); }
.field__label small, .palette__title small { font-family: var(--font-body); font-size: 0.8rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.field input, .field textarea, .field select { width: 100%; padding: 10px 12px; border: 1px solid var(--panel-border); border-radius: 9px; background: var(--panel-solid); color: var(--text); font: inherit; font-size: 0.95rem; resize: vertical; }
.field__note { margin: -4px 0 0; font-size: 0.78rem; color: var(--text-dim); }

.story-palette { min-width: 0; max-height: 600px; padding-right: 4px; overflow-y: auto; }
.palette__title { margin: 0 0 8px; }
.palette__title:not(:first-child) { margin-top: 14px; }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.thumb { display: flex; flex-direction: column; gap: 3px; padding: 4px; border: 1px solid var(--panel-border); border-radius: 8px; background: rgba(20, 29, 58, 0.6); color: var(--text-dim); font-size: 0.72rem; text-align: center; cursor: pointer; }
.thumb img { width: 100%; aspect-ratio: 16 / 9; border-radius: 4px; image-rendering: pixelated; }
.thumb:hover { border-color: rgba(140, 170, 255, 0.5); color: var(--text); }
.thumb[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }

.mission-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field--wide { grid-column: 1 / -1; }
.mission-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.mission-option { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border: 1px solid var(--panel-border); border-radius: 10px; background: rgba(20, 29, 58, 0.6); cursor: pointer; }
.mission-option:has(input:checked) { border-color: var(--gold); background: rgba(255, 209, 102, 0.08); }
.mission-option input { flex-shrink: 0; width: auto; margin-top: 3px; padding: 0; accent-color: var(--accent); }
.mission-option__text { display: flex; flex-direction: column; gap: 2px; }
.mission-option__text small { font-size: 0.8rem; color: var(--text-dim); }

.check-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0 0 14px; font-size: 0.92rem; }
.check-summary dt { color: var(--text-dim); }
.check-summary dd { margin: 0; }
.check-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.check-result { display: grid; gap: 10px; margin-top: 14px; }
.check-result:empty { display: none; }
.check-banner { padding: 12px 16px; border: 1px solid; border-radius: 12px; }
.check-banner strong { font-family: var(--font-display); font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; }
.check-banner p { margin: 4px 0 0; }
.check-banner--ok { border-color: rgba(61, 220, 151, 0.5); background: rgba(61, 220, 151, 0.08); }
.check-banner--ok strong { color: var(--easy); }
.check-banner--no { border-color: rgba(255, 93, 115, 0.45); background: rgba(40, 10, 18, 0.6); }
.check-banner--no strong { color: var(--danger); }
.check-issues { display: grid; gap: 10px; margin: 0; padding-left: 22px; }
.check-issues p { margin: 2px 0 0; line-height: 1.45; }
.check-issues__where { font-family: var(--font-mono); font-size: 0.74rem; color: var(--accent-2); }
.check-issues__fix { color: var(--text-dim); }
.check-note { margin: 0; font-size: 0.84rem; color: var(--text-dim); }

@media (max-width: 800px) {
  .story-main, .mission-form { grid-template-columns: 1fr; }
  .story-palette { max-height: none; }
  .level-row { flex-wrap: wrap; }
}

/* ---------- Reduced motion ---------- */

html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
  animation-duration: 0.001ms !important;
  transition-duration: 0.001ms !important;
}

/* ---------- Small screens ---------- */

@media (max-width: 560px) {
  .btn-back__text {
    display: none;
  }

  .screen-heading {
    letter-spacing: 0.2em;
  }

  .mode-row {
    padding: 24px 0;
  }

  .mode-card {
    padding: 22px;
  }

  .difficulty-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .launch-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    text-align: center;
  }

  .range-wrap input[type="range"] {
    width: 110px;
  }

  .briefing-stats {
    grid-template-columns: 1fr;
  }

  .cutscene-text {
    min-height: calc(1.65em * 5);
  }

  .setting {
    flex-wrap: wrap;
  }
}

/* ---------- Achievements ---------- */

.achievements-launcher {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 225px;
  margin-top: auto;
  padding: 10px 13px;
  border: 1px solid rgba(255, 209, 102, 0.28);
  border-radius: 14px;
  background: rgba(10, 17, 34, 0.88);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  transition: border-color 0.2s, transform 0.2s, background-color 0.2s;
}

.achievements-launcher:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 209, 102, 0.65);
  background: #141d34;
}

.achievements-launcher__icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: none;
  border: 1px solid rgba(255, 209, 102, 0.28);
  border-radius: 11px;
  background: rgba(255, 209, 102, 0.08);
  color: var(--gold);
}

.achievements-launcher__icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.achievements-launcher__text { display: grid; gap: 4px; }
.achievements-launcher__text strong {
  font-family: var(--font-display);
  font-size: 0.69rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.achievements-launcher__text span { color: var(--text-dim); font-size: 0.78rem; }
.achievements-launcher__arrow { margin-left: auto; color: var(--gold); font-size: 1.1rem; }

.achievements {
  width: min(880px, calc(100vw - 32px));
  max-width: 100%;
  max-height: min(820px, calc(100dvh - 32px));
  padding: 0;
  overflow-y: auto;
  border: 1px solid rgba(142, 177, 255, 0.22);
  border-radius: 22px;
  background: #0b1224;
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
}

.achievements::backdrop {
  background: rgba(2, 4, 10, 0.78);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.achievements[open] { animation: dialog-in 0.25s var(--ease-out) both; }
.achievements__header {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 30px 22px;
  background: radial-gradient(ellipse at 90% 0%, rgba(255, 179, 71, 0.13), transparent 52%), linear-gradient(120deg, #111d38, #0b1224);
}
.achievements__eyebrow {
  margin: 0 0 9px;
  color: var(--gold);
  font: 700 0.65rem var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.achievements__header h2 {
  margin: 0;
  font: 800 clamp(1.4rem, 3vw, 2rem) var(--font-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.achievements__intro { margin: 8px 0 0; color: var(--text-dim); font-size: 0.94rem; }
.achievements__close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: none;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: rgba(5, 10, 22, 0.6);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.achievements__close:hover { border-color: var(--gold); }

.achievements__progress { padding: 18px 30px 2px; }
.achievements__progress > div:first-child {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  color: var(--text-dim);
  font: 700 0.7rem var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.achievements__progress strong { color: var(--gold); }
.achievements__progress-track { height: 7px; overflow: hidden; border-radius: 99px; background: #24314c; }
.achievements__progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width 0.3s; }
.achievements__list { display: grid; gap: 23px; padding: 22px 30px 28px; }
.achievement-group h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 11px;
  color: #b4c3e7;
  font: 700 0.7rem var(--font-display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.achievement-group h3::after { content: ''; flex: 1; height: 1px; background: var(--panel-border); }
.achievement-group__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.achievement-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(140, 170, 255, 0.13);
  border-radius: 13px;
  background: rgba(19, 29, 52, 0.7);
}
.achievement-card.is-unlocked { border-color: rgba(255, 209, 102, 0.39); background: linear-gradient(120deg, rgba(255, 185, 83, 0.10), rgba(20, 31, 52, 0.9)); }
.achievement-card__badge {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  flex: none;
  border: 1px solid rgba(140, 170, 255, 0.16);
  border-radius: 11px;
  background: rgba(8, 16, 31, 0.75);
  color: #7988a9;
  font-size: 1.25rem;
}
.achievement-card.is-unlocked .achievement-card__badge { border-color: rgba(255, 209, 102, 0.3); background: rgba(255, 209, 102, 0.1); color: var(--gold); }
.achievement-card__content { min-width: 0; }
.achievement-card__content h4 { margin: 1px 0 5px; color: var(--text); font-size: 0.94rem; line-height: 1.2; }
.achievement-card__content p { margin: 0; color: var(--text-dim); font-size: 0.8rem; line-height: 1.42; }
.achievement-card__status { display: block; margin-top: 8px; color: #98a8c8; font: 700 0.62rem var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.achievement-card.is-unlocked .achievement-card__status { color: var(--gold); }
.achievements__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 30px 24px;
  border-top: 1px solid var(--panel-border);
}
.achievements__footer p { max-width: 50ch; margin: 0; color: var(--text-dim); font-size: 0.78rem; line-height: 1.5; }
.achievements__footer .btn { flex: none; }

.achievement-unlock {
  width: min(100%, 470px);
  padding: 15px 20px;
  border: 1px solid rgba(255, 209, 102, 0.38);
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(255, 181, 71, 0.12), rgba(15, 25, 46, 0.92));
}
.achievement-unlock__eyebrow { color: var(--gold); font: 700 0.65rem var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; }
.achievement-unlock p { margin: 7px 0; font-weight: 700; line-height: 1.4; }
.achievement-unlock__button { padding: 4px; border: 0; background: none; color: var(--select); font-size: 0.8rem; cursor: pointer; }
.achievement-unlock__button:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .achievements__header { padding: 24px 20px 18px; }
  .achievements__progress { padding: 16px 20px 0; }
  .achievements__list { padding: 20px; }
  .achievement-group__grid { grid-template-columns: 1fr; }
  .achievements__footer { align-items: flex-start; flex-direction: column; padding: 18px 20px 22px; }
}

/* ---------- Flight School (tutorial) ---------- */

.screen--tutorial { gap: 16px; padding: 18px 16px 24px; }
.tutorial-progress { justify-self: end; margin: 0; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); }

.tutorial {
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.lesson-nav {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: rgba(9, 14, 30, 0.84);
}

.lesson-nav__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text-dim);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.lesson-nav__btn b {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.lesson-nav__btn:hover { background: rgba(140, 170, 255, 0.08); color: var(--text); }
.lesson-nav__btn.is-done b { border-color: var(--easy); background: var(--easy); color: #04121c; }
.lesson-nav__btn[aria-current="true"] { background: rgba(79, 209, 255, 0.12); color: var(--text); }
.lesson-nav__btn[aria-current="true"] b { border-color: var(--select); background: var(--select); color: #04121c; }
.lesson-nav__btn.is-final { margin-top: 6px; border-top: 1px solid rgba(140, 170, 255, 0.12); border-radius: 0 0 10px 10px; color: var(--gold); }
.lesson-nav__btn.is-final b { border-color: rgba(255, 209, 102, 0.6); }

.lesson {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: rgba(9, 14, 30, 0.84);
}

.lesson-frame {
  align-self: center;
  width: min(100%, max(280px, calc((100vh - 400px) * 16 / 9)));
  width: min(100%, max(280px, calc((100dvh - 400px) * 16 / 9)));
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
  background: #05030f;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 40px rgba(79, 120, 255, 0.14);
  cursor: pointer;
}

.lesson-frame canvas { display: block; width: 100%; height: 100%; }
.lesson-frame.is-entering { animation: frame-in 0.4s ease both; }

.lesson__copy { display: flex; flex-direction: column; gap: 8px; }
.lesson__eyebrow { margin: 0; font-family: var(--font-display); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; color: var(--accent-2); }
.lesson__title { margin: 0; font-family: var(--font-display); font-size: clamp(1.1rem, 2.4vw, 1.45rem); letter-spacing: 0.04em; }
.lesson__text { margin: 0; max-width: 72ch; font-size: clamp(1rem, 1.6vw, 1.1rem); line-height: 1.6; }
.lesson__text strong { color: var(--gold); font-weight: 700; }

.lesson__fact {
  margin: 2px 0 0;
  max-width: 72ch;
  padding: 10px 14px;
  border-left: 3px solid var(--select);
  border-radius: 0 10px 10px 0;
  background: rgba(79, 209, 255, 0.08);
  font-size: 0.93rem;
  line-height: 1.5;
}

.lesson__fact strong { color: var(--gold); font-weight: 700; }
.lesson__fact .lesson__fact-label { color: var(--select); }

.lesson__sources { margin: 2px 0 0; max-width: 85ch; color: var(--text-dim); font-size: 0.78rem; line-height: 1.6; overflow-wrap: anywhere; }
.lesson__sources a { color: var(--select); text-underline-offset: 3px; }
.lesson__sources a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.lesson__nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lesson__next--go { min-width: 0; }
.lesson-dots { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.lesson-dots li { width: 8px; height: 8px; border-radius: 50%; background: rgba(140, 170, 255, 0.25); }
.lesson-dots li.is-past { background: rgba(140, 170, 255, 0.6); }
.lesson-dots li.is-current { background: var(--accent); box-shadow: 0 0 8px rgba(255, 122, 47, 0.6); }

.lesson__keys { display: flex; justify-content: center; gap: 18px; margin: 0; font-size: 0.75rem; color: var(--text-dim); }

@media (max-width: 820px) {
  .tutorial { grid-template-columns: minmax(0, 1fr); }
  .lesson-nav { position: static; flex-direction: row; overflow-x: auto; }
  .lesson-nav__btn { flex-shrink: 0; white-space: nowrap; }
  .lesson-nav__btn.is-final { margin-top: 0; border-top: 0; border-radius: 10px; }
  .lesson { padding: 12px; }
  .lesson__keys { display: none; }
}

@media (max-width: 480px) {
  .lesson__nav .btn--small { padding: 12px 14px; letter-spacing: 0.12em; }
}

/* ---------- Flight School coach (build screen) ---------- */

.coach {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 209, 102, 0.45);
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.1), rgba(9, 14, 30, 0.92) 55%);
}

.coach.is-ready { border-color: rgba(61, 220, 151, 0.6); background: linear-gradient(90deg, rgba(61, 220, 151, 0.12), rgba(9, 14, 30, 0.92) 55%); }
.coach__main { flex: 1; min-width: 0; }
.coach__step { margin: 0; font-family: var(--font-display); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
.coach.is-ready .coach__step { color: var(--easy); }
.coach__title { margin: 3px 0 4px; font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.05em; }
.coach__text { margin: 0; font-size: 0.9rem; line-height: 1.45; }
.coach__text strong { color: var(--gold); font-weight: 700; }
.coach__side { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.coach__steps { display: flex; gap: 5px; margin: 0; padding: 0; list-style: none; }

.coach__steps li {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
}

.coach__steps li.is-done { border-color: var(--easy); background: var(--easy); color: #04121c; }
.coach__steps li[aria-current="step"] { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.25); }
.coach__show { padding: 9px 16px; white-space: nowrap; }

/* In practice there are no hearts or hints, and the suggested part pulses. */
.screen--build.is-tutorial .build-top__status { visibility: hidden; }
.screen--build.is-tutorial .part-card.is-hinted { animation: coach-pulse 1.6s ease-in-out infinite; }
.reduce-motion .screen--build.is-tutorial .part-card.is-hinted { animation: none; }

@keyframes coach-pulse {
  50% { box-shadow: 0 0 0 1px var(--gold), 0 0 32px rgba(255, 209, 102, 0.6); }
}

@media (max-width: 900px) {
  .coach { flex-direction: column; align-items: stretch; gap: 10px; }
  .coach__side { flex-direction: row; align-items: center; justify-content: space-between; }
  .screen--build.is-tutorial .build-top__status { display: none; }
}

@media (max-width: 520px) {
  .tutorial-progress { display: none; }
  .coach__steps { gap: 3px; }
  .coach__steps li { width: 20px; height: 20px; font-size: 0.65rem; }
  .coach__show { padding: 9px 12px; letter-spacing: 0.12em; }
}
