/* ============================================================
   EmirsMusic – Glass / iOS-Designschicht
   Wird nach style.css geladen und überschreibt Oberflächen,
   Typografie und Bewegungen. Funktionale Layouts bleiben in style.css.
   ============================================================ */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Figtree",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --accent: #30d158;
  --accent-hover: #4ade73;
  --accent-dark: #28b84c;
  --accent-glow: rgba(48, 209, 88, 0.45);
  --danger: #ff453a;
  --warning: #ffd60a;

  --text: #ffffff;
  --text-subdued: rgba(235, 235, 245, 0.62);
  --text-dim: rgba(235, 235, 245, 0.38);
  --border: rgba(255, 255, 255, 0.1);
  --hairline: rgba(255, 255, 255, 0.08);

  --bg-card: rgba(255, 255, 255, 0.055);
  --bg-card-hover: rgba(255, 255, 255, 0.09);
  --fill: rgba(118, 118, 128, 0.24);
  --fill-strong: rgba(118, 118, 128, 0.34);

  --glass: rgba(30, 30, 34, 0.52);
  --glass-strong: rgba(24, 24, 28, 0.74);
  --glass-light: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-shine: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -1px 0 rgba(255, 255, 255, 0.03);
  --blur: saturate(180%) blur(28px);
  --blur-strong: saturate(190%) blur(40px);
  --shadow-float: 0 18px 50px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --tabbar-h: 0px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html { background: #000; }
body {
  background: #000;
  letter-spacing: -0.01em;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: #000; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); background-clip: content-box; }

/* ---------- Ambient-Hintergrund (Farben des aktuellen Covers) ---------- */

.ambient {
  position: fixed;
  inset: -12vmax;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60vmax 45vmax at 12% 8%, rgba(48, 209, 88, 0.16), transparent 62%),
    radial-gradient(55vmax 45vmax at 92% 18%, rgba(94, 92, 230, 0.2), transparent 62%),
    radial-gradient(70vmax 50vmax at 50% 110%, rgba(255, 55, 95, 0.1), transparent 60%),
    #050507;
}
.ambient-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(90px) saturate(1.7) brightness(0.75);
  opacity: 0;
  transform: scale(1.1);
  transition: opacity 1.2s var(--ease-out), transform 2.4s var(--ease-out);
}
.ambient-layer.is-active { opacity: 0.55; transform: scale(1); }
.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.55));
}
body { position: relative; z-index: 0; }

/* ---------- Grundlayout als Glas-Panels ---------- */

.app { position: relative; z-index: 1; }

.sidebar {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shine);
}
.main {
  background: rgba(18, 18, 22, 0.42);
  -webkit-backdrop-filter: saturate(160%) blur(30px);
  backdrop-filter: saturate(160%) blur(30px);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overscroll-behavior: contain;
}

.topbar {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom: 1px solid transparent;
  transition: background 0.35s var(--ease-out), border-color 0.35s var(--ease-out), padding 0.35s var(--spring);
}
.topbar.is-scrolled {
  background: rgba(20, 20, 24, 0.62);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  border-bottom-color: var(--hairline);
}

.search-field {
  height: 42px;
  border-radius: 13px;
  background: var(--fill);
  border: 1px solid transparent;
  transition: background 0.25s var(--ease-out), box-shadow 0.3s var(--ease-out), transform 0.35s var(--spring);
}
.search-field:hover { background: var(--fill-strong); }
.search-field:focus-within {
  background: rgba(118, 118, 128, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22), 0 0 0 5px rgba(48, 209, 88, 0.16);
}
.search-field input { font-size: 16px; letter-spacing: -0.02em; }

.icon-btn { transition: color 0.2s ease, background 0.2s ease, transform 0.35s var(--bounce); }
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); }
.icon-btn.round {
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--hairline);
}

.avatar { border: 1px solid var(--glass-border); box-shadow: var(--glass-shine); }

/* ---------- Sidebar ---------- */

