* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: #1b1038;
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

[hidden] { display: none !important; }

/* ---------- Liedauswahl ---------- */
.screen {
  height: 100%;
  overflow-y: auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background: radial-gradient(120% 60% at 50% 0%, #3b1f78 0%, #1b1038 70%);
  text-align: center;
}
.screen h1 { margin: 6px 0 2px; font-size: 2.2rem; }
.screen h2 { margin: 22px 0 10px; font-size: 1.15rem; opacity: .9; }
.sub { margin: 0 0 16px; opacity: .8; font-size: .95rem; }

.chips { display: flex; gap: 8px; justify-content: center; max-width: 520px; margin: 0 auto; }
.chip {
  flex: 1;
  border: 2px solid #ffffff33;
  background: #ffffff12;
  color: #fff;
  border-radius: 14px;
  padding: 10px 4px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.2;
}
.chip small { display: block; font-weight: 400; font-size: .72rem; opacity: .8; margin-top: 2px; }
.chip.on { background: #ffd23f; color: #2b1b00; border-color: #ffd23f; }

#songs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
}
.song {
  border: 0;
  border-radius: 18px;
  padding: 16px 8px 12px;
  color: #fff;
  font-family: inherit;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: 0 4px 0 #0005;
  min-height: 132px;
}
.song.free {
  grid-column: 1 / -1;
  --c1: #6d28d9; --c2: #db2777;
  min-height: 0;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 14px 12px;
  text-align: left;
}
.song.free .em { font-size: 2.2rem; }
.song.free .t { margin: 0; font-size: 1.1rem; }
.song.free .t small { display: block; font-weight: 400; font-size: .78rem; opacity: .85; margin-top: 2px; }
.song:active { transform: translateY(3px); box-shadow: 0 1px 0 #0005; }
.song .em { font-size: 2.4rem; display: block; }
.song .t { display: block; font-weight: 700; font-size: .98rem; margin: 6px 0 4px; line-height: 1.2; }
.song .lv { display: block; font-size: .75rem; opacity: .85; }
.song .st { display: block; margin-top: 4px; font-size: 1.05rem; letter-spacing: 2px; color: #ffe27a; min-height: 1.3em; }

/* ---------- Spiel ---------- */
#game { position: fixed; inset: 0; background: #120a28; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#hud {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 10px;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  pointer-events: none;
}
#pauseBtn {
  pointer-events: auto;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: #ffffff22; color: #fff; font-size: 1.2rem;
}
#songTitle { flex: 1; text-align: center; font-weight: 700; font-size: .95rem; opacity: .85;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#score { min-width: 64px; text-align: right; font-weight: 800; font-size: 1.3rem; font-variant-numeric: tabular-nums; }

#progress { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: #ffffff1a; pointer-events: none; }
#progressBar { height: 100%; width: 0; background: #ffd23f; }

/* ---------- Overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: #0009;
  padding: 20px;
}
.card {
  width: min(360px, 100%);
  background: #2a1a5a;
  border-radius: 24px;
  padding: 22px 18px;
  text-align: center;
  box-shadow: 0 10px 40px #000a;
}
.card h2 { margin: 0 0 12px; font-size: 1.6rem; }
.card p { margin: 6px 0 16px; opacity: .9; }
.btn {
  display: block; width: 100%;
  margin-top: 10px; padding: 14px;
  border: 0; border-radius: 16px;
  background: #ffd23f; color: #2b1b00;
  font-size: 1.1rem; font-weight: 800; font-family: inherit;
}
.btn.ghost { background: #ffffff1c; color: #fff; font-weight: 600; }
.btn:active { transform: scale(.97); }

#stars { font-size: 3rem; letter-spacing: 6px; color: #ffd23f; min-height: 1.3em; }
#stars .off { color: #ffffff30; }
