/* ================================================================
   UPLOAD18 PREMIUM PLAYER v4.0 — Styles
   ================================================================ */

/* ── RESET & ROOT ── */
:root {
    --p: #e94560;
    --rgb: 233, 69, 96;
    --bg: #0a0a12;
    --bg2: #12121f;
    --bg3: #1a1a2e;
    --f: 'Inter', sans-serif;
    --ease: cubic-bezier(.4, 0, .2, 1);
    --ease2: cubic-bezier(.16, 1, .3, 1);
    --ease3: cubic-bezier(.34, 1.56, .64, 1);
    --rad: 12px;
    --rad2: 16px;
    --rad3: 20px;
    --shadow1: 0 4px 12px rgba(0, 0, 0, .3);
    --shadow2: 0 8px 32px rgba(0, 0, 0, .5);
    --shadow3: 0 16px 64px rgba(0, 0, 0, .7);
    --glow1: 0 0 8px rgba(var(--rgb), .5);
    --glow2: 0 0 20px rgba(var(--rgb), .6);
    --glow3: 0 0 40px rgba(var(--rgb), .4);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    background: var(--bg);
    overflow: hidden;
    font-family: var(--f);
    color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.4;
}

button {
    cursor: pointer;
    font-family: var(--f);
    border: none;
    background: none;
    color: inherit;
}

input,
select {
    font-family: var(--f);
}

::selection {
    background: rgba(var(--rgb), .35);
    color: #fff;
}

/* ── HIDE JW PLAYER NATIVE UI ── */
.jw-controlbar,
.jw-controls,
.jw-controls-backdrop,
.jw-nextup-container,
.jw-flag-floating .jw-controlbar,
.jw-skin-netflix .jw-controlbar,
.jw-display,
.jw-display-icon-container {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    height: 0 !important;
}

.jw-captions,
.jwplayer .jw-captions,
#pw .jw-captions {
    z-index: 190 !important;
    overflow: visible !important;
    /* top/height are set dynamically by JS (updateCaptionPosition) */
    transition: top .15s ease, height .15s ease !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
    /* FLEXBOX BOTTOM-ANCHOR: push .jw-captions__frame to the bottom of the
       caption container. This beats JW Player's inline top/transform assignments
       because flexbox justify-content works regardless of JW's absolute positioning
       tricks, and our !important beats JW's non-!important inline style writes. */
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-items: stretch !important;
}

.jw-captions__frame,
.jwplayer .jw-captions .jw-captions__frame,
#pw .jw-captions .jw-captions__frame {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    height: auto !important;
    width: 100% !important;
    transform: none !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding-bottom: 4px !important;
}

/* Ensure cue text wraps properly and stays readable */
.jw-captions .jw-text-track-cue {
    max-width: 90% !important;
    margin: 0 auto !important;
    text-align: center !important;
    word-break: break-word !important;
    line-height: 1.4 !important;
}

/* ── iOS Safari native WebVTT cue base styles ──
   On iOS, JW Player renders subtitles as native <video> TextTrack cues,
   bypassing .jw-captions DOM entirely. The ::cue pseudo-element is the
   ONLY way to style them. applySubStyles() overrides these with user prefs. */
::cue {
    font-size: 18px;
    color: rgba(255, 255, 255, 1);
    background: rgba(0, 0, 0, 0.35);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-family: 'Inter', sans-serif;
}

.jwplayer {
    background: var(--bg) !important;
    width: 100% !important;
    height: 100% !important;
}

/* ================================================================
   PLAYER WRAPPER
   ================================================================ */
#pw {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    transition: border-radius .4s var(--ease);
    isolation: isolate;
    /* new stacking context */
}

#pw:fullscreen,
#pw:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    background: #000 !important;
}

#pw:fullscreen #player-fake,
#pw:-webkit-full-screen #player-fake {
    width: 100% !important;
    height: 100% !important;
}

#player-fake {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* All overlay elements on top of JW */
#ctrl,
#sp,
#kbh,
#bigplay,
#sfl,
#sfr,
#logo-ov,
#speed-menu,
#ctx-menu,
#toast-container,
#loader-wrap,
#quality-panel,
#sub-panel,
#stats-panel,
#skip-intro,
#ambient-canvas,
#gesture-indicator,
#share-panel,
#chapters-panel,
#screenshot-flash,
#error-overlay,
#buffer-anim,
#kb-shortcuts-panel {
    position: absolute;
    /* placeholder — full styles defined in KEYBOARD block below */
}

/* ================================================================
   ANIMATED LOADING SPINNER
   ================================================================ */
#loader-wrap {
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    transition: opacity .5s var(--ease);
}

#loader-wrap.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-rings {
    position: relative;
    width: 80px;
    height: 80px;
}

.loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    animation: spin-ring var(--dur) linear infinite;
}

.loader-ring:nth-child(1) {
    border-top-color: var(--p);
    --dur: 1.2s;
    filter: drop-shadow(var(--glow1));
}

.loader-ring:nth-child(2) {
    inset: 8px;
    border-right-color: rgba(var(--rgb), .6);
    --dur: 1.8s;
    animation-direction: reverse;
}

.loader-ring:nth-child(3) {
    inset: 16px;
    border-bottom-color: rgba(var(--rgb), .3);
    --dur: 2.4s;
}

@keyframes spin-ring {
    to {
        transform: rotate(360deg);
    }
}

.loader-text {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, .4);
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: loader-pulse 1.5s ease infinite;
}

@keyframes loader-pulse {

    0%,
    100% {
        opacity: .4;
    }

    50% {
        opacity: 1;
    }
}

/* Brand logo in loader */
.loader-brand {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, .08);
    letter-spacing: 6px;
    text-transform: uppercase;
}

/* ================================================================
   GRADIENT OVERLAYS (always present)
   ================================================================ */
#pw::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    background:
        linear-gradient(to bottom, rgba(0, 0, 0, .3) 0%, transparent 15%, transparent 75%, rgba(0, 0, 0, .6) 100%),
        linear-gradient(to right, rgba(0, 0, 0, .15) 0%, transparent 8%, transparent 92%, rgba(0, 0, 0, .15) 100%);
    transition: opacity .4s var(--ease);
}

body.t-minimal #pw::before {
    background: linear-gradient(transparent 60%, rgba(0, 0, 0, .8) 100%);
}

/* ================================================================
   CUSTOM CONTROL BAR
   ================================================================ */
#ctrl {
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: 0;
    transition: opacity .4s var(--ease), transform .4s var(--ease);
    pointer-events: auto;
}

#ctrl.hidden {
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
}

/* ── Progress Area ── */
#prog-area {
    position: relative;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 210;
}

#prog-track {
    position: absolute;
    left: 16px;
    right: 16px;
    height: 4px;
    border-radius: 99px;
    overflow: visible;
    transition: height .2s var(--ease);
    cursor: pointer;
    background: rgba(255, 255, 255, .12);
}

#prog-area:hover #prog-track {
    height: 7px;
}

#prog-buf {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 99px;
    background: rgba(255, 255, 255, .2);
    transition: width .3s linear;
}

#prog-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 99px;
    background: var(--p);
    width: 0%;
    transition: width .08s linear;
    /* animated gradient on fill */
    background: linear-gradient(90deg, var(--p), rgba(var(--rgb), 1), var(--p));
    background-size: 200% 100%;
    animation: prog-gradient 3s ease infinite;
    will-change: width;
    transform: translateZ(0);
}

@keyframes prog-gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

#prog-knob {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid var(--p);
    box-shadow: 0 0 0 0 rgba(var(--rgb), .4);
    transition: transform .15s var(--ease3), box-shadow .2s var(--ease), width .15s, height .15s;
    cursor: grab;
    pointer-events: auto;
    z-index: 5;
    will-change: transform;
}

