:root {
  --bg: #07111f;
  --bg-secondary: #10213f;
  --panel: rgba(8, 18, 35, 0.8);
  --panel-strong: rgba(14, 28, 56, 0.92);
  --text: #ecf6ff;
  --muted: #9fb6ca;
  --line: rgba(141, 193, 255, 0.18);
  --cyan: #5de4ff;
  --lime: #b8ff66;
  --orange: #ff8e3c;
  --pink: #ff5da8;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Chakra Petch", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(93, 228, 255, 0.12), transparent 30%),
    radial-gradient(circle at 85% 10%, rgba(255, 142, 60, 0.18), transparent 22%),
    linear-gradient(180deg, #050b15, #07111f 45%, #0b1830);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent);
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero,
.info-grid,
.game-section,
.powerup-section {
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 28px;
}

.hero-copy,
.hero-card,
.info-panel,
.game-frame,
.hud-panel,
.powerup-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-card,
.info-panel,
.hud-panel {
  border-radius: 28px;
  padding: 28px;
}

.eyebrow,
.panel-label,
.overlay-label,
.hero-stat-label,
.hud-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--cyan);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  line-height: 1.02;
}

h1 {
  font-size: clamp(3rem, 7vw, 5.8rem);
  max-width: 10ch;
  margin: 12px 0 16px;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  margin-bottom: 12px;
}

h3 {
  font-size: 1.25rem;
}

.hero-text,
.info-panel p,
.powerup-card p,
#overlayText {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: #04111a;
  background: linear-gradient(135deg, var(--lime), #fff37b);
  box-shadow: 0 14px 28px rgba(184, 255, 102, 0.25);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-card {
  display: grid;
  gap: 18px;
  align-content: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent),
    linear-gradient(135deg, rgba(255, 93, 168, 0.16), rgba(93, 228, 255, 0.12));
}

.hero-stat {
  padding: 18px;
  border-radius: 20px;
  background: rgba(5, 12, 24, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.25rem;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 24px;
  margin-bottom: 28px;
}

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

.controls-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.controls-list span {
  color: var(--muted);
}

.game-section,
.powerup-section {
  margin-top: 28px;
}

.section-heading {
  margin-bottom: 18px;
}

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

.game-frame {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  background: var(--panel-strong);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 10, 19, 0.66);
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  width: min(90%, 360px);
  padding: 28px;
  border-radius: 28px;
  background: rgba(6, 14, 28, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.overlay-card h3 {
  margin: 10px 0 14px;
}

.hud-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.hud-block {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hud-block strong {
  display: block;
  margin-top: 8px;
  font-size: 1.85rem;
  font-family: "Orbitron", sans-serif;
}

.hud-block.full strong {
  font-size: 1.1rem;
}

.timer-bar {
  margin-top: 12px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.timer-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  transition: width 120ms linear;
}

.powerup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.powerup-card {
  border-radius: 28px;
  padding: 24px;
  min-height: 220px;
}

.powerup-card h3 {
  margin: 12px 0;
}

.powerup-icon {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  font-size: 1.9rem;
  font-weight: 700;
}

.powerup-card.shield .powerup-icon {
  color: #09121c;
  background: linear-gradient(135deg, var(--lime), #ddff9f);
}

.powerup-card.slow .powerup-icon {
  color: #081420;
  background: linear-gradient(135deg, var(--cyan), #94f2ff);
}

.powerup-card.jump .powerup-icon {
  color: #220b04;
  background: linear-gradient(135deg, var(--orange), #ffc26c);
}

@media (max-width: 980px) {
  .hero,
  .info-grid,
  .game-layout,
  .powerup-grid {
    grid-template-columns: 1fr;
  }

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

  .hud-block.full,
  .hud-panel .button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 18px;
  }

  .hero-copy,
  .hero-card,
  .info-panel,
  .hud-panel,
  .powerup-card {
    padding: 20px;
    border-radius: 22px;
  }

  h1 {
    font-size: 2.8rem;
  }

  .hero-text,
  .info-panel p,
  .powerup-card p,
  #overlayText {
    font-size: 0.98rem;
  }

  .hud-panel {
    grid-template-columns: 1fr;
  }
}