.logo { letter-spacing: -0.04em; }
.logo-badge {
  background: linear-gradient(145deg, #4ae276, #20b04a);
  box-shadow: 0 6px 18px rgba(48, 209, 88, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.nav-link {
  border-radius: 12px;
  padding: 10px 10px;
  transition: color 0.2s ease, background 0.25s var(--ease-out), transform 0.35s var(--spring);
}
.nav-link:hover { background: rgba(255, 255, 255, 0.06); }
.nav-link.is-active { background: rgba(255, 255, 255, 0.1); box-shadow: var(--glass-shine); }
.nav-link.is-active .icon { color: var(--accent); }

.library { border-top-color: var(--hairline); }
.chip {
  background: var(--fill);
  border: 1px solid transparent;
  transition: background 0.25s var(--ease-out), color 0.2s ease, transform 0.35s var(--bounce);
}
.chip.is-active { background: rgba(255, 255, 255, 0.92); color: #000; }

.playlist-item {
  border-radius: 14px;
  transition: background 0.25s var(--ease-out), transform 0.35s var(--spring);
}
.playlist-item:hover { background: rgba(255, 255, 255, 0.07); }
.playlist-item.is-active { background: rgba(255, 255, 255, 0.11); box-shadow: var(--glass-shine); }
.playlist-cover { border-radius: 10px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
.playlist-cover.liked,
.quick-tile-cover.liked,
.card-art.liked,
.detail-cover.liked {
  background: linear-gradient(140deg, #7b5cff 0%, #5e5ce6 40%, #bf5af2 100%);
}

.sidebar-profile { border-radius: 16px; transition: background 0.25s var(--ease-out), transform 0.35s var(--spring); }
.sidebar-profile-badge {
  background: rgba(48, 209, 88, 0.16) !important;
  color: var(--accent) !important;
  border-radius: 999px;
}

/* ---------- Typografie ---------- */

.greeting,
.search-heading {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.045em;
}
.section-head h2 { font-size: 22px; letter-spacing: -0.035em; }
.section-link { color: var(--accent); letter-spacing: 0; text-transform: none; font-size: 15px; font-weight: 600; }
.section-link:hover { color: var(--accent-hover); text-decoration: none; }
.detail-title { letter-spacing: -0.05em; font-weight: 850; }
.detail-type { color: var(--text-subdued); letter-spacing: 0.06em; }

/* ---------- Kacheln & Karten ---------- */

.quick-tile {
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  box-shadow: var(--glass-shine);
  transition: background 0.25s var(--ease-out), transform 0.4s var(--spring), box-shadow 0.3s ease;
}
.quick-tile:hover { background: var(--bg-card-hover); }
.quick-tile-cover { border-radius: 12px 0 0 12px; }
.quick-tile .tile-play,
.card-play,
.btn-play-result,
.play-pill {
  background: var(--accent);
  color: #000;
  box-shadow: 0 10px 26px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.card {
  border-radius: var(--r-lg);
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  box-shadow: var(--glass-shine);
  transition: background 0.3s var(--ease-out), transform 0.45s var(--spring), box-shadow 0.35s ease;
}
.card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: var(--glass-shine), 0 18px 40px rgba(0, 0, 0, 0.35);
}
.card-art { border-radius: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4); }
.card-art img { transition: transform 0.7s var(--ease-out); }
.card:hover .card-art img { transform: scale(1.05); }
.card-play { transition: opacity 0.3s var(--ease-out), transform 0.45s var(--bounce), background 0.2s ease; }

.placeholder-card { border-radius: var(--r-lg); border-color: rgba(255, 255, 255, 0.14); }

.browse-tile {
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.45s var(--spring), filter 0.3s ease;
  isolation: isolate;
}
.browse-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.22), transparent 45%, rgba(0, 0, 0, 0.25));
}
.browse-tile .deco { border-radius: 12px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); }

/* ---------- Detail-Header ---------- */

.detail-cover {
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.detail-header::before { opacity: 0.55; filter: blur(80px) saturate(1.6); }
.play-pill { transition: transform 0.45s var(--bounce), background 0.2s ease, box-shadow 0.3s ease; }
.play-pill:hover { transform: scale(1.06); background: var(--accent-hover); }
.retry-pill {
  border-color: var(--glass-border);
  background: var(--glass-light);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--glass-shine);
  transition: transform 0.4s var(--bounce), border-color 0.2s ease, color 0.2s ease;
}

/* ---------- Track-Listen ---------- */

.track-head { border-bottom-color: var(--hairline); text-transform: none; letter-spacing: 0; font-size: 13px; }
.track-row {
  border-radius: 12px;
  transition: background 0.2s ease, transform 0.35s var(--spring);
}
.track-row:hover { background: rgba(255, 255, 255, 0.06); }
.track-row.is-playing { background: rgba(48, 209, 88, 0.08); }
.track-row.is-playing .track-name { color: var(--accent); }
.track-thumb { border-radius: 8px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3); }
.track-name { letter-spacing: -0.02em; }

/* Equalizer statt Nummer beim laufenden Song */
.track-row.is-playing .track-index .num { visibility: hidden; }
.track-row.is-playing .track-index::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 100% / 3px 40% no-repeat,
    linear-gradient(var(--accent), var(--accent)) 5.5px 100% / 3px 80% no-repeat,
    linear-gradient(var(--accent), var(--accent)) 11px 100% / 3px 55% no-repeat;
  border-radius: 1px;
  pointer-events: none;
}
body.is-audio-playing .track-row.is-playing .track-index::after { animation: eq 1.1s ease-in-out infinite; }
.track-row.is-playing:hover .track-index::after { display: none; }
@keyframes eq {
  0%   { background-size: 3px 40%, 3px 80%, 3px 55%; }
  25%  { background-size: 3px 90%, 3px 35%, 3px 75%; }
  50%  { background-size: 3px 55%, 3px 95%, 3px 30%; }
  75%  { background-size: 3px 80%, 3px 50%, 3px 95%; }
  100% { background-size: 3px 40%, 3px 80%, 3px 55%; }
}

.track-like.is-liked,
.heart-btn.is-liked { color: var(--accent); }
.missing-status, .missing-inline { color: var(--warning); }

