:root {
  --bg: #09111f;
  --panel: rgba(10, 18, 36, 0.78);
  --panel-strong: rgba(13, 24, 48, 0.94);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f6f4ed;
  --muted: rgba(246, 244, 237, 0.72);
  --accent: #ff8a5b;
  --accent-2: #63d6ff;
  --good: #71e4a1;
  --danger: #ff6363;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at top, rgba(255, 138, 91, 0.16), transparent 24%),
    radial-gradient(circle at 80% 10%, rgba(99, 214, 255, 0.14), transparent 22%),
    linear-gradient(180deg, #0b1220 0%, #07101a 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  overflow: hidden;
}

button {
  font: inherit;
}

.shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  padding: 16px;
}

.topbar, .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--accent-2);
  font-size: 0.78rem;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: clamp(1.5rem, 2.8vw, 2.5rem);
  line-height: 1;
}

.hud {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hud > div,
.controls-card {
  min-width: 110px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hud span,
.controls-card span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hud strong,
.controls-card strong {
  font-size: 0.98rem;
}

.game-wrap {
  position: relative;
  min-height: 0;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow);
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  background:
    radial-gradient(circle at 50% 20%, rgba(99, 214, 255, 0.08), transparent 26%),
    linear-gradient(180deg, #10192b 0%, #0b1120 100%);
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(6, 10, 18, 0.72);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

.panel {
  width: min(560px, 100%);
  padding: 24px;
  border-radius: 22px;
  background: var(--panel-strong);
  border: 1px solid rgba(255,255,255,0.12);
  text-align: center;
}

.overlay-kicker {
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-size: 0.75rem;
}

.panel h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: 10px;
}

.panel p {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.primary-btn,
.game-over-button {
  border: 0;
  padding: 12px 18px;
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #ffb36d);
  color: #111;
  font-weight: 800;
}

.footer {
  gap: 12px;
}

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

  .topbar, .footer {
    flex-direction: column;
    align-items: stretch;
  }

  .hud {
    justify-content: flex-start;
  }

  .controls-card {
    min-width: 0;
  }
}
