/* ==========================================================================
   Songwunsch – im Look von SF Media & Events (sfmediaevents.de)
   Dunkelgrau, Gold, Poppins. Mobil zuerst, optimiert für iPhone, Samsung & Tablets.
   ========================================================================== */

/* Poppins lokal gehostet (keine Verbindung zu Google, DSGVO-freundlich). Lizenz: assets/fonts/LICENSE.txt (SIL OFL) */
@font-face { font-family: Poppins; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/poppins-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/poppins-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/poppins-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/poppins-latin-700-normal.woff2) format("woff2"); }

:root {
  --bg: #121212;
  --bg-2: #181818;
  --card: #1e1e1e;          /* SF Dunkelgrau */
  --card-2: #2a2a2a;
  --line: #333333;
  --text: #ffffff;
  --muted: #b6b6b6;
  --accent: #d19441;        /* SF Gold */
  --accent-rgb: 209, 148, 65;
  --accent-2: #d0b186;      /* helles Gold */
  --accent-dark: #7b5726;
  --ok: #3ddc97;
  --warn: #f0b35e;
  --danger: #ff5d5d;
  --spotify: #1ed760;
  --radius: 24px;
  --radius-sm: 14px;
  --font: Poppins, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* Abstände an den Rändern – berücksichtigen Notch & abgerundete Ecken */
  --gutter: 16px;
  --safe-l: max(var(--gutter), env(safe-area-inset-left));
  --safe-r: max(var(--gutter), env(safe-area-inset-right));
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tap: 44px;              /* Mindestgröße für Tippflächen (Apple/Google-Empfehlung) */
  color-scheme: dark;
}

/* ---------- Grundlagen */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* sonst überschreiben z. B. display:flex-Regeln das Ausblenden */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;       /* berücksichtigt ein- und ausfahrende Browserleisten */
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* Hintergrund-Leuchten als eigene, fixierte Ebene (background-attachment: fixed ruckelt auf iOS) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 0% -10%, rgba(var(--accent-rgb), .16), transparent 60%),
    radial-gradient(700px 460px at 110% 0%, rgba(var(--accent-rgb), .08), transparent 60%),
    var(--bg);
  transform: translateZ(0);
}

a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; font-weight: 600; }
h1 { font-size: clamp(1.6rem, 4.2vw + .8rem, 2.5rem); letter-spacing: -.02em; overflow-wrap: anywhere; }
h2 { font-size: clamp(1.05rem, .6vw + .95rem, 1.2rem); }
p { margin: 0 0 .75rem; }
code { background: var(--card-2); padding: .1em .4em; border-radius: 6px; word-break: break-all; }
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; }  /* kein Doppeltipp-Zoom, keine Verzögerung */
img { max-width: 100%; }

::selection { background: rgba(var(--accent-rgb), .45); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: calc(20px + var(--safe-t)) var(--safe-r) calc(40px + var(--safe-b)) var(--safe-l);
}
.wrap.wide { max-width: 1180px; }
.wrap.center {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .88rem; margin: .5rem 0; transition: color .2s; }
.hint:empty { display: none; }
.hint.warn { color: var(--warn); }

.eyebrow {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .35rem;
}

.hero { padding: 4px 0 18px; }
.hero p { color: var(--muted); margin: 0; }

.brand-logo { height: 46px; width: auto; display: block; margin-bottom: 16px; }
.logo img { height: 30px; width: auto; display: block; }
/* Das SF-Logo ist schwarz – auf dunklem Grund weiß darstellen */
.logo img, .brand-logo { filter: invert(1); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
  padding: 18px;
  margin-bottom: 14px;
}

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack label { font-size: .88rem; color: var(--muted); margin-top: 6px; }
.stack .btn { margin-top: 10px; align-self: flex-start; }
.stack-lg > .card { margin-bottom: 16px; }

/* ---------- Formulare (16px Schrift verhindert den Auto-Zoom auf iPhones) */
input[type=text], input[type=password], input[type=date], input[type=number], input[type=search] {
  width: 100%;
  min-height: 48px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  padding: 12px 14px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .25); }
input::placeholder { color: #8a8a8a; opacity: 1; }
input[type=date] { color-scheme: dark; }
input[type=search]::-webkit-search-cancel-button,
input[type=search]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.code-form label { display: block; color: var(--muted); font-size: .9rem; margin-bottom: 6px; }
.code-form .row { flex-wrap: nowrap; }
.code-form .row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .15em; font-weight: 600; }