.result-row { border-radius: 14px; transition: background 0.2s ease, transform 0.35s var(--spring); }
.result-thumb { border-radius: 10px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); }
.source-badge { background: var(--fill); }
.btn-add {
  border-color: var(--glass-border);
  background: var(--glass-light);
  transition: border-color 0.2s ease, transform 0.4s var(--bounce), background 0.2s ease;
}
.btn-add.is-added { background: rgba(48, 209, 88, 0.14); color: var(--accent); }

/* Suche: Segment-Control */
.search-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--fill);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.search-tabs::-webkit-scrollbar { display: none; }
.tab {
  background: transparent;
  border-radius: 9px;
  padding: 7px 16px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.3s var(--spring), color 0.2s ease, box-shadow 0.3s ease, transform 0.35s var(--bounce);
}
.tab:hover { background: rgba(255, 255, 255, 0.06); }
.tab.is-active {
  background: rgba(99, 99, 102, 0.9);
  color: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25), inset 0 0.5px 0 rgba(255, 255, 255, 0.25);
}

/* ---------- Buttons ---------- */

.btn { border-radius: 14px; transition: transform 0.4s var(--bounce), background 0.2s ease, box-shadow 0.3s ease, opacity 0.2s ease; }
.btn:hover { transform: none; }
.btn-primary { background: var(--accent); color: #000; box-shadow: 0 8px 22px rgba(48, 209, 88, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--fill); color: var(--text); }
.btn-ghost:hover { background: var(--fill-strong); }
.btn-danger { background: var(--danger); color: #fff; }

/* ---------- Druck-Feedback (überall) ---------- */

:where(button, .card, .quick-tile, .browse-tile, .playlist-item, .result-row, .queue-row, .picker-row, .chip, .tab) {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
:where(.btn, .icon-btn, .chip, .tab, .btn-add, .retry-pill, .play-pill, .play-pause, .card-play, .tile-play, .btn-play-result, .nav-link, .tabbar-item, .np-btn, .np-icon, .menu-item):active:not(:disabled) {
  transform: scale(0.9);
  transition-duration: 0.12s;
}
:where(.card, .quick-tile, .browse-tile):active { transform: scale(0.965); transition-duration: 0.15s; }
:where(.playlist-item, .result-row, .queue-row, .picker-row, .track-row, .sidebar-profile):active {
  transform: scale(0.985);
  background: rgba(255, 255, 255, 0.1);
  transition-duration: 0.12s;
}
.play-pill:active { transform: scale(0.92) !important; }

/* Herz-Animation */
.heart-pop { animation: heart-pop 0.55s var(--bounce); }
@keyframes heart-pop {
  0% { transform: scale(1); }
  30% { transform: scale(0.7); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ---------- View-Übergänge ---------- */

.view { animation: view-in 0.55s var(--spring) both; }
@keyframes view-in {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(0.992); }
  to { opacity: 1; transform: none; }
}
.content.is-push .view { animation-name: view-push; }
@keyframes view-push {
  from { opacity: 0; transform: translate3d(28px, 0, 0); }
  to { opacity: 1; transform: none; }
}

:where(.track-table .track-row, .result-list .result-row, .card-grid > *, .quick-grid > *, .browse-grid > *, .invite-list > *, .admin-stats > *) {
  animation: item-in 0.5s var(--spring) both;
}
@keyframes item-in {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to { opacity: 1; transform: none; }
}
:where(.track-table, .result-list, .card-grid, .quick-grid, .browse-grid, .invite-list, .admin-stats) > :nth-child(2) { animation-delay: 25ms; }
:where(.track-table, .result-list, .card-grid, .quick-grid, .browse-grid, .invite-list, .admin-stats) > :nth-child(3) { animation-delay: 50ms; }
:where(.track-table, .result-list, .card-grid, .quick-grid, .browse-grid, .invite-list, .admin-stats) > :nth-child(4) { animation-delay: 75ms; }
:where(.track-table, .result-list, .card-grid, .quick-grid, .browse-grid, .invite-list, .admin-stats) > :nth-child(5) { animation-delay: 100ms; }
:where(.track-table, .result-list, .card-grid, .quick-grid, .browse-grid, .invite-list, .admin-stats) > :nth-child(6) { animation-delay: 125ms; }
:where(.track-table, .result-list, .card-grid, .quick-grid, .browse-grid, .invite-list, .admin-stats) > :nth-child(7) { animation-delay: 150ms; }
:where(.track-table, .result-list, .card-grid, .quick-grid, .browse-grid, .invite-list, .admin-stats) > :nth-child(8) { animation-delay: 175ms; }
:where(.track-table, .result-list, .card-grid, .quick-grid, .browse-grid, .invite-list, .admin-stats) > :nth-child(9) { animation-delay: 200ms; }
:where(.track-table, .result-list, .card-grid, .quick-grid, .browse-grid, .invite-list, .admin-stats) > :nth-child(10) { animation-delay: 225ms; }
:where(.track-table, .result-list, .card-grid, .quick-grid, .browse-grid, .invite-list, .admin-stats) > :nth-child(n+11) { animation-delay: 250ms; }

/* Aktualisierungen (Polling) nicht erneut animieren */
.content.is-refresh .view,
.content.is-refresh :where(.track-row, .result-row, .card-grid > *, .quick-grid > *, .browse-grid > *, .invite-list > *, .admin-stats > *) {
  animation: none;
}

/* ---------- Player (Desktop) ---------- */

.player {
  background: rgba(16, 16, 20, 0.62);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  border-top: 1px solid var(--hairline);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
  z-index: 120;
}
.player-art {
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  transition: transform 0.6s var(--bounce), box-shadow 0.4s ease;
  cursor: pointer;
}
body:not(.is-audio-playing) .player-art.has-song { transform: scale(0.9); }
.player-title { font-weight: 600; letter-spacing: -0.02em; }
.play-pause {
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.4s var(--bounce), background 0.2s ease;
}
.play-pause .icon { transition: transform 0.35s var(--bounce), opacity 0.2s ease; }
.controls .icon-btn.is-active { color: var(--accent); }
.active-dot { background: var(--accent); }

.range {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(to right, #fff var(--val, 0%), rgba(255, 255, 255, 0.2) var(--val, 0%));
  transition: height 0.25s var(--spring);
}
.range:hover,
.seek:hover { background: linear-gradient(to right, var(--accent) var(--val, 0%), rgba(255, 255, 255, 0.24) var(--val, 0%)); }
.range:active { height: 8px; }
.range::-webkit-slider-thumb { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }

/* Mini-Scrubber (nur mobil sichtbar) */
.mini-scrub,
.mini-time { display: none; }

/* ---------- Scrubber (eigene Leiste, touch-tauglich) ---------- */

.scrubber {
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.scrub-track {
  position: relative;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
  transition: height 0.35s var(--spring), background 0.25s ease;
}
.scrub-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--val, 0%);
  background: rgba(255, 255, 255, 0.92);
  border-radius: inherit;
}
.scrubber.is-dragging .scrub-track { height: 11px; background: rgba(255, 255, 255, 0.3); }
.scrubber.is-dragging .scrub-fill { background: #fff; }
.scrubber.is-disabled { opacity: 0.4; pointer-events: none; }

/* ---------- Queue-Panel ---------- */

.queue-panel {
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-float), var(--glass-shine);
  animation: pop-in 0.45s var(--spring);
  transform-origin: bottom right;
}
.queue-head { border-bottom-color: var(--hairline); }
.queue-row { border-radius: 12px; transition: background 0.2s ease, transform 0.3s var(--spring); }
.queue-row img, .queue-thumb { border-radius: 8px; }
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Modals (Desktop: Glas-Dialog) ---------- */

.modal-overlay {
  background: rgba(0, 0, 0, 0.38);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
  animation: fade 0.3s var(--ease-out) both;
}
.modal-overlay.is-closing { animation: fade-out 0.28s var(--ease-out) forwards; }
.modal {
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-float), var(--glass-shine);
  animation: modal-pop 0.5s var(--spring) both;
}
.modal-overlay.is-closing .modal { animation: modal-out 0.25s var(--ease-out) forwards; }
@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: none; }
}
@keyframes modal-out { to { opacity: 0; transform: scale(0.95); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
.modal-head h2 { letter-spacing: -0.03em; }
.modal-input,
.auth-input {
  border-radius: 12px;
  background: var(--fill);
  border: 1px solid transparent;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.3s var(--ease-out), background 0.2s ease;
}
.modal-input:focus,
.auth-input:focus {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(118, 118, 128, 0.3);
  box-shadow: 0 0 0 4px rgba(48, 209, 88, 0.16);
}
.modal-label, .auth-label { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; }
.picker-row { border-radius: 12px; }
.picker-row img, .picker-row .picker-cover { border-radius: 8px; }

/* ---------- Kontextmenü (Desktop: Glas-Popover) ---------- */

.context-menu {
  padding: 6px;
  min-width: 250px;
  background: rgba(30, 30, 34, 0.72);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--shadow-float), var(--glass-shine);
  animation: menu-in 0.35s var(--spring) both;
  transform-origin: top right;
}
.context-menu.is-closing { animation: menu-out 0.18s ease forwards; }
@keyframes menu-in { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes menu-out { to { opacity: 0; transform: scale(0.92); } }
.menu-item { border-radius: 10px; padding: 11px 12px; font-size: 15px; transition: background 0.15s ease, transform 0.3s var(--spring); }
.menu-item:hover { background: rgba(255, 255, 255, 0.1); }
.menu-item .icon { color: var(--text); opacity: 0.85; }
.menu-item.danger, .menu-item.danger .icon { color: var(--danger); }
.menu-sep { background: var(--hairline); margin: 5px 4px; }
.menu-cancel { display: none; }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 590;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out);
}
.sheet-backdrop.is-visible { opacity: 1; pointer-events: auto; }

/* ---------- Toasts (Dynamic-Island-Stil) ---------- */

.toast {
  background: rgba(28, 28, 32, 0.82);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  color: #fff;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-float), var(--glass-shine);
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 11px 18px 11px 12px;
  animation: toast-drop 0.6s var(--bounce) both;
}
.toast .icon {
  width: 24px;
  height: 24px;
  padding: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.toast.success { background: rgba(28, 28, 32, 0.82); }
.toast.success .icon { background: var(--accent); color: #000; }
.toast.error { background: rgba(28, 28, 32, 0.86); color: #fff; }
.toast.error .icon { background: var(--danger); }
.toast.info { background: rgba(28, 28, 32, 0.82); }
.toast.toast-out { animation: toast-lift 0.35s var(--ease-out) forwards; }
@keyframes toast-drop {
  from { opacity: 0; transform: translateY(16px) scale(0.86); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-lift { to { opacity: 0; transform: translateY(10px) scale(0.92); } }

/* ---------- Banner, Admin, Profil, Auth ---------- */

.import-banner {
  border-radius: var(--r-md);
  background: var(--glass-light);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-color: var(--glass-border);
  box-shadow: var(--glass-shine);
}
.import-progress span { background: linear-gradient(90deg, var(--accent), #64ff8f); }

.admin-stat,
.invite-row,
.admin-user-row,
.profile-card {
  border-radius: var(--r-lg);
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  box-shadow: var(--glass-shine);
}
.admin-stat span { letter-spacing: -0.04em; }
.invite-code { border-radius: 8px; background: var(--fill); }
.invite-copy, .invite-revoke { border-radius: 10px; border-color: var(--glass-border); transition: transform 0.35s var(--bounce), background 0.2s ease; }
.role-badge { border-radius: 999px; }

.auth-root { background: transparent; }
.auth-screen {
  background:
    radial-gradient(70vmax 50vmax at 10% 0%, rgba(48, 209, 88, 0.22), transparent 60%),
    radial-gradient(60vmax 50vmax at 100% 100%, rgba(94, 92, 230, 0.28), transparent 60%),
    radial-gradient(50vmax 40vmax at 90% 10%, rgba(255, 55, 95, 0.14), transparent 60%),
    #050507;
  padding: max(24px, var(--safe-top)) 18px max(24px, var(--safe-bottom));
}
.auth-card {
  background: rgba(30, 30, 34, 0.5);
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-float), var(--glass-shine);
  animation: modal-pop 0.6s var(--spring) both;
}
.auth-tabs { background: var(--fill); border-radius: 12px; padding: 3px; }
.auth-tab { border-radius: 9px; transition: background 0.3s var(--spring), color 0.2s ease; }
.auth-tab.is-active { background: rgba(99, 99, 102, 0.9); color: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25); }
.auth-submit { border-radius: 14px; padding: 14px 20px; font-size: 16px; }
.auth-error { color: var(--danger); }

/* ---------- Tab-Bar (nur mobil) ---------- */

.tabbar { display: none; }

/* ---------- Now Playing (Vollbild) ---------- */

.np {
  position: fixed;
  inset: 0;
  z-index: 450;
  pointer-events: none;
  visibility: hidden;
}
.np.is-open { pointer-events: auto; visibility: visible; }
.np-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.5s var(--spring);
}
.np.is-open .np-scrim { opacity: 1; }
.np-sheet {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #101014;
  transform: translate3d(0, 102%, 0);
  transition: transform 0.6s var(--spring), border-radius 0.5s var(--spring);
  will-change: transform;
  touch-action: none;
  padding: calc(var(--safe-top) + 6px) 24px calc(var(--safe-bottom) + 18px);
}
.np.is-open .np-sheet { transform: none; }
.np.is-dragging .np-sheet,
.np.is-dragging .np-scrim { transition: none; }
.np-bg {
  position: absolute;
  inset: -20%;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: blur(70px) saturate(1.8) brightness(0.62);
  transform: scale(1.15);
  transition: background-image 0.8s ease;
}
.np-sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.45) 70%, rgba(0, 0, 0, 0.6));
}
.np-sheet > :not(.np-bg) { position: relative; z-index: 1; }
.np-grabber {
  width: 38px;
  height: 5px;
  margin: 4px auto 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  flex: none;
}
.np-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: none;
}
.np-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: transform 0.4s var(--bounce), background 0.2s ease;
}
.np-icon .icon { width: 22px; height: 22px; }
.np-context { text-align: center; min-width: 0; }
.np-context span { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.6); }
.np-context strong { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.np-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 18px 0;
}
.np-art {
  width: min(100%, 46vh, 440px);
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(140deg, #2c2c30, #18181b);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: transform 0.7s var(--bounce), box-shadow 0.6s ease, opacity 0.3s ease;
  will-change: transform;
  touch-action: none;
}
.np-art img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.np-art .icon { width: 30%; height: 30%; }
.np.is-paused .np-art { transform: scale(0.8); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45); }
.np-art.is-swiping { transition: none; }

