/* Gemeinsame Stile für Startseite, Sperrbildschirm, Bestenliste und Playlist-Auswahl */

/* ---------- Sperrbildschirm ---------- */
#gate {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-content: center; gap: 18px;
  padding: 24px; text-align: center;
  background:
    radial-gradient(60vw 40vh at 85% -5%, #ff7ac622, transparent 65%),
    radial-gradient(70vw 50vh at 10% 0%, #ffb45418, transparent 60%),
    radial-gradient(90vw 70vh at 50% 115%, #3b2a6b66, transparent 70%),
    var(--bg);
  font-family: var(--font); color: var(--text);
  transition: opacity .35s ease;
}
#gate.is-open { opacity: 0; pointer-events: none; }
#gate h1 {
  margin: 0; font-size: 1.6rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
#gate p { margin: 0; color: var(--muted); }
#gate form { display: grid; gap: 12px; justify-items: center; }
#gate input {
  width: 200px; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-size: 22px; text-align: center; letter-spacing: .4em;
}
#gate input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px #ffb45426; }
#gate button {
  font: inherit; cursor: pointer; padding: 12px 28px; min-height: 44px;
  border-radius: 999px; border: 0; font-weight: 700; color: #1a1023;
  background: var(--grad); box-shadow: 0 8px 22px -8px #ff9a8a88;
}
#gate button:active { transform: scale(.97); }
#gate .gate-error { color: var(--red); font-size: .9rem; min-height: 1.4em; margin: 0; }
#gate.is-wrong form { animation: shake .35s ease; }
@keyframes shake {
  20% { transform: translateX(-8px); } 40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(5px); }
}

/* ---------- Startseite: Moduswahl ---------- */
.start-hero { text-align: center; padding: 26px 0 30px; }
.start-hero .logo {
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.start-hero h1 {
  margin: 0; font-size: clamp(1.8rem, 8vw, 2.6rem); font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; line-height: 1.1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.start-hero p { margin: 12px auto 0; color: var(--muted); max-width: 30ch; }
.start-hero p em { color: var(--amber); font-style: normal; font-family: var(--mono); }

.modi { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
@media (min-width: 620px) { .modi { grid-template-columns: 1fr 1fr; } }
.modus {
  position: relative; overflow: hidden; width: 100%; height: 100%;
  display: grid; gap: 6px; align-content: start; text-align: left; text-decoration: none;
  padding: 24px 22px; border-radius: 20px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.modus::before {
  content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 4px;
  background: var(--grad); opacity: .85;
}
.modus:hover { transform: translateY(-3px); border-color: #ffb45480; box-shadow: 0 26px 48px -20px #000e; }
.modus:active { transform: translateY(0) scale(.99); }
.modus .icon { font-size: 2rem; line-height: 1; margin-bottom: 4px; }
.modus .titel { font-size: 1.3rem; font-weight: 700; }
.modus .text { color: var(--muted); font-size: .92rem; }
.modus .meta {
  justify-self: start; margin-top: 10px; padding: 4px 12px; border-radius: 999px;
  color: var(--amber); background: var(--amber-soft); border: 1px solid #ffb45440;
  font-family: var(--mono); font-size: .78rem;
}
.start-fuss {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-top: 22px;
}

/* ---------- Hervorgehobene erste Playlist-Karte ("Alle Songs") ---------- */
.playlist-grid > li:first-child { grid-column: 1 / -1; }
.playlist-grid > li:first-child .playlist-card {
  padding: 26px 22px;
  background:
    radial-gradient(120% 140% at 100% 0%, #ff7ac626, transparent 60%),
    radial-gradient(120% 140% at 0% 100%, #ffb45420, transparent 60%),
    var(--surface);
  border-color: #ffb45459;
}
.playlist-grid > li:first-child .playlist-card::before { opacity: 1; height: 4px; }
.playlist-grid > li:first-child .playlist-name { font-size: 1.6rem; letter-spacing: .01em; }
.playlist-grid > li:first-child .playlist-desc { font-size: 1rem; }
.playlist-grid > li:first-child .playlist-count { font-size: .9rem; padding: 5px 14px; }

/* ---------- Schwebende Knöpfe ---------- */
#extras {
  position: fixed; z-index: 40; right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px;
}
#extras a, #extras button {
  font: inherit; cursor: pointer; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-content: center; font-size: 1.3rem; text-decoration: none;
  border: 1px solid var(--line); background: #181226e6; color: var(--text);
  box-shadow: 0 10px 26px -10px #000; backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px); transition: transform .15s ease, border-color .15s ease;
}
#extras a:hover, #extras button:hover { border-color: var(--amber); transform: translateY(-2px); }
#extras a:active, #extras button:active { transform: scale(.94); }

/* ---------- Bestenliste ---------- */
#board {
  position: fixed; inset: 0; z-index: 9997; display: none;
  align-items: center; justify-content: center; padding: 16px;
  background: #0d0a17cc; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-family: var(--font); color: var(--text);
}
#board.is-open { display: flex; }
#board .box {
  width: 100%; max-width: 440px; max-height: 88vh; display: flex; flex-direction: column;
  background: #181226f2; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 18px 40px -18px #000; overflow: hidden;
}
#board h2 { margin: 0; padding: 20px 20px 4px; font-size: 1.15rem; font-weight: 700; }
#board .sub { margin: 0; padding: 0 20px 14px; color: var(--muted); font-size: .9rem; }
#board .rows { overflow-y: auto; padding: 0 14px; display: grid; gap: 6px; }
#board .row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #221a3666;
}
#board .row.me { border-color: var(--amber); background: #ffb45418; }
#board .rank { font-family: var(--mono); color: var(--muted); min-width: 2.1em; font-size: .9rem; }
#board .row:nth-child(1) .rank { color: var(--amber); }
#board .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#board .val { margin-left: auto; font-family: var(--mono); font-weight: 700; color: var(--amber); white-space: nowrap; }
#board .foot {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 14px 20px 18px; border-top: 1px solid var(--line); margin-top: 12px;
}
#board .note { color: var(--muted); font-size: .85rem; margin: 0 auto 0 0; }
#board input {
  flex: 1 1 140px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px; min-width: 0;
}
#board input:focus { outline: none; border-color: var(--amber); }
#board button {
  font: inherit; cursor: pointer; padding: 11px 20px; min-height: 44px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
}
#board button.go { border: 0; font-weight: 700; color: #1a1023; background: var(--grad); }

