/* SingSina.com
   Dunkles Layout, Akzentfarbe Lila, Lyrics im hellblauen Zeilen-Look.
   Bewusst nur System-Schriften (keine Google Fonts -> kein DSGVO-Ärger). */

:root {
    --bg: #0e0d12;
    --surface: #17151d;
    --surface-2: #211e29;
    --border: #2d2938;
    --text: #f2eff7;
    --muted: #a49db3;
    --accent: #8e6f9f;
    --accent-hover: #a587b8;
    --accent-glow: rgba(142, 111, 159, .9);
    --line: rgb(222, 234, 248);      /* aktuelle Lyrics-Zeile */
    --line-dim: rgba(255, 255, 255, .75);
    --radius: 14px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

/* Eigener Mauszeiger in Lila (der schwarze Standardpfeil ist auf dem dunklen
   Layout kaum zu sehen). Über Anklickbarem invertiert: weiß mit lila Rand.
   Über dem YouTube-Video zeigt der Browser den Zeiger von YouTube. */
html, body {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24'%3E%3Cpath d='M4 2.5v16.2l4.3-4.1 2.9 6.6 2.9-1.3-2.8-6.4h6z' fill='rgb(165,135,184)' stroke='white' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 4 3, auto;
}
a, button, summary, label, [role="button"], .track-card {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24'%3E%3Cpath d='M4 2.5v16.2l4.3-4.1 2.9 6.6 2.9-1.3-2.8-6.4h6z' fill='white' stroke='rgb(142,111,159)' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E") 4 3, pointer;
}
input, textarea {
    cursor: text;
    caret-color: var(--accent-hover);
}
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/***** Kopfzeile ************************************************************/
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 12px 0;
    background: rgba(14, 13, 18, .88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

/* gleiche Breite und Ränder wie der Seiteninhalt */
.topbar-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Logo im Stil der Lyrics: Zeilenkasten, "Sina" ist das aktive Wort */
.logo {
    display: inline-flex;
    align-items: baseline;
    flex-shrink: 0;
    text-decoration: none;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1;
}
.logo-line {
    display: inline-flex;
    gap: .38em;
    padding: .36em .56em .36em .56em;
    border-radius: 4px;
    background: var(--line);
    color: #000;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .45);
}
.logo-word {
    display: inline-block;
    padding: .12em .16em;
    margin: -.12em 0;
    border-radius: 4px;
}
/* Beim Laden einmal Karaoke: erst "Sing", dann "Sina" (bleibt aktiv) */
.logo-sing { animation: logo-sing 1.1s ease-out both; }
.logo-sina { animation: logo-sina 1.1s cubic-bezier(.34, 1.8, .64, 1) both; }
@keyframes logo-sing {
    0%, 8%   { background: transparent; color: #000; box-shadow: none; transform: none; }
    15%, 50% { background: var(--accent); color: #fff; box-shadow: 0 0 0 2px #fff, 0 0 12px 3px var(--accent-glow); transform: scale(1.12); }
    62%, 100% { background: transparent; color: #000; box-shadow: none; transform: none; }
}
@keyframes logo-sina {
    0%, 55%  { background: transparent; color: #000; box-shadow: none; transform: none; }
    75%, 100% { background: var(--accent); color: #fff; box-shadow: 0 0 0 2px #fff, 0 0 12px 3px var(--accent-glow); transform: scale(1.12); }
}
.logo-tld {
    margin-left: .3em;
    color: var(--muted);
    font-weight: 600;
    transition: color .15s;
}
.logo:hover .logo-tld { color: var(--text); }

/* Suchfeld */
.search {
    flex: 1;
    max-width: 640px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 5px 5px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: border-color .15s, box-shadow .15s;
}
.search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(142, 111, 159, .25);
}
.search-icon { color: var(--muted); font-size: 1.1rem; }
.search input {
    flex: 1;
    min-width: 0;
    padding: 8px 4px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
}
.search input::placeholder { color: var(--muted); }

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: .45em;
    padding: 8px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    transition: background-color .15s, transform .1s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(.97); }

.auth-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}
.auth-trigger {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
}
.auth-trigger:hover { border-color: var(--accent); background: var(--surface-2); }
.auth-email {
    max-width: 150px;
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .85rem;
}
.auth-dialog {
    width: min(420px, calc(100% - 32px));
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
}
.auth-dialog::backdrop { background: rgba(0, 0, 0, .72); backdrop-filter: blur(4px); }
.auth-form { display: grid; gap: 10px; padding: 28px; }
.auth-close {
    justify-self: end;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface-2);
}
.auth-form h2 { margin: 0; font-size: 1.35rem; }
.auth-form > p { margin: 0 0 8px; color: var(--muted); }
.auth-form label { margin-top: 6px; font-size: .9rem; font-weight: 600; }
.auth-form input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}
.auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(142, 111, 159, .2); }
.auth-submit { justify-content: center; margin-top: 8px; }
.auth-message { color: #ffb3bf !important; }
.auth-message.success { color: #a7dfb5 !important; }
.auth-switch { text-align: center; font-size: .9rem; }
.auth-switch button { padding: 0; border: 0; background: none; color: var(--accent-hover); font: inherit; font-weight: 700; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface-2);
    font-size: 1.05rem;
    transition: background-color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--accent); border-color: var(--accent); }

/***** Seite ****************************************************************/
.page {
    flex: 1;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 28px 24px 48px;
}
.alert {
    margin: 0 0 20px;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: rgba(220, 70, 90, .15);
    border: 1px solid rgba(220, 70, 90, .45);
    color: #ffb3bf;
    font-weight: 600;
}

.hero { display: none; margin: 8px 0 32px; }
body.home .hero { display: block; }
.hero h1 {
    margin: 0 0 8px;
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
    line-height: 1.15;
    letter-spacing: -.02em;
}
.hero p { margin: 0; max-width: 640px; color: var(--muted); font-size: 1.05rem; }

/***** Player + Lyrics ******************************************************/
body.home .karaoke-container { display: none; }
.karaoke-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.player-col { min-width: 0; }

.now-playing {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
}
.now-text { min-width: 0; }
.song-title {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.3;
}
.song-channel { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.now-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Technische Details: aufklappbar, unaufdringlich */
.tech {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
    font-size: .82rem;
}
.tech summary {
    padding: 10px 14px;
    font-weight: 600;
    list-style: none;
}
.tech summary::-webkit-details-marker { display: none; }
.tech summary::before { content: "▸ "; }
.tech[open] summary::before { content: "▾ "; }
.tech dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 14px;
    margin: 0;
    padding: 0 14px 14px;
}
.tech dt { color: var(--muted); }
.tech dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

/* Hinweis, während die KI misst oder reinen Text synchronisiert */
.sync-status {
    margin: 0 0 10px;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: rgba(142, 111, 159, .18);
    border: 1px solid rgba(142, 111, 159, .55);
    color: var(--text);
    font-size: .9rem;
    font-weight: 600;
    animation: sync-pulse 1.8s ease-in-out infinite;
}
@keyframes sync-pulse { 50% { opacity: .7; } }
.sync-status.calm {
    animation: none;
    background: var(--surface);
    border-color: var(--border);
    color: var(--muted);
}

/* Lyrics-Spalte im gleichen Look wie das Vollbild-Overlay */
.lyricsContainer { flex: 1; min-width: 0; }
/* Lyrics-Liste ausgeblendet: Die Lyrics laufen im Overlay auf dem großen
   Video. Zum Wieder-Einblenden diese Regel entfernen und unten bei
   "Kino-Breite" das Zwei-Spalten-Layout zurückholen. */
.lyricsContainer { display: none; }
#lyrics {
    font-family: var(--mono);
    font-size: 0.85rem;
    white-space: pre-wrap;
    overflow-y: auto;
    line-height: 1.6;
    height: 340px;
    position: relative;
    margin: 0;
    padding: 18px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #000;
    color: #eee; /* für Nur-Text-Lyrics ohne Zeitstempel */
    text-align: center;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

/* Kino-Breite: Video so breit wie die Song-Übersicht, aber nie höher als
   der Bildschirm (dann schmaler und mittig). Früher zweispaltig:
   .karaoke-container { flex-direction: row; } .player-col { flex: 0 0 min(560px, 44%); } */
.player-col { width: 100%; }
.stage {
    width: min(100%, calc((100vh - 170px) * 16 / 9));
    margin-inline: auto;
}
.player-col .sync-status,
.player-col .now-playing,
.player-col .tech {
    width: min(100%, calc((100vh - 170px) * 16 / 9));
    margin-inline: auto;
}
.player-col .sync-status { margin-top: 14px; margin-bottom: 0; }
/* Overlay im großen Player tiefer, YouTube-Leiste ist relativ zur Höhe kleiner */
@container (min-width: 900px) {
    .stage .overlay { bottom: 15%; }  /* .stage davor: schlägt die Grundregel weiter unten */
}

@media (min-width: 960px) {
    #lyrics {
        font-size: 1.1rem;
        height: min(640px, calc(100vh - 140px));
    }
    #lyrics .line.current {
        font-size: 1.6rem;
    }
}
.line {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 8px;
    padding: 7px 14px;
    border-radius: 3px;
    color: #333;
    background-color: var(--line-dim);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .45);
    transition: font-size .2s, padding .2s, background-color .2s;
}
.line.current {
    font-size: 1.15rem;
    padding: .5em 1em; /* größerer Kasten: Platz für das wachsende Wort */
    font-weight: bold;
    color: #000;
    background-color: var(--line);
}
/* Alle Wörter haben denselben Innenabstand (per negativem Margin wieder
   ausgeglichen), damit beim Hervorheben nichts nach links/rechts springt. */
