:root {
  --bg: #0a0a0f;
  --bg-soft: #11111a;
  --panel: rgba(10, 10, 15, 0.88);
  --panel-strong: rgba(0, 0, 0, 0.32);
  --text: #ffffff;
  --text-muted: #98a2b3;
  --text-dim: #667085;
  --purple: #a855f7;
  --purple-strong: #7c3aed;
  --pink: #ec4899;
  --indigo: #6366f1;
  --teal: #14b8a6;
  --amber: #f59e0b;
  --red: #f87171;
  --border: rgba(255, 255, 255, 0.1);
  --border-purple: rgba(168, 85, 247, 0.28);
  --shadow: 0 0 60px rgba(168, 85, 247, 0.15);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.background-gradient,
.background-grid,
.particle-layer,
.orb {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.background-gradient {
  background: linear-gradient(135deg, rgba(59, 7, 100, 0.45), rgba(10, 10, 15, 0.95), rgba(80, 7, 36, 0.34));
}

.background-grid {
  background-image:
    linear-gradient(rgba(168, 85, 247, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
}

.particle-layer {
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  animation: float var(--float-duration) ease-in-out infinite alternate;
  animation-delay: var(--float-delay);
}

.orb {
  border-radius: 999px;
  filter: blur(120px);
}

.orb-left {
  top: 15%;
  left: -14rem;
  width: 26rem;
  height: 26rem;
  background: rgba(147, 51, 234, 0.22);
}

.orb-right {
  right: -14rem;
  bottom: 18%;
  width: 26rem;
  height: 26rem;
  background: rgba(219, 39, 119, 0.18);
}

.orb-center {
  top: 68%;
  left: 50%;
  width: 18rem;
  height: 18rem;
  transform: translateX(-50%);
  background: rgba(99, 102, 241, 0.16);
}

.content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 2rem 1rem 2.5rem;
}

.logo-wrap {
  margin: 1.5rem 0 2rem;
}

.logo {
  width: min(220px, 60vw);
  height: auto;
  display: block;
  filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.5));
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border-purple);
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.1);
  backdrop-filter: blur(12px);
  color: #d8b4fe;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.badge-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #c084fc;
  box-shadow: 0 0 18px rgba(192, 132, 252, 0.8);
  animation: pulse 1.8s ease-in-out infinite;
}

.hero {
  max-width: 56rem;
  text-align: center;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.96;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.headline-gradient {
  background: linear-gradient(90deg, #c084fc, #f472b6, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  max-width: 40rem;
  margin: 0 auto 2rem;
  color: var(--text-muted);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  line-height: 1.7;
}

.signup {
  width: 100%;
  max-width: 32rem;
  margin-bottom: 2.5rem;
}

.notify-form {
  display: flex;
  gap: 0.75rem;
}

.notify-form input {
  flex: 1;
  min-width: 0;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  backdrop-filter: blur(12px);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.notify-form input::placeholder {
  color: #6b7280;
}

.notify-form input:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.65);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.08);
}

.notify-form button,
.cta-button {
  border: 0;
  border-radius: var(--radius-md);
  padding: 0.95rem 1.4rem;
  background: linear-gradient(90deg, #7c3aed, #db2777);
  color: var(--text);
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
  box-shadow: 0 18px 30px rgba(76, 29, 149, 0.35);
}

.notify-form button:hover,
.cta-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 20px 34px rgba(76, 29, 149, 0.46);
}

.notify-form button:active,
.cta-button:active {
  transform: scale(0.98);
}

.notify-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 1.5rem;
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: var(--radius-xl);
  background: rgba(168, 85, 247, 0.1);
  backdrop-filter: blur(12px);
  text-align: center;
}

.success-icon {
  font-size: 2.5rem;
}

.success-title {
  margin: 0;
  color: #d8b4fe;
  font-size: 1.1rem;
  font-weight: 700;
}

