/* ==========================================================================
   MyTube — Schulprojekt
   Mobile-first, touch-friendly styles
   ========================================================================== */

:root {
    --accent: #f59e0b;
    --accent-soft: #fbbf24;
    --bg: #09090b;
    --surface: #18181b;
    --surface-2: #27272a;
    --border: #3f3f46;
    --text-mute: #a1a1aa;
}

* { -webkit-tap-highlight-color: transparent; }

/* iOS Safari bug: overflow-x:hidden on <html> breaks vertical scroll.
   Keep horizontal clipping on <body> only and let <html> scroll freely. */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; min-height: 100vh; }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ----- Scrollbar ----- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #52525b; }

/* ==========================================================================
   Video Player Wrapper
   ========================================================================== */

.video-wrapper {
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04);
    position: relative;
    isolation: isolate;
    touch-action: manipulation;
}

@media (max-width: 640px) {
    .video-wrapper { border-radius: 14px; }
}

.video-wrapper video {
    display: block;
    width: 100%;
    height: 100%;
}

/* Big center play overlay */
.center-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.55) 100%);
    z-index: 30;
    cursor: pointer;
    transition: opacity 0.25s ease;
}

.center-play.hidden { opacity: 0; pointer-events: none; }

.center-play-btn {
    width: 80px;
    height: 80px;
    border-radius: 9999px;
    background: rgba(255,255,255,0.96);
    color: #18181b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transition: transform 0.2s ease, background 0.2s ease;
}

.center-play-btn:hover { transform: scale(1.05); }
.center-play-btn:active { transform: scale(0.95); }

/* Buffering spinner */
.buffering {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 25;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.buffering.visible { opacity: 1; }

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Seek-feedback flash (double-tap on mobile) */
.seek-flash {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    opacity: 0;
    z-index: 35;
}
.seek-flash.left  { left: 0;  background: linear-gradient(to right, rgba(0,0,0,0.4), transparent); border-radius: 50% 0 0 50% / 50% 0 0 50%; }
.seek-flash.right { right: 0; background: linear-gradient(to left,  rgba(0,0,0,0.4), transparent); border-radius: 0 50% 50% 0 / 0 50% 50% 0; }
.seek-flash.show { animation: seekFlash 0.6s ease; }
@keyframes seekFlash {
    0%   { opacity: 0; transform: scale(0.9); }
    25%  { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1); }
}
.seek-flash i { font-size: 22px; margin-bottom: 4px; }
.seek-flash .flash-inner { display: flex; flex-direction: column; align-items: center; gap: 4px; }

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

.controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 56px 16px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
    z-index: 40;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.controls.hidden-controls {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}

@media (max-width: 640px) {
    .controls { padding: 64px 10px 10px; }
}

/* ----- Progress bar ----- */

.progress-wrap {
    position: relative;
    padding: 14px 0;
    margin: 0 4px 4px;
    cursor: pointer;
    touch-action: none;
}

.progress-track {
    position: relative;
    height: 5px;
    background: rgba(255,255,255,0.22);
    border-radius: 9999px;
    transition: height 0.15s ease;
    overflow: visible;
}

.progress-wrap:hover .progress-track,
.progress-wrap.scrubbing .progress-track { height: 8px; }

.progress-buffer {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(255,255,255,0.28);
    border-radius: 9999px;
    pointer-events: none;
}

.progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-soft) 100%);
    border-radius: 9999px;
    pointer-events: none;
    will-change: width;
}

.progress-thumb {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    background: var(--accent-soft);
    border-radius: 9999px;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s ease;
    box-shadow: 0 0 0 4px rgba(245,158,11,0.25);
    pointer-events: none;
    z-index: 5;
}

.progress-wrap:hover .progress-thumb,
.progress-wrap.scrubbing .progress-thumb { transform: translate(-50%, -50%) scale(1); }

@media (hover: none) {
    .progress-thumb { transform: translate(-50%, -50%) scale(1); }
    .progress-track { height: 6px; }
}

/* Chapter markers */
.chapter-marker {
    position: absolute;
    top: 50%;
    width: 3px;
    height: calc(100% + 4px);
    background: rgba(255,255,255,0.7);
    border-radius: 2px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
}

/* Chapter tooltip */
.chapter-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    background: rgba(24,24,27,0.97);
    backdrop-filter: blur(12px);
    color: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.3;
    pointer-events: none;
    z-index: 50;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    transition: opacity 0.12s ease;
    max-width: 220px;
    white-space: normal;
}

.chapter-tooltip.hidden { opacity: 0; }

/* Lift the tooltip well above the user's finger when scrubbing on touch */
.progress-wrap.scrubbing .chapter-tooltip {
    bottom: calc(100% + 36px);
    transform: scale(1.06);
    transform-origin: bottom center;
}

.chapter-tooltip .ct-time {
    display: block;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    color: var(--accent-soft);
    margin-bottom: 2px;
}

.chapter-tooltip .ct-title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chapter-tooltip .ct-speaker {
    display: block;
    font-size: 10px;
    color: #a1a1aa;
    margin-top: 1px;
}

/* ----- Bottom row of controls ----- */

