@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --ink: #0b0c12;
  --ink-soft: #15171f;
  --card: #1b1d27;
  --line: #2a2d3a;
  --paper: #eef0f4;
  --muted: #9a9db0;
  --amber: #ff9f1c;
  --amber-soft: rgba(255, 159, 28, 0.14);
  --mint: #43e6b5;
  --danger: #ff5d6c;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 159, 28, 0.10) 0, transparent 45%),
    radial-gradient(circle at 85% 100%, rgba(67, 230, 181, 0.08) 0, transparent 45%),
    var(--ink);
  color: var(--paper);
  font-family: "Inter", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  line-height: 1.5;
}

.page {
  width: 100%;
  max-width: 460px;
}

.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  text-align: center;
  margin-bottom: 10px;
}

h1 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(32px, 7vw, 44px);
  letter-spacing: -0.03em;
  text-align: center;
  margin: 0 0 10px;
}

.sub {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  max-width: 360px;
  margin: 0 auto 22px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.progress-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 64%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--amber), var(--mint));
  animation: creep 6s ease-in-out infinite alternate;
}
@keyframes creep {
  from { width: 58%; }
  to { width: 68%; }
}
.progress-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.6);
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  padding: 0 2px;
}
.hud .score {
  color: var(--paper);
  font-weight: 600;
  font-size: 15px;
}
.hud .score span { color: var(--amber); }
.lives-dots { letter-spacing: 3px; margin-left: 2px; }
.lives-dots .lost { opacity: 0.25; }

.game-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, #11131c 0%, #171a26 100%);
  border: 1px solid var(--line);
  touch-action: none;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(11, 12, 18, 0.97);
  backdrop-filter: blur(6px);
  padding: 20px;
}
.overlay[hidden] { display: none; }
.overlay h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.overlay p {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 0 16px;
  max-width: 260px;
}
.overlay .final-score {
  font-family: "JetBrains Mono", monospace;
  color: var(--amber);
  font-size: 13px;
  margin-bottom: 14px;
}

.btn {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: #10120a;
  background: linear-gradient(180deg, #ffb347, var(--amber));
  border: none;
  border-radius: 10px;
  padding: 11px 22px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 24px -10px rgba(255, 159, 28, 0.55);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}

.hint {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
  font-family: "JetBrains Mono", monospace;
}
.hint kbd {
  font-family: inherit;
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}

footer {
  text-align: center;
  margin-top: 26px;
  color: var(--muted);
  font-size: 12.5px;
}
footer a {
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
footer a:hover { border-color: var(--amber); color: var(--amber); }

@media (prefers-reduced-motion: reduce) {
  .progress-fill { animation: none; width: 64%; }
  .btn { transition: none; }
}

@media (max-width: 420px) {
  h1 { font-size: 30px; }
  .card { padding: 14px; border-radius: 16px; }
}
