/* =========================================================
   HOLLOW – Basis-Styles (gemeinsam für App, Share, Stream)
   ========================================================= */

:root {
    --bg: #070a12;
    --bg-2: #0b0f1a;
    --panel: #10141f;
    --panel-2: #171c2a;
    --panel-3: #212838;
    --line: rgba(255, 255, 255, .07);
    --line-2: rgba(255, 255, 255, .12);
    --text: #eeeef6;
    --muted: #8a93ab;
    --muted-2: #5b647c;

    --accent: #1d4ed8;
    --accent-2: #6b9bff;
    --accent-rgb: 29, 78, 216;
    --accent-soft: rgba(var(--accent-rgb), .16);
    --accent-glow: 0 10px 30px -8px rgba(var(--accent-rgb), .7);

    --danger: #ff4d6d;
    --success: #2ed3a0;
    --warn: #ffb547;

    --r-sm: 10px;
    --r: 14px;
    --r-lg: 20px;
    --r-xl: 26px;

    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --player-h: 92px;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

/* Live-Farben: werden aktiv, sobald gestreamt wird (App) bzw. auf der Stream-Seite */
.theme-live {
    --accent: #ff3d6e;
    --accent-2: #ff9a4d;
    --accent-rgb: 255, 61, 110;
    --bg: #0f080b;
    --bg-2: #160b10;
    --panel: #1a0d13;
    --panel-2: #231219;
    --panel-3: #2e1820;
    --line: rgba(255, 140, 160, .09);
    --line-2: rgba(255, 140, 160, .16);
    --muted: #b08a96;
    --muted-2: #7a5862;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color .6s var(--ease);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; }
::selection { background: rgba(var(--accent-rgb), .45); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.accent-text { color: var(--accent-2); }
.danger-text { color: var(--danger) !important; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--panel-3) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- Icons ---------- */
.i { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: flex; align-items: center; gap: 3px; height: 26px; }
.brand-mark i { display: block; width: 4px; border-radius: 4px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); animation: mark 1.4s ease-in-out infinite; }
.brand-mark i:nth-child(1) { height: 12px; animation-delay: -.2s; }
.brand-mark i:nth-child(2) { height: 24px; animation-delay: -.6s; }
.brand-mark i:nth-child(3) { height: 18px; animation-delay: -.9s; }
.brand-mark i:nth-child(4) { height: 9px;  animation-delay: -.4s; }
@keyframes mark { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.55); } }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 16px; font-weight: 800; letter-spacing: .08em; }
.brand-text small { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.brand-lg .brand-mark { height: 34px; }
.brand-lg .brand-text b { font-size: 20px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
    background: var(--panel-2); color: var(--text); font-weight: 600; font-size: 13.5px;
    cursor: pointer; white-space: nowrap; transition: transform .15s var(--ease), background .2s, box-shadow .2s, border-color .2s, opacity .2s;
}
.btn:hover { background: var(--panel-3); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .i { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--accent-glow); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .22); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #ff6b85; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 12.5px; }
.btn-block { width: 100%; }

.icon-btn {
    display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none;
    transition: color .2s, background .2s, transform .15s;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm .i { width: 16px; height: 16px; }
.icon-btn.active { color: var(--accent-2); }
.icon-btn.is-fav { color: var(--danger); }
.icon-btn.is-fav .i { fill: currentColor; }

.play-btn {
    display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 0;
    background: var(--accent); color: #fff; cursor: pointer; box-shadow: var(--accent-glow);
    transition: transform .15s var(--ease), background .2s;
}
.play-btn:hover { transform: scale(1.06); }
.play-btn:active { transform: scale(.95); }
.play-btn .i { width: 20px; height: 20px; }
.play-btn .ic-play { margin-left: 2px; }
.play-btn .ic-pause, .play-btn.playing .ic-play { display: none; }
.play-btn.playing .ic-pause { display: block; }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 16px; border-radius: 999px;
    border: 1px solid var(--line-2); background: transparent; color: var(--text); font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all .2s var(--ease); white-space: nowrap;
}
.chip:hover { border-color: rgba(255, 255, 255, .28); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: var(--accent-glow); }
.chip-sm { height: 28px; padding: 0 11px; font-size: 12px; }
.chip .i { width: 14px; height: 14px; }
.chip em { font-style: normal; color: var(--muted); font-size: 11px; }
.chip.active em { color: rgba(255, 255, 255, .75); }

.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--accent-soft); color: var(--accent-2); }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: rgba(255, 255, 255, .07); color: var(--muted); }
.badge.accent { background: var(--accent-soft); color: var(--accent-2); }
.badge.ok { background: rgba(46, 211, 160, .14); color: var(--success); }
.badge.bad { background: rgba(255, 77, 109, .14); color: var(--danger); }
.badge.warn { background: rgba(255, 181, 71, .14); color: var(--warn); }

