/* ============================================================
   EmirsMusic – Spotify-inspiriertes Design
   ============================================================ */

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/figtree-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/figtree-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #000000;
  --bg-main: #121212;
  --bg-elevated: #1f1f1f;
  --bg-card: #181818;
  --bg-card-hover: #282828;
  --bg-highlight: #2a2a2a;
  --text: #ffffff;
  --text-subdued: #b3b3b3;
  --text-dim: #7a7a7a;
  --accent: #1ed760;
  --accent-hover: #3be477;
  --accent-dark: #1db954;
  --border: rgba(255, 255, 255, 0.09);
  --sidebar-w: 300px;
  --player-h: 90px;
  --radius: 8px;
  --font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 24px; height: 24px; flex: none; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

::selection { background: var(--accent); color: #000; }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.4); background-clip: content-box; }

:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   Layout
   ============================================================ */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 8px;
  height: calc(100vh - var(--player-h));
  height: calc(100dvh - var(--player-h));
  padding: 8px 8px 0;
}

.sidebar {
  background: var(--bg-main);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.main {
  position: relative;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #1d1d1d 0%, var(--bg-main) 320px);
}

/* ============================================================
   Sidebar
   ============================================================ */

.sidebar-top { padding: 20px 20px 8px; }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px 22px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.6px;
}
.logo-badge {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
}
.logo-badge .icon { width: 19px; height: 19px; }
.logo-text span { color: var(--accent); }

.main-nav { display: flex; flex-direction: column; gap: 2px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 6px;
  color: var(--text-subdued);
  font-size: 15px;
  font-weight: 700;
  border-radius: 6px;
  transition: color 0.15s ease;
  text-align: left;
}
.nav-link .icon { width: 24px; height: 24px; }
.nav-link:hover { color: var(--text); }
.nav-link.is-active { color: var(--text); }

.library {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin-top: 10px;
  padding: 0 8px 8px;
  border-top: 1px solid var(--border);
}

