:root {
  --bg: #0b0f1a;
  --bg-deep: #060811;
  --grid: rgba(255, 255, 255, 0.04);
  --glass: rgba(255, 255, 255, 0.05);
  --neon-cyan: #00eaff;
  --neon-magenta: #ff00ff;
  --neon-lime: #b0ff00;
  --neon-yellow: #ffe800;
  --neon-orange: #ff7a00;
  --text: #e6f1ff;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Orbitron', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 800px at 30% 20%, #0f1830 0%, var(--bg) 40%, var(--bg-deep) 100%);
  background-attachment: fixed;
  overflow: hidden;
}

#app {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
}

.glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255,255,255,0.06);
  backdrop-filter: blur(10px) saturate(140%);
}

#hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px;
  padding: 12px 16px;
}

#hud .brand {
  font-family: 'Audiowide', cursive;
  letter-spacing: 2px;
  font-size: 20px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(0, 234, 255, 0.8), 0 0 20px rgba(0, 234, 255, 0.4);
}

#hud .hud-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.divider {
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,0.18);
}

#stage-wrap {
  position: relative;
  margin: 0 auto 16px;
  border-radius: 16px;
  overflow: hidden;
  background: radial-gradient(800px 600px at 60% 60%, rgba(0, 234, 255, 0.06) 0%, rgba(255, 0, 255, 0.06) 40%, transparent 70%),
              linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.45), 0 10px 40px rgba(0, 0, 0, 0.35);
  width: 1024px;
  height: 768px;
}

#grid-overlay {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px),
                    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  mix-blend-mode: screen;
}

#gameCanvas {
  display: block;
  width: 1024px;
  height: 768px;
}

#stage-hud {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 44px;
  display: grid;
  grid-template-columns: 200px 1fr 200px;
  align-items: center;
  padding: 8px 10px;
  pointer-events: none;
}

#stage-hud .corner {
  font-size: 14px;
  padding: 6px 10px;
  justify-self: start;
  pointer-events: auto;
}
#stage-hud .corner.right { justify-self: end; }

.stage-title {
  justify-self: center;
  font-family: 'Audiowide', cursive;
  letter-spacing: 2px;
  font-size: 18px;
  text-shadow: 0 0 8px rgba(255,0,255,0.8), 0 0 20px rgba(255,0,255,0.4);
}

#overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(100% 100% at 50% 50%, rgba(6, 8, 17, 0.35) 0%, rgba(6,8,17,0.75) 60%, rgba(6,8,17,0.9) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

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

.overlay-inner {
  text-align: center;
  padding: 28px 24px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255,255,255,0.03));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.title {
  font-family: 'Audiowide', cursive;
  margin: 0 0 10px;
  font-size: 42px;
  letter-spacing: 1px;
}

.subtitle {
  margin: 0 0 18px;
  opacity: 0.85;
}

.controls {
  display: grid;
  gap: 6px;
  margin: 10px 0 20px;
  opacity: 0.9;
}

.key {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.06);
}

.btn {
  cursor: pointer;
  font: inherit;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.neon {
  color: var(--neon-magenta);
  text-shadow:
    0 0 6px rgba(255,0,255,0.9),
    0 0 16px rgba(255,0,255,0.7),
    0 0 32px rgba(255,0,255,0.35);
}

#help {
  margin: 0 16px 16px;
  padding: 10px 14px;
  text-align: center;
}

/* Responsive */
@media (max-width: 900px) {
  #hud { margin: 10px; }
  #stage-wrap { margin: 0 10px 10px; }
  #help { margin: 0 10px 10px; }
  .title { font-size: 34px; }
}


