.app {
  position: relative;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 52px);
  overflow: hidden;
  max-width: 480px;
}

/* ── HUD ── */
#hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  height: 42px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

#score-display {
  font-size: 1.45rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 3px;
  color: var(--text-strong);
}

#combo-display {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 1px;
}

/* ── Canvas ── */
.canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #09090f;
  min-height: 0;
}

#game-canvas {
  position: absolute;
  inset: 0;
  display: block;
  touch-action: none;
}

/* ── Touch buttons ── */
#touch-btns {
  display: flex;
  flex-shrink: 0;
  height: 70px;
  background: #09090f;
}

.touch-btn {
  flex: 1;
  font-size: 1.9rem;
  background: transparent;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.07s;
}
.touch-btn:nth-child(1) { color: #e74c3c; border-right: 1px solid rgba(255,255,255,0.06); }
.touch-btn:nth-child(2) { color: #3498db; border-right: 1px solid rgba(255,255,255,0.06); }
.touch-btn:nth-child(3) { color: #2ecc71; border-right: 1px solid rgba(255,255,255,0.06); }
.touch-btn:nth-child(4) { color: #f1c40f; }
.touch-btn:active { background: rgba(255,255,255,0.12); }

/* ── Overlays ── */
.full-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(6,6,14,0.93);
  z-index: 20;
  padding: 24px 16px 20px;
  overflow-y: auto;
}

[hidden] { display: none !important; }

.overlay-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 20px;
  text-align: center;
}

/* ── Song cards ── */
#song-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 360px;
}

.song-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 14px;
  padding: 14px 16px;
}

.song-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.song-bpm {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.song-diffs {
  display: flex;
  gap: 8px;
}

.song-diffs .btn {
  flex: 1;
  font-size: 0.78rem;
  padding: 7px 4px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
}

.song-diffs .btn:hover { background: rgba(255,255,255,0.18); }

/* ── Result screen ── */
#result-grade {
  font-size: 5.5rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 6px;
  text-shadow: 0 0 30px currentColor;
}

#result-score {
  font-size: 2.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 4px;
  margin-bottom: 18px;
}

#result-stats {
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  text-align: center;
  line-height: 2;
  margin-bottom: 22px;
}

#result-stats b { color: #fff; }

.result-actions {
  display: flex;
  gap: 12px;
}