#prog-area:hover #prog-knob {
    transform: translate(-50%, -50%) scale(1.35);
    box-shadow: 0 0 0 8px rgba(var(--rgb), .18);
}

#prog-knob:active {
    cursor: grabbing;
}

/* Seek preview tooltip */
#prog-tooltip {
    position: absolute;
    bottom: 40px;
    transform: translateX(-50%);
    background: rgba(8, 8, 16, .95);
    border: 1px solid rgba(var(--rgb), .3);
    backdrop-filter: blur(14px);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding: 5px 12px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s;
    white-space: nowrap;
    box-shadow: var(--shadow2);
    letter-spacing: .5px;
}

/* Chapter markers */
.chapter-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 12px;
    background: rgba(255, 255, 255, .6);
    border-radius: 2px;
    z-index: 4;
    pointer-events: auto;
    transition: background .2s, height .2s, transform .2s;
}

.chapter-marker:hover {
    background: var(--p);
    height: 18px;
    transform: translate(-50%, -50%) scaleX(1.5);
}

.chapter-marker-tip {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(8, 8, 16, .92);
    border: 1px solid rgba(var(--rgb), .25);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
}

.chapter-marker:hover .chapter-marker-tip {
    opacity: 1;
}

/* ── Buttons Row ── */
#btns {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 14px 12px;
    position: relative;
}

#btns-left,
#btns-right {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Control button with ripple */
.cb {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: rgba(255, 255, 255, .78);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all .18s var(--ease);
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.cb svg {
    width: 22px;
    height: 22px;
    pointer-events: none;
    transition: transform .15s var(--ease);
}

.cb:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.cb:active {
    transform: scale(.88);
}

.cb:active svg {
    transform: scale(.85);
}

/* Ripple effect on buttons */
.cb-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(var(--rgb), .3);
    transform: scale(0);
    animation: ripple-out .5s var(--ease) forwards;
    pointer-events: none;
}

@keyframes ripple-out {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Time display — above progress bar */
#time-disp {
    padding: 4px 14px 2px;
    font-size: 11.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, .55);
    letter-spacing: .3px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

#time-disp span {
    color: rgba(255, 255, 255, .92);
}

/* Volume */
#vol-wrap {
    display: flex;
    align-items: center;
    gap: 2px;
}

#vol-slider-wrap {
    width: 0;
    overflow: hidden;
    transition: width .3s var(--ease2);
    height: 40px;
    display: flex;
    align-items: center;
}

#vol-wrap:hover #vol-slider-wrap {
    width: 80px;
}

#vol-track {
    width: 70px;
    height: 4px;
    background: rgba(255, 255, 255, .18);
    border-radius: 99px;
    cursor: pointer;
    position: relative;
    margin: 0 6px;
}



#vol-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--p);
    width: 100%;
    transition: width .05s;
}

#vol-knob {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: var(--shadow1);
    transition: transform .15s var(--ease);
}

#vol-knob:hover {
    transform: translate(-50%, -50%) scale(1.3);
}

/* Speed badge */
#speed-badge {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .5px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all .18s;
    color: rgba(255, 255, 255, .7);
}

#speed-badge:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

/* Title bar */
#title-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 150;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: none;
    transition: opacity .4s var(--ease);
}

#ctrl.hidden~#title-bar {
    opacity: 0;
}

#title-bar h1 {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, .9);
    text-shadow: 0 2px 8px rgba(0, 0, 0, .7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

/* ================================================================
   INITIAL PLAY OVERLAY (before first play)
   ================================================================ */
#initial-play {
    position: absolute;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, .15) 0%, rgba(0, 0, 0, .55) 100%);
    cursor: pointer;
    transition: opacity .5s var(--ease);
}

#initial-play.hidden {
    opacity: 0;
    pointer-events: none;
}

#initial-play-btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .35);
    backdrop-filter: blur(20px);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .3s var(--ease);
    position: relative;
}

#initial-play-btn .ip-rings {
    position: absolute;
    inset: -6px;
    pointer-events: none;
}

#initial-play-btn .ip-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
}

#initial-play-btn .ip-ring-outer {
    border-top-color: var(--p);
    border-right-color: var(--p);
    opacity: .6;
    animation: ip-spin 3s linear infinite;
}

#initial-play-btn .ip-ring-inner {
    inset: 6px;
    border-bottom-color: var(--p);
    border-left-color: var(--p);
    opacity: .4;
    animation: ip-spin 2s linear infinite reverse;
}

@keyframes ip-spin {
    to {
        transform: rotate(360deg);
    }
}

#initial-play-btn svg {
    width: 44px;
    height: 44px;
    margin-left: 5px;
    filter: drop-shadow(0 0 12px rgba(var(--rgb), .5));
    position: relative;
    z-index: 2;
}

#initial-play-btn::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--rgb), .15) 0%, transparent 70%);
    animation: ip-glow 2.5s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes ip-glow {
    0% {
        transform: scale(1);
        opacity: .5;
    }

    100% {
        transform: scale(1.2);
        opacity: .8;
    }
}

#initial-play-btn:hover {
    transform: scale(1.1);
    background: rgba(var(--rgb), .15);
}

#initial-play-btn:hover .ip-ring-outer {
    opacity: 1;
}

#initial-play-btn:hover .ip-ring-inner {
    opacity: .7;
}

#initial-play-btn:active {
    transform: scale(.95);
}

/* ================================================================
   BIG PLAY ANIMATION (center)
   ================================================================ */
#bigplay {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 300;
    pointer-events: none;
    opacity: 0;
    font-size: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#bigplay-icon {
    width: 72px;
    height: 72px;
    background: rgba(var(--rgb), .2);
    backdrop-filter: blur(16px);
    border: 2px solid rgba(var(--rgb), .4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow2);
}

#bigplay-icon svg {
    width: 32px;
    height: 32px;
    fill: var(--p);
    margin-left: 3px;
}

#bigplay.pop {
    animation: bp-anim .55s var(--ease2) forwards;
}

@keyframes bp-anim {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(.5);
    }

    40% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.3);
    }
}

/* ================================================================
   SEEK FLASH OVERLAYS
   ================================================================ */
.sflash {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40%;
    pointer-events: none;
    z-index: 250;
    background: radial-gradient(circle at center, rgba(var(--rgb), .08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity .35s;
}

#sfl {
    left: 0;
}

#sfr {
    right: 0;
}

.sflash.pop {
    animation: sflash-anim .65s var(--ease2) forwards;
}

@keyframes sflash-anim {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.sflash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.sflash-arrows {
    display: flex;
    gap: 2px;
}

.sflash-arrows svg {
    width: 24px;
    height: 24px;
    fill: rgba(255, 255, 255, .9);
    animation: sflash-arrow .3s ease;
}

.sflash-arrows svg:nth-child(2) {
    animation-delay: .05s;
}

.sflash-arrows svg:nth-child(3) {
    animation-delay: .1s;
}

@keyframes sflash-arrow {
    0% {
        opacity: 0;
        transform: translateX(-4px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.sflash-text {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, .85);
    letter-spacing: .5px;
}

/* Seek ripple (double-tap area highlight) */
.seek-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    transform: scale(0);
    pointer-events: none;
    animation: seek-ripple .7s var(--ease2) forwards;
}

@keyframes seek-ripple {
    to {
        transform: scale(6);
        opacity: 0;
    }
}

/* ================================================================
   VOLUME RING INDICATOR (brief overlay)
   ================================================================ */
#vol-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 350;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s;
}

#vol-indicator.show {
    opacity: 1;
}

.vol-ring {
    width: 60px;
    height: 60px;
    position: relative;
}

.vol-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, .15);
    stroke-width: 4;
}