.switch {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  margin-top: 6px;
  color: var(--text) !important;
  font-size: 1rem !important;
  -webkit-user-select: none;
  user-select: none;
}
.switch input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 46px;
  height: 28px;
  margin: 0;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  cursor: pointer;
  transition: background .2s;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
  transition: transform .25s var(--ease);
}
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
.switch span { display: flex; flex-direction: column; }
.switch small { color: var(--muted); font-size: .82rem; }

/* ---------- Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 22px;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  transition: transform .12s var(--ease), opacity .2s, filter .2s, background-color .2s, color .2s;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-small { min-height: 38px; padding: 7px 16px; font-size: .88rem; }
.btn-block { width: 100%; margin-top: 14px; }
.btn-ghost { background: transparent; border: 1.5px solid var(--accent); color: var(--accent); }
.btn-icon { padding: 7px 12px; min-width: 38px; }
.btn-danger { background: var(--danger); }
.btn-spotify { background: var(--spotify); color: #06180d; }
.btn.is-done:disabled { background: rgba(var(--accent-rgb), .16); color: var(--accent); opacity: 1; }
.btn.is-busy { color: transparent !important; position: relative; }
.btn.is-busy::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}

@media (hover: hover) {
  .btn:hover { filter: brightness(1.08); }
  .btn-ghost:hover { background: rgba(var(--accent-rgb), .12); filter: none; }
}

.pill {
  display: inline-block;
  min-width: 26px;
  text-align: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--card-2);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pill-live { background: rgba(61, 220, 151, .15); color: var(--ok); }

/* ---------- Song-Listen */
.tracks { list-style: none; margin: 0; padding: 0; }
.track {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  min-height: 64px;
}
.track:last-child { border-bottom: 0; }
.queue .track {
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  will-change: transform;
}
.queue .track:last-child { border-bottom: 1px solid var(--line); }
.queue .track.is-mine { border-color: rgba(var(--accent-rgb), .6); background: linear-gradient(90deg, rgba(var(--accent-rgb), .08), var(--card) 60%); }
.track.is-busy { opacity: .5; pointer-events: none; transition: opacity .2s; }

.cover {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex: none;
  background: var(--card-2);
}
img.cover { opacity: 0; transition: opacity .3s; }
img.cover.loaded { opacity: 1; }
.cover-empty { display: block; }

.track-info { flex: 1; min-width: 0; }
.track-title, .track-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-title { font-weight: 600; }
.track-artist { color: var(--muted); font-size: .88rem; }
.track-meta {
  font-size: .8rem;
  color: var(--accent-2);
  margin-top: 2px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.track-meta .dedication { font-style: italic; }
.track-meta .guest-name { color: var(--muted); }
.history .status-withdrawn .track-info { opacity: .5; }
.badge-e {
  display: inline-block;
  margin-left: 6px;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--muted);
  color: var(--bg);
  font-size: .62rem;
  font-weight: 700;
  vertical-align: 2px;
}
.pos {
  width: 1.5em;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  flex: none;
  font-variant-numeric: tabular-nums;
}
.empty-row { color: var(--muted); padding: 18px 0; text-align: center; border: 0 !important; background: none !important; }
.empty-queue { display: flex; flex-direction: column; gap: 2px; padding: 28px 12px; border: 1.5px dashed var(--line) !important; border-radius: var(--radius-sm); }
.empty-queue strong { color: var(--text); font-weight: 600; }
.mine-tag { font-size: .78rem; color: var(--accent); font-weight: 600; white-space: nowrap; }

/* Schon gelaufen */
.played-section { margin-top: 26px; }
.played .track { opacity: .8; }
.played .track.is-mine { opacity: 1; }
.played-tag { flex: none; font-size: .78rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.played .is-mine .played-tag { color: var(--ok); }
.played-more { display: flex; margin: 10px auto 0; }

/* Admin: Abhaken ist die Hauptaktion */
.btn-check { min-width: 112px; }

.like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  min-width: 64px;
  min-height: var(--tap);
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: .92rem;
  font-variant-numeric: tabular-nums;
  padding: 6px 14px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: color .2s, border-color .2s, background-color .2s, transform .12s var(--ease);
}
.like .heart { display: block; line-height: 0; }
.like .heart svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round; /* runde Ecken – keine spitzen Überstände am Herz */
  stroke-linecap: round;
  transition: fill .2s;
}
.like.liked { color: var(--accent); border-color: rgba(var(--accent-rgb), .6); background: rgba(var(--accent-rgb), .14); }
.like.liked .heart svg { fill: currentColor; }
.like:disabled, .like.is-own { opacity: .65; }
.like.is-own { cursor: help; border-style: dashed; }
.like.static { cursor: default; min-height: 34px; min-width: 0; padding: 4px 10px; }
.like:not(:disabled):not(.static):not(.is-own):active { transform: scale(.92); }