.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 0 4px;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}

.ctrl-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    color: #fff;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    flex-shrink: 0;
}

.ctrl-btn:hover { background: rgba(255,255,255,0.12); }
.ctrl-btn:active { transform: scale(0.92); }

.ctrl-btn i { font-size: 16px; line-height: 1; }
.ctrl-btn .fa-play { font-size: 18px; margin-left: 2px; }

.time-display {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
    color: rgba(255,255,255,0.92);
    user-select: none;
    padding: 0 6px;
    white-space: nowrap;
}

.time-sep { color: rgba(255,255,255,0.4); margin: 0 4px; }

/* Hide keyboard-shortcut hints on touch devices */
@media (max-width: 640px), (hover: none) {
    #kb-shortcuts { display: none !important; }
}

/* Tighten controls on small screens so all buttons fit one row */
@media (max-width: 640px) {
    .controls { padding: 56px 6px 8px; }
    .controls-row { gap: 2px; padding: 0 2px; }
    .controls-left, .controls-right { gap: 0; }
    .ctrl-btn { width: 34px; height: 34px; }
    .ctrl-btn i { font-size: 14px; }
    .ctrl-btn .fa-play { font-size: 15px; margin-left: 1px; }
    .time-display { font-size: 11px; padding: 0 4px; }
    .time-sep { margin: 0 2px; }
    .progress-wrap { margin: 0 2px 2px; padding: 12px 0; }
}

@media (max-width: 380px) {
    .ctrl-btn { width: 30px; height: 30px; }
    .ctrl-btn i { font-size: 13px; }
    .ctrl-btn .fa-play { font-size: 14px; }
    .time-display { font-size: 10px; padding: 0 2px; }
}

/* Volume cluster */
.volume-cluster {
    display: flex;
    align-items: center;
    overflow: hidden;
}

.volume-slider-wrap {
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease, margin 0.2s ease;
}

.volume-cluster:hover .volume-slider-wrap,
.volume-cluster:focus-within .volume-slider-wrap {
    width: 90px;
    margin-left: 4px;
    margin-right: 6px;
}

.volume-slider {
    width: 100%;
    height: 4px;
    border-radius: 9999px;
    background: rgba(255,255,255,0.25);
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}
.volume-slider::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

/* Hide volume on mobile/touch (iOS doesn't allow programmatic volume) */
@media (max-width: 640px), (hover: none) {
    .volume-cluster { display: none; }
}

/* ==========================================================================
   Settings menu
   ========================================================================== */

.settings-menu {
    position: absolute;
    bottom: 70px;
    right: 16px;
    background: rgba(24,24,27,0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    min-width: 240px;
    max-width: calc(100vw - 32px);
    padding: 6px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    z-index: 60;
    transform-origin: bottom right;
    animation: menuPop 0.18s ease;
}

@keyframes menuPop {
    from { opacity: 0; transform: scale(0.92) translateY(6px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.settings-section { padding: 8px 4px; }
.settings-label {
    padding: 6px 10px 4px;
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--text-mute);
    text-transform: uppercase;
}
.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s ease;
    font-size: 14px;
    color: #fff;
    gap: 12px;
}
.settings-item:hover { background: rgba(255,255,255,0.06); }
.settings-item.active { color: var(--accent-soft); }
.settings-item .item-value { color: var(--text-mute); font-size: 12px; }
.settings-item .item-check { color: var(--accent-soft); font-size: 12px; opacity: 0; }
.settings-item.active .item-check { opacity: 1; }
.settings-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 4px 6px; }

.speed-row { padding: 12px; }
.speed-row .speed-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}
.speed-value {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    color: var(--accent-soft);
    font-weight: 600;
}

.range-input {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.18);
    border-radius: 9999px;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}
.range-input::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-soft);
    cursor: pointer;
}
.range-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 0;
    border-radius: 50%;
    background: var(--accent-soft);
    cursor: pointer;
}

/* Mobile: settings becomes bottom sheet */
@media (max-width: 640px) {
    .settings-menu {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        padding: 14px 14px calc(env(safe-area-inset-bottom, 0px) + 18px);
        animation: sheetUp 0.25s ease;
        z-index: 200;
    }
    @keyframes sheetUp {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    .settings-menu::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: rgba(255,255,255,0.25);
        border-radius: 999px;
        margin: 0 auto 10px;
    }
}

/* Sheet backdrop on mobile */
.settings-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 190;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 640px) {
    .settings-backdrop.visible { display: block; }
}

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
    background: rgba(24,24,27,0.96);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 12px 20px;
    border-radius: 14px;
    font-size: 13px;
    z-index: 250;
    animation: toastIn 0.25s ease, toastOut 0.25s ease 1.6s forwards;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* ==========================================================================
   Timestamps card
   ========================================================================== */

.timestamps {
    display: grid;
    gap: 6px;
}

.ts-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    text-align: left;
    width: 100%;
}

.ts-item:hover { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.06); }
.ts-item:active { transform: scale(0.99); }

.ts-item.active {
    background: rgba(245,158,11,0.08);
    border-color: rgba(245,158,11,0.3);
}