.vol-ring-fill {
    fill: none;
    stroke: var(--p);
    stroke-width: 4;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset .15s;
    filter: drop-shadow(var(--glow1));
}

.vol-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

/* ================================================================
   TOAST NOTIFICATIONS
   ================================================================ */
#toast-container {
    top: 0;
    left: 0;
    right: 0;
    z-index: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 14px;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: rgba(10, 10, 18, .92);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(var(--rgb), .2);
    border-radius: var(--rad);
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, .9);
    box-shadow: var(--shadow2);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toast-in .3s var(--ease3) forwards;
    pointer-events: auto;
    max-width: 320px;
}

.toast.out {
    animation: toast-out .25s var(--ease) forwards;
}

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-14px) scale(.95);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: none;
    }

    to {
        opacity: 0;
        transform: translateY(-10px) scale(.95);
    }
}

/* ================================================================
   CUSTOM CONTEXT MENU (right-click)
   ================================================================ */
#ctx-menu {
    z-index: 800;
    display: none;
    background: rgba(12, 12, 22, .96);
    backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid rgba(var(--rgb), .2);
    border-radius: var(--rad);
    padding: 6px 0;
    min-width: 220px;
    box-shadow: var(--shadow3);
    animation: ctx-in .15s var(--ease) forwards;
    overflow: hidden;
}

#ctx-menu.open {
    display: block;
}

@keyframes ctx-in {
    from {
        opacity: 0;
        transform: scale(.96) translateY(-4px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, .78);
    cursor: pointer;
    transition: all .15s;
    position: relative;
}

.ctx-item:hover {
    background: rgba(var(--rgb), .1);
    color: #fff;
}

.ctx-item-icon {
    width: 18px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

.ctx-item-label {
    flex: 1;
}

.ctx-item-shortcut {
    font-size: 10px;
    color: rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .06);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.ctx-divider {
    height: 1px;
    background: rgba(255, 255, 255, .06);
    margin: 4px 0;
}

.ctx-item-sub {
    font-size: 10px;
    color: rgba(255, 255, 255, .35);
    padding: 4px 16px 6px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

/* ================================================================
   QUALITY SELECTOR PANEL
   ================================================================ */
#quality-panel {
    bottom: 90px;
    right: 60px;
    z-index: 550;
    background: rgba(10, 12, 22, .96);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(var(--rgb), .22);
    border-radius: var(--rad2);
    padding: 12px 0;
    min-width: 180px;
    box-shadow: var(--shadow3);
    display: none;
    animation: panel-in .2s var(--ease);
}

#quality-panel.open {
    display: block;
}

@keyframes panel-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.qp-title {
    padding: 8px 18px;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, .3);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.qp-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 18px;
    font-size: 13px;
    color: rgba(255, 255, 255, .7);
    cursor: pointer;
    transition: all .15s;
}

.qp-option:hover {
    background: rgba(var(--rgb), .08);
    color: #fff;
}

.qp-option.active {
    color: var(--p);
    font-weight: 600;
}

.qp-option.active::after {
    content: '✓';
    font-size: 12px;
    color: var(--p);
}

.qp-label-badge {
    font-size: 9px;
    font-weight: 700;
    background: rgba(var(--rgb), .2);
    color: var(--p);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    letter-spacing: .5px;
}

/* ================================================================
   SUBTITLE SETTINGS PANEL
   ================================================================ */
#sub-panel {
    bottom: 90px;
    right: 60px;
    z-index: 550;
    background: rgba(10, 12, 22, .97);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(var(--rgb), .22);
    border-radius: var(--rad);
    padding: 8px 0;
    width: 280px;
    max-height: 480px;
    overflow-y: auto;
    box-shadow: var(--shadow3);
    display: none;
    animation: panel-in .15s var(--ease);
}

#sub-panel::-webkit-scrollbar {
    width: 4px;
}

#sub-panel::-webkit-scrollbar-track {
    background: transparent;
}

#sub-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .15);
    border-radius: 99px;
}

#sub-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .25);
}

#sub-panel.open {
    display: block;
}

.sub-title {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, .3);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.sub-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.sub-label {
    font-size: 12.5px;
    color: rgba(255, 255, 255, .7);
}

.sub-slider {
    -webkit-appearance: none;
    width: 80px;
    height: 4px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .15);
    outline: none;
    cursor: pointer;
}

.sub-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--p);
    box-shadow: var(--glow1);
    cursor: pointer;
}

.sub-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, .15);
}

/* ================================================================
   STATS FOR NERDS PANEL
   ================================================================ */
#stats-panel {
    top: 14px;
    left: 14px;
    z-index: 550;
    background: rgba(0, 0, 0, .88);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--rad);
    padding: 14px 18px;
    width: 320px;
    font-size: 11px;
    font-family: 'Roboto Mono', 'SF Mono', monospace;
    color: rgba(255, 255, 255, .7);
    display: none;
    animation: panel-in .2s var(--ease);
    line-height: 1.8;
    user-select: text;
}

#stats-panel.open {
    display: block;
}

.stats-title {
    font-size: 10px;
    font-weight: 700;
    color: rgba(var(--rgb), .8);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.stats-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.stats-key {
    color: rgba(255, 255, 255, .45);
}

.stats-val {
    color: rgba(255, 255, 255, .85);
    text-align: right;
}

.stats-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    color: rgba(255, 255, 255, .5);
    transition: all .15s;
}

.stats-close:hover {
    background: rgba(255, 255, 255, .15);
    color: #fff;
}

/* ================================================================
   SKIP INTRO BUTTON
   ================================================================ */
#skip-intro {
    bottom: 100px;
    right: 24px;
    z-index: 400;
    display: none;
    animation: skip-in .35s var(--ease3) forwards;
}

#skip-intro.show {
    display: flex;
}

@keyframes skip-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.skip-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, .25);
    color: rgba(255, 255, 255, .9);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s var(--ease);
    letter-spacing: .3px;
}

.skip-btn:hover {
    background: rgba(255, 255, 255, .2);
    border-color: var(--p);
    box-shadow: var(--glow1);
}

.skip-btn svg {
    width: 16px;
    height: 16px;
}

/* ================================================================
   AMBIENT GLOW CANVAS
   ================================================================ */
#ambient-canvas {
    inset: 0;
    z-index: 0;
    pointer-events: none;
    filter: blur(70px) saturate(200%) brightness(.5);
    opacity: .35;
    mix-blend-mode: screen;
    transition: opacity .8s;
}

body.t-flat #ambient-canvas,
body.t-minimal #ambient-canvas {
    opacity: 0;
}


/* ================================================================
   SCREENSHOT FLASH
   ================================================================ */
#screenshot-flash {
    inset: 0;
    z-index: 600;
    pointer-events: none;
    background: #fff;
    opacity: 0;
}

#screenshot-flash.flash {
    animation: ss-flash .3s ease forwards;
}

@keyframes ss-flash {
    0% {
        opacity: .7;
    }

    100% {
        opacity: 0;
    }
}

/* ================================================================
   ERROR OVERLAY
   ================================================================ */
#error-overlay {
    inset: 0;
    z-index: 850;
    display: none;
    background: rgba(8, 8, 14, .97);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
}

#error-overlay.show {
    display: flex;
}

.error-icon {
    font-size: 48px;
    filter: drop-shadow(var(--glow2));
    animation: err-shake .5s ease;
}

@keyframes err-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    75% {
        transform: translateX(8px);
    }
}

.error-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--p);
}

.error-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, .5);
    max-width: 320px;
}

.error-retry-btn {
    padding: 10px 28px;
    border-radius: 10px;
    background: var(--p);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    box-shadow: var(--glow1);
}

.error-retry-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
}

/* ================================================================
   BUFFERING ANIMATION
   ================================================================ */