.np-queue {
  display: none;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  touch-action: pan-y;
  overscroll-behavior: contain;
  padding: 4px 0;
}
.np.show-queue .np-art { display: none; }
.np.show-queue .np-queue { display: block; animation: view-in 0.45s var(--spring); }
.np-queue h3 { font-size: 17px; font-weight: 700; margin: 4px 4px 10px; }
.np-queue .queue-row:hover { background: rgba(255, 255, 255, 0.08); }
.np-queue .queue-row.is-current .queue-row-title { color: var(--accent); }

.np-meta { display: flex; align-items: center; gap: 14px; flex: none; }
.np-titles { flex: 1; min-width: 0; }
.np-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.035em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np-artist {
  margin-top: 2px;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.62);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np-like { color: rgba(255, 255, 255, 0.85); width: 44px; height: 44px; }
.np-like .icon { width: 26px; height: 26px; }
.np-like.is-liked { color: var(--accent); }

.np-scrub { margin-top: 18px; flex: none; }
.np-scrub .scrub-track { height: 7px; background: rgba(255, 255, 255, 0.22); }
.np-scrub.is-dragging .scrub-track { height: 13px; }
.np-times {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
  flex: none;
  transition: transform 0.35s var(--spring), color 0.2s ease;
}
.np-scrub.is-dragging + .np-times { color: #fff; transform: translateY(4px); }

.np-controls {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  margin: 18px 0 8px;
  flex: none;
}
.np-btn {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #fff;
  transition: transform 0.45s var(--bounce), background 0.25s ease;
}
.np-btn .icon { width: 34px; height: 34px; }
.np-btn:active { background: rgba(255, 255, 255, 0.12); }
.np-play { width: 84px; height: 84px; }
.np-play .icon { width: 52px; height: 52px; }
.np-play .pause-icon { display: none; }
.np:not(.is-paused) .np-play .play-icon { display: none; }
.np:not(.is-paused) .np-play .pause-icon { display: block; }

.np-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  flex: none;
}
.np-extra {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.65);
  transition: color 0.2s ease, background 0.25s var(--ease-out), transform 0.4s var(--bounce);
}
.np-extra .icon { width: 22px; height: 22px; }
.np-extra.is-active { color: #000; background: rgba(255, 255, 255, 0.85); }
.np-extra .repeat-one { position: absolute; top: 5px; right: 6px; font-size: 9px; font-weight: 800; display: none; }
.np-extra.is-repeat-one .repeat-one { display: block; }

@media (min-width: 901px) {
  .np-sheet {
    inset: 4vh auto 4vh 50%;
    width: min(460px, 92vw);
    margin-left: calc(min(460px, 92vw) / -2);
    border-radius: 32px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-float);
    padding: 14px 28px 24px;
  }
}

