/* style.css — all styling */
:root {
  color-scheme: dark;
  --bg: #0b1220;
  --bg-2: #0f1a2e;
  --fg: #e2e8f0;
  --muted: #64748b;
  --accent: #22d3ee;
  --accent-2: #5eead4;
  --danger: #f43f5e;
  --panel: rgba(15, 26, 46, 0.92);
  --border: rgba(94, 234, 212, 0.18);
  --glow: rgba(34, 211, 238, 0.35);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f7;
  --bg-2: #e2e8f0;
  --fg: #0f172a;
  --muted: #64748b;
  --accent: #0891b2;
  --accent-2: #0d9488;
  --danger: #e11d48;
  --panel: rgba(255, 255, 255, 0.95);
  --border: rgba(13, 148, 136, 0.25);
  --glow: rgba(8, 145, 178, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

body { overflow: hidden; }

#root {
  height: 100%;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(34,211,238,0.08), transparent 60%),
    radial-gradient(900px 500px at 50% 110%, rgba(94,234,212,0.06), transparent 60%),
    var(--bg);
}

/* HUD */
.hud {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 18px 6px;
  gap: 12px;
}
.stat { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.stat-right { align-items: flex-end; }
.stat-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.stat-right .stat-value { color: var(--accent-2); }
.title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  text-shadow: 0 0 18px var(--glow);
}

/* Stage */
.stage {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
}
canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* Overlay */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(2,6,23,0.55), rgba(2,6,23,0.85));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.25s ease;
  z-index: 5;
}
.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 30px 24px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45), 0 0 40px var(--glow) inset;
  max-width: 86vw;
  width: 320px;
}
.panel-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--fg);
  margin-bottom: 6px;
}
.panel-sub {
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
  margin-bottom: 18px;
}

.cta {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 13px 28px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #042f2e;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(34,211,238,0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.cta:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 14px 30px rgba(34,211,238,0.45); }
.cta:active { transform: translateY(1px) scale(0.98); }
.cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.hint {
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Footer */
.foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 18px 16px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.foot .dot-sep { opacity: 0.5; }
#streakInfo { color: var(--accent-2); font-weight: 700; }

/* Small screens */
@media (max-width: 380px) {
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 9px; }
  .title { font-size: 12px; letter-spacing: 0.24em; }
  .panel { padding: 22px 22px 20px; }
  .panel-title { font-size: 22px; }
}