#buffer-anim {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 280;
    pointer-events: none;
    display: none;
}

#buffer-anim.show {
    display: block;
}

.buffer-spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .1);
    border-top-color: var(--p);
    animation: spin-ring .8s linear infinite;
    filter: drop-shadow(var(--glow1));
}

/* ================================================================
   KEYBOARD SHORTCUTS HELP PANEL
   ================================================================ */
#kb-shortcuts-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 600;
    width: 420px;
    max-height: 80vh;
    background: rgba(10, 12, 22, .97);
    backdrop-filter: blur(28px);
    border: 1px solid rgba(var(--rgb), .22);
    border-radius: var(--rad3);
    padding: 28px;
    box-shadow: var(--shadow3);
    display: none;
    animation: panel-in .25s var(--ease);
    overflow-y: auto;
}

#kb-shortcuts-panel.open {
    display: block;
}

.kb-close {
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    color: rgba(255, 255, 255, .6);
    font-size: 13px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    line-height: 1;
    flex-shrink: 0;
}

.kb-close:hover {
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

.kb-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.kb-section {
    margin-bottom: 16px;
}

.kb-section-title {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, .3);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.kb-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: rgba(255, 255, 255, .7);
}

.kb-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 8px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, .8);
    font-family: 'Roboto Mono', monospace;
}

/* ================================================================
   SHARE PANEL
   ================================================================ */
#share-panel {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 600;
    width: 360px;
    background: rgba(10, 12, 22, .97);
    backdrop-filter: blur(28px);
    border: 1px solid rgba(var(--rgb), .22);
    border-radius: var(--rad3);
    padding: 24px;
    box-shadow: var(--shadow3);
    display: none;
    animation: panel-in .2s var(--ease);
}

#share-panel.open {
    display: block;
}

.share-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-url-wrap {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.share-url-input {
    flex: 1;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, .8);
    font-size: 12px;
    outline: none;
}

.share-url-input:focus {
    border-color: rgba(var(--rgb), .4);
}

.share-copy-btn {
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--p);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.share-copy-btn:hover {
    filter: brightness(1.15);
}

.share-socials {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.share-social-btn {
    flex: 1;
    min-width: 70px;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.share-social-btn:hover {
    transform: translateY(-2px);
}

.share-social-btn svg {
    width: 20px;
    height: 20px;
}

.share-btn-twitter {
    background: rgba(29, 161, 242, .15);
    color: #1da1f2;
}

.share-btn-facebook {
    background: rgba(24, 119, 242, .15);
    color: #1877f2;
}

.share-btn-reddit {
    background: rgba(255, 86, 0, .15);
    color: #ff5600;
}

.share-btn-telegram {
    background: rgba(0, 136, 204, .15);
    color: #0088cc;
}

/* ================================================================
   KB HINT (one-liner overlay)
   ================================================================ */
#kbh {
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 600;
    pointer-events: none;
    opacity: 0;
    background: rgba(8, 8, 16, .88);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--rgb), .2);
    color: rgba(255, 255, 255, .92);
    padding: 8px 18px;
    border-radius: 99px;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity .2s;
    box-shadow: var(--shadow1);
}

#kbh.show {
    opacity: 1;
}

/* ================================================================
   LOGO OVERLAY
   ================================================================ */
#logo-ov {
    top: 14px;
    right: 16px;
    z-index: 250;
    opacity: .8;
    transition: opacity .3s, transform .3s;
    pointer-events: auto;
    max-width: 10%;
    cursor: pointer;
    text-decoration: none;
}

#logo-ov:hover {
    opacity: 1;
    transform: scale(1.04);
}

#logo-ov img {
    max-width: 100%;
    border-radius: 8px;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .6));
}

@media(max-width:768px) {
    #logo-ov {
        max-width: 8%;
    }
}

@media(max-width:480px) {
    #logo-ov {
        max-width: 6%;
    }
}

/* ================================================================
   DENIED BOX
   ================================================================ */
.denied {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
    justify-content: center;
    background: rgba(6, 8, 14, .98);
    color: var(--p);
    font-size: 1.7em;
    font-weight: 700;
    text-align: center;
}

.denied img {
    width: 80px;
    filter: drop-shadow(0 0 20px rgba(var(--rgb), .9));
    animation: denied-pulse 2s ease infinite;
}

@keyframes denied-pulse {

    0%,
    100% {
        filter: drop-shadow(0 0 12px rgba(var(--rgb), .8));
    }

    50% {
        filter: drop-shadow(0 0 28px rgba(var(--rgb), 1));
    }
}

/* ================================================================
   RESUME MODAL
   ================================================================ */
.mov {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.mov.show {
    display: flex;
    animation: ov-in .3s forwards;
}

@keyframes ov-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.mcard {
    background: rgba(14, 16, 28, .94);
    border: 1px solid rgba(var(--rgb), .3);
    border-radius: var(--rad3);
    padding: 36px 40px;
    max-width: 380px;
    width: 92%;
    text-align: center;
    box-shadow: var(--shadow3), 0 0 0 1px rgba(var(--rgb), .08);
    animation: card-in .35s var(--ease2) forwards;
}

@keyframes card-in {
    from {
        transform: translateY(24px) scale(.94);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

.mcard .mi {
    font-size: 3em;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 16px rgba(var(--rgb), .6));
}

.mcard h3 {
    font-size: 1.15em;
    font-weight: 700;
    margin-bottom: 6px;
}

.mcard p {
    font-size: .84em;
    color: rgba(255, 255, 255, .5);
    margin-bottom: 26px;
    line-height: 1.5;
}

.mcard strong {
    color: var(--p);
    font-size: 1.2em;
}

.mbtns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.mb {
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: .9em;
    font-weight: 600;
    transition: all .2s var(--ease);
    font-family: var(--f);
    letter-spacing: .3px;
}

.mb-p {
    background: linear-gradient(135deg, var(--p), rgba(var(--rgb), .8));
    color: #fff;
    box-shadow: 0 4px 24px rgba(var(--rgb), .45);
}

.mb-p:hover {
    filter: brightness(1.18);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(var(--rgb), .5);
}

.mb-g {
    background: rgba(255, 255, 255, .07);
    color: rgba(255, 255, 255, .8);
    border: 1px solid rgba(255, 255, 255, .13);
}

.mb-g:hover {
    background: rgba(255, 255, 255, .14);
    transform: translateY(-3px);
}

/* ================================================================
   SETTINGS / CUSTOMIZATION PANEL
   ================================================================ */
#sp {
    bottom: 96px;
    right: 16px;
    z-index: 500;
    width: 290px;
    background: rgba(10, 12, 22, .97);
    border: 1px solid rgba(var(--rgb), .25);
    border-radius: var(--rad2);
    padding: 20px;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-shadow: var(--shadow3), 0 0 0 1px rgba(var(--rgb), .05);
    display: none;
    flex-direction: column;
    gap: 14px;
    font-size: 13px;
    animation: panel-in .22s var(--ease);
}

#sp.open {
    display: flex;
}

.sp-h {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, .3);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sp-r {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sp-l {
    color: rgba(255, 255, 255, .68);
    font-size: 12.5px;
}

.spc {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, .15);
    cursor: pointer;
    padding: 2px;
    background: none;
    transition: border-color .2s;
}

.spc:hover {
    border-color: rgba(var(--rgb), .5);
}

.spsel {
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .13);
    color: #fff;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    font-family: var(--f);
    outline: none;
    transition: border-color .2s;
}

.spsel:focus {
    border-color: rgba(var(--rgb), .4);
}

.spsel option {
    background: #0f1018;
}

.spt {
    position: relative;
    width: 42px;
    height: 23px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .1);
    cursor: pointer;
    border: none;
    transition: background .2s;
    flex-shrink: 0;
}