/* ============================================================
   Mobil (iOS-Layout)
   ============================================================ */

@media (max-width: 900px) {
  :root {
    --tabbar-h: 54px;
    --mini-h: 64px;
    --dock-gap: 8px;
    --player-h: calc(var(--mini-h) + var(--dock-gap) * 2 + var(--tabbar-h) + var(--safe-bottom));
  }

  body { font-size: 15px; }

  .app {
    height: 100vh;
    height: 100dvh;
    padding: 0;
    gap: 0;
  }
  .main {
    border-radius: 0;
    border: 0;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .topbar {
    padding: calc(var(--safe-top) + 8px) 16px 10px;
    gap: 10px;
  }
  .content {
    padding: 0 16px calc(var(--player-h) + 28px);
  }

  /* Seitenleiste als Glas-Drawer */
  .sidebar {
    left: 0;
    top: 0;
    bottom: 0;
    width: min(330px, 86vw);
    z-index: 470;
    border-radius: 0 28px 28px 0;
    border-left: 0;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    background: rgba(22, 22, 26, 0.72);
    -webkit-backdrop-filter: var(--blur-strong);
    backdrop-filter: var(--blur-strong);
    transform: translate3d(-105%, 0, 0);
    transition: transform 0.55s var(--spring);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.5);
    touch-action: pan-y;
  }
  .sidebar.is-dragging { transition: none; }
  .sidebar.is-open { transform: none; }
  .sidebar-backdrop {
    z-index: 465;
    background: rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: fade 0.35s var(--ease-out);
  }
  .menu-btn { background: var(--fill); }

  /* Schwebender Mini-Player */
  .player {
    left: 8px;
    right: 8px;
    bottom: calc(var(--tabbar-h) + var(--safe-bottom) + var(--dock-gap));
    height: var(--mini-h);
    padding: 0 8px 0 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 1fr;
    align-items: center;
    column-gap: 6px;
    row-gap: 0;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background: rgba(38, 38, 44, 0.62);
    -webkit-backdrop-filter: var(--blur-strong);
    backdrop-filter: var(--blur-strong);
    box-shadow: var(--shadow-float), var(--glass-shine);
    overflow: hidden;
    transition: transform 0.45s var(--spring);
    touch-action: pan-x;
  }
  .player.is-pressed { transform: scale(0.98); }
  .player-left { grid-column: 1; grid-row: 1; gap: 10px; min-width: 0; cursor: pointer; }
  .player-art { width: 46px; height: 46px; border-radius: 10px; display: grid; }
  .player-title { font-size: 15px; pointer-events: none; }
  .player-artist { font-size: 13px; }
  .player-center { display: contents; }
  .controls { grid-column: 2; grid-row: 1; gap: 2px; }
  .controls #btn-shuffle,
  .controls #btn-repeat { display: none; }
  .controls .icon-btn { width: 40px; height: 40px; color: #fff; }
  .controls .icon-btn .icon { width: 22px; height: 22px; }
  .play-pause { width: 40px; height: 40px; background: transparent; box-shadow: none; color: #fff; }
  .play-pause:hover { background: rgba(255, 255, 255, 0.1); }
  .play-pause .icon { width: 26px; height: 26px; }
  .player-center .progress-row { display: none; }
  .player-right { display: none; }

  .mini-scrub {
    display: flex;
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 16px;
    align-items: flex-end;
    padding-bottom: 4px;
  }
  .mini-scrub .scrub-track { height: 3px; background: rgba(255, 255, 255, 0.16); }
  .mini-scrub .scrub-fill { background: var(--accent); }
  .mini-scrub.is-dragging { height: 26px; }
  .mini-scrub.is-dragging .scrub-track { height: 8px; }
  .mini-time {
    display: block;
    position: absolute;
    right: 14px;
    bottom: 14px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    opacity: 0;
    transform: translateY(6px) scale(0.9);
    transition: opacity 0.2s ease, transform 0.35s var(--bounce);
    pointer-events: none;
  }
  .player.is-scrubbing .mini-time { opacity: 1; transform: none; }

  /* Tab-Bar */
  .tabbar {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 110;
    height: calc(var(--tabbar-h) + var(--safe-bottom));
    padding: 0 8px var(--safe-bottom);
    background: rgba(18, 18, 22, 0.7);
    -webkit-backdrop-filter: var(--blur-strong);
    backdrop-filter: var(--blur-strong);
    border-top: 1px solid var(--hairline);
  }
  .tabbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: rgba(235, 235, 245, 0.5);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: color 0.2s ease, transform 0.4s var(--bounce);
  }
  .tabbar-item .icon { width: 25px; height: 25px; transition: transform 0.45s var(--bounce); }
  .tabbar-item.is-active { color: var(--accent); }
  .tabbar-item.is-active .icon { transform: translateY(-1px) scale(1.08); }
  .tabbar-item[hidden] { display: none !important; }

  /* Toasts oben wie Dynamic Island */
  .toast-root {
    top: calc(var(--safe-top) + 10px);
    bottom: auto;
    width: calc(100vw - 24px);
  }
  .toast {
    width: auto;
    max-width: 100%;
    animation: toast-island 0.65s var(--bounce) both;
  }
  .toast.toast-out { animation: toast-island-out 0.4s var(--spring) forwards; }
  @keyframes toast-island {
    from { opacity: 0; transform: translateY(-30px) scale(0.6); }
    to { opacity: 1; transform: none; }
  }
  @keyframes toast-island-out { to { opacity: 0; transform: translateY(-24px) scale(0.75); } }

  /* Kontextmenü als Action-Sheet */
  .context-menu.is-sheet {
    left: 8px !important;
    right: 8px !important;
    top: auto !important;
    bottom: calc(var(--safe-bottom) + 8px);
    min-width: 0;
    max-height: 75vh;
    overflow-y: auto;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    animation: sheet-up 0.5s var(--spring) both;
    transform-origin: bottom center;
  }
  .context-menu.is-sheet.is-closing { animation: sheet-down 0.3s var(--ease-out) forwards; }
  .context-menu.is-sheet .menu-group {
    overflow: hidden;
    border-radius: 18px;
    background: rgba(40, 40, 46, 0.78);
    -webkit-backdrop-filter: var(--blur-strong);
    backdrop-filter: var(--blur-strong);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shine);
  }
  .context-menu.is-sheet .menu-item {
    justify-content: center;
    min-height: 56px;
    border-radius: 0;
    font-size: 17px;
    font-weight: 500;
    color: #64d2ff;
    border-top: 1px solid var(--hairline);
  }
  .context-menu.is-sheet .menu-group > .menu-item:first-child,
  .context-menu.is-sheet .menu-sep + .menu-item { border-top: 0; }
  .context-menu.is-sheet .menu-item .icon { color: inherit; width: 20px; height: 20px; }
  .context-menu.is-sheet .menu-item.danger,
  .context-menu.is-sheet .menu-item.danger .icon { color: var(--danger); }
  .context-menu.is-sheet .menu-sep { height: 0; margin: 0; border-top: 1px solid rgba(255, 255, 255, 0.14); }
  .context-menu.is-sheet .menu-cancel {
    display: flex;
    margin-top: 8px;
    font-weight: 700;
    color: #64d2ff;
    border-radius: 18px;
    background: rgba(44, 44, 50, 0.86);
    -webkit-backdrop-filter: var(--blur-strong);
    backdrop-filter: var(--blur-strong);
    border: 1px solid var(--glass-border);
  }
  @keyframes sheet-up { from { transform: translate3d(0, 110%, 0); } to { transform: none; } }
  @keyframes sheet-down { to { transform: translate3d(0, 110%, 0); } }

  /* Modals als Bottom-Sheet */
  .modal-overlay { align-items: end; place-items: end center; padding: 0; }
  .modal {
    width: 100%;
    max-height: calc(100dvh - var(--safe-top) - 24px);
    border-radius: 30px 30px 0 0;
    border-bottom: 0;
    padding-bottom: var(--safe-bottom);
    animation: sheet-up 0.55s var(--spring) both;
    touch-action: pan-y;
  }
  .modal::before {
    content: "";
    display: block;
    width: 38px;
    height: 5px;
    margin: 8px auto 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.3);
    flex: none;
  }
  .modal.is-dragging { transition: none; animation: none; }
  .modal-overlay.is-closing .modal { animation: sheet-down 0.32s var(--ease-out) forwards; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1; padding: 14px 18px; font-size: 16px; }

  /* Queue-Panel als Sheet über dem Dock */
  .queue-panel {
    left: 8px;
    right: 8px;
    width: auto;
    bottom: calc(var(--player-h) + 4px);
  }

  /* Detailansicht wie Apple Music */
  .detail-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
    padding: 10px 0 8px;
  }
  .detail-cover { width: min(64vw, 260px); height: min(64vw, 260px); border-radius: 16px; }
  .detail-info { width: 100%; }
  .detail-title { font-size: 28px; letter-spacing: -0.04em; margin-bottom: 8px; }
  .detail-meta { justify-content: center; }
  .detail-actions {
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 14px 0 6px;
  }
  .detail-actions .retry-pill { margin-left: 0; }

  .greeting, .search-heading { font-size: 32px; margin: 4px 0 16px; }
  .quick-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .quick-tile { height: 56px; border-radius: 12px; gap: 10px; }
  .quick-tile-cover { width: 56px; height: 56px; }
  .quick-tile-title { font-size: 13px; padding-right: 8px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .quick-tile .tile-play { display: none; }

  .card-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 44%;
    grid-template-columns: none;
    overflow-x: auto;
    gap: 12px;
    margin: 0 -16px;
    padding: 4px 16px 12px;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .card-grid::-webkit-scrollbar { display: none; }
  .card-grid > * { scroll-snap-align: start; }
  .card { padding: 0; background: transparent; border: 0; box-shadow: none; }
  .card:hover { transform: none; background: transparent; box-shadow: none; }
  .card-art { margin-bottom: 8px; border-radius: 14px; }
  .card-title { font-size: 14px; font-weight: 600; }
  .card-sub { font-size: 13px; margin-top: 2px; }
  .card-play { opacity: 1; transform: none; width: 38px; height: 38px; right: 8px; bottom: 8px; }
  .placeholder-card { min-height: 0; aspect-ratio: 1 / 1; padding: 14px; }

  .browse-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .browse-tile { border-radius: 16px; font-size: 17px; }

  .track-row {
    padding: 7px 6px;
    gap: 10px;
    border-radius: 12px;
  }
  .track-thumb { width: 48px; height: 48px; border-radius: 9px; }
  .track-name { font-size: 16px; }
  .track-artist-inline { font-size: 13px; }

  .search-field { height: 40px; border-radius: 12px; }
  .search-tabs { display: flex; width: 100%; }
  .search-tabs .tab { flex: 1; padding: 8px 10px; font-size: 13px; }

  .admin-head .btn { border-radius: 14px; }
}

