:root {
  --bg-0: #09051d;
  --bg-1: #130a38;
  --bg-2: #24105c;
  --panel: rgba(18, 11, 48, 0.76);
  --panel-solid: #211047;
  --text: #fff7ff;
  --muted: #c9bdf6;
  --accent: #7df9ff;
  --accent-2: #ffcf5f;
  --danger: #ff6685;
  --good: #82ffb2;
  --shadow: rgba(0, 0, 0, 0.35);
  --radius-xl: 28px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 18%, rgba(125, 249, 255, 0.2), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(255, 207, 95, 0.18), transparent 26%),
    linear-gradient(135deg, var(--bg-0), var(--bg-1) 50%, var(--bg-2));
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  touch-action: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  cursor: pointer;
}

.game-shell {
  min-height: 100dvh;
  width: min(100vw, 1180px);
  margin: 0 auto;
  padding: clamp(10px, 2.2vw, 22px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(10px, 1.8vw, 18px);
}

.top-hud,
.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.nova-badge {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background:
    radial-gradient(circle at 35% 28%, #fff, var(--accent) 30%, #7657ff 62%, #2c166d);
  box-shadow: 0 14px 28px var(--shadow), 0 0 26px rgba(125, 249, 255, 0.4);
  color: #170a37;
  font-size: 28px;
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(20px, 4vw, 34px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.stats {
  display: flex;
  gap: 8px;
}

.stat-card {
  min-width: 82px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.18);
  text-align: center;
  backdrop-filter: blur(14px);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-card strong {
  display: block;
  margin-top: 2px;
  color: #fff;
  font-size: clamp(17px, 3vw, 23px);
  line-height: 1.1;
}

.stage-wrap {
  position: relative;
  min-height: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.03));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(255,255,255,0.16);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  background: #09051d;
}

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: 18px;
  background: linear-gradient(180deg, rgba(9, 5, 29, 0.32), rgba(9, 5, 29, 0.84));
  backdrop-filter: blur(6px);
}

.overlay.is-visible {
  display: grid;
}

.panel {
  width: min(92vw, 560px);
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 15% 10%, rgba(125, 249, 255, 0.22), transparent 34%),
    radial-gradient(circle at 90% 0%, rgba(255, 207, 95, 0.18), transparent 30%),
    var(--panel);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  text-align: center;
}

.panel-kicker {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-size: 12px;
}

.panel h2 {
  margin: 0;
  font-size: clamp(26px, 5vw, 44px);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.panel p:not(.panel-kicker) {
  margin: 14px auto 0;
  max-width: 45ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 22px 0;
}

.controls-grid span {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #e8ddff;
  font-size: 12px;
  font-weight: 700;
}

.button-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.ghost-button,
.pause-button,
.touch-button {
  min-height: 44px;
  border-radius: 999px;
  font-weight: 900;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.primary-button:hover,
.ghost-button:hover,
.pause-button:hover,
.touch-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.primary-button {
  padding: 12px 22px;
  background: linear-gradient(135deg, #fff2a4, var(--accent-2) 42%, #ff8a4b);
  color: #321303;
  box-shadow: 0 14px 32px rgba(255, 207, 95, 0.22);
}

.ghost-button,
.pause-button {
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.bottom-bar {
  justify-content: center;
}

.touch-button {
  width: 72px;
  background: linear-gradient(135deg, rgba(125, 249, 255, 0.28), rgba(118, 87, 255, 0.28));
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

.pause-button {
  min-width: 116px;
}

@media (max-width: 720px) {
  .game-shell {
    padding: 10px;
    gap: 8px;
  }

  .top-hud {
    align-items: flex-start;
  }

  .nova-badge {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    font-size: 24px;
  }

  .stats {
    gap: 6px;
  }

  .stat-card {
    min-width: 60px;
    padding: 8px;
    border-radius: 13px;
  }

  .stat-card span {
    font-size: 9px;
  }

  canvas {
    min-height: 0;
    height: calc(100dvh - 148px);
  }

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

  .bottom-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  .touch-button {
    width: 100%;
  }
}

@media (max-width: 440px) {
  .brand-lockup h1 {
    max-width: 130px;
  }

  .eyebrow {
    display: none;
  }

  .stat-card {
    min-width: 54px;
  }
}
