/* ============================================================
   style.css — Ekspedisi Kosmik: Misi Penjelajah Tata Surya
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-space: #0a0e1a;
  --bg-panel: rgba(10, 14, 30, 0.92);
  --bg-card: rgba(20, 28, 58, 0.85);
  --accent: #00d4ff;
  --accent-glow: rgba(0, 212, 255, 0.3);
  --accent-warm: #ffaa00;
  --text: #e0e8f0;
  --text-dim: #8899aa;
  --success: #44dd88;
  --danger: #ff4466;
  --warning: #ffcc33;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg-space);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ── Game Container ───────────────────────────────────────── */
#game-container {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-space);
  background-image: radial-gradient(circle at 50% 50%, rgba(3, 7, 18, 0.45) 0%, rgba(3, 7, 18, 0.75) 100%), url('assets/Background%20Luar%20Angkasa.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ── Global Audio Controls (BGM & SFX Toggle) ─────────────── */
.audio-controls {
  position: absolute;
  top: 9px;
  right: 16px;
  z-index: 9999;
  display: flex;
  align-items: center;
}

.btn-audio {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 20, 45, 0.92);
  border: 1.5px solid rgba(0, 212, 255, 0.55);
  color: var(--text);
  font-family: var(--font);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 12px rgba(0, 212, 255, 0.25);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  user-select: none;
}

.btn-audio:hover {
  background: rgba(18, 38, 85, 0.98);
  border-color: var(--accent);
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
}

.btn-audio:active {
  transform: scale(0.95);
}

.btn-audio.muted {
  border-color: rgba(255, 68, 102, 0.6);
  color: var(--text-dim);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), 0 0 8px rgba(255, 68, 102, 0.25);
}

.btn-audio.muted:hover {
  border-color: var(--danger);
  box-shadow: 0 6px 16px rgba(255, 68, 102, 0.5);
}

.audio-icon {
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.audio-label {
  display: none;
}

/* ── Screens ──────────────────────────────────────────────── */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: opacity 0.5s ease;
}
.screen.active { display: flex; }

