:root {
  --bg-top: #08111f;
  --bg-bottom: #132743;
  --panel: rgba(8, 17, 31, 0.72);
  --panel-border: rgba(149, 204, 255, 0.2);
  --text: #eef7ff;
  --muted: #9cb4cb;
  --accent: #7cf2c8;
  --accent-2: #ffd166;
  --danger: #ff5d73;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Chakra Petch", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(124, 242, 200, 0.16), transparent 28%),
    radial-gradient(circle at 20% 20%, rgba(255, 209, 102, 0.18), transparent 18%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    radial-gradient(circle at 15% 25%, rgba(255, 255, 255, 0.12) 0 2px, transparent 2px),
    radial-gradient(circle at 70% 18%, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px),
    radial-gradient(circle at 82% 32%, rgba(255, 255, 255, 0.15) 0 2px, transparent 2px),
    radial-gradient(circle at 58% 74%, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px);
}

body::after {
  background:
    linear-gradient(120deg, rgba(124, 242, 200, 0.08), transparent 45%),
    linear-gradient(300deg, rgba(255, 93, 115, 0.08), transparent 40%);
}

.shell {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 0;
}

.hero-panel {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy,
.game-frame {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-copy {
  border-radius: 28px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.8rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  line-height: 0.92;
}

.intro {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 1.05rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.controls span,
.pill {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.controls span {
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--text);
}

.game-frame {
  position: relative;
  border-radius: 32px;
  padding: 18px;
  overflow: hidden;
}

canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  display: block;
  background: linear-gradient(180deg, #14345e 0%, #285b7d 48%, #6ca5b8 100%);
}

.hud {
  position: absolute;
  top: 32px;
  left: 32px;
  right: 32px;
  display: flex;
  gap: 12px;
  pointer-events: none;
}

.pill {
  min-width: 132px;
  border-radius: 18px;
  padding: 10px 14px;
}

.label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.pill strong {
  font-size: 1.5rem;
}

.energy-pill {
  min-width: 200px;
}

.energy-bar {
  height: 12px;
  margin-top: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

#energyFill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 140ms linear, filter 140ms linear;
}

.overlay {
  position: absolute;
  inset: 18px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(8, 17, 31, 0.18), rgba(8, 17, 31, 0.72));
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-card {
  width: min(420px, calc(100% - 32px));
  padding: 28px;
  border-radius: 28px;
  text-align: center;
  background: rgba(10, 18, 32, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.overlay-card p {
  margin: 0;
}

.overlay-card h2 {
  margin: 10px 0 14px;
  font-size: clamp(2rem, 4vw, 3rem);
}

#overlayText {
  color: var(--muted);
  line-height: 1.5;
}

button {
  margin-top: 20px;
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 700;
  color: #08111f;
  background: linear-gradient(135deg, var(--accent), #b4ffde);
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

button:active {
  transform: translateY(1px);
}

@media (max-width: 980px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    gap: 18px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 18px, 100%);
    padding: 10px 0 18px;
  }

  .hero-copy,
  .game-frame {
    border-radius: 22px;
  }

  .hero-copy {
    padding: 22px;
  }

  .game-frame {
    padding: 10px;
  }

  .hud {
    top: 20px;
    left: 20px;
    right: 20px;
    flex-wrap: wrap;
  }

  .pill {
    min-width: 0;
    flex: 1 1 130px;
  }

  .energy-pill {
    flex-basis: 100%;
  }
}