.spt.on {
    background: var(--p);
}

.spt::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #fff;
    transition: transform .22s var(--ease3);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

.spt.on::after {
    transform: translateX(19px);
}

.sp-div {
    height: 1px;
    background: rgba(255, 255, 255, .06);
}

/* Theme pills */
.tpills {
    display: flex;
    gap: 6px;
}

.tp {
    flex: 1;
    padding: 10px 4px 8px;
    border-radius: 10px;
    border: 1.5px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .02);
    cursor: pointer;
    text-align: center;
    font-size: 10.5px;
    color: rgba(255, 255, 255, .45);
    transition: all .2s var(--ease);
    font-family: var(--f);
    line-height: 1;
}

.tp:hover {
    border-color: rgba(var(--rgb), .45);
    color: rgba(255, 255, 255, .8);
    transform: translateY(-1px);
}

.tp.sel {
    border-color: var(--p);
    background: rgba(var(--rgb), .16);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 14px rgba(var(--rgb), .25);
}

.tp .ti {
    font-size: 16px;
    display: block;
    margin-bottom: 4px;
}

.sp-desc {
    font-size: 10.5px;
    color: rgba(255, 255, 255, .28);
    line-height: 1.5;
    min-height: 28px;
}

.spbtn {
    width: 100%;
    padding: 11px;
    border-radius: 10px;
    background: rgba(var(--rgb), .14);
    border: 1px solid rgba(var(--rgb), .3);
    color: var(--p);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--f);
    transition: all .2s;
    letter-spacing: .4px;
}

.spbtn:hover {
    background: rgba(var(--rgb), .26);
    transform: translateY(-1px);
}

/* Speed menu */
#speed-menu {
    bottom: 90px;
    right: 130px;
    z-index: 501;
    background: rgba(10, 12, 22, .97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(var(--rgb), .22);
    border-radius: var(--rad);
    padding: 8px 0;
    min-width: 100px;
    box-shadow: var(--shadow3);
    display: none;
    animation: panel-in .15s var(--ease);
}

#speed-menu.open {
    display: block;
}

.speed-opt {
    display: block;
    width: 100%;
    padding: 8px 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, .7);
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    font-family: inherit;
    transition: all .15s;
}

.speed-opt:hover {
    background: rgba(var(--rgb), .08);
    color: #fff;
}

.speed-opt.active {
    color: var(--p);
    font-weight: 600;
}

/* ================================================================
   THEME CSS OVERRIDES
   ================================================================ */

/* ── GLASS ── */
body.t-glass #btns {
    background: rgba(10, 12, 22, .52);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--rad2);
    margin: 0 12px 12px;
    box-shadow: var(--shadow2), 0 0 0 1px rgba(var(--rgb), .06);
}

body.t-glass #prog-area {
    margin: 0 12px;
}

body.t-glass #prog-fill {
    box-shadow: var(--glow1);
}

body.t-glass .cb:hover {
    background: rgba(255, 255, 255, .12);
    color: var(--p);
    transform: translateY(-1px);
}

body.t-glass .cb:hover svg {
    filter: drop-shadow(0 0 6px rgba(var(--rgb), .7));
}

/* ── FLAT ── */
body.t-flat #btns {
    background: #151515;
    border-top: 1px solid #282828;
    border-radius: 0;
    margin: 0;
}

body.t-flat #prog-area {
    padding: 0 16px;
    background: #111;
}

body.t-flat #prog-track {
    background: rgba(255, 255, 255, .18);
    border-radius: 0;
}

body.t-flat #prog-fill {
    border-radius: 0;
    box-shadow: none;
    animation: none;
    background: var(--p);
}

body.t-flat #prog-knob {
    border-radius: 50%;
    width: 13px;
    height: 13px;
    opacity: 0;
    transition: opacity .15s;
    border: none;
    background: var(--p);
}

body.t-flat #prog-area:hover #prog-knob {
    opacity: 1;
}

body.t-flat #prog-area:hover #prog-track {
    height: 5px;
}

body.t-flat .cb:hover {
    background: rgba(255, 255, 255, .08);
    border-radius: 4px;
}

body.t-flat #pw::before {
    display: none;
}

/* ── NEON ── */
body.t-neon #btns {
    background: rgba(0, 0, 0, .96);
    border-radius: 0;
    margin: 0;
    border-top: 2px solid var(--p);
    box-shadow: 0 -6px 36px rgba(var(--rgb), .4), inset 0 0 80px rgba(var(--rgb), .04);
}

body.t-neon #prog-area {
    background: rgba(0, 0, 0, .94);
    border-top: 1px solid rgba(var(--rgb), .35);
}

body.t-neon #prog-track {
    background: rgba(var(--rgb), .1);
    border-radius: 0;
    height: 5px;
}

body.t-neon #prog-fill {
    border-radius: 0;
    animation: none;
    background: var(--p);
    box-shadow: 0 0 12px rgba(var(--rgb), 1), 0 0 24px rgba(var(--rgb), .6);
}

body.t-neon #prog-knob {
    border-radius: 0;
    width: 8px;
    height: 20px;
    background: var(--p);
    border: none;
    box-shadow: 0 0 14px rgba(var(--rgb), 1);
    animation: nk-pulse 1.6s infinite;
}

@keyframes nk-pulse {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(var(--rgb), 1);
    }

    50% {
        box-shadow: 0 0 22px rgba(var(--rgb), 1), 0 0 44px rgba(var(--rgb), .5);
    }
}

body.t-neon .cb {
    color: var(--p);
}

body.t-neon .cb svg {
    filter: drop-shadow(0 0 4px rgba(var(--rgb), .7));
}

body.t-neon .cb:hover {
    color: #fff;
    background: rgba(var(--rgb), .12);
    box-shadow: inset 0 0 14px rgba(var(--rgb), .15);
}

body.t-neon #pw {
    outline: 2px solid var(--p);
    box-shadow: 0 0 0 2px var(--p), var(--glow3), inset 0 0 100px rgba(var(--rgb), .03);
    animation: neon-border-pulse 3s infinite;
}

@keyframes neon-border-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 2px var(--p), 0 0 30px rgba(var(--rgb), .3);
    }

    50% {
        box-shadow: 0 0 0 2px var(--p), 0 0 70px rgba(var(--rgb), .6), 0 0 140px rgba(var(--rgb), .2);
    }
}

body.t-neon #time-disp {
    color: var(--p);
    font-family: 'Roboto Mono', monospace;
    text-shadow: 0 0 10px rgba(var(--rgb), .7);
}

/* Neon scanline */
body.t-neon #pw::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(var(--rgb), .02) 3px, rgba(var(--rgb), .02) 4px);
    animation: scanline 10s linear infinite;
}

@keyframes scanline {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 0 500px;
    }
}

/* ── MINIMAL ── */
body.t-minimal #ctrl {
    opacity: 0;
    transition: opacity .6s var(--ease);
}

body.t-minimal #pw:hover #ctrl {
    opacity: 1;
}

body.t-minimal #btns {
    background: linear-gradient(transparent, rgba(0, 0, 0, .75));
    border-radius: 0;
    margin: 0;
    padding: 20px 22px 14px;
}

body.t-minimal #prog-track {
    background: rgba(255, 255, 255, .18);
    height: 2px;
    border-radius: 0;
}

body.t-minimal #prog-fill {
    border-radius: 0;
    box-shadow: none;
    animation: none;
    height: 2px;
    background: var(--p);
}

body.t-minimal #prog-knob {
    width: 8px;
    height: 8px;
    opacity: 0;
}

body.t-minimal #prog-area:hover #prog-knob {
    opacity: 1;
}

body.t-minimal #prog-area:hover #prog-track {
    height: 3px;
}