/* Lade-Platzhalter */
.skeleton .cover, .sk-line {
  background: linear-gradient(90deg, var(--card-2) 0%, #353535 50%, var(--card-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}
.sk-line { height: 12px; border-radius: 6px; margin: 6px 0; width: 70%; }
.sk-line.short { width: 40%; }

/* ---------- Gäste-Seite */
.search-card {
  position: sticky;
  top: calc(8px + var(--safe-t));
  z-index: 5;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
}
.search-field { position: relative; display: block; }
.search-field > svg {
  position: absolute;
  left: 15px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}
.search-field input { padding-left: 46px; padding-right: 50px; min-height: 52px; font-size: 17px; border-radius: 999px; }
.search-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: opacity .2s, color .2s;
}
.search-clear svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.search-field input:placeholder-shown ~ .search-clear { opacity: 0; pointer-events: none; }
.search-clear:active { color: var(--text); }

.results:not(:empty) {
  margin-top: 8px;
  max-height: 52vh;
  max-height: 52svh;           /* „kleine“ Viewport-Höhe: passt auch mit eingeblendeter Tastatur */
  overflow-y: auto;
  overscroll-behavior: contain; /* Scrollen in der Liste schiebt nicht die ganze Seite */
  -webkit-overflow-scrolling: touch;
  margin-right: -8px;
  padding-right: 8px;
}
.results.loading .track:not(.skeleton) { opacity: .55; transition: opacity .2s; }
.results .btn { min-width: 112px; }

.section-head { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; }
.section-head h2 { margin: 0; }

.now-playing {
  display: flex;
  align-items: center;
  gap: 14px;
  border-color: rgba(var(--accent-rgb), .5);
  position: relative;
  overflow: hidden;
}
.now-playing .cover, .now-playing-admin .cover { width: 60px; height: 60px; }
.now-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
}
.np-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, .06);
}
.np-bar {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
}
.np-bar.paused { background: var(--muted); }

.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.eq i { width: 3px; background: currentColor; border-radius: 1px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; }
.eq i:nth-child(3) { animation-delay: -.6s; }

.site-footer { text-align: center; color: var(--muted); font-size: .82rem; margin-top: 28px; }
.site-footer p { margin: 0 0 6px; }
.site-footer a { font-weight: 600; text-decoration: none; }
.legal-links { display: flex; justify-content: center; gap: 4px; }
.legal-links a { color: var(--muted); font-weight: 500; padding: 8px 10px; min-height: 36px; display: inline-flex; align-items: center; }
@media (hover: hover) { .legal-links a:hover { color: var(--text); } }

/* Logo links, Admin-Zugang rechts */
.guest-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.guest-topline .brand-logo { margin-bottom: 16px; }
.wrap.center > .guest-topline { margin-bottom: 4px; }
.admin-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s, border-color .2s;
}
.admin-shortcut svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.admin-shortcut.is-admin { color: var(--accent); border-color: rgba(var(--accent-rgb), .6); }
@media (hover: hover) { .admin-shortcut:hover { color: var(--text); border-color: var(--muted); } }
.login-back { text-align: center; margin-top: 14px; }
.login-back a { color: var(--muted); text-decoration: none; }
@media (max-width: 480px) { .hide-narrow { display: none !important; } }

