:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #0b0c10;
    --surface: #15171f;
    --surface-2: #1c1f29;
    --border: #262a36;
    --text: #f4f4f6;
    --text-muted: #8b8f9c;
    --text-soft: #6b7280;
    --dark-1: #0f172a;
    --dark-2: #1e293b;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
    --shadow: 0 4px 12px rgba(15, 23, 42, .06), 0 2px 4px rgba(15, 23, 42, .04);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .10), 0 4px 12px rgba(15, 23, 42, .06);
    --shadow-xl: 0 24px 60px rgba(79, 70, 229, .18);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Sarabun', -apple-system, "Segoe UI", Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg);
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-dark); }

/* === Nav === */
.nav {
    background: rgba(8, 9, 12, .85);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    color: #fff;
    padding: 0 28px;
    display: flex;
    align-items: center;
    gap: 24px;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(255, 255, 255, .04);
    box-shadow: 0 2px 12px rgba(15, 23, 42, .08);
}
.nav .brand {
    font-weight: 800;
    font-size: 17px;
    color: #fff;
    letter-spacing: -.01em;
    background: linear-gradient(135deg, #a5b4fc, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.nav .brand:hover { text-decoration: none; filter: brightness(1.15); }
.nav-links { display: flex; gap: 2px; flex: 1; }
.nav-links a {
    color: #cbd5e1;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all .15s;
}
.nav-links a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-links a.active {
    background: var(--surface-2);
    color: #fff;
    box-shadow: none;
}
.nav-user { font-size: 13px; color: #cbd5e1; display: flex; align-items: center; gap: 14px; }
.nav-user a { color: #94a3b8; font-weight: 500; }
.nav-user a:hover { color: #fff; }

/* === Layout === */
.wrap { max-width: 1180px; margin: 0 auto; padding: 32px 20px 80px; }
h1 {
    font-size: 28px;
    margin: 0 0 4px;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text);
}
h2 {
    font-size: 18px;
    margin: 0 0 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.01em;
}
.sub { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }

/* === Card === */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
    border: 1px solid var(--border);
}
.card h2:first-child { margin-top: 0; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: all .15s;
    line-height: 1.2;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: none;
}
.btn-primary:hover { background: var(--primary-light); color: #fff; box-shadow: none; }
.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: #242833; border-color: #3a3f4c; color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 4px 12px rgba(239, 68, 68, .3); }
.btn-danger:hover { background: #dc2626; color: #fff; box-shadow: 0 6px 16px rgba(239, 68, 68, .45); }
.btn-sm { padding: 5px 11px; font-size: 12px; }

/* === Form === */
input, select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: #1a1c24;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--text-soft); }
input:focus, select:focus, textarea:focus {
    outline: 0;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}
input[type=file] { padding: 8px; cursor: pointer; }
label {
    display: block;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 5px;
    font-weight: 600;
}
.field { margin-bottom: 14px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }

/* === Table === */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th {
    background: var(--surface-2);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: .05em;
}
tbody tr:hover td { background: rgba(255, 255, 255, .03); }
tbody tr:last-child td { border-bottom: 0; }

/* === Video Grid === */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.video-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .2s cubic-bezier(.4, 0, .2, 1), box-shadow .2s;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    color: var(--text);
}
.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.thumb {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 56px;
    font-weight: 800;
    position: relative;
    overflow: hidden;
    letter-spacing: -.04em;
}
.thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top left, rgba(255, 255, 255, .2), transparent 60%);
    pointer-events: none;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .play-ico {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    transition: background .2s;
    color: #fff;
    font-size: 48px;
    z-index: 2;
    opacity: 0;
}
.video-card:hover .thumb .play-ico { background: rgba(0, 0, 0, .35); opacity: 1; }
.thumb .play-ico::before {
    content: '▶';
    width: 62px; height: 62px;
    background: rgba(255, 255, 255, .95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 22px;
    padding-left: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}
.thumb .status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(15, 23, 42, .85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.thumb .status-badge.done {
    background: linear-gradient(135deg, #10b981, #059669);
}
.video-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.video-title {
    font-weight: 700;
    font-size: 15.5px;
    line-height: 1.35;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.video-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin: 2px 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
}

/* === Pills === */
.pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .01em;
    background: var(--surface-2);
    color: var(--text-muted);
}
.pill-done { background: #064e3b; color: #6ee7b7; }
.pill-progress { background: #3a2c10; color: #fcd34d; }
.pill-none { background: #27272f; color: #cbd5e1; }
.pill-info { background: #1e3a8a; color: #bfdbfe; }
.pill-kitchen { background: #3f1d1d; color: #fca5a5; }
.pill-cashier { background: #1e3a8a; color: #bfdbfe; }
.pill-manager { background: #312e81; color: #c7d2fe; }
.pill-all { background: #27272f; color: #cbd5e1; }

/* === Progress bar === */
.bar {
    height: 6px;
    background: #262a36;
    border-radius: 999px;
    overflow: hidden;
}
.bar .fill {
    height: 100%;
    background: var(--primary);
    transition: width .4s cubic-bezier(.4, 0, .2, 1);
    border-radius: 999px;
}
.bar.bar-success .fill {
    background: linear-gradient(90deg, var(--success), #059669);
}

/* === Search & Filter === */
.search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
    flex-wrap: wrap;
    align-items: center;
    background: var(--surface);
    padding: 10px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.search-row input { flex: 2; min-width: 200px; border: 0; box-shadow: none; background: transparent; padding-left: 12px; }
.search-row input:focus { box-shadow: none; }
.search-row select { flex: 1; min-width: 140px; border: 1px solid var(--border); }
.search-row .btn { flex: 0 0 auto; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.chip {
    padding: 7px 14px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 13px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
    transition: all .15s;
}
.chip:hover:not(.active) {
    background: var(--surface-2);
    border-color: #3a3f4c;
    color: var(--text);
    text-decoration: none;
}
.chip.active {
    background: #fff;
    color: #0b0c10;
    border-color: transparent;
    box-shadow: none;
}

/* === Stats === */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}
.stat-card {
    background: var(--surface);
    padding: 22px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, #06b6d4, #3b82f6); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, #10b981, #059669); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
}
.stat-value {
    font-size: 32px;
    font-weight: 800;
    margin-top: 6px;
    color: var(--text);
    letter-spacing: -.03em;
    line-height: 1.1;
}
.stat-hint { font-size: 12px; color: var(--text-soft); margin-top: 4px; }

/* === Alerts === */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    border-left: 4px solid currentColor;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-info { background: #15233f; color: #bfdbfe; }
.alert-success { background: #0c2a20; color: #6ee7b7; }
.alert-warning { background: #2a200c; color: #fcd34d; }
.alert-danger { background: #2a0f0f; color: #fca5a5; }

/* === Empty state === */
.empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-soft);
    background: var(--surface);
    border-radius: var(--radius);
    border: 2px dashed var(--border);
    font-size: 14px;
}

/* === Login === */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(ellipse at top, rgba(99, 102, 241, .18), transparent 55%),
        radial-gradient(ellipse at bottom, rgba(139, 92, 246, .15), transparent 55%),
        var(--bg);
    position: relative;
    overflow: hidden;
}
.login-wrap::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    top: -150px; right: -150px;
    background: radial-gradient(circle, rgba(139, 92, 246, .15), transparent 65%);
    border-radius: 50%;
    filter: blur(40px);
}
.login-wrap::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    bottom: -100px; left: -100px;
    background: radial-gradient(circle, rgba(99, 102, 241, .15), transparent 65%);
    border-radius: 50%;
    filter: blur(40px);
}
.login-card {
    background: rgba(21, 23, 31, .92);
    backdrop-filter: blur(20px);
    padding: 38px 34px;
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
    border: 1px solid var(--border);
}
.login-card h1 {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 26px;
    font-weight: 800;
}

/* === Video Player page === */
.player-wrap { max-width: 1000px; margin: 28px auto; padding: 0 20px; }
.player-box {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .25);
}
.player-box video { width: 100%; display: block; max-height: 70vh; }
.player-ctrl {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: linear-gradient(180deg, #1e293b, #0f172a);
    color: #fff;
    font-size: 13px;
}
.player-ctrl button {
    background: rgba(255, 255, 255, .1);
    color: #fff;
    border: 0;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: background .15s;
    font-family: inherit;
}
.player-ctrl button:hover { background: rgba(255, 255, 255, .18); }
.player-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, .1);
    border-radius: 999px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.player-bar .watched {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(99, 102, 241, .6);
}
.player-bar .cursor {
    position: absolute;
    top: -2px; bottom: -2px;
    width: 3px;
    background: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, .5);
    border-radius: 2px;
}
.player-time { font-variant-numeric: tabular-nums; min-width: 95px; text-align: right; color: #cbd5e1; font-weight: 500; }

/* === Page header === */
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
}

/* === Utility === */
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 14px; }
.mb-0 { margin-bottom: 0 !important; }
.flex { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.hidden { display: none; }

/* Fade in */
.wrap > * { animation: fadeIn .4s ease-out both; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    .nav { padding: 0 16px; gap: 10px; height: 56px; }
    .nav .brand { font-size: 15px; }
    .nav-user span { display: none; }
    .nav-links { gap: 0; overflow-x: auto; }
    .nav-links a { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
    .wrap { padding: 20px 14px 60px; }
    h1 { font-size: 22px; }
    .stat-value { font-size: 26px; }
}

/* ===========================================
   Watch page v2 — modern player + sidebar
   =========================================== */

/* layout shell: stack on mobile, 2-col on desktop */
.watch-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px 14px 80px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}
.watch-back {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.watch-back:hover { color: var(--primary); }

@media (min-width: 1024px) {
    .watch-shell {
        grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
        gap: 28px;
        padding: 28px 24px 100px;
    }
}

/* sticky video container (mobile) */
.player-wrap-pro {
    position: relative;
    z-index: 5;
}
@media (max-width: 1023px) {
    .player-wrap-pro.is-sticky {
        position: sticky;
        top: 56px;
    }
}

/* player stage: video + overlay */
.player-stage {
    position: relative;
    background: linear-gradient(135deg, #1e1b4b, #0f172a);
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .35);
    user-select: none;
    -webkit-user-select: none;
}
.player-stage video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}
/* YouTube iframe host */
.yt-host {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.yt-host iframe {
    width: 100% !important;
    height: 100% !important;
    border: 0;
    display: block;
}
.player-stage.is-fullscreen { border-radius: 0; aspect-ratio: auto; height: 100vh; }

/* center play overlay (huge tap target) */
.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, .25), rgba(139, 92, 246, .25));
    cursor: pointer;
    transition: opacity .25s, background .25s;
}
.player-overlay.is-hidden { opacity: 0; pointer-events: none; }
.player-overlay-btn {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    padding-left: 6px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .4);
    transition: transform .2s;
}
.player-overlay:hover .player-overlay-btn { transform: scale(1.08); }
.player-overlay:active .player-overlay-btn { transform: scale(.95); }

/* loading spinner */
.player-spinner {
    position: absolute;
    top: 50%; left: 50%;
    width: 48px; height: 48px;
    margin: -24px 0 0 -24px;
    border: 3px solid rgba(255, 255, 255, .25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: player-spin .8s linear infinite;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
}
.player-spinner.is-active { opacity: 1; }
@keyframes player-spin { to { transform: rotate(360deg); } }

/* status badge on player (top-left) */
.player-status {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(15, 23, 42, .75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 6px;
}
.player-status.is-done { background: linear-gradient(135deg, #10b981, #059669); }

/* bottom controls — auto hide */
.player-controls-pro {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 28px 14px 12px;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .85));
    color: #fff;
    z-index: 4;
    transition: opacity .25s, transform .25s;
}
.player-controls-pro.is-hidden { opacity: 0; transform: translateY(8px); pointer-events: none; }

.player-bar-pro {
    position: relative;
    height: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    touch-action: none;
}
.player-bar-track {
    position: relative;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, .2);
    border-radius: 999px;
    overflow: hidden;
    transition: height .15s;
}
.player-bar-pro:hover .player-bar-track,
.player-bar-pro.is-dragging .player-bar-track { height: 7px; }
.player-bar-watched {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: rgba(255, 255, 255, .35);
    border-radius: 999px;
}
.player-bar-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: linear-gradient(90deg, var(--primary-light), var(--accent));
    border-radius: 999px;
    box-shadow: 0 0 8px rgba(139, 92, 246, .6);
}
.player-bar-thumb {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    background: #fff;
    border-radius: 50%;
    transform: translateY(-50%) scale(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
    transition: transform .15s;
}
.player-bar-pro:hover .player-bar-thumb,
.player-bar-pro.is-dragging .player-bar-thumb { transform: translateY(-50%) scale(1); }

.player-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.player-btn {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border: 0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .15s;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.player-btn:hover { background: rgba(255, 255, 255, .22); }
.player-btn:active { transform: scale(.92); }
.player-btn.is-locked { opacity: .5; cursor: not-allowed; }

.player-time {
    font-variant-numeric: tabular-nums;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .85);
    font-weight: 500;
    padding: 0 8px;
    min-width: 88px;
}
.player-spacer { flex: 1; }

/* speed menu popup */
.player-speed-wrap { position: relative; }
.speed-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: rgba(15, 23, 42, .98);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 6px;
    min-width: 110px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
    border: 1px solid rgba(255, 255, 255, .08);
    display: none;
    z-index: 10;
}
.speed-menu.is-open { display: block; animation: speed-pop .15s ease-out; }
@keyframes speed-pop {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.speed-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    color: #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
    transition: background .12s;
}
.speed-option:hover:not(.is-locked) { background: rgba(255, 255, 255, .08); color: #fff; }
.speed-option.is-active { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; }
.speed-option.is-locked { opacity: .35; cursor: not-allowed; }
.speed-option .lock-ico { font-size: 11px; }

/* hint banner under player */
.player-hint {
    margin-top: 12px;
    padding: 12px 16px;
    background: #2a200c;
    color: #fcd34d;
    border-radius: var(--radius-sm);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid #f59e0b;
}

/* sidebar / meta */
.watch-meta { display: flex; flex-direction: column; gap: 14px; }
.watch-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.watch-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--text);
    letter-spacing: -.02em;
    line-height: 1.3;
}
.watch-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.watch-progress-mini {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.watch-progress-mini .bar { margin-top: 6px; }
.watch-progress-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}
.watch-progress-row strong { color: var(--text); font-size: 14px; }

.watch-desc {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* completion card (replaces #doneCard) */
.complete-card {
    background: linear-gradient(135deg, #0c2a20, #08231b);
    border: 1px solid rgba(16, 185, 129, .35);
    border-radius: var(--radius);
    padding: 28px 22px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}
.complete-card .ico {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 8px;
    display: block;
    animation: bounce-in .6s cubic-bezier(.34, 1.56, .64, 1);
}
.complete-card h2 {
    font-size: 22px;
    color: #6ee7b7;
    margin: 4px 0 8px;
}
.complete-card p {
    color: #34d399;
    margin: 0 0 18px;
    font-size: 14px;
}
@keyframes bounce-in {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.quiz-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 8px 20px rgba(99, 102, 241, .35);
    transition: transform .15s, box-shadow .15s;
}
.quiz-cta-btn:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(99, 102, 241, .5);
}

/* mobile fine-tuning */
@media (max-width: 640px) {
    .watch-shell { padding: 12px 10px 60px; gap: 12px; }
    .watch-title { font-size: 18px; }
    .watch-card { padding: 16px; border-radius: var(--radius); }
    .player-overlay-btn { width: 72px; height: 72px; font-size: 28px; }
    .player-status { font-size: 11px; padding: 5px 10px; top: 10px; left: 10px; }
    .player-controls-pro { padding: 24px 10px 10px; }
    .player-btn { width: 44px; height: 44px; font-size: 17px; } /* bigger tap target */
    .player-time { font-size: 12px; min-width: 78px; padding: 0 4px; }
    .player-bar-pro { height: 22px; }
    .player-bar-track { height: 6px; }
    .player-bar-pro:hover .player-bar-track,
    .player-bar-pro.is-dragging .player-bar-track { height: 8px; }
    .player-bar-thumb { width: 16px; height: 16px; margin-left: -8px; }
}
