/* Floating "now playing" player, bottom right. */

.mini-player {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9;
    width: min(360px, calc(100vw - 40px));
    display: grid;
    grid-template-columns: 56px 1fr auto;
    grid-template-areas:
        "art info collapse"
        "art controls controls"
        "progress progress progress"
        "time time time";
    column-gap: 14px;
    padding: 14px 14px 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 40px rgb(0 0 0 / 28%);
    animation: shani-rise 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mini-player__art {
    grid-area: art;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--surface-2);
    overflow: hidden;
}

button.mini-player__art { padding: 0; border: 0; color: inherit; cursor: zoom-in; }
.mini-player__art img { width: 100%; height: 100%; object-fit: cover; }

.mini-player__info { grid-area: info; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }

.mini-player__info strong, .mini-player__info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-player__info strong { font-size: var(--text-md); }
.mini-player__info span { color: var(--ink-muted); font-size: var(--text-sm); }
.mini-player__info small { color: var(--accent); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

.mini-player__controls { grid-area: controls; display: flex; align-items: center; gap: 6px; margin-top: 4px; }

.mini-player__controls svg, .mini-player__collapse svg, .mini-player__play svg, .music-note {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mini-player__controls .icon-button svg path:last-child { fill: currentColor; }

.mini-player__play {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg);
    cursor: pointer;
}

.mini-player__play svg { width: 18px; height: 18px; stroke-width: 2.4; }
.mini-player__play svg path[d^="M8"] { fill: currentColor; }

.mini-player__collapse {
    grid-area: collapse;
    align-self: start;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--ink-muted);
    cursor: pointer;
}

.mini-player__collapse:hover { background: var(--surface-2); color: var(--ink); }
.mini-player__collapse svg { width: 16px; height: 16px; }

.mini-player__progress {
    grid-area: progress;
    height: 4px;
    margin-top: 12px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    overflow: hidden;
}

.mini-player__progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width 1s linear; }

.mini-player__time {
    grid-area: time;
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    color: var(--ink-muted);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

.music-note { width: 26px; height: 26px; color: var(--ink-muted); }

.mini-player-bubble {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--surface-2);
    box-shadow: 0 8px 24px rgb(0 0 0 / 28%);
    overflow: hidden;
    cursor: pointer;
}

.mini-player-bubble img { width: 100%; height: 100%; object-fit: cover; }
.mini-player-bubble.is-playing { border-color: var(--accent); }
.mini-player-bubble.is-playing img { animation: shani-spin 12s linear infinite; }

@media (prefers-reduced-motion: reduce) {
    .mini-player, .mini-player-bubble.is-playing img { animation: none; }
    .mini-player__progress span { transition: none; }
}

/* ---------- Large view ---------- */

.player-backdrop { position: fixed; inset: 0; z-index: 30; background: rgb(0 0 0 / 55%); animation: shani-fade 0.2s ease; }

.player-large {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 31;
    width: min(920px, calc(100vw - 32px));
    max-height: min(640px, calc(100dvh - 32px));
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 22px 22px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--bg);
    color: var(--ink);
    box-shadow: 0 24px 80px rgb(0 0 0 / 45%);
    animation: shani-fade 0.2s ease;
}

/* The cover, blurred and faint, as the backdrop of the whole view. */
.player-large__glow {
    position: absolute;
    inset: -40px;
    z-index: -1;
    background-size: cover;
    background-position: center;
    filter: blur(60px) saturate(1.4);
    opacity: 0.35;
}

.player-large > :not(.player-large__glow) { position: relative; }
.player-large__head { display: flex; align-items: center; justify-content: space-between; }
.player-large__source { color: var(--accent); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.player-large svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.player-large__body { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 28px; min-height: 0; }
.player-large__main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.player-large__art {
    width: 100%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 18px;
    background: var(--surface-2);
    box-shadow: 0 14px 40px rgb(0 0 0 / 35%);
}
.player-large__art img { width: 100%; height: 100%; object-fit: cover; }
.player-large__art .music-note { width: 64px; height: 64px; }

.player-large__titles h2 { margin: 0; font-size: 1.25rem; line-height: 1.25; }
.player-large__artist { margin: 2px 0 0; color: var(--ink); opacity: 0.85; }
.player-large__meta { margin: 4px 0 0; color: var(--ink-muted); font-size: 0.82rem; }

/* Seek bar: a range input drawn as the same thin bar as in the small card. */
.player-large__timeline input[type="range"] {
    width: 100%;
    height: 6px;
    margin: 0;
    appearance: none;
    border-radius: var(--radius-pill);
    background: linear-gradient(to right, var(--accent) var(--progress, 0%), var(--surface-2) var(--progress, 0%));
    cursor: pointer;
}
.player-large__timeline input[type="range"]:disabled { cursor: default; }
.player-large__timeline input[type="range"]::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); box-shadow: 0 1px 4px rgb(0 0 0 / 40%); }
.player-large__timeline input[type="range"]:disabled::-webkit-slider-thumb { visibility: hidden; }
.player-large__timeline input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--ink); }

.player-large__controls { display: flex; align-items: center; justify-content: center; gap: 14px; }
.player-large__controls .icon-button { position: relative; }
.player-large__controls .icon-button:disabled { opacity: 0.35; cursor: default; }
.player-large__controls .icon-button.is-active { color: var(--accent); }
.player-large__controls svg path[d^="M7 6v12"], .player-large__controls svg path[d^="M17 6v12"] { fill: currentColor; }
.player-large__repeat-one { position: absolute; right: 2px; bottom: 2px; font-size: 0.6rem; font-weight: 800; }
.mini-player__play--large { width: 56px; height: 56px; }
.mini-player__play--large svg { width: 24px; height: 24px; }

/* Lyrics: the line being sung stands out, the ones before it fade. */
.player-large__lyrics { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding-right: 4px; }
.player-large__lines { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.player-large__lines li { color: var(--ink-muted); font-size: 1.05rem; font-weight: 600; line-height: 1.35; transition: color 0.3s, font-size 0.3s; }
.player-large__lines li.is-past { opacity: 0.45; }
.player-large__lines li.is-current { color: var(--ink); font-size: 1.35rem; }
.player-large__lines button { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.player-large__lines button:hover { color: var(--accent); }
.player-large__plain { white-space: pre-line; color: var(--ink); line-height: 1.6; }
.player-large__lyrics-note { margin: 0; color: var(--ink-muted); }
.player-large__credit { margin-top: auto; color: var(--ink-muted); font-size: 0.7rem; }
.player-large__credit a { color: inherit; }

@media (max-width: 720px) {
    .player-large { max-height: calc(100dvh - 24px); overflow-y: auto; }
    .player-large__body { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .player-large__art { max-width: 260px; margin: 0 auto; }
    .player-large__lyrics { overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
    .player-large, .player-backdrop { animation: none; }
    .player-large__lines li { transition: none; }
}

/* The whole player switches the size on a click; its buttons, bar and lyric lines keep their own job. */
.mini-player, .player-large { cursor: pointer; }
.player-large__timeline, .player-large__lines, .player-large__credit { cursor: auto; }