.ts-time {
    flex-shrink: 0;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
    color: var(--accent-soft);
    background: rgba(245,158,11,0.12);
    padding: 4px 8px;
    border-radius: 6px;
    min-width: 52px;
    text-align: center;
    font-weight: 600;
    position: relative;
}

.ts-item.active .ts-time::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: scale(0.85); }
    50%      { opacity: 1;   transform: scale(1.15); }
}

.ts-content { flex: 1; min-width: 0; }
.ts-title {
    font-size: 14px;
    color: #e4e4e7;
    font-weight: 500;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ts-item.active .ts-title { color: #fff; }

.ts-speaker {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-mute);
    margin-top: 2px;
}
.ts-speaker::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
}

.ts-icon {
    color: var(--text-mute);
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.ts-item:hover .ts-icon, .ts-item.active .ts-icon { opacity: 1; }
.ts-item.active .ts-icon { color: var(--accent-soft); }

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.78);
    backdrop-filter: blur(8px);
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
    animation: modalIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.1);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.94) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-card.modal-wide { max-width: 640px; }

@media (max-width: 640px) {
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal-card {
        border-radius: 22px 22px 0 0;
        max-height: 92vh;
        animation: sheetUp 0.28s ease;
    }
}

/* ==========================================================================
   Helpers
   ========================================================================== */

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fade-in { animation: fadeIn 0.4s ease; }

.controls, .settings-menu, .ts-item { user-select: none; -webkit-user-select: none; }

:fullscreen .video-wrapper, :-webkit-full-screen .video-wrapper {
    border-radius: 0;
    box-shadow: none;
    height: 100vh;
}
:fullscreen video, :-webkit-full-screen video {
    height: 100vh;
    object-fit: contain;
}

/* ==========================================================================
   Action bar (likes / share / save)
   ========================================================================== */

/* Hide horizontal scrollbar on the action bar (looks cleaner on overflow) */
[style*="scrollbar-width:none"]::-webkit-scrollbar { display: none; }

.action-pill {
    display: inline-flex;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 9999px;
    overflow: hidden;
    flex-shrink: 0;
}

/* Live-viewers pulse */
.live-dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #f87171;
    font-weight: 600;
}
.live-dot::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f87171;
    box-shadow: 0 0 0 0 rgba(248,113,113,0.7);
    animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse {
    0%   { box-shadow: 0 0 0 0 rgba(248,113,113,0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(248,113,113,0); }
    100% { box-shadow: 0 0 0 0 rgba(248,113,113,0); }
}

.action-divider {
    width: 1px;
    background: rgba(255,255,255,0.08);
    align-self: stretch;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--surface);
    color: #e4e4e7;
    border: 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
    text-decoration: none;
}

.action-btn:hover { background: var(--surface-2); color: #fff; }
.action-btn:active { transform: scale(0.97); }

.action-btn.solo {
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 9999px;
    flex-shrink: 0;
}

.action-btn i { font-size: 14px; }

.action-btn.liked {
    color: var(--accent-soft);
}
.action-btn.liked i { animation: likeBounce 0.5s ease; }
@keyframes likeBounce {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.4) rotate(-12deg); }
    60%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.action-btn.disliked { color: #fb7185; }

.action-btn.saved { color: var(--accent-soft); }

/* ==========================================================================
   Resume-watching toast
   ========================================================================== */

.resume-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(0);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(24,24,27,0.98);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    z-index: 220;
    max-width: calc(100vw - 24px);
    animation: resumeIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

@keyframes resumeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(40px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.resume-icon {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    background: rgba(245,158,11,0.14);
    color: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.resume-body { min-width: 0; }
.resume-title { font-size: 13px; font-weight: 600; color: #fff; }
.resume-time  { font-size: 11px; color: var(--text-mute); margin-top: 1px; }

.resume-yes {
    padding: 8px 14px;
    background: var(--accent-soft);
    color: #18181b;
    border: 0;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
}
.resume-yes:hover { background: var(--accent); }

.resume-no {
    width: 32px; height: 32px;
    background: transparent;
    color: var(--text-mute);
    border: 0;
    border-radius: 9999px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}
.resume-no:hover { background: rgba(255,255,255,0.06); color: #fff; }

/* ==========================================================================
   Mini-player
   ========================================================================== */

.mini-player {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: rgba(24,24,27,0.98);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    z-index: 70;
    animation: miniIn 0.3s ease;
}

@keyframes miniIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.mini-thumb {
    width: 70px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }

.mini-info { flex: 1; min-width: 0; }
.mini-title {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mini-progress {
    height: 3px;
    background: rgba(255,255,255,0.15);
    border-radius: 9999px;
    margin-top: 6px;
    overflow: hidden;
}
#mini-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-soft);
    transition: width 0.2s linear;
}

.mini-btn {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #fff;
    border-radius: 9999px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
}
.mini-btn:hover { background: rgba(255,255,255,0.1); }

@media (max-width: 480px) {
    .mini-player { left: 12px; right: 12px; bottom: 12px; width: auto; }
    .mini-thumb { width: 56px; height: 34px; }
}
