@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Rajdhani:wght@400;500;600;700&display=swap');

:root {
  --bg: #070a1c;
  --panel: #101632;
  --panel2: #151e40;
  --cyan: #35f5ff;
  --purple: #a66bff;
  --pink: #ff45bd;
  --green: #65ffb0;
  --red: #ff526f;
  --white: #effaff;
  --muted: #9baac9;
  --ship-a: #35f5ff;
  --ship-b: #a66bff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 20% 0%, #182451 0%, transparent 45%),
    radial-gradient(ellipse at 90% 30%, #24113e 0%, transparent 40%),
    var(--bg);
  color: var(--white);
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.topbar {
  min-height: 76px;
  padding: 12px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid #26365e;
  background: #080d22eF;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.brand {
  color: var(--cyan);
  text-decoration: none;
  font-family: Orbitron, sans-serif;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 2px;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 4px;
  margin-left: 34px;
}

.brand-mark {
  font-size: 27px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.navlink {
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 700;
  transition: .2s;
}

.navlink:hover,
.navlink.active {
  color: var(--cyan);
  background: #35f5ff12;
  border-color: #35f5ff55;
}

.menu-toggle {
  display: none;
  color: var(--cyan);
  background: transparent;
  border: 1px solid #35f5ff66;
  border-radius: 8px;
  padding: 7px 12px;
}

.page {
  display: none;
  width: min(1200px, 92%);
  min-height: 75vh;
  margin: 0 auto;
  padding: 65px 0;
}

.page.active {
  display: block;
  animation: appear .35s ease;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1,
h2,
h3 {
  font-family: Orbitron, sans-serif;
}

h1 {
  font-size: clamp(35px, 6vw, 72px);
  line-height: 1.13;
  margin: 15px 0;
  letter-spacing: 2px;
}

h1 span {
  color: var(--cyan);
  text-shadow: 0 0 25px #35f5ff66;
}

h2 {
  font-size: clamp(25px, 4vw, 38px);
}

h3 {
  font-size: 17px;
}

.eyebrow {
  color: var(--pink);
  font-family: Orbitron, sans-serif;
  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 800;
}

.muted,
.tiny {
  color: var(--muted);
}

.tiny {
  font-size: 14px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  align-items: center;
  gap: 40px;
  min-height: 510px;
}

.tagline {
  color: var(--cyan);
  font-size: 21px;
  font-weight: 700;
}

.tagline span {
  color: var(--pink);
  padding: 0 8px;
}

.primary {
  border: 0;
  border-radius: 9px;
  padding: 14px 24px;
  margin-top: 16px;
  color: #06101e;
  background: linear-gradient(100deg, var(--cyan), #9effff);
  font-family: Orbitron, sans-serif;
  font-weight: 900;
  letter-spacing: 1px;
  box-shadow: 0 0 22px #35f5ff55;
  transition: .2s;
}

.primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 35px #35f5ff99;
}

.ship-stage {
  height: 390px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.hero-ship {
  position: relative;
  width: 125px;
  height: 145px;
  z-index: 1;
  font-size: 0;
  background: linear-gradient(
    90deg,
    #743cff,
    #35f5ff,
    #ffffff,
    #35f5ff,
    #743cff
  );
  clip-path: polygon(
    50% 0,
    66% 35%,
    100% 85%,
    67% 75%,
    50% 100%,
    33% 75%,
    0 85%,
    34% 35%
  );
  filter: drop-shadow(0 0 12px var(--cyan))
          drop-shadow(0 0 25px var(--purple));
  animation: shipFloat 2.5s ease-in-out infinite;
}

.hero-ship::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 40px;
  left: 50%;
  top: 25%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px var(--cyan), 0 0 25px var(--cyan);
}

.hero-ship::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 25px;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  background: var(--pink);
  filter: blur(7px);
}

@keyframes shipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.orbit {
  position: absolute;
  width: 290px;
  height: 100px;
  border: 1px solid #35f5ff66;
  border-radius: 50%;
  transform: rotate(-25deg);
  box-shadow: 0 0 15px #35f5ff33;
}

.orbit.o2 {
  width: 360px;
  height: 150px;
  transform: rotate(35deg);
  border-color: #a66bff66;
}

.stage-caption {
  position: absolute;
  bottom: 20px;
  color: var(--muted);
  font: 10px Orbitron, sans-serif;
  letter-spacing: 2px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 35px;
}

.feature-grid article,
.panel,
.side-panel {
  background: linear-gradient(145deg, #121b3b, #0c1229);
  border: 1px solid #293b68;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 10px 35px #0003;
}

.feature-grid article > b {
  font-size: 30px;
  color: var(--cyan);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
}

.pill {
  border: 1px solid #35f5ff55;
  color: var(--cyan);
  border-radius: 30px;
  padding: 7px 12px;
  font-size: 12px;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 20px;
}

.game-shell {
  min-width: 0;
  background: #080d21;
  border: 1px solid #344775;
  border-radius: 14px;
  overflow: hidden;
}

.game-hud {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  padding: 13px 5px;
  background: #121a38;
  color: var(--muted);
  font-family: Orbitron, sans-serif;
  font-size: 11px;
}

.game-hud b {
  color: var(--cyan);
  display: block;
  font-size: 19px;
  margin-top: 5px;
}

.arena {
  width: 100%;
  height: 550px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 15%, #182d59 0%, transparent 50%),
    linear-gradient(#090e25, #080a19);
  touch-action: none;
}

.arena::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image:
    radial-gradient(2px 2px at 10% 15%, white 50%, transparent 100%),
    radial-gradient(1px 1px at 80% 20%, white 50%, transparent 100%),
    radial-gradient(2px 2px at 45% 60%, white 50%, transparent 100%),
    radial-gradient(1px 1px at 25% 80%, white 50%, transparent 100%),
    radial-gradient(2px 2px at 90% 75%, white 50%, transparent 100%);
  background-size: 170px 170px;
  animation: starMove 12s linear infinite;
  pointer-events: none;
}

@keyframes starMove {
  to { background-position: 0 170px; }
}

.galaxy-label {
  position: absolute;
  z-index: 1;
  top: 13px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--cyan);
  font: 10px Orbitron, sans-serif;
  letter-spacing: 2px;
  white-space: nowrap;
}

.question {
  position: absolute;
  top: 48px;
  left: 0;
  width: 100%;
  text-align: center;
  font: 700 27px Orbitron, sans-serif;
  color: white;
  text-shadow: 0 0 15px var(--cyan);
}

.lane {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 33.333%;
  border-left: 1px solid #35f5ff12;
}

.lane0 { left: 0; }
.lane1 { left: 33.333%; }
.lane2 { left: 66.666%; }

.answer-tile {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 70px;
  padding: 13px 12px;
  text-align: center;
  border: 2px solid var(--cyan);
  border-radius: 12px;
  background: #101b3b;
  color: white;
  font: 700 21px Orbitron, sans-serif;
  box-shadow: 0 0 18px #35f5ff66;
  transition: top .03s linear;
}
.ship {
  position: absolute;
  width: 45px;
  height: 50px;
  left: calc(50% - 22px);
  bottom: 48px;
  z-index: 5;
  background: linear-gradient(90deg, var(--ship-a), white, var(--ship-b));
  clip-path: polygon(50% 0, 67% 48%, 100% 90%, 65% 78%, 50% 100%, 35% 78%, 0 90%, 33% 48%);
  filter: drop-shadow(0 0 8px var(--ship-a));
}

.cockpit {
  position: absolute;
  top: 15px;
  left: 17px;
  width: 11px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 10px var(--cyan);
}

.flame {
  position: absolute;
  bottom: -12px;
  left: 17px;
  width: 11px;
  height: 16px;
  background: var(--pink);
  filter: blur(5px);
}

.laser {
  position: absolute;
  width: 4px;
  height: 19px;
  border-radius: 5px;
  background: white;
  box-shadow: 0 0 10px var(--cyan), 0 0 20px var(--cyan);
  z-index: 4;
}

.toast {
  position: absolute;
  top: 105px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  color: var(--green);
  font: 700 14px Orbitron, sans-serif;
  text-shadow: 0 0 12px currentColor;
  pointer-events: none;
}

.overlay,
.transition {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
  background: #05091adf;
  backdrop-filter: blur(6px);
}

.overlay h2,
.transition h2 {
  color: var(--cyan);
  font-size: 24px;
}

.overlay p,
.transition p {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.transition {
  z-index: 8;
  background: #080d24ed;
}

.portal {
  font-size: 60px;
  color: var(--pink);
  text-shadow: 0 0 30px var(--purple);
  animation: spin 3s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#transitionTimer {
  color: var(--cyan);
  font: 900 35px Orbitron, sans-serif;
}

.game-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  background: #101832;
}

.game-controls button,
.ship-arrow {
  border: 1px solid #35f5ff66;
  border-radius: 8px;
  padding: 9px 16px;
  color: var(--cyan);
  background: #101c3c;
}

.game-controls button:hover,
.ship-arrow:hover {
  background: #20345d;
}

.game-controls .touch {
  display: none;
}

.game-controls .fire {
  color: #06101e;
  background: var(--pink);
  border-color: var(--pink);
  font-weight: 900;
}

.side-panel h3 {
  color: var(--cyan);
}

.side-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.stat {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #293b68;
}

.stat b {
  color: var(--cyan);
}

.table-head,
.score-row {
  display: grid;
  grid-template-columns: .5fr 2fr 1fr;
  gap: 10px;
  padding: 13px;
}

.table-head {
  color: var(--cyan);
  font: 11px Orbitron, sans-serif;
}

.score-row {
  border-top: 1px solid #293b68;
}

.score-row span:last-child {
  color: var(--green);
  font-weight: 700;
}

.hangar-showcase {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 40px 0;
}

.hangar-grid {
  width: min(500px, 75%);
}

.ship-card {
  min-height: 260px;
  padding: 25px;
  border: 1px solid #35f5ff66;
  border-radius: 15px;
  background: linear-gradient(145deg, #18254a, #0b1026);
  text-align: center;
}

.ship-preview {
  width: 90px;
  height: 105px;
  margin: 10px auto 25px;
  background: linear-gradient(90deg, var(--ship-a), white, var(--ship-b));
  clip-path: polygon(50% 0, 67% 48%, 100% 90%, 65% 78%, 50% 100%, 35% 78%, 0 90%, 33% 48%);
  filter: drop-shadow(0 0 15px var(--ship-a));
  font-size: 50px;
}

.ship-card h3 {
  color: var(--cyan);
}

.ship-card p {
  color: var(--muted);
}

.ship-card button {
  border: 0;
  border-radius: 8px;
  padding: 10px 20px;
  background: var(--cyan);
  font-weight: 900;
}

.ship-card button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.profile-panel {
  max-width: 650px;
}

label {
  display: block;
  margin: 15px 0;
  color: var(--cyan);
  font-weight: 700;
}

input:not([type="checkbox"]):not([type="range"]) {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid #344775;
  border-radius: 8px;
  color: white;
  background: #080d21;
}

.settings-panel {
  max-width: 650px;
}

input[type="range"] {
  display: block;
  width: 100%;
  accent-color: var(--cyan);
}

.check {
  display: flex;
  align-items: center;
  gap: 12px;
}

.check input {
  accent-color: var(--cyan);
  width: 18px;
  height: 18px;
}

.danger {
  padding: 11px 16px;
  border: 1px solid var(--red);
  border-radius: 8px;
  color: var(--red);
  background: #ff526f12;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 15px;
}

.achievement {
  padding: 20px;
  background: var(--panel);
  border: 1px solid #293b68;
  border-radius: 12px;
}

.achievement.unlocked {
  border-color: var(--green);
  box-shadow: 0 0 15px #65ffb022;
}

.achievement b {
  color: var(--cyan);
  font-size: 24px;
}

.achievement p {
  color: var(--muted);
}

footer {
  padding: 28px 5%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  border-top: 1px solid #293b68;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

footer b {
  color: var(--cyan);
}

@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
  }

  .menu-toggle {
    display: block;
  }

  nav {
    display: none;
    width: 100%;
    flex-direction: column;
  }

  nav.open {
    display: flex;
  }

  .navlink {
    text-align: left;
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .ship-stage {
    height: 300px;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .side-panel {
    order: 2;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .page {
    width: 94%;
    padding: 35px 0;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .game-hud {
    font-size: 9px;
  }

  .arena {
    height: 490px;
  }

  .game-controls .touch {
    display: inline-block;
    min-width: 58px;
    min-height: 44px;
  }

  .game-controls {
    gap: 7px;
  }

  .question {
    font-size: 22px;
  }

  .answer-tile {
    font-size: 17px;
    min-width: 55px;
    padding: 10px 7px;
  }

  .hangar-showcase {
    gap: 8px;
  }

  .ship-arrow {
    padding: 9px;
  }

  .hero {
    gap: 5px;
  }

  footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}