/* ── Stars Background ─────────────────────────────────────── */
.stars-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(1px 1px at 10% 20%, #fff 0.5px, transparent 1px),
    radial-gradient(1px 1px at 30% 60%, #aaccff 0.5px, transparent 1px),
    radial-gradient(1.5px 1.5px at 50% 10%, #fff 0.5px, transparent 1px),
    radial-gradient(1px 1px at 70% 80%, #aaccff 0.5px, transparent 1px),
    radial-gradient(1px 1px at 90% 40%, #fff 0.5px, transparent 1px),
    radial-gradient(1.5px 1.5px at 15% 85%, #ddeeff 0.5px, transparent 1px),
    radial-gradient(1px 1px at 45% 45%, #fff 0.5px, transparent 1px),
    radial-gradient(1px 1px at 80% 15%, #aaccff 0.5px, transparent 1px),
    radial-gradient(1.5px 1.5px at 60% 70%, #fff 0.5px, transparent 1px),
    radial-gradient(1px 1px at 25% 35%, #ddeeff 0.5px, transparent 1px);
  background-size: 200px 200px, 300px 300px, 250px 250px, 180px 180px, 220px 220px,
                   280px 280px, 160px 160px, 240px 240px, 190px 190px, 270px 270px;
  animation: twinkle 4s ease-in-out infinite alternate;
  pointer-events: none;
}
.stars-moving {
  animation: starsMove 2s linear infinite;
}
@keyframes twinkle { 0% { opacity: 0.6; } 100% { opacity: 1; } }
@keyframes starsMove { 0% { transform: translateY(0); } 100% { transform: translateY(20px); } }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, #0088cc, #00bbff);
  color: #fff;
  border: none;
  padding: 14px 36px;
  font-size: 1.15rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 20px var(--accent-glow);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 30px var(--accent-glow);
}
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary.btn-small { padding: 10px 24px; font-size: 0.95rem; }

.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 24px;
  font-size: 1rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.25s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.15); }

.btn-hud {
  background: rgba(0,180,255,0.12);
  color: var(--accent);
  border: 1px solid rgba(0,180,255,0.25);
  padding: 8px 18px;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-hud:hover { background: rgba(0,180,255,0.25); }

/* ── TITLE SCREEN ─────────────────────────────────────────── */
.title-content {
  text-align: center;
  z-index: 2;
  animation: fadeInUp 1s ease;
}
.title-logo {
  font-size: 5rem;
  margin-bottom: 10px;
  animation: rocketBounce 2s ease-in-out infinite;
}
@keyframes rocketBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}
.title-content h1 {
  font-size: 3rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}
.title-content h2 {
  font-size: 1.3rem;
  color: var(--text-dim);
  font-weight: 400;
  margin-bottom: 8px;
}
.title-sub {
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 30px;
}
.title-input {
  margin-bottom: 24px;
}
.title-input label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.title-input input {
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(0,180,255,0.3);
  color: #fff;
  padding: 12px 20px;
  font-size: 1.1rem;
  border-radius: 50px;
  width: 280px;
  text-align: center;
  outline: none;
  transition: border-color 0.3s;
}
.title-input input:focus { border-color: var(--accent); }
.title-input input::placeholder { color: rgba(255,255,255,0.3); }

/* ── INTRO / NARRATION & LAUNCH ARENA ─────────────────────── */
#screen-intro {
  overflow: hidden;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  justify-content: flex-start;
  padding-top: 45px;
}

.narration-box {
  background: var(--bg-panel);
  border: 1px solid rgba(0,180,255,0.25);
  border-radius: var(--radius);
  padding: 28px 36px;
  max-width: 620px;
  text-align: center;
  z-index: 20;
  box-shadow: 0 0 40px rgba(0,100,200,0.2);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#screen-intro.launch-active .narration-box {
  opacity: 0;
  transform: translateY(-30px);
  pointer-events: none;
}

.narration-avatar { font-size: 3rem; margin-bottom: 8px; }
.narration-speaker {
  color: var(--accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
}
.narration-text {
  font-size: 1.15rem;
  line-height: 1.7;
  margin-bottom: 20px;
  min-height: 60px;
}

/* Screen rumble / camera shake during launch */
#screen-intro.screen-shaking {
  animation: launchCameraShake 0.08s infinite alternate;
}

@keyframes launchCameraShake {
  0% { transform: translate(-2px, 1px); }
  50% { transform: translate(2px, -2px); }
  100% { transform: translate(-1px, 2px); }
}

/* Launch Stage Arena */
.launch-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

/* Platform Base & Gantry */
.launch-platform {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 380px;
  height: 90px;
  z-index: 6;
}

.launch-base {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 250px;
  height: 50px;
  background: linear-gradient(180deg, #303846 0%, #1a1e27 100%);
  border-top: 3px solid #5a667d;
  border-radius: 6px 6px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.75);
  overflow: hidden;
}

.pad-hazard {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: repeating-linear-gradient(
    -45deg,
    #ffcc00,
    #ffcc00 10px,
    #111111 10px,
    #111111 20px
  );
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.gantry-tower {
  position: absolute;
  bottom: 0;
  width: 28px;
  height: 180px;
  background: repeating-linear-gradient(
    0deg,
    #8b2222 0px,
    #8b2222 8px,
    #3b1010 8px,
    #3b1010 24px
  );
  border: 2px solid #b83333;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6);
}

.gantry-left {
  left: 30px;
  border-radius: 4px 4px 0 0;
}

.gantry-right {
  right: 30px;
  border-radius: 4px 4px 0 0;
}

/* Pad Warning Beacons */
.pad-beacon {
  position: absolute;
  top: -8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff2200;
  box-shadow: 0 0 10px #ff2200;
  animation: beaconPulse 0.8s infinite alternate;
}
.b-left { left: 37px; }
.b-right { right: 37px; }

#screen-intro.launch-active .pad-beacon {
  background: #ffbb00;
  box-shadow: 0 0 20px #ffaa00, 0 0 40px #ff4400;
  animation: beaconFastPulse 0.2s infinite alternate;
}

@keyframes beaconPulse {
  0% { opacity: 0.4; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1.15); }
}

@keyframes beaconFastPulse {
  0% { opacity: 0.5; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.3); }
}

/* Launch Smoke Puffs */
.launch-smoke {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  width: 440px;
  height: 120px;
  pointer-events: none;
  z-index: 7;
}

.smoke-puff {
  position: absolute;
  bottom: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 248, 255, 0.85) 0%, rgba(200, 220, 245, 0.5) 45%, rgba(160, 185, 220, 0.2) 70%, transparent 85%);
  filter: blur(8px);
  opacity: 0;
  transform: scale(0.3);
}

.puff-1 { left: 45%; width: 90px; height: 90px; }
.puff-2 { left: 30%; width: 110px; height: 110px; }
.puff-3 { left: 55%; width: 120px; height: 110px; }
.puff-4 { left: 15%; width: 130px; height: 120px; }
.puff-5 { left: 65%; width: 130px; height: 120px; }
.puff-6 { left: 40%; width: 140px; height: 130px; }

#screen-intro.launch-active .smoke-puff {
  animation: smokeBillow 2.2s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
}
#screen-intro.launch-active .puff-1 { animation-delay: 0.1s; }
#screen-intro.launch-active .puff-2 { animation-delay: 0.25s; }
#screen-intro.launch-active .puff-3 { animation-delay: 0.2s; }
#screen-intro.launch-active .puff-4 { animation-delay: 0.4s; }
#screen-intro.launch-active .puff-5 { animation-delay: 0.35s; }
#screen-intro.launch-active .puff-6 { animation-delay: 0.5s; }