.legal h3 { font-size: 1rem; margin: 16px 0 4px; }
.legal ul { padding-left: 20px; margin: 0 0 .75rem; }
.legal li { margin-bottom: 6px; }
.legal p, .legal li { color: #dcdcdc; }

.empty-state { text-align: center; }
.empty-state .brand-logo { margin: 0 auto 16px; }
.empty-state .btn { margin-top: 8px; }

/* Tablet & Desktop: weiterhin eine zentrale Spalte (Suche oben, Liste darunter) – nur etwas breiter */
@media (min-width: 900px) {
  .wrap.guest { max-width: 760px; padding-top: calc(32px + var(--safe-t)); }
  .results:not(:empty) { max-height: 46vh; }
}

/* Kleine Handys (z. B. iPhone SE, Galaxy A-Serie im Zoom-Modus) */
@media (max-width: 374px) {
  :root { --gutter: 12px; }
  .card { padding: 14px; border-radius: 20px; }
  .track { gap: 10px; }
  .cover { width: 42px; height: 42px; }
  .results .btn { min-width: 0; padding: 7px 12px; }
  .like { min-width: 56px; padding: 6px 10px; }
  .pos { width: 1.2em; }
}

/* Handy quer: Kopfbereich kompakt, damit mehr Liste sichtbar ist */
@media (orientation: landscape) and (max-height: 500px) {
  .hero { padding-bottom: 10px; }
  .hero .brand-logo { height: 32px; margin-bottom: 8px; }
  .hero h1 { font-size: 1.4rem; }
  .hero p { display: none; }
  .results:not(:empty) { max-height: 60svh; }
}

/* ---------- Menü von unten (Bottom Sheet) */
html.sheet-open { overflow: hidden; }
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, .6);
  opacity: 0;
  transition: opacity .3s;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 71;
  max-width: 460px;
  max-height: 88vh;
  max-height: 88dvh;
  margin: 0 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  padding: 10px max(22px, var(--safe-r)) calc(22px + var(--safe-b)) max(22px, var(--safe-l));
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .5);
  transform: translateY(105%);
  transition: transform .32s var(--ease);
}
.sheet:focus { outline: none; }
.sheet.open { transform: none; }
.sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 16px; }
.sheet-title { font-size: 1.1rem; margin-bottom: 16px; }
.sheet-track { border: 0; padding: 0 0 8px; min-height: 0; }
.sheet-label { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-weight: 600; font-size: .9rem; }
.sheet-label small { color: var(--muted); font-weight: 400; }
.sheet-label input { font-weight: 400; }
.sheet-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.sheet-actions .btn-block { margin-top: 0; min-height: var(--tap); padding: 10px 18px; font-size: .95rem; }
.sheet-actions .btn > span { display: inline-flex; align-items: center; gap: 8px; }
.btn-svg { line-height: 0; }
.btn-svg svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-plain { border-color: transparent; color: var(--muted); }
@media (min-width: 600px) {
  /* Tablet/Desktop: als schwebendes Fenster in der Mitte */
  /* Rundum gleiche Abstände, da hier kein Zieh-Griff oben ist */
  .sheet { bottom: 50%; border-radius: 22px; border-bottom: 1px solid var(--line); padding: 24px; transform: translateY(calc(50% + 40px)); opacity: 0; transition: transform .32s var(--ease), opacity .25s; }
  .sheet.open { transform: translateY(50%); opacity: 1; }
  .sheet-handle { display: none; }
}

/* „⋯“ beim eigenen Wunsch */
.more-btn {
  flex: none;
  width: 36px;
  height: var(--tap);
  margin-right: -6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.more-btn:active { background: var(--card-2); color: var(--text); }

/* „Dein Song läuft!“ */
.celebrate { text-align: center; padding: 6px 0 0; }
.celebrate .cover { width: 140px; height: 140px; border-radius: 18px; margin: 0 auto 16px; display: block; box-shadow: 0 16px 40px rgba(var(--accent-rgb), .35); }
.celebrate h2 { font-size: 1.8rem; margin-bottom: 6px; }
.celebrate-track { margin-bottom: 4px; }
.sheet-celebrate { border-color: rgba(var(--accent-rgb), .6); }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 80; pointer-events: none; }

/* Kurzanleitung */
.onboard { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.onboard-step { display: flex; gap: 12px; align-items: flex-start; }
.onboard-step div { display: flex; flex-direction: column; gap: 1px; }
.onboard-step strong { font-size: .95rem; font-weight: 600; }
.onboard-step span:not(.onboard-num) { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.onboard-num {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* ---------- Meldungen */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + var(--safe-b));
  z-index: 90;
  transform: translate(-50%, 24px);
  opacity: 0;
  pointer-events: none;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--accent);
  color: #1e1e1e;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  transition: transform .3s var(--ease), opacity .3s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.has-action { display: flex; align-items: center; gap: 14px; text-align: left; }
.toast.has-action.show { pointer-events: auto; }
.toast-action {
  flex: none;
  border: 0;
  background: rgba(0, 0, 0, .18);
  color: inherit;
  font-weight: 700;
  border-radius: 10px;
  padding: 8px 12px;
  min-height: 38px;
  cursor: pointer;
}
.toast.error { background: var(--danger); color: #fff; }

.net-status {
  position: fixed;
  left: 50%;
  top: calc(10px + var(--safe-t));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #2a2a2a;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: .85rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  transform: translate(-50%, -150%);
  transition: transform .3s var(--ease);
  white-space: nowrap;
}
.net-status.show { transform: translate(-50%, 0); }
.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .25);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}

