:root {
  --bg: #07080d;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #f87171;
  --ink: #f8fafc;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(248, 113, 113, 0.16), transparent 46%),
    linear-gradient(180deg, #07080d, #111827 60%, #1c1917);
  user-select: none;
  touch-action: manipulation;
}

.header { text-align: center; padding: 1rem 1rem 0.25rem; }
.header h1 { margin: 0.2rem 0; color: var(--accent); letter-spacing: 0.02em; }
.header p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.back { color: var(--muted); text-decoration: none; font-size: 0.9rem; }

.hud {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin: 0.5rem 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.hud strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.stage {
  position: relative;
  width: min(960px, 96vw);
  margin: 0 auto 1.5rem;
}

#game {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid #3f1d1d;
  background: #0b1020;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.2rem;
  text-align: center;
  background: rgba(2, 6, 23, 0.84);
  border-radius: 16px;
  z-index: 3;
}
.overlay.hidden { display: none; }
#overlay-title { margin: 0; font-size: 1.55rem; color: var(--accent); }
.hint {
  margin: 0;
  max-width: 32rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
#start {
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.4rem;
  background: #f87171;
  color: #1c0a0a;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