.line span,
.ov-current span {
    display: inline-block;
    position: relative;
    padding: 0 .15em;
    margin: 0 -.15em;
    border-radius: 4px;
    /* Rausgehen: ruhig ausblenden */
    transition:
        transform .35s ease-out,
        background-color .35s ease-out,
        color .35s ease-out,
        box-shadow .35s ease-out;
}

/* Das gerade gesungene Wort: soll richtig rausstechen */
.highlight {
    z-index: 1;
    background-color: var(--accent);
    color: #fff;
    font-weight: 900;
    /* transform statt font-size: kein Reflow, Zeile und weißer Kasten
       bleiben ruhig stehen, nur das Wort selbst federt. */
    transform: scale(var(--s, 1.2)); /* --s pro Wort aus app.js (wordScale) */
    box-shadow: 0 0 0 2px #fff, 0 0 16px 4px var(--accent-glow);
}
/* Mehr Luft zwischen den Wörtern der aktuellen Zeile, damit das
   vergrößerte Wort auch bei langen Wörtern nicht ins Nachbarwort ragt. */
.line.current,
.ov-current {
    word-spacing: .35em;
}
/* Reinkommen: schnell mit Federeffekt (Überschwinger), damit es kickt */
.line span.highlight,
.ov-current span.highlight {
    transition:
        transform .3s cubic-bezier(.34, 1.8, .64, 1),
        background-color .12s ease-out,
        color .12s ease-out,
        box-shadow .2s ease-out;
}

