/* Nexus Sonorum – dunkles Design im Stil von iTunes-Coverflow und Tidal, mit dunkelblauen Akzenten. */

:root {
  --bg: #0a0c12;
  --bg-2: #10131b;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --surface-3: rgba(255, 255, 255, 0.13);
  --glass: rgba(16, 19, 27, 0.72);
  --glass-strong: rgba(13, 15, 22, 0.9);
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --text: #eef0f5;
  --text-2: #a3a9b8;
  --text-3: #6d7384;
  --accent: #3b6ff0;
  --accent-2: #5a87ff;
  --accent-soft: rgba(59, 111, 240, 0.18);
  --accent-text: #8fb0ff;
  --danger: #ff6b6b;
  --ok: #41d39b;
  --warn: #f2b84b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "SF Pro Text", Roboto, "Helvetica Neue", sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "SF Pro Display", sans-serif;
  --pb-h: 86px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f3f5f9;
  --bg-2: #ffffff;
  --surface: rgba(10, 20, 40, 0.04);
  --surface-2: rgba(10, 20, 40, 0.07);
  --surface-3: rgba(10, 20, 40, 0.12);
  --glass: rgba(255, 255, 255, 0.78);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --border: rgba(10, 20, 40, 0.08);
  --border-2: rgba(10, 20, 40, 0.14);
  --text: #111521;
  --text-2: #4f5668;
  --text-3: #7d8496;
  --accent: #1d4ed8;
  --accent-2: #2b5ff0;
  --accent-soft: rgba(29, 78, 216, 0.12);
  --accent-text: #1d4ed8;
  --shadow: 0 18px 50px rgba(20, 30, 60, 0.16);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
}
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.ic { width: 20px; height: 20px; flex: none; display: block; }
.small .ic, .icon-btn.small .ic { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ Grundlayout */

.app { position: fixed; inset: 0; display: grid; grid-template-rows: 60px auto 1fr var(--pb-h); grid-template-columns: minmax(0, 1fr); }
.app > *, .main > *, .playerbar > * { min-width: 0; }

.ambient { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.ambient-img {
  position: absolute; inset: -12%; background-size: cover; background-position: center;
  filter: blur(80px) saturate(1.5); opacity: 0; transition: opacity 1.2s ease; transform: scale(1.1);
}
.ambient-img.on { opacity: 0.42; }
:root[data-theme="light"] .ambient-img.on { opacity: 0.28; }
.ambient::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 0%, var(--bg) 82%); }

.topbar, .chips-row, .main, .playerbar { position: relative; z-index: 1; }

.topbar {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px; padding: 0 18px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font: 600 17px var(--display); letter-spacing: 0.01em; white-space: nowrap; }
.brand-name span { font-size: 0.66em; font-weight: 700; letter-spacing: 0.22em; color: var(--accent-text); margin-left: 3px; }

.segments { justify-self: center; display: flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-2); }
.segment {
  display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 6px 14px; border-radius: 8px;
  color: var(--text-2); cursor: pointer; font-weight: 500; transition: background .15s, color .15s;
}
.segment:hover { color: var(--text); }
.segment.on { background: var(--bg-2); color: var(--text); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25); }