.library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px 8px 6px;
  flex: none;
}
.library-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-subdued);
  font-size: 15px;
  font-weight: 700;
  padding: 4px 0;
}
.library-title:hover { color: var(--text); }
.library-title .icon { width: 22px; height: 22px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-subdued);
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.icon-btn .icon { width: 20px; height: 20px; }
.icon-btn.round { background: rgba(0, 0, 0, 0.55); color: #fff; }
.icon-btn.round:hover { background: rgba(0, 0, 0, 0.8); }

.library-filters {
  display: flex;
  gap: 8px;
  padding: 0 6px 10px;
  flex: none;
}
.chip {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s ease;
}
.chip:hover { background: rgba(255, 255, 255, 0.18); }
.chip.is-active { background: #fff; color: #000; font-weight: 600; }

.library-list {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 2px 8px;
  flex: 1;
  min-height: 0;
}

.playlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  text-align: left;
  transition: background 0.15s ease;
}
.playlist-item:hover { background: rgba(255, 255, 255, 0.08); }
.playlist-item.is-active { background: rgba(255, 255, 255, 0.12); }

.playlist-cover {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  background: linear-gradient(135deg, #333, #181818);
  flex: none;
  display: grid;
  place-items: center;
  color: var(--text-subdued);
  overflow: hidden;
}
.playlist-cover img { width: 100%; height: 100%; object-fit: cover; }
.playlist-cover .icon { width: 20px; height: 20px; }
.playlist-cover.liked {
  background: linear-gradient(135deg, #450af5, #8e8ee5);
  color: #fff;
}

.playlist-item-text { display: flex; flex-direction: column; min-width: 0; }
.playlist-item-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.playlist-item-sub {
  font-size: 12px;
  color: var(--text-subdued);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.library-empty {
  padding: 16px 12px;
  color: var(--text-subdued);
  font-size: 13px;
  line-height: 1.6;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 39;
}

/* ============================================================
   Topbar
   ============================================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.92), rgba(18, 18, 18, 0.65));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.history-buttons { display: flex; gap: 8px; flex: none; }

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 400px;
  height: 46px;
  padding: 0 14px;
  background: #242424;
  border-radius: 500px;
  color: var(--text-subdued);
  transition: background 0.15s ease, box-shadow 0.15s ease;
  cursor: text;
}
.search-field:hover { background: #2a2a2a; }
.search-field:focus-within {
  background: #2a2a2a;
  box-shadow: 0 0 0 2px #fff inset;
  color: var(--text);
}
.search-field .search-icon { width: 20px; height: 20px; }
.search-field input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 14px;
}
.search-field input::placeholder { color: var(--text-subdued); }
.search-clear {
  display: grid;
  place-items: center;
  color: var(--text-subdued);
  padding: 4px;
}
.search-clear:hover { color: var(--text); }
.search-clear .icon { width: 16px; height: 16px; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #535353;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.15s ease;
}
.avatar:hover { transform: scale(1.06); }

.menu-btn { display: none; }

/* ============================================================
   Content / Views
   ============================================================ */

.content {
  padding: 0 24px 40px;
  max-width: 1600px;
  outline: none;
}

.view { animation: fade-in 0.25s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.section { margin-top: 32px; }
.section:first-child { margin-top: 8px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
}
.section-link {
  color: var(--text-subdued);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.section-link:hover { color: var(--text); text-decoration: underline; }

.greeting {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin: 10px 0 20px;
}

/* Quick tiles */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 10px;
}
.quick-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 68px;
  min-width: 0;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: background 0.2s ease;
  text-align: left;
}
.quick-tile:hover { background: rgba(255, 255, 255, 0.16); }
.quick-tile-cover {
  width: 68px;
  height: 68px;
  flex: none;
  background: linear-gradient(135deg, #3b3b3b, #181818);
  display: grid;
  place-items: center;
  color: var(--text-subdued);
  overflow: hidden;
}
.quick-tile-cover img { width: 100%; height: 100%; object-fit: cover; }
.quick-tile-cover.liked { background: linear-gradient(135deg, #450af5, #8e8ee5); color: #fff; }
.quick-tile-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 48px;
}
.quick-tile .tile-play {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.quick-tile:hover .tile-play { opacity: 1; }
.quick-tile .tile-play:hover { transform: translateY(-50%) scale(1.06); background: var(--accent-hover); }
.tile-play .icon { width: 20px; height: 20px; }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}
.card {
  position: relative;
  padding: 16px;
  border-radius: 8px;
  background: var(--bg-card);
  text-align: left;
  transition: background 0.2s ease;
}
.card:hover { background: var(--bg-card-hover); }
.card-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  margin-bottom: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #333, #181818);
  display: grid;
  place-items: center;
  color: var(--text-subdued);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-art.liked { background: linear-gradient(135deg, #450af5, #8e8ee5); color: #fff; }
.card-art.liked .icon { width: 56px; height: 56px; }
.card-play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
  z-index: 2;
}
.card:hover .card-play { opacity: 1; transform: none; }
.card-play:hover { background: var(--accent-hover); transform: scale(1.05); }
.card-play .icon { width: 22px; height: 22px; }
.card-title {
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-sub {
  margin-top: 5px;
  font-size: 13px;
  color: var(--text-subdued);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Empty / placeholder cards */
.placeholder-card {
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-subdued);
  min-height: 240px;
  text-align: center;
  padding: 24px;
  border-radius: 8px;
}
.placeholder-card:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.placeholder-card .icon { width: 36px; height: 36px; }
.placeholder-card strong { font-size: 15px; }
.placeholder-card span { font-size: 13px; line-height: 1.5; }

/* ============================================================
   Detail-Header (Playlist / Liked)
   ============================================================ */

.detail-header {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 26px;
  padding: 28px 8px 26px;
  isolation: isolate;
}
.detail-header::before {
  content: "";
  position: absolute;
  inset: -120px -24px -40px;
  background-image: var(--cover, none);
  background-size: cover;
  background-position: center;
  filter: blur(70px) saturate(1.3);
  opacity: 0.42;
  z-index: -1;
  pointer-events: none;
}
.detail-cover {
  width: 220px;
  height: 220px;
  flex: none;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #3b3b3b, #181818);
  display: grid;
  place-items: center;
  color: var(--text-subdued);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-cover .icon { width: 72px; height: 72px; }
.detail-cover.liked {
  background: linear-gradient(135deg, #450af5, #8e8ee5);
  color: #fff;
  box-shadow: 0 16px 48px rgba(69, 10, 245, 0.35);
}

.detail-info { min-width: 0; padding-bottom: 4px; }
.detail-type {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.detail-title {
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.04;
  overflow-wrap: anywhere;
  margin-bottom: 16px;
}
.detail-description {
  color: var(--text-subdued);
  font-size: 14px;
  margin-bottom: 12px;
  max-width: 720px;
}
.detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--text-subdued);
}
.detail-meta strong { color: var(--text); font-weight: 600; }
.detail-meta .dot::before { content: "•"; margin: 0 6px; }

.detail-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 18px 8px 8px;
}

.play-pill {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
}
.play-pill:hover { background: var(--accent-hover); transform: scale(1.05); }
.play-pill .icon { width: 26px; height: 26px; margin-left: 2px; }
.play-pill.is-disabled { opacity: 0.45; pointer-events: none; }

.detail-actions .icon-btn { width: 40px; height: 40px; }
.detail-actions .icon-btn .icon { width: 28px; height: 28px; }

/* ============================================================
   Track-Liste
   ============================================================ */

.track-table { margin-top: 8px; }
.track-head {
  display: grid;
  grid-template-columns: 24px minmax(160px, 4fr) minmax(100px, 2.4fr) minmax(90px, 1.6fr) 70px 64px;
  align-items: center;
  gap: 14px;
  height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  color: var(--text-subdued);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.track-head .col-index { text-align: right; padding-right: 4px; }
.track-head .col-duration { text-align: right; }
.track-head .icon { width: 16px; height: 16px; margin-left: auto; }

.track-row {
  display: grid;
  grid-template-columns: 24px minmax(160px, 4fr) minmax(100px, 2.4fr) minmax(90px, 1.6fr) 70px 64px;
  align-items: center;
  gap: 14px;
  padding: 7px 12px;
  border-radius: 4px;
  cursor: default;
  transition: background 0.12s ease;
}
.track-row:hover { background: rgba(255, 255, 255, 0.08); }
.track-row.is-playing { background: rgba(255, 255, 255, 0.06); }
.track-row.is-playing .track-name { color: var(--accent); }

.track-index {
  position: relative;
  text-align: right;
  color: var(--text-subdued);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  padding-right: 4px;
  height: 24px;
  display: grid;
  place-items: center end;
}
.track-index .num { display: block; }
.track-index .row-play {
  display: none;
  color: #fff;
  padding: 0;
  line-height: 0;
}
.track-index .row-play .icon { width: 18px; height: 18px; }
.track-row:hover .track-index .num { display: none; }
.track-row:hover .track-index .row-play { display: inline-grid; }

.track-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.track-thumb {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  flex: none;
  background: #2a2a2a;
}
.track-text { min-width: 0; }
.track-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-artist-inline {
  display: none;
  font-size: 12px;
  color: var(--text-subdued);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.track-artist-col,
.track-added {
  color: var(--text-subdued);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-artist-col:hover { color: var(--text); text-decoration: underline; }
.track-duration {
  color: var(--text-subdued);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.track-actions {
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.track-row:hover .track-actions,
.track-row.is-playing .track-actions { opacity: 1; }
.track-actions .icon-btn { width: 28px; height: 28px; }
.track-actions .icon-btn .icon { width: 18px; height: 18px; }

/* Laufender Playlist-Import: gleiche Zeilenstruktur wie fertige Songs */
.track-row.is-importing { cursor: default; }
.track-row.is-importing:hover .track-index .num { display: block; }
.track-row.is-importing .track-index .row-play { display: none !important; }
.track-row.is-importing .track-actions { opacity: 1; }
.track-row.is-importing .import-status-text { color: var(--text-subdued); font-size: 12px; }
.track-row.is-importing.is-active { background: rgba(30, 215, 96, 0.06); }
.track-row.is-importing.is-active .import-status-text { color: var(--accent); }
.track-row.is-importing.is-error .track-name { color: var(--text-subdued); }
.track-row.is-importing.is-error .import-status-text { color: #ff6b7a; }
.import-spinner {
  width: 18px;
  height: 18px;
  color: var(--accent);
  animation: spin 0.9s linear infinite;
}
.track-row.is-error .import-dismiss { color: #ff6b7a; }
.track-row.is-error .import-retry { color: var(--text-subdued); }
.track-row.is-error .import-retry:hover { color: var(--accent); background: rgba(30, 215, 96, 0.1); }
.import-error-inline {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
}
.retry-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.retry-pill .icon { width: 16px; height: 16px; }
.retry-pill:hover { border-color: var(--accent); color: var(--accent); }
.track-row.is-error .import-dismiss:hover { color: #ff8b96; background: rgba(233, 20, 41, 0.12); }
.import-status-inline {
  display: none;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-subdued);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-row.is-importing.is-active .import-status-inline { color: var(--accent); }
.track-row.is-importing.is-error .import-status-inline { color: #ff6b7a; }

.track-like.is-liked { color: var(--accent); }

/* Fehlende Media-Dateien */
.track-row.is-missing .track-name { color: var(--text-subdued); }
.track-row.is-missing .track-thumb { filter: grayscale(1); opacity: 0.55; }
.track-row.is-missing .track-index .row-play { color: var(--accent); }
.track-row.is-missing .track-actions,
.track-row.is-reinstalling .track-actions { opacity: 1; }
.track-row.is-reinstalling { background: rgba(30, 215, 96, 0.05); }
.missing-status {
  color: #f0b429;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.missing-status.is-installing { color: var(--accent); }
.install-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.install-link .icon { width: 14px; height: 14px; }
.install-link:hover { color: var(--accent-hover); text-decoration: underline; }
.missing-inline {
  display: none;
  margin-top: 2px;
  font-size: 12px;
  color: #f0b429;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.missing-inline.is-installing { color: var(--accent); }
.track-install { color: var(--accent); }
.track-install:hover { color: var(--accent-hover); background: rgba(30, 215, 96, 0.12); }
.track-install-spinner {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
}
.track-install-spinner .spinner { width: 18px; height: 18px; color: var(--accent); }
.track-like.is-liked .icon path { fill: var(--accent); stroke: var(--accent); }

/* Empty playlist */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 80px 24px;
  color: var(--text-subdued);
}
.empty-state .icon { width: 56px; height: 56px; opacity: 0.6; }
.empty-state h3 { color: var(--text); font-size: 22px; font-weight: 700; }
.empty-state p { max-width: 420px; font-size: 14px; line-height: 1.6; }

/* ============================================================
   Suche
   ============================================================ */

.search-heading {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin: 10px 0 20px;
}

.search-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.tab {
  padding: 8px 16px;
  border-radius: 500px;
  background: #242424;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}
.tab:hover { background: #2f2f2f; }
.tab.is-active { background: #fff; color: #000; }

.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.browse-tile {
  position: relative;
  aspect-ratio: 1.7 / 1;
  border-radius: 8px;
  padding: 16px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
  text-align: left;
  overflow: hidden;
  transition: transform 0.18s ease, filter 0.18s ease;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.browse-tile:hover { transform: scale(1.03); filter: brightness(1.1); }
.browse-tile .deco {
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 96px;
  height: 96px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
  transform: rotate(25deg);
  display: grid;
  place-items: center;
}
.browse-tile .deco .icon { width: 34px; height: 34px; color: rgba(255, 255, 255, 0.7); }

.result-list { display: flex; flex-direction: column; gap: 2px; }
.result-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 0.12s ease;
}
.result-row:hover { background: rgba(255, 255, 255, 0.08); }
.result-thumb {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
  flex: none;
  background: #2a2a2a;
}
.result-info { min-width: 0; flex: 1; }
.result-title {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  color: var(--text-subdued);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}
.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-subdued);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex: none;
}
.source-badge.yt { color: #ff7a7a; }
.source-badge.sc { color: #ffab6b; }

.result-action { flex: none; display: flex; align-items: center; gap: 8px; }
.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.btn-add:hover { border-color: #fff; transform: scale(1.03); background: rgba(255, 255, 255, 0.06); }
.btn-add .icon { width: 16px; height: 16px; }
.btn-add.is-busy { pointer-events: none; opacity: 0.8; }
.btn-add.is-added { border-color: transparent; color: var(--accent); background: rgba(30, 215, 96, 0.1); }

.btn-play-result {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: grid;
  place-items: center;
  flex: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn-play-result:hover { transform: scale(1.07); background: var(--accent-hover); }
.btn-play-result .icon { width: 17px; height: 17px; margin-left: 1px; }

.search-status {
  margin: 8px 0;
  color: var(--text-subdued);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.loading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px;
  color: var(--text-subdued);
  font-size: 14px;
}
.spinner {
  width: 22px;
  height: 22px;
  animation: spin 0.9s linear infinite;
  color: var(--text-subdued);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Player
   ============================================================ */

.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--player-h);
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(180px, 30%) minmax(340px, 40%) minmax(180px, 30%);
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: #000;
  border-top: 1px solid #1a1a1a;
}

.player-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.player-art {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 4px;
  overflow: hidden;
  background: #282828;
  display: grid;
  place-items: center;
  color: var(--text-dim);
}
.player-art img { width: 100%; height: 100%; object-fit: cover; }
.player-art .icon { width: 22px; height: 22px; }
.player-meta { min-width: 0; }
.player-title {
  display: block;
  max-width: 100%;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  padding: 0;
}
.player-title:hover { text-decoration: underline; }
.player-title.is-empty { color: var(--text-subdued); }
.player-title.is-empty:hover { text-decoration: none; cursor: default; }
.player-artist {
  font-size: 12px;
  color: var(--text-subdued);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.heart-btn { color: var(--text-subdued); margin-left: 2px; }
.heart-btn.is-liked { color: var(--accent); }
.heart-btn.is-liked .icon path { fill: var(--accent); stroke: var(--accent); }

.player-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.controls .icon-btn { color: var(--text-subdued); width: 32px; height: 32px; }
.controls .icon-btn:hover { color: var(--text); background: none; }
.controls .icon-btn .icon { width: 18px; height: 18px; }
.controls .icon-btn.is-active { color: var(--accent); }
.controls .icon-btn.is-active:hover { color: var(--accent-hover); }

#btn-shuffle { position: relative; }
.active-dot {
  display: none;
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
#btn-shuffle.is-active .active-dot { display: block; }

#btn-repeat { position: relative; }
.repeat-one {
  position: absolute;
  top: 3px;
  right: 2px;
  font-size: 9px;
  font-weight: 800;
  color: inherit;
}

.play-pause {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  display: grid;
  place-items: center;
  transition: transform 0.12s ease, background 0.12s ease;
}
.play-pause:hover { transform: scale(1.06); background: #f2f2f2; }
.play-pause .icon { width: 18px; height: 18px; }
.play-pause .play-icon { margin-left: 2px; }
.play-pause .pause-icon { display: none; }
.play-pause.is-playing .play-icon { display: none; }
.play-pause.is-playing .pause-icon { display: block; }

.progress-row {
  width: 100%;
  max-width: 620px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 2px;
}
.time {
  font-size: 11px;
  color: var(--text-subdued);
  font-variant-numeric: tabular-nums;
  min-width: 38px;
  text-align: center;
  flex: none;
}

.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, #fff var(--val, 0%), #4d4d4d var(--val, 0%));
  cursor: pointer;
  outline: none;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: opacity 0.15s ease;
  border: 0;
}
.range:hover::-webkit-slider-thumb,
.range:active::-webkit-slider-thumb,
.range:focus-visible::-webkit-slider-thumb { opacity: 1; }
.range:disabled { cursor: default; }
.range:disabled::-webkit-slider-thumb { opacity: 0 !important; }
.range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  opacity: 0;
}
.range:hover::-moz-range-thumb,
.range:active::-moz-range-thumb { opacity: 1; }
.range:disabled::-moz-range-thumb { opacity: 0 !important; }
.range:hover { background: linear-gradient(to right, var(--accent) var(--val, 0%), #5a5a5a var(--val, 0%)); }
.seek:hover { background: linear-gradient(to right, var(--accent) var(--val, 0%), #5a5a5a var(--val, 0%)); }

.player-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.volume { width: 100px; }
.player-right .icon-btn .icon { width: 18px; height: 18px; }

#btn-mute .mute-icon { display: none; }
#btn-mute.is-muted .volume-icon { display: none; }
#btn-mute.is-muted .mute-icon { display: block; }

.track-thumb-fallback,
.result-thumb-fallback {
  display: grid;
  place-items: center;
  color: var(--text-subdued);
}
.track-thumb-fallback .icon { width: 16px; height: 16px; }
.result-thumb-fallback .icon { width: 20px; height: 20px; }
.btn-add .spinner { width: 16px; height: 16px; }

.modal-body code {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 12px;
}

/* Queue */
.queue-panel {
  position: fixed;
  right: 12px;
  bottom: calc(var(--player-h) + 10px);
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: min(520px, calc(100dvh - var(--player-h) - 30px));
  display: flex;
  flex-direction: column;
  background: #1c1c1c;
  border: 1px solid #2b2b2b;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
  z-index: 300;
  overflow: hidden;
}
.queue-panel[hidden] { display: none; }
.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex: none;
}
.queue-head h3 { font-size: 15px; font-weight: 700; }
.queue-list { overflow-y: auto; padding: 6px; flex: 1; }
.queue-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border-radius: 4px;
  text-align: left;
}
.queue-row:hover { background: rgba(255, 255, 255, 0.08); }
.queue-row img { width: 38px; height: 38px; border-radius: 3px; object-fit: cover; background: #2a2a2a; flex: none; }
.queue-row-text { min-width: 0; display: flex; flex-direction: column; }
.queue-thumb {
  width: 38px;
  height: 38px;
  border-radius: 3px;
  background: #2a2a2a;
  display: grid;
  place-items: center;
  color: var(--text-subdued);
  flex: none;
}
.queue-thumb .icon { width: 16px; height: 16px; }
.queue-row-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-row-artist {
  font-size: 12px;
  color: var(--text-subdued);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-row.is-current .queue-row-title { color: var(--accent); }
.queue-empty { padding: 24px; text-align: center; color: var(--text-subdued); font-size: 13px; }

/* ============================================================
   Modals, Kontextmenü, Toasts
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 0.15s ease;
  padding: 20px;
}
.modal {
  width: min(460px, 100%);
  max-height: min(88vh, 800px);
  display: flex;
  flex-direction: column;
  background: #282828;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: modal-in 0.18s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 12px;
  flex: none;
}
.modal-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; }
.modal-body { padding: 6px 22px 22px; overflow-y: auto; }
.modal-body p { color: var(--text-subdued); font-size: 13px; margin-bottom: 14px; }
.modal-input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: #3e3e3e;
  color: var(--text);
  font-size: 14px;
  outline: none;
  margin-bottom: 16px;
}
.modal-input:focus { border-color: #fff; outline: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

.modal-label {
  display: block;
  margin: 2px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-subdued);
}
.modal-hint {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: -8px 0 18px;
}

/* Playlist-Import */
.import-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 8px;
  padding: 14px 18px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  overflow: hidden;
}
.import-banner .spinner { width: 22px; height: 22px; color: var(--accent); }
.import-banner > .icon { width: 22px; height: 22px; }
.import-banner.is-error { border-color: rgba(233, 20, 41, 0.45); background: rgba(233, 20, 41, 0.08); }
.import-banner.is-error > .icon { color: #ff6b7a; }
.import-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.import-text strong { font-size: 13px; font-weight: 700; }
.import-current {
  font-size: 12px;
  color: var(--text-subdued);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.import-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
}
.import-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.5s ease;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn .icon { width: 18px; height: 18px; flex: none; }
.btn:hover { transform: scale(1.03); }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.4; pointer-events: none; }
.btn-ghost { color: var(--text-subdued); background: transparent; }
.btn-ghost:hover { color: var(--text); }
.btn-danger { background: #e91429; color: #fff; }
.btn-danger:hover { background: #f52a3e; }

.playlist-picker { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px;
  border-radius: 5px;
  text-align: left;
}
.picker-row:hover { background: rgba(255, 255, 255, 0.08); }
.picker-row img,
.picker-row .picker-cover {
  width: 44px;
  height: 44px;
  border-radius: 3px;
  object-fit: cover;
  background: #3a3a3a;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--text-subdued);
}
.picker-row .picker-cover .icon { width: 18px; height: 18px; }
.picker-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-check { color: var(--accent); opacity: 0; }
.picker-check .icon { width: 20px; height: 20px; }
.picker-row.is-added .picker-check { opacity: 1; }
.picker-new { color: var(--text-subdued); }
.picker-new:hover { color: var(--text); }

.context-menu {
  position: fixed;
  z-index: 600;
  min-width: 230px;
  padding: 5px;
  background: #282828;
  border: 1px solid #3a3a3a;
  border-radius: 5px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.6);
  animation: fade-in 0.1s ease;
}
.context-menu[hidden] { display: none; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 3px;
  font-size: 14px;
  color: var(--text);
  text-align: left;
}
.menu-item:hover { background: rgba(255, 255, 255, 0.1); }
.menu-item .icon { width: 17px; height: 17px; color: var(--text-subdued); }
.menu-item.danger { color: #ff6b7a; }
.menu-item.danger .icon { color: #ff6b7a; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 6px; }

.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(var(--player-h) + 22px);
  transform: translateX(-50%);
  z-index: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.25s ease;
  max-width: min(520px, calc(100vw - 32px));
}
.toast.success { background: var(--accent); }
.toast.error { background: #e91429; color: #fff; }
.toast.info { background: #fff; }
.toast .icon { width: 18px; height: 18px; flex: none; }
.toast.toast-out { animation: toast-out 0.25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1100px) {
  :root { --sidebar-w: 260px; }
  .detail-cover { width: 180px; height: 180px; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    left: 8px;
    top: 8px;
    bottom: calc(var(--player-h) + 8px);
    width: min(320px, calc(100vw - 60px));
    z-index: 40;
    transform: translateX(calc(-100% - 16px));
    transition: transform 0.22s ease;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
  }
  .sidebar.is-open { transform: none; }
  .sidebar-backdrop:not([hidden]) { display: block; }
  .menu-btn { display: inline-grid; }
  .history-buttons { display: none; }
  :root { --player-h: 108px; }
  .player {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-content: center;
    column-gap: 10px;
    row-gap: 6px;
    padding: 8px 14px 10px;
  }
  .player-center { display: contents; }
  .player-left { grid-column: 1; grid-row: 1; }
  .controls { grid-column: 2; grid-row: 1; justify-self: end; }
  .player-center .progress-row {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    gap: 8px;
    padding-bottom: 0;
  }
  .player-right { display: none; }
  .time { min-width: 34px; font-size: 11px; }
  .seek { height: 5px; padding: 0; }
  .seek::-webkit-slider-thumb { width: 14px; height: 14px; opacity: 1; }
  .seek::-moz-range-thumb { width: 14px; height: 14px; opacity: 1; }
  .seek { background: linear-gradient(to right, var(--accent) var(--val, 0%), #4d4d4d var(--val, 0%)); }
  .controls { gap: 8px; }
  .controls #btn-shuffle, .controls #btn-repeat { display: none; }
  .detail-header { gap: 20px; }
  .detail-cover { width: 150px; height: 150px; }
}

@media (max-width: 640px) {
  .topbar { padding: 12px 14px; gap: 10px; }
  .content { padding: 0 14px 28px; }
  .search-field { height: 42px; }
  .avatar { display: none; }
  .greeting { font-size: 23px; margin: 6px 0 16px; }
  .section-head h2 { font-size: 19px; }
  .quick-grid { grid-template-columns: 1fr; }
  .quick-tile { height: 60px; }
  .quick-tile-cover { width: 60px; height: 60px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .card { padding: 12px; }
  .detail-header { flex-direction: column; align-items: flex-start; gap: 16px; padding-top: 14px; }
  .detail-cover { width: 132px; height: 132px; }
  .detail-title { font-size: 30px; letter-spacing: -1px; }
  .detail-actions { padding-top: 10px; gap: 14px; }
  .detail-actions .icon-btn { width: 34px; height: 34px; }
  .play-pill { width: 50px; height: 50px; }
  .track-head { display: none; }
  .track-row {
    grid-template-columns: 24px minmax(0, 1fr) 56px;
    gap: 10px;
    padding: 8px;
  }
  .track-artist-col,
  .track-added,
  .track-duration { display: none; }
  .track-artist-inline { display: block; }
  .import-status-inline { display: block; }
  .missing-inline { display: block; }
  .track-actions { opacity: 1; }
  .player { padding: 8px 10px 10px; }
  :root { --player-h: 104px; }
  .player-art { width: 46px; height: 46px; }
  .heart-btn { display: none; }
  .player-title { font-size: 13px; }
  .play-pause { width: 34px; height: 34px; }
  .controls .icon-btn { width: 30px; height: 30px; }
  .browse-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .browse-tile { font-size: 16px; padding: 12px; aspect-ratio: 1.55 / 1; }
  .result-thumb { width: 48px; height: 48px; }
  .result-row { padding: 6px; gap: 10px; }
  .btn-add { padding: 7px 12px; font-size: 12px; }
  .btn-add span { display: none; }
  .btn-add .icon { margin: 0; }
  .search-heading { font-size: 24px; }
  .toast-root { bottom: calc(var(--player-h) + 14px); }
  .queue-panel { right: 8px; bottom: calc(var(--player-h) + 8px); width: calc(100vw - 16px); }
}

@media (max-width: 380px) {
  .player-art { display: none; }
}

/* ============================================================
   Auth, Profil & Admin
   ============================================================ */

.auth-mode .app,
.auth-mode .player { display: none !important; }

.auth-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow-y: auto;
  background: #000;
}

.auth-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(30, 215, 96, 0.14), transparent 60%),
    radial-gradient(700px 450px at 90% 90%, rgba(69, 10, 245, 0.16), transparent 60%),
    #000;
}

.auth-card {
  width: min(440px, 100%);
  background: #121212;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
}

.auth-loading {
  display: grid;
  place-items: center;
  min-height: 160px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.6px;
}
.auth-brand .logo-badge { width: 34px; height: 34px; }
.auth-brand .logo-badge .icon { width: 20px; height: 20px; }

.auth-sub {
  color: var(--text-subdued);
  font-size: 13px;
  margin: 12px 0 20px;
  line-height: 1.5;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  background: #1a1a1a;
  border-radius: 999px;
}
.auth-tab {
  flex: 1;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--text-subdued);
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.is-active { background: #fff; color: #000; }

.auth-form { display: flex; flex-direction: column; gap: 8px; }

.auth-label {
  display: block;
  margin: 6px 0 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-subdued);
}

.auth-input {
  width: 100%;
  padding: 12px 13px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: #242424;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.auth-input:focus { border-color: #fff; background: #2a2a2a; }

.auth-submit { width: 100%; margin-top: 14px; }
.auth-error {
  min-height: 18px;
  margin-top: 6px;
  color: #ff6b7a;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
}
.auth-hint {
  margin: 4px 0;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}

/* Sidebar-Profil */
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  margin: 0 0 14px;
  border-radius: 6px;
  text-align: left;
  transition: background 0.15s ease;
}
.sidebar-profile:hover { background: rgba(255, 255, 255, 0.08); }
.sidebar-avatar {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1ed760, #0e7a3c);
  color: #000;
  font-size: 16px;
  font-weight: 800;
}
.sidebar-avatar img,
.avatar img,
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.sidebar-profile-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.sidebar-profile-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-profile-username {
  font-size: 12px;
  color: var(--text-subdued);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-profile-badge {
  flex: none;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(30, 215, 96, 0.14);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Profilseite */
.profile-view { max-width: 1040px; }
.profile-header {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 24px 8px 30px;
}
.profile-avatar-wrap { position: relative; flex: none; }
.profile-avatar {
  width: 122px;
  height: 122px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1ed760, #0e7a3c);
  color: #000;
  font-size: 44px;
  font-weight: 900;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.45);
}
.profile-avatar-edit {
  position: absolute;
  right: 0;
  bottom: 2px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: #000;
  border: 3px solid var(--bg-main);
}
.profile-avatar-edit .icon { width: 17px; height: 17px; }
.profile-head-text { min-width: 0; }
.profile-title {
  margin: 6px 0 4px;
  font-size: 44px;
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.profile-handle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-subdued);
  font-size: 14px;
}
.profile-email { margin-top: 4px; color: var(--text-dim); font-size: 13px; }
.role-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(30, 215, 96, 0.14);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  padding: 0 8px 40px;
}
.profile-card {
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.profile-card h2 { margin-bottom: 12px; font-size: 18px; font-weight: 800; }
.profile-card .auth-label { margin-top: 8px; }
.profile-card .auth-input { margin-bottom: 8px; }
.profile-note {
  color: var(--text-subdued);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 16px;
}
.profile-card-danger { border-color: rgba(233, 20, 41, 0.25); }
.form-actions { display: flex; justify-content: flex-end; margin-top: 8px; }

/* Admin / Invites */
.admin-panel { padding: 4px 0 30px; }
.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.admin-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.admin-head p {
  max-width: 680px;
  margin-top: 5px;
  color: var(--text-subdued);
  font-size: 13px;
  line-height: 1.55;
}
.invite-list { display: flex; flex-direction: column; gap: 8px; }
.invite-row {
  display: grid;
  grid-template-columns: minmax(250px, 1.5fr) minmax(210px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.invite-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.invite-code {
  padding: 5px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.invite-status {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-subdued);
  font-size: 12px;
  font-weight: 700;
}
.invite-status.is-open { color: var(--accent); background: rgba(30, 215, 96, 0.12); }
.invite-status.is-used { color: var(--text-subdued); }
.invite-status.is-expired,
.invite-status.is-revoked { color: #ff9d6b; background: rgba(255, 157, 107, 0.1); }
.invite-meta { display: flex; flex-direction: column; gap: 2px; color: var(--text-subdued); font-size: 12px; }
.invite-actions { display: flex; justify-content: flex-end; gap: 8px; }
.invite-copy,
.invite-revoke {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.invite-copy:hover { border-color: #fff; background: rgba(255, 255, 255, 0.06); }
.invite-revoke { color: #ff6b7a; border-color: rgba(255, 107, 122, 0.4); }
.invite-revoke:hover { border-color: #ff6b7a; background: rgba(233, 20, 41, 0.08); }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 8px 0 28px;
}
.admin-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-subdued);
  font-size: 13px;
}
.admin-stat span { color: var(--text); font-size: 26px; font-weight: 800; }
.admin-view .admin-panel + .admin-panel { margin-top: 12px; }
.admin-panel .empty-state {
  padding: 36px 20px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.admin-panel .empty-state .icon { width: 40px; height: 40px; }
.admin-panel .empty-state h3 { font-size: 18px; }
.admin-user-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(200px, 1fr) minmax(200px, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.admin-user-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.admin-user-avatar {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1ed760, #138a3e);
  color: #000;
  font-weight: 800;
}
.admin-user-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.admin-user-online {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-card);
}
.admin-user-text { min-width: 0; }
.admin-user-name { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.admin-user-sub {
  overflow: hidden;
  color: var(--text-subdued);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-user-meta { display: flex; flex-direction: column; gap: 3px; color: var(--text-subdued); font-size: 12px; }
.admin-user-meta b { color: var(--text); font-weight: 600; }
.invite-code.is-small { padding: 1px 5px; font-size: 11px; }

@media (max-width: 800px) {
  .invite-row { grid-template-columns: 1fr; gap: 10px; }
  .admin-user-row { grid-template-columns: 1fr; gap: 10px; }
  .admin-head { gap: 12px; margin-bottom: 14px; }
  .admin-head .btn { align-self: stretch; }
  .admin-stats { gap: 8px; margin-bottom: 22px; }
  .admin-stat { padding: 12px; font-size: 12px; }
  .admin-stat span { font-size: 22px; }
  .invite-row { padding: 12px; }
  .invite-code { font-size: 13px; word-break: break-all; }
  .invite-actions { justify-content: flex-start; }
  .admin-head { flex-direction: column; }
}

@media (max-width: 640px) {
  .auth-card { padding: 22px 18px; }
  .profile-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .profile-title { font-size: 30px; letter-spacing: -1px; }
  .profile-avatar { width: 96px; height: 96px; font-size: 34px; }
  .profile-grid { padding: 0 0 28px; }
  .profile-card { padding: 16px; }
}