/* Neue Zeile im Overlay sanft reinschieben */
.ov-current.line-in {
    animation: line-in .25s ease-out;
}
@keyframes line-in {
    from { opacity: .3; transform: translateY(.35em); }
    to   { opacity: 1;  transform: none; }
}

/***** Video + Lyrics-Overlay (normal und im eigenen Vollbild) ***********/
.stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius);
    background: #000;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
    container-type: inline-size; /* cqw = 1 % der Video-Breite, für die Overlay-Schrift */
}
#player {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}
.stage-next {
    display: grid;
    place-items: center;
    position: absolute;
    right: 16px;
    bottom: 64px;
    z-index: 6;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    background: rgba(14, 13, 18, .78);
    color: #fff;
    font-size: 1.3rem;
}
.stage-next:hover { background: var(--accent); }
.stage-next:disabled { opacity: .5; }
.fs-exit { display: none; }
.stage.fs {
    position: fixed;
    inset: 0;
    z-index: 1000;
    width: auto;        /* Kino-Breite im Vollbild aufheben */
    margin: 0;
    aspect-ratio: auto;
    border-radius: 0;
}
.stage.fs.cursor-idle,
.stage.fs.cursor-idle * { cursor: none !important; }
.overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 33%; /* im kleinen Player über Fortschrittsbalken und Steuerleiste */
    padding: 0 4%;
    text-align: center;
    pointer-events: none; /* Klicks gehen weiter an den Player */
}
.stage.ai-syncing .overlay { padding-right: calc(4% + 116px); }
.stage.fs .overlay {
    bottom: 12%;
    padding: 0 6%;
}
.stage.fs.ai-syncing .overlay { padding-right: calc(6% + 124px); }
.ai-sync-indicator {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 999px;
    background: rgba(14, 13, 18, .94);
    color: #fff;
    font-size: .9rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .35);
}
.ai-sync-indicator[hidden] { display: none; }
.ai-sync-indicator i {
    color: #e6c46a;
    font-size: 1.1rem;
    animation: ai-sync-spin 1.1s linear infinite;
}
.stage.fs .ai-sync-indicator { min-height: 48px; padding: 12px 17px; font-size: 1rem; }
.stage.fs .ai-sync-indicator i { font-size: 1.2rem; }
@keyframes ai-sync-spin { to { transform: rotate(360deg); } }
/* Gleicher Look wie die Lyrics-Spalte: Monospace, .line.current, .highlight */
.ov-current,
.ov-next {
    display: block; /* nicht table: Chrome verwirft dort die Leerzeichen zwischen den Wörtern */
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    padding: .25em .6em;
    border-radius: 3px;
    font-family: var(--mono);
    line-height: 1.3;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .45);
}
.ov-current:empty,
.ov-next:empty { display: none; }
.ov-current {
    padding: .3em .65em;
    font-size: clamp(.85rem, 2.1cqw, 1.55rem);
    font-weight: bold;
    color: #000;
    background-color: var(--line);
}
.ov-next {
    margin-top: .25em;
    font-size: clamp(.7rem, 1.3cqw, 1rem);
    color: #333;
    background-color: var(--line-dim);
}
.stage.fs .ov-current {
    padding: .5em 1em;
    font-size: clamp(.95rem, 4cqw, 3.2rem);
    line-height: 1.6;
}
.stage.fs .ov-next {
    font-size: clamp(.75rem, 2.6cqw, 1.9rem);
    line-height: 1.6;
}
.stage.fs .fs-exit {
    display: grid;
    place-items: center;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    background: rgba(14, 13, 18, .7);
    color: #fff;
    font-size: 1.3rem;
}
.stage.fs .fs-exit:hover { background: var(--accent); }