.search-box { position: relative; width: min(300px, 28vw); }
.search-box input {
  width: 100%; height: 34px; padding: 0 12px 0 34px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); outline: none; transition: border-color .15s, background .15s;
}
.search-box input:focus { border-color: var(--accent); background: var(--surface-2); }
.search-ic { position: absolute; left: 10px; top: 8px; color: var(--text-3); }
.search-ic .ic { width: 18px; height: 18px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0;
  background: transparent; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s, transform .1s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.on { color: var(--accent-text); }
.icon-btn.dark { color: rgba(255, 255, 255, 0.82); background: rgba(255, 255, 255, 0.08); }
.icon-btn.dark:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.icon-btn.dark.on { background: rgba(90, 135, 255, 0.35); color: #fff; }
.icon-btn:disabled { opacity: .35; cursor: default; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 18px; cursor: pointer;
  border: 1px solid var(--border-2); background: var(--surface-2); font-weight: 600; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn .ic { width: 17px; height: 17px; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.small { height: 30px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }

.chips-row { display: flex; align-items: center; gap: 8px; padding: 2px 18px 10px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--border); background: var(--surface); padding: 5px 13px; border-radius: 16px; cursor: pointer;
  color: var(--text-2); white-space: nowrap; font-size: 13px; transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--border-2); }
.chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); font-weight: 600; }
.chips.dark .chip { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.75); }
.chips.dark .chip.on { background: rgba(90, 135, 255, 0.35); color: #fff; }

.main { display: grid; grid-template-rows: 11fr 9fr; min-height: 0; position: relative; }

/* ------------------------------------------------------------------ Coverflow */

.flow-area { position: relative; min-height: 220px; display: grid; grid-template-rows: 1fr auto auto; }
.coverflow {
  position: relative; overflow: hidden; perspective: 1250px; perspective-origin: 50% 42%; cursor: grab; touch-action: pan-y;
  --cf-size: 280px;
}
.coverflow:active { cursor: grabbing; }
.cf-stage { position: absolute; left: 50%; top: 44%; width: 0; height: 0; transform-style: preserve-3d; }
.cf-item {
  position: absolute; width: var(--cf-size); height: var(--cf-size); left: calc(var(--cf-size) / -2); top: calc(var(--cf-size) / -2);
  transform-style: preserve-3d; will-change: transform; backface-visibility: hidden;
}
.cf-cover {
  width: 100%; height: 100%; border-radius: 10px; overflow: hidden; position: relative;
  background: linear-gradient(145deg, #232a3d, #151925); box-shadow: 0 22px 46px rgba(0, 0, 0, 0.5);
  -webkit-box-reflect: below 3px linear-gradient(transparent 58%, rgba(255, 255, 255, 0.22));
}
:root[data-theme="light"] .cf-cover { background: linear-gradient(145deg, #dfe4ee, #c9d0de); box-shadow: 0 22px 46px rgba(20, 30, 60, 0.25); }
.cf-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.cf-cover.loaded img { opacity: 1; }
.cf-ph { position: absolute; inset: 0; display: grid; place-items: center; font: 600 calc(var(--cf-size) * 0.18) var(--display); color: rgba(255, 255, 255, 0.18); }
:root[data-theme="light"] .cf-ph { color: rgba(20, 30, 60, 0.2); }
.cf-item.is-center .cf-cover { box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06); }

.flow-caption { text-align: center; padding: 0 20px; min-height: 46px; }
.flow-caption .t { font: 600 17px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-caption .s { color: var(--text-2); font-size: 13px; }
.scrubber { width: min(520px, 70vw); justify-self: center; margin: 6px 0 4px; accent-color: var(--accent); opacity: .55; }
.scrubber:hover { opacity: 1; }
.flow-empty, .flow-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: var(--text-2); text-align: center; padding: 20px;
}
.flow-empty p { max-width: 460px; margin: 0; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ Titelliste */

.detail {
  margin: 0 18px 12px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--border);
  backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3);
  display: grid; grid-template-rows: auto 1fr; min-height: 0; overflow: hidden;
}
.detail-head { display: flex; align-items: center; gap: 16px; padding: 14px 18px 10px; border-bottom: 1px solid var(--border); }
.detail-info { flex: 1; min-width: 0; }
.detail-info h2 { margin: 0; font: 600 20px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-sub { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-meta { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.detail-quality { color: var(--accent-text); font-size: 12px; font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-actions { display: flex; gap: 8px; }
.tracks { overflow-y: auto; padding: 4px 6px 10px; user-select: none; }
.track {
  display: grid; grid-template-columns: 38px minmax(0, 3fr) minmax(0, 2fr) 120px 34px 56px; align-items: center; gap: 8px;
  height: 40px; padding: 0 10px; border-radius: 8px; cursor: default;
}
.track:hover { background: var(--surface); }
.track.current { background: var(--accent-soft); }
.track.current .t-title { color: var(--accent-text); font-weight: 600; }
.track.disabled { opacity: .42; }
.t-num { color: var(--text-3); text-align: center; font-variant-numeric: tabular-nums; }
.t-title, .t-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-artist { color: var(--text-2); }
.t-format { color: var(--text-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-dur { color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }
.t-star { opacity: 0; }
.track:hover .t-star, .t-star.on { opacity: 1; }
.t-star.on { color: #ff5a7a; }
.tracks-empty { padding: 24px; color: var(--text-3); text-align: center; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; background: var(--accent-text); animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; } .eq i:nth-child(3) { animation-delay: -0.6s; }
.eq.paused i { animation-play-state: paused; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }

/* ------------------------------------------------------------------ Player-Leiste */

.playerbar {
  display: grid; grid-template-columns: minmax(240px, 3fr) minmax(320px, 4fr) minmax(240px, 3fr); align-items: center; gap: 18px;
  padding: 0 18px; background: var(--glass-strong); border-top: 1px solid var(--border);
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); z-index: 5;
}
.pb-now { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pb-cover {
  width: 58px; height: 58px; border-radius: 8px; border: 0; padding: 0; flex: none; cursor: pointer;
  background: var(--surface-2) center/cover no-repeat; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.pb-text { min-width: 0; flex: 1; }
.pb-title { display: block; max-width: 100%; border: 0; background: none; padding: 0; text-align: left; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-title:hover { text-decoration: underline; }
.pb-artist { color: var(--text-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-badges { display: flex; gap: 8px; align-items: center; margin-top: 3px; min-height: 18px; }
.badge { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; }
.badge:empty { display: none; }
.pb-buffer { font-size: 11px; color: var(--accent-text); }
.heart.on, .icon-btn.heart.on { color: #ff5a7a; }
.pb-center { display: grid; gap: 4px; justify-items: center; }
.pb-transport { display: flex; align-items: center; gap: 8px; }
.play-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--text); color: var(--bg); transition: transform .1s;
}
.play-btn:hover { transform: scale(1.06); }
.play-btn .ic { width: 20px; height: 20px; }
.pb-progress { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 10px; width: 100%; font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pb-progress span:first-child { text-align: right; }
.pb-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.volume { width: 96px; }

input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; height: 16px; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--fill-color, var(--text)) var(--fill, 0%), var(--surface-3) var(--fill, 0%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--text); margin-top: -4px; opacity: 0; transition: opacity .15s; }
input[type=range]:hover::-webkit-slider-thumb { opacity: 1; }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--surface-3); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--text); }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--text); }
.seek:hover { --fill-color: var(--accent-2); }

/* ------------------------------------------------------------------ Panels: Warteschlange */

.panel {
  background: var(--glass-strong); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
}
.queue { position: fixed; right: 18px; top: 70px; bottom: calc(var(--pb-h) + 12px); width: min(400px, calc(100vw - 36px)); z-index: 20; display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px 18px; }
.panel-head h3 { flex: 1; margin: 0; font: 600 17px var(--display); }
.queue-list { overflow-y: auto; padding: 0 8px 12px; }
.q-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.q-item:hover { background: var(--surface); }
.q-item.current { background: var(--accent-soft); }
.q-item.past { opacity: .5; }
.q-cover { width: 40px; height: 40px; border-radius: 6px; background: var(--surface-2) center/cover; }
.q-text { min-width: 0; }
.q-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.q-artist { color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-item .icon-btn { opacity: 0; }
.q-item:hover .icon-btn { opacity: 1; }
.q-label { color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 10px 10px 4px; }

/* ------------------------------------------------------------------ Wird gespielt */

.nowplaying { position: fixed; inset: 0 0 var(--pb-h) 0; z-index: 10; background: #05070c; color: #fff; overflow: hidden; }
.app.idle.np-open .nowplaying { bottom: 0; }
.np-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.np-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.62) 0%, rgba(0,0,0,.22) 50%, rgba(0,0,0,.52) 100%); pointer-events: none; }
.np-inner { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); padding: 18px 34px 22px; gap: 14px; }
.np-top { display: flex; align-items: center; gap: 12px; }
.np-top .chips { flex: 1; min-width: 0; }
.np-actions { display: flex; gap: 8px; }
.np-body { display: grid; grid-template-columns: auto 1fr; gap: 54px; min-height: 0; align-items: center; }
.np-stage { width: min(380px, 34vw, 52vh); }
.np-cover { width: 100%; aspect-ratio: 1; border-radius: 14px; background: #202638 center/cover; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6); }
.np-title { font: 700 26px var(--display); margin-top: 24px; line-height: 1.2; }
.np-artist { font-size: 17px; color: rgba(255, 255, 255, 0.8); margin-top: 4px; }
.np-album { font-size: 14px; color: rgba(255, 255, 255, 0.55); margin-top: 2px; }
.np-badges { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.np-badges .badge { background: rgba(255, 255, 255, 0.15); color: rgba(255, 255, 255, 0.92); }
.np-right { position: relative; height: 100%; min-height: 0; }
.np-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; color: rgba(255,255,255,.75); font-size: 18px; padding: 20px; }

.np-lyrics { position: absolute; inset: 0; }
.lyrics-scroll {
  position: absolute; inset: 0; overflow-y: auto; scrollbar-width: none;
  mask-image: linear-gradient(transparent 0%, #000 14%, #000 82%, transparent 100%);
  -webkit-mask-image: linear-gradient(transparent 0%, #000 14%, #000 82%, transparent 100%);
}
.lyrics-scroll::-webkit-scrollbar { display: none; }
.lyrics-lines { padding: 30vh 30px 40vh 0; }
.ly { font: 700 30px/1.3 var(--display); margin: 0 0 18px; color: rgba(255, 255, 255, 0.92); cursor: pointer; transition: color .3s, transform .3s; transform-origin: left center; }
.synced .ly { color: rgba(255, 255, 255, 0.32); }
.synced .ly.past { color: rgba(255, 255, 255, 0.5); }
.synced .ly.active { color: #fff; transform: scale(1.04); }
.ly:empty::before { content: "♪"; }

.singalong { position: absolute; inset: 0; display: grid; grid-template-rows: 1fr auto; }
.sing-lines { align-self: center; text-align: center; padding: 0 10px; transition: none; }
.sing-prev, .sing-next2 { font: 600 22px var(--display); color: rgba(255, 255, 255, 0.26); }
.sing-next { font: 600 29px var(--display); color: rgba(255, 255, 255, 0.62); margin-top: 32px; }
.sing-next2 { margin-top: 14px; }
.sing-prev { margin-bottom: 28px; }
.sing-cur {
  --p: 0%;
  font: 800 clamp(30px, 4.2vw, 54px)/1.18 var(--display); display: inline-block; max-width: 100%;
  background: linear-gradient(90deg, #fff var(--p), rgba(255, 255, 255, 0.3) calc(var(--p) + 3%));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(90, 135, 255, 0.55));
}
.sing-anim { animation: singIn .38s cubic-bezier(.2, .8, .2, 1); }
@keyframes singIn { from { transform: translateY(26px); opacity: .35; } to { transform: none; opacity: 1; } }
.sing-note { text-align: center; color: rgba(255, 255, 255, 0.45); font-size: 12px; }

/* ------------------------------------------------------------------ Vollbild: Leisten nach Inaktivität ausblenden */

.app.fs .topbar, .app.fs .chips-row { display: none; }
.app.fs { grid-template-rows: 0 0 1fr var(--pb-h); }
.app.idle .chrome { opacity: 0; pointer-events: none; transition: opacity .6s; }
.app.idle { cursor: none; }
.app.idle.np-open { grid-template-rows: 0 0 1fr 0; }
.chrome { transition: opacity .25s; }

/* ------------------------------------------------------------------ Einstellungen */

.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.5); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(6px); }
.modal-card {
  position: relative; width: min(1020px, 100%); height: min(720px, 100%); display: grid; grid-template-columns: 220px 1fr;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
}
.modal-close { position: absolute; top: 10px; right: 10px; }
.settings-nav { padding: 18px 10px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.settings-nav h2 { font: 600 18px var(--display); margin: 4px 10px 14px; }
.nav-item { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 9px 12px; border-radius: 9px; text-align: left; cursor: pointer; color: var(--text-2); }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.settings-body { overflow-y: auto; padding: 26px 34px 40px; user-select: text; }
.settings-body h2 { font: 600 22px var(--display); margin: 0 0 4px; }
.settings-body h3 { font-size: 11.5px; letter-spacing: .1em; color: var(--text-3); text-transform: uppercase; margin: 26px 0 10px; }
.settings-body p.hint, .hint { color: var(--text-2); margin: 6px 0; font-size: 13px; }
.hint.small { font-size: 12px; color: var(--text-3); }
.field { display: grid; gap: 5px; margin-bottom: 12px; align-content: start; }
.field label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--border-2); background: var(--surface); outline: none;
}
.textarea { height: 200px; padding: 10px 11px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
.select option { background: var(--bg-2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; align-items: start; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 14px; align-items: start; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; margin: 8px 0; }
.toggle input { appearance: none; width: 40px; height: 22px; border-radius: 11px; background: var(--surface-3); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(18px); }
.card { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 14px 16px; margin: 10px 0; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); }
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill.ok { color: var(--ok); background: rgba(65, 211, 155, 0.12); }
.status-pill.bad { color: var(--danger); background: rgba(255, 107, 107, 0.12); }
.status-pill.warn { color: var(--warn); background: rgba(242, 184, 75, 0.12); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 4px 14px; font-size: 13px; margin-top: 10px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.msg { margin-top: 8px; font-size: 13px; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }
.msg.warn { color: var(--warn); }
.share-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.share-row + .share-row { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.share-title { font-weight: 600; overflow-wrap: anywhere; }
.share-sub { color: var(--text-3); font-size: 12px; }
.tabs-mini { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); margin: 6px 0 12px; }
.tabs-mini button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; cursor: pointer; color: var(--text-2); }
.tabs-mini button.on { background: var(--bg-2); color: var(--text); }
.shortcuts { display: grid; grid-template-columns: 170px 1fr; gap: 6px 16px; font-size: 13px; }
.shortcuts kbd { font-family: inherit; font-size: 12px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-2); background: var(--surface); }

/* ------------------------------------------------------------------ Kontextmenü, Toast, Login */

.context-menu { position: fixed; z-index: 60; min-width: 220px; padding: 6px; background: var(--glass-strong); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow); backdrop-filter: blur(24px); }
.context-menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.context-menu button:hover { background: var(--surface-2); }
.context-menu .ic { width: 17px; height: 17px; color: var(--text-2); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--pb-h) + 18px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 70;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 600; max-width: min(560px, 90vw);
  box-shadow: var(--shadow); transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.login { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #1a2550, var(--bg) 60%); }
.login-card { width: min(360px, 90vw); display: grid; gap: 14px; justify-items: center; padding: 34px; border-radius: 20px; background: var(--glass); border: 1px solid var(--border); box-shadow: var(--shadow); }
.login-card .brand-name { font-size: 24px; margin: 0; }
.login-card input { width: 100%; height: 42px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--border-2); background: var(--surface); outline: none; }
.login-card .btn { width: 100%; justify-content: center; height: 42px; }
.login-error { color: var(--danger); min-height: 1em; margin: 0; }

/* ------------------------------------------------------------------ Kleine Bildschirme (Handy, Tablet hochkant) */

@media (max-width: 900px) {
  .app { --pb-h: 132px; }
  .playerbar {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; grid-template-areas: "now right" "center center";
    gap: 6px 10px; padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  }
  .pb-now { grid-area: now; }
  .pb-right { grid-area: right; }
  .pb-center { grid-area: center; }
  .pb-right .volume, #pbMute, #pbFull, #pbLyrics { display: none; }
  .pb-cover { width: 46px; height: 46px; }
  .track { grid-template-columns: 30px minmax(0, 1fr) 46px; }
  .t-artist, .t-format, .t-star { display: none; }
  .np-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 14px; align-items: start; }
  .np-stage { width: min(260px, 62vw, 30vh); justify-self: center; text-align: center; }
  .np-title { font-size: 20px; margin-top: 14px; }
  .np-artist { font-size: 15px; }
  .np-right { min-height: 200px; }
  .lyrics-lines { padding: 12vh 6px 30vh; }
  .np-badges { justify-content: center; }
  .modal-card { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .settings-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px; }
  .settings-nav h2 { display: none; }
  .settings-body { padding: 20px 18px 40px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar { grid-template-columns: auto 1fr auto; gap: 8px; padding: 0 12px; }
  .brand-name { display: none; }
  .search-box { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .app { grid-template-rows: 96px auto 1fr var(--pb-h); }
  .topbar { grid-template-rows: 48px 40px; align-content: center; }
  .segment { padding: 6px 10px; }
  .detail { margin: 0 10px 10px; }
  .main { grid-template-rows: minmax(210px, 5fr) 6fr; }
  .detail-head { flex-wrap: wrap; gap: 10px; padding: 12px 14px 10px; }
  .detail-info { flex-basis: 100%; }
  .detail-info h2 { font-size: 18px; }
  .chips-row { padding: 2px 12px 8px; }
  .np-inner { padding: 12px 16px; }
  .ly { font-size: 22px; }
}