@media (max-width: 380px) {
  .player-art { display: grid !important; width: 40px; height: 40px; }
  .controls #btn-prev-mini { display: none; }
}

/* Auf großen Bildschirmen schwebende Player-Leiste */
@media (min-width: 901px) {
  :root { --player-h: 96px; }
  .player {
    left: 8px;
    right: 8px;
    bottom: 8px;
    height: calc(var(--player-h) - 16px);
    border-radius: 22px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-float), var(--glass-shine);
  }
  .app { padding: 8px 8px 0; height: calc(100dvh - var(--player-h)); }
}

/* Bewegung reduzieren, wenn gewünscht */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Mediathek ---------- */

.library-playlists {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 -6px 26px;
}
.library-playlists .playlist-cover { width: 56px; height: 56px; border-radius: 12px; }
.library-playlists .playlist-item-title { font-size: 16px; font-weight: 600; }
.library-playlists .playlist-item-sub { font-size: 13px; }
.library-section-title { font-size: 22px; font-weight: 800; letter-spacing: -0.035em; margin-bottom: 8px; }

@media (max-width: 900px) {
  .controls [data-action="prev"] { display: none; }
  body:not(.is-audio-playing) .player-art.has-song { transform: scale(0.88); }
  .player-left { -webkit-user-select: none; user-select: none; }
}
@media (min-width: 901px) {
  .library-playlists {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px;
    margin: 0 0 28px;
  }
  .library-playlists .playlist-item { background: var(--bg-card); border: 1px solid var(--hairline); }
}