body.t-minimal .cb {
    color: rgba(255, 255, 255, .6);
}

body.t-minimal .cb:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

/* Letterbox bars */
body.t-minimal #pw::before {
    background:
        linear-gradient(rgba(0, 0, 0, .5) 0%, transparent 8%, transparent 88%, rgba(0, 0, 0, .8) 100%) !important;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media(max-width:768px) {
    #btns {
        padding: 4px 8px 10px;
        overflow: hidden;
    }

    #btns-left,
    #btns-right {
        flex-shrink: 1;
        min-width: 0;
    }

    .cb {
        width: 34px;
        height: 34px;
        flex-shrink: 0;
    }

    .cb svg {
        width: 18px;
        height: 18px;
    }

    #time-disp {
        font-size: 10px;
        padding: 2px 8px 1px;
    }

    #speed-badge {
        font-size: 9px;
        padding: 2px 4px;
    }

    #quality-badge {
        font-size: 8px;
        padding: 1px 4px;
        min-width: 20px;
    }

    /* Hide less-essential buttons on medium mobile */
    #btn-screenshot {
        display: none !important;
    }

    #sp {
        width: 260px;
    }

    #kb-shortcuts-panel {
        width: 92%;
    }

    #share-panel {
        width: 92%;
    }

    /* Subtitle panel responsive */
    #sub-panel {
        width: 260px;
        right: 10px;
        max-height: 60vh;
    }

    #title-bar h1 {
        font-size: 13px;
    }

    /* Larger touch target for progress bar */
    #prog-area {
        padding: 14px 12px 10px;
    }

    /* Hide ambient glow on mobile (saves GPU) */
    #ambient-canvas {
        display: none !important;
    }

    /* Mobile-responsive thumbnail preview (smaller, touch-friendly) */
    #thumb-preview {
        bottom: 60px;
    }

    #thumb-canvas {
        width: 120px;
        height: 68px;
    }

    #thumb-time {
        font-size: 11px;
        padding: 4px 0;
    }

    /* Larger touch target for progress knob on mobile */
    #prog-knob {
        width: 20px;
        height: 20px;
    }

    /* Always show knob on touch devices (no hover needed) */
    #prog-track {
        height: 5px;
    }

    /* Context menu max width */
    #ctx-menu {
        max-width: 85vw;
    }

    /* Stats panel fits mobile */
    #stats-panel {
        width: 90%;
        left: 5%;
        right: 5%;
    }

    /* Error overlay mobile sizing */
    #error-overlay .error-title {
        font-size: 18px;
    }

    #error-overlay .error-desc {
        font-size: 13px;
    }

    /* ── Subtitle responsive: tablet/small desktop ── */
    .jw-captions {
        padding-bottom: 6px !important;
    }

    .jw-captions__frame {
        max-width: 92% !important;
    }

    .jw-captions .jw-text-track-cue {
        max-width: 94% !important;
    }
}

@media(max-width:640px) {
    .cb {
        width: 30px;
        height: 30px;
    }

    .cb svg {
        width: 16px;
        height: 16px;
    }

    #quality-badge,
    #btn-pip {
        display: none !important;
    }

    #speed-badge {
        font-size: 9px;
        padding: 1px 3px;
    }

    #time-disp {
        font-size: 9.5px;
        padding: 2px 6px 1px;
    }
}

@media(max-width:480px) {
    #btns {
        padding: 2px 6px 8px;
        gap: 0;
    }

    .cb {
        width: 30px;
        height: 30px;
    }

    .cb svg {
        width: 15px;
        height: 15px;
    }

    #time-disp {
        font-size: 10px;
        padding: 0 2px;
    }

    /* Hide volume slider on mobile (use hardware buttons) */
    #vol-slider-wrap {
        display: none !important;
    }

    /* Hide less-essential buttons on very small screens */
    #btn-screenshot,
    #btn-pip,
    #quality-badge {
        display: none !important;
    }

    #sp {
        width: 240px;
        right: 8px;
    }

    /* Subtitle panel — bottom sheet on small mobile */
    #sub-panel {
        width: calc(100% - 16px);
        max-width: 320px;
        right: 8px;
        left: 8px;
        bottom: 70px;
        max-height: 50vh;
        border-radius: 12px;
    }

    /* Larger progress bar touch area on small screens */
    #prog-area {
        padding: 16px 8px 12px;
    }

    #prog-track {
        height: 5px;
    }

    /* Toast positioning */
    #toast-container {
        bottom: 90px;
        left: 8px;
        right: 8px;
    }

    /* ── Subtitle responsive: mobile phones ── */
    .jw-captions {
        padding-bottom: 8px !important;
    }

    .jw-captions__frame {
        max-width: 96% !important;
    }

    .jw-captions .jw-text-track-cue {
        max-width: 96% !important;
        padding: 2px 6px !important;
        border-radius: 3px !important;
    }
}

/* ── TOUCH DEVICE OVERRIDES ── */
@media(hover:none) {

    /* Remove hover effects that don't work on touch */
    .cb:hover {
        background: none;
        color: rgba(255, 255, 255, .78);
    }

    .cb:active {
        background: rgba(255, 255, 255, .12);
        transform: scale(.92);
    }

    /* Progress knob always visible on touch */
    #prog-knob {
        width: 14px;
        height: 14px;
        opacity: 1;
    }

    /* Volume expand on touch (hidden entirely on small screens) */
    #vol-wrap:hover #vol-slider-wrap {
        width: 0;
    }

    /* Neon scanline eats GPU on mobile */
    body.t-neon #pw::after {
        display: none;
    }

    /* Disable neon border pulse animation (GPU hog) */
    body.t-neon #pw {
        animation: none;
    }
}

/* ================================================================
   SCROLLBAR
   ================================================================ */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .02);
}

::-webkit-scrollbar-thumb {
    background: rgba(var(--rgb), .35);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--rgb), .55);
}

/* ================================================================
   ACCESSIBILITY
   ================================================================ */
.cb:focus-visible,
.tp:focus-visible,
.spt:focus-visible,
.spbtn:focus-visible,
.mb:focus-visible,
.ctx-item:focus-visible {
    outline: 2px solid var(--p);
    outline-offset: 2px;
}

@media(prefers-reduced-motion:reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* ================================================================
   THUMBNAIL SCRUBBER PREVIEW
   ================================================================ */
#thumb-preview {
    position: absolute;
    bottom: 72px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(8, 8, 20, .92);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s, transform .18s;
    z-index: 300;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .7);
    backdrop-filter: blur(8px);
}

#thumb-preview.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

#thumb-canvas {
    display: block;
    width: 160px;
    height: 90px;
    opacity: 0;
    transition: opacity .2s;
    background: rgba(8, 8, 20, .9);
}

#thumb-time {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 0;
    color: rgba(255, 255, 255, .9);
    letter-spacing: .5px;
    background: rgba(0, 0, 0, .4);
}




/* ================================================================
   ANIMATED PROGRESS FILL GRADIENT
   ================================================================ */
#prog-fill {
    background: linear-gradient(90deg,
            rgba(var(--rgb), .7) 0%,
            var(--p) 50%,
            rgba(var(--rgb), .9) 100%);
    background-size: 200% 100%;
    animation: prog-shimmer 3s linear infinite;
}

@keyframes prog-shimmer {
    0% {
        background-position: 200% center;
    }

    100% {
        background-position: -200% center;
    }
}

/* Knob glow pulse on hover */
#prog-track:hover #prog-knob {
    box-shadow: 0 0 0 4px rgba(var(--rgb), .25), var(--glow1);
    transform: translate(-50%, -50%) scale(1.3);
}

/* ================================================================
   IDLE CURSOR HIDE
   ================================================================ */