@keyframes smokeBillow {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.3);
  }
  20% {
    opacity: 0.95;
    transform: translateY(-15px) scale(1);
  }
  70% {
    opacity: 0.75;
    transform: translateY(-45px) scale(1.6);
  }
  100% {
    opacity: 0;
    transform: translateY(-80px) scale(2.2);
  }
}

/* Rocket Assembly on Pad */
.rocket-assembly {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  width: 105px;
  height: 160px;
  z-index: 10;
  transition: none;
}

.rocket-figure {
  width: 100%;
  height: 100%;
  position: relative;
}

.rocket-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.6));
}

/* Pre-launch Idle / Standby Hover */
.rocket-assembly:not(.launching) .rocket-figure {
  animation: padStandby 3s ease-in-out infinite alternate;
}
@keyframes padStandby {
  0% { transform: translateY(0); }
  100% { transform: translateY(-3px); }
}

/* Ignition & Liftoff Ascent */
.rocket-assembly.launching {
  animation: rocketLiftoff 2.4s cubic-bezier(0.42, 0, 1, 1) forwards;
}

@keyframes rocketLiftoff {
  0% {
    bottom: 25px;
    transform: translateX(-50%) scale(1);
  }
  15% {
    bottom: 25px;
    transform: translateX(calc(-50% - 2px)) scale(1.02);
  }
  25% {
    bottom: 35px;
    transform: translateX(calc(-50% + 2px)) scale(1.02);
  }
  40% {
    bottom: 80px;
    transform: translateX(calc(-50% - 1px)) scale(1.01);
  }
  65% {
    bottom: 250px;
    transform: translateX(calc(-50% + 1px)) scale(0.98);
  }
  85% {
    bottom: 600px;
    transform: translateX(-50%) scale(0.92);
  }
  100% {
    bottom: 125vh;
    transform: translateX(-50%) scale(0.85);
  }
}

/* Rocket Thruster Plasma Flame */
.rocket-thruster {
  position: absolute;
  top: 130px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 110px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: -1;
}

/* When launching, thruster roars! */
.rocket-assembly.launching .rocket-thruster,
#screen-intro.launch-active .rocket-thruster {
  opacity: 1;
}

.flame-cone {
  position: absolute;
  top: 0;
  transform-origin: top center;
}