.success-copy {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(100%, 48rem);
  margin-bottom: 1.5rem;
}

.divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.28), transparent);
}

.divider strong {
  color: #6b7280;
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.game-shell {
  width: min(100%, 52rem);
}

.game-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-purple);
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, rgba(88, 28, 135, 0.3), rgba(10, 10, 15, 0.95), rgba(131, 24, 67, 0.2));
  box-shadow: var(--shadow), 0 0 120px rgba(168, 85, 247, 0.08), inset 0 0 60px rgba(0, 0, 0, 0.5);
}

.scanlines {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.03;
  pointer-events: none;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255, 255, 255, 1) 2px, rgba(255, 255, 255, 1) 4px);
}

.game-header,
.game-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  background: rgba(0, 0, 0, 0.3);
}

.game-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.game-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.game-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.game-brand span:last-child {
  background: linear-gradient(90deg, #c084fc, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.game-stats,
.game-highscore {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.83rem;
}

.game-stats span,
.game-help,
.game-highscore span {
  color: var(--text-muted);
}

.game-stats strong {
  color: #d8b4fe;
}

#level-value {
  color: #f9a8d4;
}

#lives-value {
  color: var(--red);
}

#highscore-value {
  color: #fbbf24;
}

.game-canvas-wrap {
  position: relative;
  z-index: 2;
}

#game-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(8px);
}

.overlay-card {
  max-width: 25rem;
  text-align: center;
}

.overlay-icon {
  margin-bottom: 1rem;
  font-size: 4.5rem;
  animation: bounce 1.8s ease-in-out infinite;
}

.overlay h2 {
  margin: 0 0 0.7rem;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(90deg, #c084fc, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.overlay p {
  margin: 0;
  color: #d1d5db;
  font-size: 0.95rem;
  line-height: 1.7;
}

.enemy-row {
  color: #9ca3af;
}

kbd {
  display: inline-block;
  padding: 0.12rem 0.35rem;
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.08);
  color: #d8b4fe;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
}

.restart-button {
  margin-top: 15rem;
}

.game-help {
  font-size: 0.75rem;
}

.mobile-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.control-button {
  width: 4rem;
  height: 4rem;
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 1.6rem;
  user-select: none;
  touch-action: none;
  transition: background-color 160ms ease, transform 160ms ease;
}

.control-button:active,
.control-button.is-active {
  background: rgba(168, 85, 247, 0.22);
}

.fire-button {
  width: 5rem;
  height: 5rem;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(145deg, #7c3aed, #db2777);
  box-shadow: 0 18px 30px rgba(76, 29, 149, 0.35);
}

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin-top: 2.5rem;
  padding-bottom: 1rem;
  color: var(--text-dim);
  font-size: 0.875rem;
}

.footer-copy,
.footer-links {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.footer-icon {
  color: var(--purple);
}

.footer-links a {
  color: inherit;
  text-decoration: none;
  transition: color 160ms ease;
}

.footer-links a:hover {
  color: #c084fc;
}

@keyframes float {
  0% {
    transform: translateY(0) translateX(0);
  }

  100% {
    transform: translateY(-30px) translateX(10px);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(0.95);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@media (max-width: 900px) {
  .game-header,
  .game-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .game-stats {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

@media (max-width: 700px) {
  .content {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .notify-form {
    flex-direction: column;
  }

  .divider {
    gap: 0.75rem;
  }

  .divider strong {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
  }

  .overlay h2 {
    font-size: 1.7rem;
  }

  .restart-button {
    margin-top: 11rem;
  }

  .game-help {
    line-height: 1.5;
  }
}

@media (max-width: 560px) {
  .hero h1 {
    line-height: 1;
  }

  .game-stats,
  .game-highscore,
  .game-help {
    font-size: 0.74rem;
  }

  .control-button {
    width: 3.6rem;
    height: 3.6rem;
  }

  .fire-button {
    width: 4.5rem;
    height: 4.5rem;
  }
}