/* ---------- Formulare ---------- */
.field { position: relative; display: block; }
.field input, .field textarea, .field select, .input {
    width: 100%; height: 46px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--line-2);
    background: var(--bg-2); color: var(--text); outline: none; transition: border-color .2s, box-shadow .2s;
}
.field textarea, textarea.input { height: auto; min-height: 96px; padding: 12px 16px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus, .input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .15); }
.field-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.field-icon + input { padding-left: 44px; }
.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 7px 2px; }
select.input, .field select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
select option { background: var(--panel-2); }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 13px; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check span { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); display: grid; place-items: center; transition: all .2s; flex: none; }
.check input:checked + span { background: var(--accent); border-color: var(--accent); }
.check input:checked + span::after { content: ''; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: var(--panel-3); position: relative; transition: background .25s; flex: none; }
.switch .track::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* Range-Slider */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px; outline: none; cursor: pointer;
    background: linear-gradient(90deg, var(--accent) 0, var(--accent) var(--p, 50%), var(--panel-3) var(--p, 50%)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); transition: transform .15s; }
.range::-webkit-slider-thumb:hover { transform: scale(1.2); }
.range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }

/* ---------- Cover-Platzhalter ---------- */
.cover-ph { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255, 255, 255, .5);
    background: radial-gradient(120% 120% at 20% 10%, rgba(var(--accent-rgb), .55), transparent 60%), linear-gradient(135deg, #111a36, #0b0f1a); }
.cover-ph .i { width: 34%; height: 34%; max-width: 48px; max-height: 48px; }

/* ---------- Player-Leiste ---------- */
.playerbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: var(--player-h);
    display: grid; grid-template-columns: minmax(220px, 1fr) minmax(320px, 2fr) minmax(220px, 1fr); align-items: center; gap: 24px;
    padding: 0 22px; padding-bottom: env(safe-area-inset-bottom);
    background: rgba(11, 15, 26, .82); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
    border-top: 1px solid var(--line);
    transition: background .6s;
}
.theme-live .playerbar { background: rgba(24, 10, 16, .85); }
.pb-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pb-cover { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; flex: none; background: var(--panel-2); }
.pb-cover img { width: 100%; height: 100%; object-fit: cover; }
.pb-meta { min-width: 0; }
.pb-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-center { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.pb-controls { display: flex; align-items: center; gap: 14px; }
.pb-progress { display: flex; align-items: center; gap: 12px; width: 100%; }
.pb-progress .time { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 38px; text-align: center; }
.wave-wrap { position: relative; flex: 1; height: 30px; }
canvas.wave { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; touch-action: none; }
.wave.readonly { cursor: default; }
.pb-right { display: flex; align-items: center; justify-content: flex-end; gap: 14px; min-width: 0; }
.pb-viz { width: 120px; height: 36px; flex: none; }
.volume { display: flex; align-items: center; gap: 6px; width: 140px; flex: none; }
.volume .ic-vol1, .volume .ic-volx { display: none; }
.volume.low .ic-vol { display: none; } .volume.low .ic-vol1 { display: block; }
.volume.mute .ic-vol, .volume.mute .ic-vol1 { display: none; } .volume.mute .ic-volx { display: block; }
.pb-version { position: relative; }
.pb-version .chip span { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Dropdown ---------- */
.dropdown {
    position: absolute; bottom: calc(100% + 10px); right: 0; min-width: 220px; padding: 6px; border-radius: var(--r);
    background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .7);
    opacity: 0; transform: translateY(6px); pointer-events: none; transition: all .2s var(--ease); z-index: 60;
}
.dropdown.open { opacity: 1; transform: none; pointer-events: auto; }
.dropdown.down { bottom: auto; top: calc(100% + 8px); }
.dd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; text-align: left; font-size: 13px; color: var(--text); }
.dd-item:hover { background: rgba(255, 255, 255, .06); }
.dd-item.active { color: var(--accent-2); }
.dd-item .i { width: 16px; height: 16px; color: var(--muted); }
.dd-item.active .i { color: var(--accent-2); }
.dd-item small { margin-left: auto; color: var(--muted); font-size: 11px; }
.dd-sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 200; right: 22px; bottom: calc(var(--player-h) + 18px); display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 380px; padding: 12px 16px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .6); font-size: 13px; animation: toastIn .35s var(--ease); }
.toast .i { color: var(--accent-2); }
.toast.err .i { color: var(--danger); }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* ---------- Modals ---------- */
.modal-root { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.modal-back { position: absolute; inset: 0; background: rgba(4, 4, 8, .65); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; pointer-events: auto; display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.modal-back.open { opacity: 1; }
.modal { width: 100%; max-width: 620px; border-radius: var(--r-xl); background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .8); transform: translateY(14px) scale(.98); transition: transform .3s var(--ease); margin: auto; }
.modal-back.open .modal { transform: none; }
.modal.wide { max-width: 760px; }
.modal.narrow { max-width: 440px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 0; }
.modal-head h3 { font-size: 19px; font-weight: 700; }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 22px; flex-wrap: wrap; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; overflow: hidden;
    background: radial-gradient(1000px 600px at 15% -10%, rgba(var(--accent-rgb), .25), transparent 60%), radial-gradient(800px 500px at 110% 110%, rgba(64, 200, 190, .12), transparent 60%), var(--bg); }
