.hero { text-align: center; padding: 16px 0; }
.hero h1 {
  font-size: clamp(36px, 8vw, 60px);
  font-weight: 900;
  color: var(--red);
  text-shadow: 3px 3px 0 var(--gold), 6px 6px 0 var(--ink);
  letter-spacing: 3px;
  transform: rotate(-1deg);
  line-height: 1;
}
.tagline { color: var(--ink-2); font-weight: 700; margin-top: 6px; font-size: 14px; }

.game-wrap {
  max-width: 500px;
  margin: 16px auto 0;
  position: relative;
}

.hud {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.pill {
  background: rgba(0,0,0,0.8);
  color: var(--cream);
  padding: 7px 12px;
  border-radius: 999px;
  border: 2px solid var(--gold);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
}
.pill--combo { background: var(--red); border-color: var(--red-d); }
.pill--progress {
  flex: 1;
  min-width: 80px;
  background: rgba(0,0,0,0.5);
  padding: 0;
  height: 16px;
  position: relative;
  overflow: hidden;
  border: 2px solid var(--gold);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffdd55, #ff6600);
  transition: width 0.15s linear;
}

#game {
  display: block;
  width: 100%;
  /* Shorter aspect so the hit line always fits above the lane buttons */
  aspect-ratio: 3 / 4;
  max-height: 55vh;
  background: #1a1028;
  border: 4px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow-hard);
  touch-action: none;
}

.lane-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.lane-btn {
  padding: 18px 0;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 12px;
  font-family: inherit;
  font-size: 28px;
  font-weight: 900;
  color: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  user-select: none;
  transition: transform 0.05s, box-shadow 0.05s, background 0.1s;
}
.lane-btn:active,
.lane-btn.active {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--ink);
  background: var(--gold);
}
.lane-btn[data-lane="0"] { border-color: #e53935; color: #e53935; }
.lane-btn[data-lane="1"] { border-color: #f4c542; color: #a87a00; }
.lane-btn[data-lane="2"] { border-color: #2e7a2e; color: #2e7a2e; }

.hint {
  text-align: center;
  color: var(--ink-2);
  font-size: 12px;
  opacity: 0.75;
  margin-top: 8px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
}
.overlay[hidden] { display: none; }
.panel {
  background: var(--paper);
  border: 5px solid var(--red);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  padding: 28px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.panel h2 {
  font-size: 30px;
  color: var(--red);
  text-shadow: 2px 2px 0 var(--gold);
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.panel p { color: var(--ink-2); margin: 6px 0; line-height: 1.5; }
.panel .zx-btn { display: block; width: 100%; margin-top: 10px; }
.big-score {
  font-size: 56px;
  font-weight: 900;
  color: var(--red);
  text-shadow: 3px 3px 0 var(--ink);
  margin: 14px 0;
  line-height: 1;
}

.diff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 16px 0;
}
.diff-btn {
  padding: 16px 6px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  font-family: inherit;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.1s, box-shadow 0.1s;
}
.diff-btn small { font-size: 10px; font-weight: 500; opacity: 0.75; }
.diff-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--ink); }
.diff-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.diff-btn--easy   { background: #7dd87d; color: var(--ink); }
.diff-btn--medium { background: var(--gold); color: var(--ink); }
.diff-btn--hard   { background: var(--red); color: white; }

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}
.stat {
  background: white;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 10px 4px;
  box-shadow: 0 2px 0 var(--ink);
}
.stat b { display: block; font-size: 22px; color: var(--red); }
.stat span { font-size: 10px; color: #666; letter-spacing: 1px; }
.rank-line { font-size: 16px; font-weight: 700; margin: 10px 0; }
.rank-line b { color: var(--gold); font-size: 24px; text-shadow: 1px 1px 0 var(--ink); }