/* SingSina-Logo im Vollbild: oben links unter Titel und Kanal des YouTube-Players,
   gleiche Größe wie in der Kopfzeile, nicht anklickbar (Klicks gehen ans Video) */
.stage-logo { display: none; }
.stage.fs .stage-logo {
    display: inline-flex;
    position: absolute;
    top: 64px;
    left: 30px;
    z-index: 2;
    font-size: 1.5rem;   /* etwas größer als in der Kopfzeile (1.15rem), ca. 42 px hoch */
    pointer-events: none;
}
.stage.fs .stage-logo .logo-tld {
    color: rgba(255, 255, 255, .8);
    text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
}

/***** Song-Ende ***********************************************************/
/* Overlay nach der letzten Zeile sanft ausblenden */
.overlay {
    transition: opacity .8s ease, transform .8s ease;
}
.overlay.ov-done {
    opacity: 0;
    transform: translateY(12px);
}

/* "Als Nächstes"-Endscreen über dem Player (auch im Vollbild) */
.up-next {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    padding: 4%;
    background: radial-gradient(ellipse at center, rgba(14, 13, 18, .72), rgba(14, 13, 18, .94));
    opacity: 0;
    transition: opacity .45s ease;
}
.up-next.visible { opacity: 1; }
.up-next-card {
    width: min(480px, 100%);
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(23, 21, 29, .92);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
    transform: translateY(14px) scale(.97);
    transition: transform .45s cubic-bezier(.2, .9, .3, 1.15);
}
.up-next.visible .up-next-card { transform: none; }
.up-next-label {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.up-next-label span { color: var(--text); }
.up-next-track {
    display: flex;
    gap: 14px;
    align-items: center;
    text-decoration: none;
}
.up-next-thumb {
    flex: 0 0 44%;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
}
.up-next-thumb img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.up-next-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.up-next-title {
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.up-next-channel { color: var(--muted); font-size: .88rem; }
.up-next-progress {
    height: 4px;
    margin: 18px 0 16px;
    border-radius: 2px;
    background: var(--surface-2);
    overflow: hidden;
}
.up-next-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}
.up-next.running .up-next-progress span {
    width: 100%;
    transition: width 4s linear;   /* = UP_NEXT_SECONDS in app.js */
}
.up-next-actions { display: flex; gap: 10px; }
/* kleiner Player (Handy): kompakte Karte ohne Vorschaubild */
@container (max-width: 560px) {
    .up-next { padding: 10px; }
    .up-next-card { padding: 12px 14px; border-radius: 12px; }
    .up-next-label { margin-bottom: 6px; font-size: .72rem; }
    .up-next-thumb { display: none; }
    .up-next-title { -webkit-line-clamp: 1; font-size: .9rem; }
    .up-next-channel { font-size: .78rem; }
    .up-next-progress { margin: 10px 0; }
    .up-next-actions .btn-primary, .up-next-actions .btn-ghost { padding: 6px 12px; font-size: .85rem; }
}
.btn-ghost {
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    font-weight: 600;
    transition: background-color .15s;
}
.btn-ghost:hover { background: var(--surface-2); }

/* Songwechsel im Player (ohne Neuladen, auch im Vollbild): Bild blendet ins
   Schwarze und mit dem neuen Song wieder auf. Logo bleibt darüber stehen. */
.stage::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .38s ease;
}
.stage.switching::before { opacity: 1; }
.stage.fs .stage-logo { z-index: 5; }