#pw.cursor-hidden,
#pw.cursor-hidden * {
    cursor: none !important;
}

/* ================================================================
   LOOP INDICATOR DOT
   ================================================================ */
#btn-loop.active::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--p);
}

/* ================================================================
   CHAPTER PROGRESS DOT (animated)
   ================================================================ */
#prog-knob {
    transition: transform .12s var(--ease3), box-shadow .12s;
}



/* ================================================================
   BUFFER BAR (on progress track)
   ================================================================ */
#prog-buf {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, .15);
    border-radius: inherit;
    transition: width .4s ease;
    pointer-events: none;
    z-index: 1;
}

/* ================================================================
   WATCH PROGRESS BAR (orange, shows previously watched position)
   ================================================================ */
#prog-watched {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 160, 0, .25);
    border-radius: inherit;
    transition: width .4s ease;
    pointer-events: none;
    z-index: 0;
}

/* ================================================================
   QUALITY BADGE
   ================================================================ */
#quality-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--ff);
    color: #fff;
    background: linear-gradient(135deg, rgba(var(--rgb), .5), rgba(var(--rgb), .2));
    border: 1px solid rgba(var(--rgb), .4);
    border-radius: 4px;
    padding: 2px 6px;
    margin: 0 2px;
    letter-spacing: .5px;
    cursor: default;
    user-select: none;
    transition: background .3s, border-color .3s;
    vertical-align: middle;
    line-height: 1;
    min-width: 32px;
    text-align: center;
}

#quality-badge:hover {
    background: linear-gradient(135deg, rgba(var(--rgb), .7), rgba(var(--rgb), .3));
}

/* ================================================================
   CINEMA MODE OVERLAY
   ================================================================ */
body.cinema::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    z-index: 98;
    pointer-events: none;
    animation: cinemaFadeIn .5s ease forwards;
}

@keyframes cinemaFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

body.cinema #pw {
    position: relative;
    z-index: 99;
    box-shadow: 0 0 80px 20px rgba(var(--rgb), .15),
        0 0 200px 60px rgba(0, 0, 0, .6);
}

/* ================================================================
   SMOOTH SEEK TRANSITION
   ================================================================ */
#pw.seeking video {
    opacity: .4;
    transition: opacity .12s ease;
}

#pw.seeked video {
    opacity: 1;
    transition: opacity .2s ease;
}

/* ================================================================
   ENHANCED BUFFERING SPINNER
   ================================================================ */
#buffer-anim .buffer-spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--p);
    border-right-color: rgba(var(--rgb), .3);
    animation: bufferSpin .8s linear infinite, bufferPulse 2s ease-in-out infinite;
}

@keyframes bufferSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes bufferPulse {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
        opacity: .9;
    }

    50% {
        transform: rotate(180deg) scale(1.15);
        opacity: 1;
    }
}

/* ================================================================
   SMOOTH AUTO-HIDE CONTROLS
   ================================================================ */
#ctrl {
    transition: opacity .35s ease, transform .35s ease;
}

#ctrl.ctrl-hidden {
    opacity: 0 !important;
    transform: translateY(8px);
    pointer-events: none;
}

#title-bar {
    transition: opacity .35s ease, transform .35s ease;
}

#title-bar.ctrl-hidden {
    opacity: 0 !important;
    transform: translateY(-8px);
    pointer-events: none;
}

/* ================================================================
   FEATURE 5: UNMUTE NOTICE
   ================================================================ */
.unmute-notice {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    z-index: 500;
    animation: unmuteSlideIn 0.4s ease;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.unmute-notice:hover {
    background: rgba(233, 69, 96, 0.9);
}

.unmute-notice .unmute-icon {
    font-size: 18px;
}

.unmute-notice.fade-out {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
}

@keyframes unmuteSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ================================================================
   FEATURE 7: MOBILE DOUBLE-TAP SEEK ZONES
   ================================================================ */
.tap-seek {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 35%;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.tap-seek-left {
    left: 0;
    border-radius: 0 50% 50% 0;
}

.tap-seek-right {
    right: 0;
    border-radius: 50% 0 0 50%;
}

.tap-seek-label {
    opacity: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.tap-seek.tap-active {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
}

.tap-seek.tap-active .tap-seek-label {
    opacity: 1;
    animation: tapSeekPop 0.5s ease forwards;
}

@keyframes tapSeekPop {
    0% {
        opacity: 0;
        transform: scale(0.7);
    }

    30% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 0;
        transform: scale(1);
    }
}

/* Hide tap zones on non-touch / desktop */
@media (hover: hover) and (pointer: fine) {
    .tap-seek {
        display: none;
    }
}

/* ================================================================
   SMART CONTAINER-BASED RESPONSIVE
   ================================================================
   Uses data-size attribute set by ResizeObserver (in premium.js).
   This adapts to ACTUAL container size, not viewport — works in
   iframes, embeds, mobile webviews, any size.

   data-size="xs"  → tiny   (< 300px wide or < 200px tall)
   data-size="sm"  → small  (300-479px wide or < 280px tall)
   data-size="md"  → medium (480-767px wide)
   data-size="lg"  → large  (768px+ wide) — default, no changes
   ================================================================ */

/* ── MEDIUM: Gentle scaling ── */
#pw[data-size="md"] #initial-play-btn {
    width: 80px;
    height: 80px;
}

#pw[data-size="md"] #initial-play-btn svg {
    width: 36px;
    height: 36px;
}

#pw[data-size="md"] .loader-rings {
    width: 60px;
    height: 60px;
}

#pw[data-size="md"] .loader-text {
    font-size: 10px;
}

#pw[data-size="md"] .loader-brand {
    font-size: 11px;
    bottom: 24px;
}

#pw[data-size="md"] #buffer-anim .buffer-spinner {
    width: 36px;
    height: 36px;
}

#pw[data-size="md"] #bigplay-icon {
    width: 56px;
    height: 56px;
}

#pw[data-size="md"] #bigplay-icon svg {
    width: 26px;
    height: 26px;
}

/* ── SMALL: Compact layout ── */
#pw[data-size="sm"] #initial-play-btn {
    width: 60px;
    height: 60px;
}

#pw[data-size="sm"] #initial-play-btn svg {
    width: 28px;
    height: 28px;
    margin-left: 3px;
}

#pw[data-size="sm"] #initial-play-btn .ip-rings {
    inset: -4px;
}

#pw[data-size="sm"] #initial-play-btn .ip-ring {
    border-width: 1.5px;
}

#pw[data-size="sm"] .loader-rings {
    width: 44px;
    height: 44px;
}

#pw[data-size="sm"] .loader-ring {
    border-width: 2px;
}

#pw[data-size="sm"] .loader-text {
    font-size: 8px;
    bottom: -20px;
    letter-spacing: 2px;
}

#pw[data-size="sm"] .loader-brand {
    font-size: 9px;
    bottom: 16px;
    letter-spacing: 4px;
}

#pw[data-size="sm"] #buffer-anim .buffer-spinner {
    width: 28px;
    height: 28px;
    border-width: 2.5px;
}

#pw[data-size="sm"] #bigplay-icon {
    width: 44px;
    height: 44px;
}

#pw[data-size="sm"] #bigplay-icon svg {
    width: 20px;
    height: 20px;
}

#pw[data-size="sm"] #title-bar {
    padding: 8px 12px;
}

#pw[data-size="sm"] #title-bar h1 {
    font-size: 12px;
}

#pw[data-size="sm"] #time-disp {
    font-size: 10px;
    padding: 2px 10px 1px;
}

#pw[data-size="sm"] #btns {
    padding: 2px 6px 6px;
}

#pw[data-size="sm"] .cb {
    width: 32px;
    height: 32px;
}