/* ---------- Admin */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + var(--safe-t)) var(--safe-r) 12px var(--safe-l);
  border-bottom: 1px solid var(--line);
  background: rgba(18, 18, 18, .88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; white-space: nowrap; }
.logo small { color: var(--muted); font-weight: 600; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: .92rem;
  padding: 10px 12px;
  border-radius: 999px;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
}
.topbar nav a:active { background: var(--card-2); }
@media (hover: hover) { .topbar nav a:hover { color: var(--text); } }

.admin .wrap { padding-top: 20px; }
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin: 16px 0 0; font-weight: 600; }
.flash-ok { background: rgba(61, 220, 151, .12); color: var(--ok); border: 1px solid rgba(61, 220, 151, .3); }
.flash-error { background: rgba(255, 93, 93, .12); color: var(--danger); border: 1px solid rgba(255, 93, 93, .3); }
.login-card { max-width: 400px; width: 100%; margin: 0 auto; }
.login-card label { display: block; color: var(--muted); font-size: .9rem; margin: 12px 0 6px; }

.grid-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grid-2.grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); }
}
.grid-2 > .card { margin-bottom: 0; }

.spotify-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.spotify-card h2 { margin: 0; }
.spotify-card p { margin: 0; color: var(--muted); }
.spotify-status { display: flex; align-items: center; gap: 14px; min-width: 0; }
.spotify-card .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 4px rgba(240, 179, 94, .15); flex: none; }
.spotify-card.is-connected .dot { background: var(--spotify); box-shadow: 0 0 0 4px rgba(30, 215, 96, .15); }

.event-list { list-style: none; margin: 0; padding: 0; }
.event-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  margin: 0 -12px;
  min-height: 60px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  transition: background-color .15s;
}
.event-list a:active { background: var(--card-2); }
@media (hover: hover) { .event-list a:hover { background: var(--card-2); } }
.event-list a > div { min-width: 0; }
.event-list strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-list .muted { font-size: .84rem; }

.past-events { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.past-events summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  font-size: .9rem;
  min-height: var(--tap);
  display: flex;
  align-items: center;
  list-style: none;
}
.past-events summary::-webkit-details-marker { display: none; }
.past-events summary::before { content: "▸"; margin-right: 8px; transition: transform .2s; }
.past-events[open] summary::before { transform: rotate(90deg); }
.past-events .event-list { opacity: .75; }

.page-head { margin: 4px 0 18px; }
.page-head .back { color: var(--muted); text-decoration: none; font-size: .9rem; display: inline-flex; min-height: 36px; align-items: center; }
.page-head h1 { margin-top: 2px; }

.now-playing-admin { position: relative; }
.now-playing-admin .track { border: 0; padding: 0 0 12px; min-height: 0; }
.now-playing-admin .np-progress { border-radius: 2px; }

.actions { display: flex; gap: 6px; flex: none; }
.history .status-label { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.history .status-removed .track-info { opacity: .5; text-decoration: line-through; }

/* Admin auf Handy & kleinem Tablet: Aktionen in eigene Zeile, volle Breite, große Tippflächen */
@media (max-width: 700px) {
  .admin .queue .track,
  .admin .history .track { flex-wrap: wrap; }
  .admin .queue .actions,
  .admin .history .actions { width: 100%; }
  .admin .queue .actions .btn,
  .admin .history .actions .btn { flex: 1; min-height: var(--tap); }
  .admin .queue .actions .btn-icon { flex: 0 0 var(--tap); }
  .admin .history .status-label { width: 100%; order: 3; padding-left: 60px; margin-top: -6px; }
  .admin .history .actions { order: 4; }
  .logo small { display: none; }
}

.share-card .qr { background: #fff; padding: 14px; border-radius: var(--radius-sm); width: fit-content; margin: 4px auto 12px; }
.share-card .qr canvas { width: min(220px, 60vw) !important; height: auto !important; display: block !important; }
.share-card .qr img { display: none !important; } /* qrcodejs legt zusätzlich ein (leeres) Bild an */
.share-link { display: block; text-align: center; word-break: break-all; margin-bottom: 12px; font-weight: 600; }
.share-card .row { justify-content: center; }

.danger-card { border-color: rgba(255, 93, 93, .3); }

.settings-card .switch { margin-top: 8px; }
.settings-group {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 18px 0 2px;
}

/* ---------- Animationen */
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .toast, .net-status, .btn, .like, .switch input::after { transition-duration: .01ms !important; }
  .eq i { height: 8px; }
}