.outer-flame {
  width: 36px;
  height: 110px;
  border-radius: 50% 50% 35% 35% / 15% 15% 85% 85%;
  background: linear-gradient(180deg, #ffaa00 0%, #ff5500 35%, #ff0044 75%, transparent 100%);
  filter: blur(2.5px) drop-shadow(0 0 20px rgba(255, 100, 0, 0.95));
  animation: flameRoar 0.08s infinite alternate;
}

.mid-flame {
  width: 22px;
  height: 75px;
  border-radius: 50% 50% 30% 30% / 15% 15% 85% 85%;
  background: linear-gradient(180deg, #ffffbb 0%, #ffcc00 40%, #ff6600 85%, transparent 100%);
  filter: blur(1.2px) drop-shadow(0 0 12px rgba(255, 220, 0, 0.9));
  animation: flameRoarMid 0.06s infinite alternate;
}

.core-flame {
  width: 12px;
  height: 42px;
  border-radius: 50% 50% 25% 25% / 15% 15% 85% 85%;
  background: linear-gradient(180deg, #ffffff 0%, #d4f8ff 50%, #00ddff 90%, transparent 100%);
  box-shadow: 0 0 10px #ffffff, 0 0 16px #00e5ff;
  animation: flameRoarCore 0.05s infinite alternate;
}

@keyframes flameRoar {
  0% { transform: scale(0.92, 0.95) skewX(-1deg); }
  50% { transform: scale(1.04, 1.05) skewX(0.5deg); }
  100% { transform: scale(0.96, 1.02) skewX(1deg); }
}

@keyframes flameRoarMid {
  0% { transform: scale(0.95, 0.96); }
  100% { transform: scale(1.05, 1.04); }
}

@keyframes flameRoarCore {
  0% { transform: scale(0.9, 0.95); }
  100% { transform: scale(1.08, 1.05); }
}

/* Mach Shock Diamonds */
.mach-rings {
  position: absolute;
  top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.m-ring {
  width: 10px;
  height: 5px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px #00f0ff, 0 0 14px #ffffff;
  opacity: 0.9;
  animation: machPulse 0.12s infinite alternate;
}
.mr-2 { width: 8px; height: 4px; opacity: 0.75; }
.mr-3 { width: 6px; height: 3px; opacity: 0.6; }

@keyframes machPulse {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.15); opacity: 1; }
}

/* Exhaust Spark Particles */
.exhaust-particles {
  position: absolute;
  top: 50px;
  width: 30px;
  height: 80px;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px #ffcc00;
  opacity: 0;
}

.p1 { left: 20%; animation: sparkFall 0.4s infinite; }
.p2 { left: 70%; animation: sparkFall 0.35s 0.1s infinite; }
.p3 { left: 40%; animation: sparkFall 0.45s 0.2s infinite; }
.p4 { left: 80%; animation: sparkFall 0.3s 0.15s infinite; }

@keyframes sparkFall {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(60px) scale(0.2); opacity: 0; }
}

/* ── COCKPIT / MAP SCREEN ─────────────────────────────────── */
.cockpit-frame {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(3, 7, 18, 0.55);
  position: relative;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 145px 12px 24px;
  background: rgba(0,20,50,0.9);
  border-bottom: 1px solid rgba(0,180,255,0.15);
  z-index: 5;
  flex-shrink: 0;
}
.hud-item { display: flex; align-items: center; gap: 8px; }
.hud-label { color: var(--text-dim); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; }
.hud-value { color: var(--accent); font-weight: 700; font-size: 1rem; }

.fuel-bar-container {
  width: 160px; height: 22px;
  background: rgba(255,255,255,0.08);
  border-radius: 11px;
  position: relative;
  overflow: hidden;
}
.fuel-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--success), #22cc66);
  border-radius: 11px;
  transition: width 0.8s ease, background 0.5s;
}
.fuel-bar.low { background: linear-gradient(90deg, var(--danger), #ff6644); }
.fuel-bar.medium { background: linear-gradient(90deg, var(--warning), #ffaa00); }
.fuel-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

#solar-canvas {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

/* Planet Selector Pills */
.hud-planet-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(10, 18, 38, 0.95);
  border-top: 1px solid rgba(0, 180, 255, 0.12);
  z-index: 5;
  flex-shrink: 0;
}
.planet-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ccddee;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.planet-pill-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.planet-pill-svg svg {
  width: 15px;
  height: 15px;
  display: block;
}
.planet-pill:hover {
  background: rgba(0, 212, 255, 0.2);
  border-color: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
}
.planet-pill.visited {
  border-color: rgba(68, 221, 136, 0.4);
  background: rgba(68, 221, 136, 0.1);
  color: var(--success);
}
.planet-pill.active {
  border-color: var(--accent);
  background: rgba(0, 212, 255, 0.3);
  box-shadow: 0 0 10px var(--accent-glow);
}
.sector-divider {
  font-size: 0.7rem;
  color: var(--accent-warm);
  font-weight: 700;
  padding: 2px 8px;
  background: rgba(255, 170, 0, 0.12);
  border-radius: 10px;
  border: 1px dashed rgba(255, 170, 0, 0.3);
}

.hud-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  background: rgba(0,20,50,0.9);
  border-top: 1px solid rgba(0,180,255,0.15);
  z-index: 5;
  flex-shrink: 0;
}
.hud-actions-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hud-message {
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
  flex: 1;
}
.btn-finish { background: rgba(0,200,100,0.15); color: var(--success); border-color: rgba(0,200,100,0.3); }

/* ── Cockpit Tutorial / Onboarding Modal ────────────────────── */
.tutorial-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.tutorial-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.tutorial-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 22, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.tutorial-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(150deg, rgba(13, 26, 56, 0.98), rgba(7, 16, 38, 0.98));
  border: 1.5px solid rgba(0, 212, 255, 0.45);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 35px rgba(0, 212, 255, 0.25);
  padding: 24px 28px;
  animation: tutorialPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes tutorialPop {
  0% { opacity: 0; transform: scale(0.92) translateY(12px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.tutorial-close-btn {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ccddee;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.tutorial-close-btn:hover {
  background: rgba(255, 68, 102, 0.3);
  border-color: var(--danger);
  color: #fff;
  transform: rotate(90deg);
}

.tutorial-header {
  margin-bottom: 18px;
  text-align: left;
}
.tutorial-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 212, 255, 0.12);
  border: 1px solid rgba(0, 212, 255, 0.35);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}
.tutorial-ai-icon {
  font-size: 1rem;
  line-height: 1;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 8px #00ff88;
  display: inline-block;
  animation: pulseDot 1.5s infinite;
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.tutorial-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 0 16px rgba(0, 212, 255, 0.4);
  margin-bottom: 6px;
}
.tutorial-subtitle {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.5;
}
.tutorial-subtitle strong {
  color: var(--accent);
}

.tutorial-steps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.tutorial-step-card {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 180, 255, 0.16);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: all 0.25s;
}
.tutorial-step-card:hover {
  background: rgba(0, 212, 255, 0.08);
  border-color: rgba(0, 212, 255, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
.step-num-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #0066cc);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 212, 255, 0.35);
  margin-top: 1px;
}
.step-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-content {
  flex: 1;
}
.step-content h4 {
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 3px;
}
.step-content p {
  color: #b0c4de;
  font-size: 0.8rem;
  line-height: 1.4;
  margin: 0;
}
.step-content p strong {
  color: #eaf6ff;
}

.tutorial-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  border-top: 1px solid rgba(0, 180, 255, 0.15);
  padding-top: 16px;
}
.tutorial-tip {
  font-size: 0.82rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.tutorial-tip strong {
  color: var(--accent);
}
.btn-tutorial-start {
  padding: 10px 32px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 25px;
  box-shadow: 0 4px 18px rgba(0, 212, 255, 0.4);
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.25s;
}
.btn-tutorial-start:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 24px rgba(0, 212, 255, 0.6);
}

/* Planet Tooltip */
.planet-tooltip {
  position: absolute;
  background: var(--bg-panel);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  text-align: center;
  z-index: 10;
  box-shadow: 0 0 30px var(--accent-glow);
  pointer-events: auto;
  min-width: 180px;
  transition: opacity 0.2s;
}
.planet-tooltip.hidden { display: none; }
.planet-tooltip h3 {
  color: var(--accent);
  margin-bottom: 4px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tooltip-icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tooltip-icon-svg svg {
  width: 20px;
  height: 20px;
  display: block;
}
.planet-tooltip p { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 12px; }

/* ── TRAVEL ANIMATION ─────────────────────────────────────── */
#screen-travel {
  overflow: hidden;
  position: relative;
}

.travel-warp-lines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 160px,
    rgba(0, 200, 255, 0.12) 160px,
    rgba(0, 200, 255, 0.12) 163px
  );
  animation: warpStreaks 0.6s linear infinite;
  pointer-events: none;
}
@keyframes warpStreaks {
  0% { transform: translateX(0); }
  100% { transform: translateX(-160px); }
}

.travel-content {
  text-align: center;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.travel-rocket-wrapper {
  position: relative;
  width: 220px;
  height: 140px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spaceCruiseFloat 2.2s ease-in-out infinite alternate;
}

.travel-rocket-svg-box {
  width: 90px;
  height: 140px;
  transform: rotate(90deg); /* Menghadap ke kanan arah jelajah */
  position: relative;
}

.cruise-thruster {
  opacity: 1 !important;
  top: 115px;
}
.cruise-thruster .outer-flame {
  height: 75px;
  background: linear-gradient(180deg, #00d4ff 0%, #0066ff 40%, #ff4400 80%, transparent 100%);
  filter: blur(2px) drop-shadow(0 0 15px rgba(0, 200, 255, 0.9));
}
.cruise-thruster .mid-flame {
  height: 50px;
  background: linear-gradient(180deg, #ffffff 0%, #aaffee 45%, #00ccff 85%, transparent 100%);
}
.cruise-thruster .core-flame {
  height: 28px;
}

@keyframes spaceCruiseFloat {
  0% { transform: translateY(-8px) translateX(-5px); }
  100% { transform: translateY(8px) translateX(6px); }
}

.travel-text {
  font-size: 1.35rem;
  color: var(--accent);
  margin-top: 10px;
  font-weight: 600;
  text-shadow: 0 0 15px var(--accent-glow);
}
.travel-dots span {
  font-size: 2rem;
  color: var(--accent);
  animation: dotPulse 1.4s infinite;
}
.travel-dots span:nth-child(2) { animation-delay: 0.2s; }
.travel-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse { 0%, 80%, 100% { opacity: 0; } 40% { opacity: 1; } }

/* ── PLANET VISIT SCREEN ──────────────────────────────────── */
.planet-visit-bg {
  position: absolute; inset: 0;
  opacity: 0.2;
  transition: all 0.5s ease;
  background-size: cover;
  background-position: center;
}
.planet-visit-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 800px;
  max-height: 100vh;
  overflow-y: auto;
  padding: 24px 30px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.planet-visit-content::-webkit-scrollbar { width: 6px; }
.planet-visit-content::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

.planet-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.planet-icon-large { 
  font-size: 4rem; 
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 68px;
  flex-shrink: 0;
}
.planet-icon-large svg {
  width: 68px;
  height: 68px;
  display: block;
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.25));
  animation: floatPlanetIcon 4s ease-in-out infinite;
}
@keyframes floatPlanetIcon {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}
.planet-header h2 { font-size: 2rem; color: var(--accent); }
.tagline { color: var(--text-dim); font-size: 1rem; }

.planet-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.06);
}
.planet-section h3 { color: var(--accent-warm); margin-bottom: 12px; font-size: 1.1rem; }
.planet-desc { line-height: 1.7; font-size: 1.05rem; }