/* Seitenwechsel (Startseite -> Song): alte Seite blendet aus, neue blendet ein */
/* "backwards", nicht "both": eine dauerhaft angewendete Animation macht .page zum
   Bezugsrahmen für position: fixed, dann wäre das Vollbild nicht mehr bildschirmfüllend */
.page { animation: page-in .45s ease-out backwards; }
@keyframes page-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
body.leaving .page {
    opacity: 0;
    transform: translateY(-6px) scale(.99);
    transition: opacity .35s ease, transform .35s ease;
}

/***** Song-Übersicht (Startseite und unter dem Player) *********************/
.track-section { margin-top: 48px; }
body.home .track-section { margin-top: 0; }
.grid-heading {
    margin: 0 0 16px;
    font-size: 1.25rem;
    letter-spacing: -.01em;
}
.track-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 28px 18px;
}
.track-card {
    display: block;
    text-decoration: none;
    border-radius: var(--radius);
    padding: 6px;
    margin: -6px;
    transition: background-color .15s, transform .15s;
}
.track-card:hover { background: var(--surface-2); transform: translateY(-3px); }
.track-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.track-thumb {
    position: relative;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}
.track-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform .3s;
}
.track-card:hover .track-thumb img { transform: scale(1.04); }
/* Play-Symbol beim Drüberfahren */
.track-thumb::after {
    content: "\F4F4"; /* bootstrap-icons: play-fill */
    font-family: "bootstrap-icons";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 2.6rem;
    color: #fff;
    background: rgba(14, 13, 18, .35);
    opacity: 0;
    transition: opacity .15s;
}
.track-card:hover .track-thumb::after { opacity: 1; }
.track-card.current .track-thumb { box-shadow: 0 0 0 3px var(--accent), 0 0 18px var(--accent-glow); }
.badge-playing {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 1;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
}
.track-title {
    margin-top: 10px;
    font-weight: 650;
    font-size: .95rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.track-channel {
    margin-top: 3px;
    font-size: .85rem;
    color: var(--muted);
}

/***** Fußzeile *************************************************************/
.footer {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    justify-content: center;
    padding: 20px 24px 28px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: .82rem;
}
.footer-brand { color: var(--text); font-weight: 700; font-family: var(--mono); }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }

/***** Handy ****************************************************************/
@media (max-width: 720px) {
    .topbar { padding: 10px 0; }
    .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 0 16px; }
    .search { flex-basis: 100%; max-width: none; }
    .btn-primary span { display: none; }  /* nur Mikro-Symbol */
    .search { order: 3; }
    .auth-controls { order: 2; }
    .topbar-inner > .logo { order: 1; }
    .auth-email { max-width: 120px; }
    .btn-primary { padding: 9px 13px; }
    .stage-next { right: 10px; bottom: 56px; width: 42px; height: 42px; }
    .page { padding: 20px 16px 40px; }
}
@media (max-width: 480px) {
    .track-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px 10px;
    }
    .track-title { font-size: .85rem; }
    .track-thumb::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .line span,
    .ov-current span,
    .line span.highlight,
    .ov-current span.highlight { transition: none; }
    .ov-current.line-in { animation: none; }
    .logo-sing, .logo-sina { animation: none; }
    .logo-sina { background: var(--accent); color: #fff; box-shadow: 0 0 0 2px #fff, 0 0 12px 3px var(--accent-glow); }
    .track-card, .track-card:hover, .track-thumb img, .track-card:hover .track-thumb img { transform: none; transition: none; }
    .sync-status { animation: none; }
    .page, body.leaving .page { animation: none; transform: none; }
    .up-next, .up-next-card, .overlay { transition: none; }
}

/***** Persönliche Playlist ***********************************************/
.playlist-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.playlist-filters .auth-trigger { min-height: 44px; }
.playlist-filters [aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
.playlist-status { color: var(--muted); font-size: .9rem; margin: 0 0 16px; }
#playlistRetry { min-height: 44px; margin-bottom: 16px; }
.track-item { position: relative; min-width: 0; }
.playlist-star { font-size: 1.5rem; min-width: 44px; min-height: 44px; }
.playlist-star[aria-pressed="true"] { color: var(--accent-hover); }
.playlist-star:hover { background: var(--surface-2); border-color: var(--accent-hover); }
.playlist-star:disabled, .playlist-star[aria-disabled="true"] { opacity: .5; cursor: wait; }
.global-star { color: var(--muted); }
.global-star:hover { background: var(--surface-2); border-color: #e6c46a; color: #e6c46a; }
.global-star[aria-pressed="true"] { background: #e6c46a; border-color: #e6c46a; color: #241b09; }
.global-star[aria-pressed="true"]:hover { background: #f0d47a; border-color: #f0d47a; }
.global-star:disabled { opacity: .65; }
.track-star { position: absolute; top: 8px; right: 8px; background: var(--bg); z-index: 2; }
.playlist-star:focus-visible, .playlist-filters button:focus-visible, #playlistRetry:focus-visible {
    outline: 2px solid var(--accent-hover); outline-offset: 2px;
}