#pw[data-size="sm"] .cb svg {
    width: 18px;
    height: 18px;
}

#pw[data-size="sm"] #speed-badge {
    font-size: 10px;
    padding: 2px 5px;
}

#pw[data-size="sm"] #quality-badge {
    font-size: 9px;
    padding: 2px 5px;
}

#pw[data-size="sm"] #prog-area {
    height: 24px;
    padding: 0 10px;
}

#pw[data-size="sm"] .vol-ring {
    width: 44px;
    height: 44px;
}

#pw[data-size="sm"] .vol-ring-text {
    font-size: 11px;
}

/* Resume modal — small */
#pw[data-size="sm"]~#rmod .mcard,
#pw[data-size="sm"]~.mov .mcard {
    transform: scale(0.7);
}

/* ── EXTRA SMALL: Minimal UI ── */
#pw[data-size="xs"] #initial-play-btn {
    width: 44px;
    height: 44px;
}

#pw[data-size="xs"] #initial-play-btn svg {
    width: 22px;
    height: 22px;
    margin-left: 2px;
}

#pw[data-size="xs"] #initial-play-btn .ip-rings {
    display: none;
}

#pw[data-size="xs"] .loader-rings {
    width: 32px;
    height: 32px;
}

#pw[data-size="xs"] .loader-ring {
    border-width: 2px;
}

#pw[data-size="xs"] .loader-text {
    font-size: 7px;
    bottom: -16px;
}

#pw[data-size="xs"] .loader-brand {
    display: none;
}

#pw[data-size="xs"] #buffer-anim .buffer-spinner {
    width: 22px;
    height: 22px;
    border-width: 2px;
}

#pw[data-size="xs"] #bigplay-icon {
    width: 36px;
    height: 36px;
    border-width: 1px;
}

#pw[data-size="xs"] #bigplay-icon svg {
    width: 16px;
    height: 16px;
}

#pw[data-size="xs"] #title-bar {
    padding: 4px 8px;
}

#pw[data-size="xs"] #title-bar h1 {
    font-size: 10px;
    max-width: 80%;
}

#pw[data-size="xs"] #time-disp {
    font-size: 9px;
    padding: 1px 6px 0;
}

#pw[data-size="xs"] #btns {
    padding: 1px 4px 4px;
    gap: 0;
}

#pw[data-size="xs"] .cb {
    width: 26px;
    height: 26px;
    border-radius: 6px;
}

#pw[data-size="xs"] .cb svg {
    width: 14px;
    height: 14px;
}

#pw[data-size="xs"] #speed-badge {
    font-size: 8px;
    padding: 1px 3px;
}

#pw[data-size="xs"] #quality-badge {
    display: none;
}

#pw[data-size="xs"] #vol-wrap {
    display: none;
}

#pw[data-size="xs"] #btn-rw,
#pw[data-size="xs"] #btn-fw {
    display: none;
}

#pw[data-size="xs"] #btn-pip {
    display: none;
}

#pw[data-size="xs"] #btn-cc {
    display: none;
}

#pw[data-size="xs"] #btn-screenshot {
    display: none;
}

#pw[data-size="xs"] #prog-area {
    height: 20px;
    padding: 0 6px;
}

#pw[data-size="xs"] #prog-track {
    left: 6px;
    right: 6px;
    height: 3px;
}

#pw[data-size="xs"] #prog-knob {
    width: 12px;
    height: 12px;
}

#pw[data-size="xs"] .vol-ring {
    width: 32px;
    height: 32px;
}

#pw[data-size="xs"] .vol-ring-text {
    font-size: 9px;
}

#pw[data-size="xs"] .toast {
    font-size: 10px;
    padding: 6px 12px;
    max-width: 200px;
}

/* Resume modal — extra small */
#pw[data-size="xs"]~#rmod .mcard,
#pw[data-size="xs"]~.mov .mcard {
    transform: scale(0.55);
}

/* ── Responsive panels (settings, quality, etc.) ── */
#pw[data-size="sm"] #sp,
#pw[data-size="xs"] #sp {
    bottom: 60px !important;
    right: 8px !important;
    max-height: 60vh;
    font-size: 12px;
}

#pw[data-size="sm"] #quality-panel,
#pw[data-size="xs"] #quality-panel {
    bottom: 60px !important;
    right: 8px !important;
    min-width: 140px;
}

#pw[data-size="sm"] #speed-menu,
#pw[data-size="xs"] #speed-menu {
    bottom: 60px !important;
    right: 8px !important;
    min-width: 120px;
}

/* ── Error overlay responsive ── */
#pw[data-size="sm"] #error-overlay .error-icon,
#pw[data-size="xs"] #error-overlay .error-icon {
    font-size: 32px;
}

#pw[data-size="sm"] #error-overlay .error-title,
#pw[data-size="xs"] #error-overlay .error-title {
    font-size: 14px;
}

#pw[data-size="sm"] #error-overlay .error-desc,
#pw[data-size="xs"] #error-overlay .error-desc {
    font-size: 11px;
}

/* ── Denied box responsive ── */
#pw[data-size="sm"] #denied-box img,
#pw[data-size="xs"] #denied-box img {
    width: 48px;
    height: 48px;
}

#pw[data-size="sm"] #denied-box div,
#pw[data-size="xs"] #denied-box div {
    font-size: 14px;
}

/* ── Screenshot flash responsive ── */
#pw[data-size="sm"] #screenshot-flash,
#pw[data-size="xs"] #screenshot-flash {
    display: none;
}

/* ── Resume modal responsive ── */
/* The .mcard defaults to 380px width, 36px 40px padding, 48px icon */

/* Small: compact modal */
body[data-size="sm"] .mcard,
#pw[data-size="sm"]~#rmod .mcard,
#pw[data-size="sm"]~.mov .mcard {
    max-width: 280px !important;
    width: 90% !important;
    padding: 20px 22px !important;
    border-radius: 14px !important;
}

body[data-size="sm"] .mcard .mi,
#pw[data-size="sm"]~#rmod .mi {
    font-size: 32px !important;
    margin-bottom: 6px !important;
}

body[data-size="sm"] .mcard h3,
#pw[data-size="sm"]~#rmod h3 {
    font-size: 15px !important;
    margin-bottom: 4px !important;
}

body[data-size="sm"] .mcard p,
#pw[data-size="sm"]~#rmod p {
    font-size: 12px !important;
    margin-bottom: 14px !important;
}

body[data-size="sm"] .mcard .mb,
#pw[data-size="sm"]~#rmod .mb {
    font-size: 12px !important;
    padding: 8px 16px !important;
    height: 36px !important;
}

/* Extra small: minimal modal */
body[data-size="xs"] .mcard,
#pw[data-size="xs"]~#rmod .mcard,
#pw[data-size="xs"]~.mov .mcard {
    max-width: 220px !important;
    width: 92% !important;
    padding: 14px 16px !important;
    border-radius: 10px !important;
}

body[data-size="xs"] .mcard .mi,
#pw[data-size="xs"]~#rmod .mi {
    font-size: 24px !important;
    margin-bottom: 4px !important;
}

body[data-size="xs"] .mcard h3,
#pw[data-size="xs"]~#rmod h3 {
    font-size: 13px !important;
    margin-bottom: 2px !important;
}

body[data-size="xs"] .mcard p,
#pw[data-size="xs"]~#rmod p {
    font-size: 10px !important;
    margin-bottom: 10px !important;
}

body[data-size="xs"] .mcard .mb,
#pw[data-size="xs"]~#rmod .mb {
    font-size: 10px !important;
    padding: 6px 12px !important;
    height: 28px !important;
}

body[data-size="xs"] .mcard .mbtns,
#pw[data-size="xs"]~#rmod .mbtns {
    gap: 6px !important;
}