/* ---------- Auswahl für die eigene Playlist ---------- */
#picker {
  position: fixed; inset: 0; z-index: 9998; display: none;
  align-items: center; justify-content: center; padding: 16px;
  background: #0d0a17cc; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-family: var(--font); color: var(--text);
}
#picker.is-open { display: flex; }
#picker .box {
  width: 100%; max-width: 460px; max-height: 88vh; display: flex; flex-direction: column;
  background: #181226f2; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 18px 40px -18px #000; overflow: hidden;
}
#picker h2 { margin: 0; padding: 20px 20px 4px; font-size: 1.15rem; font-weight: 700; }
#picker .sub { margin: 0; padding: 0 20px 14px; color: var(--muted); font-size: .9rem; }
#picker .list { overflow-y: auto; padding: 0 14px; display: grid; gap: 8px; }
#picker label {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 52px;
  border: 1px solid var(--line); border-radius: 12px; background: #221a3666; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
#picker label:hover { border-color: #ffb45480; }
#picker label.on { border-color: var(--amber); background: #ffb45418; }
#picker input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--amber); flex: none; }
#picker .nm { font-weight: 600; }
#picker .ct { margin-left: auto; color: var(--muted); font-size: .82rem; white-space: nowrap; }
#picker .foot {
  display: flex; gap: 10px; align-items: center; padding: 14px 20px 18px;
  border-top: 1px solid var(--line); margin-top: 12px;
}
#picker .total { color: var(--muted); font-size: .85rem; margin-right: auto; }
#picker button {
  font: inherit; cursor: pointer; padding: 11px 20px; min-height: 44px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
}
#picker button.go { border: 0; font-weight: 700; color: #1a1023; background: var(--grad); }
#picker button.go:disabled { filter: grayscale(.8) brightness(.7); cursor: default; }