.facts-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.facts-list li {
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Gravity comparison */
.gravity-compare { display: flex; flex-direction: column; gap: 10px; }
.gravity-item { display: flex; align-items: center; gap: 12px; }
.gravity-label { width: 90px; font-size: 0.9rem; color: var(--text-dim); text-align: right; }
.gravity-bar-wrap { flex: 1; height: 28px; background: rgba(255,255,255,0.06); border-radius: 14px; overflow: hidden; }
.gravity-bar {
  height: 100%;
  background: linear-gradient(90deg, #4488cc, #66aadd);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  min-width: 60px;
  transition: width 1s ease;
}
.gravity-bar-planet { background: linear-gradient(90deg, #cc6644, #ee8866); }
.gravity-explanation { color: var(--text-dim); font-size: 0.85rem; margin-top: 10px; line-height: 1.5; }

/* Interaction area */
.interaction-area {
  margin-top: 12px;
  min-height: 80px;
}

/* Quiz */
.quiz-media {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid rgba(0, 212, 255, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.4);
}
.quiz-media.hidden { display: none; }
.quiz-media img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.quiz-media:hover img {
  transform: scale(1.02);
}
.quiz-media-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(3, 7, 18, 0.92) 35%);
  padding: 12px 14px 8px;
  font-size: 0.82rem;
  color: #ffdd88;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.3px;
}
.quiz-prompt {
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 16px;
  padding: 14px;
  background: rgba(0,100,200,0.1);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quiz-option {
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.1);
  color: var(--text);
  padding: 14px 18px;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s;
  text-align: left;
  line-height: 1.5;
}
.quiz-option:hover:not(.selected):not(.disabled) {
  border-color: var(--accent);
  background: rgba(0,180,255,0.1);
}
.quiz-option.correct {
  border-color: var(--success);
  background: rgba(68,221,136,0.15);
}
.quiz-option.wrong {
  border-color: var(--danger);
  background: rgba(255,68,102,0.15);
}
.quiz-option.disabled { cursor: default; opacity: 0.7; }
.quiz-feedback {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  line-height: 1.6;
}
.quiz-feedback.hidden { display: none; }
.quiz-feedback.correct-fb { background: rgba(68,221,136,0.12); border: 1px solid rgba(68,221,136,0.3); }
.quiz-feedback.wrong-fb { background: rgba(255,68,102,0.12); border: 1px solid rgba(255,68,102,0.3); }

/* Planet nav */
.planet-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-bottom: 20px;
}
.planet-badge {
  color: var(--success);
  font-weight: 700;
  font-size: 1.1rem;
  animation: badgePop 0.5s ease;
}
.planet-badge.hidden { display: none; }
@keyframes badgePop { 0% { transform: scale(0); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* ── ASTEROID BELT ────────────────────────────────────────── */
.asteroid-content {
  z-index: 2;
  text-align: center;
  max-width: 650px;
  width: 90%;
}
.asteroid-header h2 { color: var(--accent-warm); font-size: 1.8rem; margin-bottom: 8px; }
.asteroid-header p { color: var(--text-dim); margin-bottom: 20px; }
.asteroid-field {
  height: 120px;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.03);
}
.asteroid-rock {
  position: absolute;
  font-size: 1.5rem;
  animation: floatAsteroid 3s linear infinite;
}
@keyframes floatAsteroid {
  0% { transform: translateX(110%) rotate(0deg); }
  100% { transform: translateX(-110%) rotate(360deg); }
}
.asteroid-quiz-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid rgba(255,180,0,0.2);
}

/* ── LOGBOOK ──────────────────────────────────────────────── */
.logbook-content {
  z-index: 2;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.logbook-content h2 { color: var(--accent); margin-bottom: 6px; text-align: center; }
.logbook-sub { color: var(--text-dim); text-align: center; margin-bottom: 24px; }
.logbook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.logbook-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.3s;
}
.logbook-card.visited { border-color: rgba(0,200,100,0.3); }
.logbook-card.locked { opacity: 0.4; }
.logbook-card-icon { 
  font-size: 2.2rem; 
  margin-bottom: 6px; 
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}
.logbook-card-icon svg {
  width: 44px;
  height: 44px;
  display: block;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
}
.logbook-card-name { font-weight: 700; color: var(--accent); font-size: 1rem; margin-bottom: 4px; }
.logbook-card-status { font-size: 0.8rem; }
.logbook-card-status.done { color: var(--success); }
.logbook-card-status.pending { color: var(--text-dim); }

/* ── ENDING / GAME OVER ───────────────────────────────────── */
.ending-content {
  text-align: center;
  z-index: 2;
  max-width: 550px;
  animation: fadeInUp 0.8s ease;
}
.ending-badge { font-size: 5rem; margin-bottom: 10px; }
.ending-content h2 { font-size: 2rem; color: var(--accent); margin-bottom: 12px; }
.ending-content p { color: var(--text-dim); margin-bottom: 16px; line-height: 1.6; }

.ending-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 24px 0;
}
.stat-item { text-align: center; }
.stat-number { display: block; font-size: 2.5rem; font-weight: 800; color: var(--accent-warm); }
.stat-label { font-size: 0.8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

.ending-certificate {
  background: var(--bg-card);
  border: 2px solid var(--accent-warm);
  border-radius: var(--radius);
  padding: 24px;
  margin: 20px 0;
}
.ending-certificate h3 { color: var(--accent-warm); font-size: 1.5rem; margin: 8px 0; }

/* ── Interaction Mini-Games ───────────────────────────────── */
.interaction-btn {
  background: rgba(0,180,255,0.15);
  border: 1px solid rgba(0,180,255,0.3);
  color: var(--accent);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s;
  margin: 4px;
}
.interaction-btn:hover { background: rgba(0,180,255,0.3); }
.interaction-btn.active { background: var(--accent); color: #000; font-weight: 700; }

.interaction-result {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  line-height: 1.5;
  background: rgba(0,180,255,0.08);
  border: 1px solid rgba(0,180,255,0.15);
}
.interaction-result.success { background: rgba(68,221,136,0.1); border-color: rgba(68,221,136,0.25); }

.temp-gauge {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  margin: 16px 0;
}
.temp-bar {
  width: 200px;
  height: 20px;
  background: linear-gradient(90deg, #3366ff, #33cc33, #ff3333);
  border-radius: 10px;
  position: relative;
}
.temp-marker {
  width: 8px; height: 28px;
  background: #fff;
  border-radius: 4px;
  position: absolute;
  top: -4px;
  transition: left 0.3s;
  box-shadow: 0 0 8px rgba(255,255,255,0.5);
}

.rover-grid {
  display: grid;
  grid-template-columns: repeat(5, 48px);
  gap: 4px;
  justify-content: center;
  margin: 12px 0;
}
.rover-cell {
  width: 48px; height: 48px;
  background: rgba(200,80,40,0.2);
  border: 1px solid rgba(200,80,40,0.3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.2s;
}
.rover-cell:hover { background: rgba(200,80,40,0.4); }
.rover-cell.revealed { background: rgba(200,80,40,0.5); cursor: default; }

.tilt-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin: 16px 0;
}
.tilt-planet {
  font-size: 4rem;
  transition: transform 0.5s ease;
  display: inline-block;
}
.tilt-controls { display: flex; flex-direction: column; gap: 8px; }

/* ── Utility ──────────────────────────────────────────────── */
.hidden { display: none !important; }

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* ── Responsive Mobile-First ──────────────────────────────── */
@media (max-width: 768px) {
  .title-content {
    width: 92%;
    max-width: 400px;
    padding: 24px 16px;
  }
  .title-content h1 { font-size: 1.75rem; }
  .title-content h2 { font-size: 0.95rem; }
  .title-logo { font-size: 3rem; margin-bottom: 6px; }
  .cadet-input-group { width: 100%; max-width: 320px; }
  .cadet-input { font-size: 0.95rem; padding: 11px 14px; }

  /* Top HUD: single compact row on mobile with room for audio button */
  .hud-top {
    padding: 8px 52px 8px 10px;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: space-between;
  }
  .hud-item {
    gap: 4px;
  }
  .hud-label {
    font-size: 0.65rem;
    letter-spacing: 0.5px;
  }
  .hud-value {
    font-size: 0.82rem;
  }
  .fuel-bar-container {
    width: 75px;
    height: 16px;
    border-radius: 8px;
  }
  .fuel-text {
    font-size: 0.65rem;
  }

  /* Single-row horizontal swipe scroll for planet pills */
  .hud-planet-selector {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 212, 255, 0.4) transparent;
    padding: 6px 10px;
    gap: 6px;
  }
  .hud-planet-selector::-webkit-scrollbar {
    height: 4px;
  }
  .hud-planet-selector::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.35);
    border-radius: 4px;
  }
  .planet-pill {
    flex-shrink: 0;
    padding: 5px 10px;
    font-size: 0.75rem;
    white-space: nowrap;
    touch-action: manipulation;
  }
  .sector-divider {
    flex-shrink: 0;
    font-size: 0.62rem;
    padding: 2px 6px;
    white-space: nowrap;
  }

  /* Bottom HUD */
  .hud-bottom {
    padding: 6px 10px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .hud-actions-left {
    display: flex;
    gap: 6px;
    flex: 1;
    justify-content: flex-start;
  }
  .btn-hud {
    padding: 6px 10px;
    font-size: 0.75rem;
    touch-action: manipulation;
  }
  .hud-message {
    width: 100%;
    order: 3;
    font-size: 0.76rem;
    padding-top: 2px;
  }

  /* Planet Exploration */
  .planet-visit-content {
    padding: 14px 12px 32px;
    max-height: 100dvh;
    -webkit-overflow-scrolling: touch;
  }
  .planet-header {
    flex-direction: column;
    text-align: center;
    gap: 10px;
    margin-bottom: 14px;
  }
  .planet-icon-large {
    font-size: 3rem;
    min-width: 56px;
    min-height: 56px;
  }
  .planet-icon-large svg {
    width: 52px;
    height: 52px;
  }
  .planet-title-group h2 {
    font-size: 1.4rem;
  }
  .planet-tagline {
    font-size: 0.85rem;
  }
  .planet-traits {
    gap: 6px;
    margin-top: 8px;
    justify-content: center;
  }
  .trait-tag {
    font-size: 0.72rem;
    padding: 3px 8px;
  }
  .planet-section {
    padding: 12px 10px;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
  }
  .planet-section h3 {
    font-size: 1rem;
    margin-bottom: 8px;
  }
  .quiz-prompt {
    font-size: 0.9rem;
    padding: 10px 12px;
  }
  .quiz-option {
    padding: 11px 12px;
    font-size: 0.85rem;
    line-height: 1.42;
    min-height: 44px;
    touch-action: manipulation;
  }
  .interaction-btn {
    padding: 8px 12px;
    font-size: 0.82rem;
    min-height: 40px;
    touch-action: manipulation;
    margin: 3px;
  }
  .temp-bar {
    width: 150px;
  }
  .temp-gauge {
    gap: 10px;
    font-size: 0.85rem;
  }

  /* Asteroid Belt Screen */
  .asteroid-content {
    width: 94%;
    max-height: 94dvh;
    overflow-y: auto;
    padding: 16px 12px;
    -webkit-overflow-scrolling: touch;
  }
  .asteroid-header h2 {
    font-size: 1.35rem;
  }
  .asteroid-field {
    height: 85px;
  }

  /* Logbook Modal */
  .logbook-content {
    padding: 18px 12px;
    width: 95%;
    max-height: 92dvh;
    -webkit-overflow-scrolling: touch;
  }
  .logbook-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
  }
  .logbook-card {
    padding: 10px 6px;
  }
  .logbook-card-icon {
    min-height: 40px;
    margin-bottom: 4px;
  }
  .logbook-card-icon svg {
    width: 36px;
    height: 36px;
  }
  .logbook-card-name {
    font-size: 0.85rem;
  }
  .logbook-card-status {
    font-size: 0.72rem;
  }

  /* Ending Screen */
  .ending-content {
    width: 92%;
    max-height: 94dvh;
    overflow-y: auto;
    padding: 16px 10px;
    -webkit-overflow-scrolling: touch;
  }
  .ending-badge {
    font-size: 3.5rem;
    margin-bottom: 6px;
  }
  .ending-content h2 {
    font-size: 1.5rem;
  }
  .ending-certificate {
    padding: 16px 12px;
  }
  .ending-certificate h3 {
    font-size: 1.25rem;
  }
  .ending-stats {
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
  }
  .stat-number {
    font-size: 1.9rem;
  }

  .narration-box {
    padding: 18px 14px;
    margin: 0 12px;
  }

  /* Audio Button Mobile */
  .audio-controls {
    top: 7px;
    right: 8px;
  }
  .btn-audio {
    width: 36px;
    height: 36px;
    padding: 0;
    touch-action: manipulation;
  }

  /* Tutorial on mobile */
  .tutorial-card {
    padding: 18px 14px;
    max-height: 90dvh;
    border-radius: 16px;
    -webkit-overflow-scrolling: touch;
  }
  .tutorial-steps-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 14px;
  }
  .tutorial-title {
    font-size: 1.25rem;
  }
  .tutorial-subtitle {
    font-size: 0.82rem;
  }
}

@media (max-width: 360px) {
  .fuel-bar-container {
    width: 55px;
  }
  .rover-grid {
    grid-template-columns: repeat(5, 42px);
  }
  .rover-cell {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }
}

/* ── Print Media Query for Certificate ─────────────────────── */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .audio-controls,
  .screen:not(#screen-ending),
  .stars-bg,
  .ending-badge,
  .ending-stats,
  .ending-content h2,
  .ending-content p#ending-text,
  button {
    display: none !important;
  }
  #screen-ending {
    display: flex !important;
    position: static !important;
    padding: 0 !important;
  }
  .ending-content {
    max-width: 100% !important;
    margin: 0 auto !important;
    border: none !important;
  }
  .ending-certificate {
    background: #ffffff !important;
    border: 4px double #d4af37 !important;
    color: #000000 !important;
    padding: 40px !important;
    margin: 20px auto !important;
    box-shadow: none !important;
  }
  .ending-certificate h3 {
    color: #0a183d !important;
    font-size: 2rem !important;
  }
  .ending-certificate p {
    color: #333333 !important;
  }
}