.login-bg { position: fixed; inset: 0; pointer-events: none; }
.login-bg canvas { width: 100%; height: 100%; }
.login-card { position: relative; width: 100%; max-width: 400px; padding: 36px 32px; border-radius: var(--r-xl); background: rgba(16, 20, 31, .78); border: 1px solid var(--line-2); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .9); display: flex; flex-direction: column; gap: 16px; }
.login-card h1 { font-size: 26px; font-weight: 800; margin-top: 18px; }
.login-card .muted { margin-top: -8px; }
.alert { padding: 11px 14px; border-radius: var(--r-sm); background: rgba(255, 77, 109, .12); color: #ff8da1; border: 1px solid rgba(255, 77, 109, .25); font-size: 13px; }

/* ---------- Leere Zustände ---------- */
.empty { padding: 60px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .i { width: 44px; height: 44px; color: var(--muted-2); }
.empty h3 { color: var(--text); font-size: 18px; }

/* ---------- Gemeinsame Responsive-Regeln Player ---------- */
@media (max-width: 1100px) {
    .pb-viz { display: none; }
}
@media (max-width: 860px) {
    :root { --player-h: 158px; }
    .playerbar { grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 6px 12px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); height: auto; min-height: var(--player-h); }
    .pb-left { grid-column: 1; grid-row: 1; }
    .pb-right { grid-column: 2; grid-row: 1; gap: 6px; }
    .pb-center { grid-column: 1 / -1; grid-row: 2; }
    .volume { width: auto; }
    .volume .range { display: none; }
    .pb-cover { width: 44px; height: 44px; }
    .pb-controls { gap: 8px; }
    .toasts { left: 14px; right: 14px; align-items: stretch; }
    .row2 { grid-template-columns: 1fr; }
}
