/* DVA Cast - Machine A Receiver CSS (Apple-inspired Translucent Glass, Ultra-lightweight) */
:root {
    --dva-bg: #07090f;
    --dva-surface: rgba(0, 0, 0, 0.25);
    --dva-border: rgba(255, 255, 255, 0.16);
    --dva-accent: #e50914;
    --dva-accent-pink: #d50055;
    --dva-accent-grad: linear-gradient(135deg, #e50914 0%, #d50055 100%);
    --dva-text: #f5f6fa;
    --dva-muted: #b0b8c8;
    --dva-cue-size: 100%;
    --dva-cue-scale: 1;
    --dva-radius-lg: 40px;
    --dva-radius-sm: 24px;
    --dva-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent !important;
}

*:focus,
*:active,
button:focus,
a:focus,
[tabindex]:focus {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

html, body {
    width: 100%;
    height: 100%;
    background: var(--dva-bg);
    color: var(--dva-text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

.dva-hidden {
    display: none !important;
}

.dva-svg {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Màn hình 1: Chờ quét QR */
.dva-wait-wrap {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at 20% 20%, rgba(229, 9, 20, 0.16), transparent 46%),
                radial-gradient(circle at 80% 80%, rgba(213, 0, 85, 0.12), transparent 46%),
                #07090f;
    opacity: 1;
    transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity;
}

.dva-wait-wrap.dva-view-fade-out {
    opacity: 0;
    pointer-events: none;
}

.dva-card {
    width: 100%;
    max-width: 900px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);
    border: 1px solid var(--dva-border);
    border-radius: var(--dva-radius-lg);
    padding: 30px 32px;
    box-shadow: var(--dva-shadow);
}

.dva-brand {
    display: flex;
    align-items: center;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.2px;
    margin-bottom: 24px;
}

.dva-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: 11px;
    border-radius: 12px;
    background: var(--dva-accent-grad);
    border: none;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(229, 9, 20, 0.35);
    flex-shrink: 0;
}

.dva-brand-tag {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: #e4e8f2;
    padding: 7px 14px;
    border-radius: var(--dva-radius-sm);
    border: none;
    background: var(--dva-surface);
    box-shadow: var(--dva-shadow);
}

.dva-wait-grid {
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 30px;
    align-items: center;
}

.dva-qr-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.dva-qr-box {
    width: 244px;
    height: 244px;
    background: #ffffff;
    border-radius: var(--dva-radius-sm);
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.dva-qr-box canvas,
.dva-qr-box img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    image-rendering: pixelated;
}

.dva-qr-loading {
    color: #333c4d;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.dva-code-pill {
    width: 244px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--dva-radius-sm);
    background: var(--dva-surface);
    border: none;
    box-shadow: var(--dva-shadow);
}

.dva-code-label {
    font-size: 12px;
    color: var(--dva-muted);
}

.dva-code-val {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 20px;
    letter-spacing: 3px;
    color: #ffffff;
}

.dva-ttl-row {
    width: 244px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--dva-muted);
}

.dva-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--dva-surface);
    color: #ffffff;
    border: none;
    border-radius: var(--dva-radius-sm);
    padding: 7px 13px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--dva-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.dva-btn-ghost:hover,
.dva-btn-ghost:focus,
.dva-btn-ghost.dva-tv-focused {
    outline: none !important;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45), 0 10px 24px rgba(229, 9, 20, 0.35);
    transform: scale(1.04);
}

.dva-title {
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.22;
    font-weight: 700;
    letter-spacing: -0.4px;
    margin-bottom: 10px;
}

.dva-subtitle {
    font-size: 15px;
    line-height: 1.5;
    color: var(--dva-muted);
    margin-bottom: 20px;
}

.dva-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 22px;
}

.dva-steps li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    line-height: 1.45;
    color: #e6ebf4;
}

.dva-step-num {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--dva-surface);
    border: none;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dva-actions-wait {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.dva-actions-btns {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.dva-actions-btns > * + * {
    margin-left: 10px;
}

.dva-btn-link {
    display: inline-flex;
    align-items: center;
    color: #ffffff;
    text-decoration: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: var(--dva-radius-sm);
    background: var(--dva-surface);
    border: none;
    box-shadow: var(--dva-shadow);
    cursor: pointer;
    transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.16s ease, background 0.16s ease;
}

.dva-btn-link .dva-svg {
    margin-right: 7px;
}

.dva-btn-download {
    background: rgba(229, 9, 20, 0.22);
}

.dva-btn-link:hover,
.dva-btn-link:focus,
.dva-btn-link.dva-tv-focused {
    outline: none !important;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45), 0 10px 24px rgba(229, 9, 20, 0.35);
    transform: scale(1.04);
}

.dva-privacy-note {
    font-size: 12px;
    color: var(--dva-muted);
}

/* ================================================================
   Màn hình 2: Trình phát thuần HTML5 <video> & HUD kiểu Điện ảnh
   ================================================================ */
.dva-player-wrap {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000000;
    opacity: 1;
    transition: opacity 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.dva-player-wrap.dva-view-fade-in-start {
    opacity: 0;
}

html.dva-native-playback,
body.dva-native-playback,
body.dva-native-playback .dva-player-wrap,
body.dva-native-playback .dva-player-wrap.dva-pseudo-fs {
    background: transparent !important;
}

body.dva-native-playback .dva-video {
    display: none !important;
    opacity: 0 !important;
}

/* App TV luôn chạy toàn màn hình nên ẩn toàn bộ nút Fullscreen */
.dva-native-app #dva-side-fs,
.dva-native-app #dva-btn-fs {
    display: none !important;
}

.dva-player-wrap.dva-hud-idle {
    cursor: none;
}

.dva-video {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: block;
    object-fit: contain;
    background: #000000;
    pointer-events: none !important;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    outline: none;
}

.dva-video.dva-video-cover {
    object-fit: cover;
}

.dva-video::-webkit-media-controls,
.dva-video::-webkit-media-controls-enclosure,
.dva-video::-webkit-media-controls-panel,
.dva-video::-webkit-media-controls-start-playback-button,
.dva-video::-webkit-media-controls-play-button,
.dva-video::-webkit-media-controls-overlay-play-button,
.dva-video::-webkit-media-controls-overlay-enclosure,
.dva-video::-internal-media-controls-overlay-cast-button,
.dva-video::-internal-media-controls-cast-button {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    -webkit-appearance: none !important;
    width: 0 !important;
    height: 0 !important;
}

.dva-player-wrap.dva-pseudo-fs {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483000 !important;
    background: #000000 !important;
}

.dva-video::cue {
    font-size: var(--dva-cue-size);
    background-color: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    text-shadow: 0 1px 3px #000000;
}

/* Phụ đề HTML đồng bộ chuẩn subtitleUI.php (hiển thị ổn định trên cả Native ExoPlayer và Trình duyệt) */
.dva-sub-layer {
    position: absolute;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    bottom: 10%;
    width: 80%;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    pointer-events: none !important;
    contain: layout style;
}

.dva-sub-line {
    margin: 10px 0;
    font-size: 4vh;
    font-weight: 500;
    line-height: 1.2em;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.4s ease-out;
    will-change: opacity;
    white-space: pre-line;
    pointer-events: none !important;
}

.dva-sub-line.show {
    opacity: 1;
}

.dva-sub-smooth {
    transition: all 250ms ease !important;
}

.dva-sub-vn {
    order: 1;
    font-size: 4vh;
    color: #ffffff;
    width: fit-content;
    max-width: 100%;
    text-shadow: rgb(0, 0, 0) 0px 0px 5px, rgb(0, 0, 0) 0px 1px 5px, rgb(0, 0, 0) 0px 2px 5px, rgb(0, 0, 0) -2px 0px 1px, rgb(0, 0, 0) 2px 0px 1px, rgb(0, 0, 0) 0px -2px 1px, rgb(0, 0, 0) 0px 2px 1px, rgb(0, 0, 0) -1px 1px 1px, rgb(0, 0, 0) 1px 1px 1px, rgb(0, 0, 0) 1px -1px 1px, rgb(0, 0, 0) 1px 1px 1px;
}

.dva-sub-en {
    order: 3;
    font-size: 3vh;
    color: #ffffff;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 25px;
    width: fit-content;
    max-width: 100%;
    text-shadow: rgb(0, 0, 0) 0px 0px 5px, rgb(0, 0, 0) 0px 1px 5px, rgb(0, 0, 0) 0px 2px 5px, rgb(0, 0, 0) -2px 0px 1px, rgb(0, 0, 0) 2px 0px 1px, rgb(0, 0, 0) 0px -2px 1px, rgb(0, 0, 0) 0px 2px 1px, rgb(0, 0, 0) -1px 1px 1px, rgb(0, 0, 0) 1px 1px 1px, rgb(0, 0, 0) 1px -1px 1px, rgb(0, 0, 0) 1px 1px 1px;
}

.dva-sub-sep {
    order: 2;
    width: 20%;
    background: rgba(255, 255, 255, 0.25);
    height: 2px;
    border-radius: 10px;
    margin: -5px 0;
    transition: opacity 0.3s ease-in-out;
    opacity: 0;
    box-shadow: rgb(0, 0, 0) 0px 0px 6px;
}

.dva-sub-top {
    position: absolute;
    top: 10px;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    width: 86%;
    text-align: center;
    z-index: 6;
    text-shadow: rgb(0, 0, 0) 0px 0px 5px, rgb(0, 0, 0) 0px 1px 5px, rgb(0, 0, 0) 0px 2px 5px, rgb(0, 0, 0) -2px 0px 1px, rgb(0, 0, 0) 2px 0px 1px, rgb(0, 0, 0) 0px -2px 1px, rgb(0, 0, 0) 0px 2px 1px, rgb(0, 0, 0) -1px 1px 1px, rgb(0, 0, 0) 1px 1px 1px, rgb(0, 0, 0) 1px -1px 1px, rgb(0, 0, 0) 1px 1px 1px;
}

.dva-ecg-container {
    display: none;
    position: relative;
    width: 300px;
    height: 50px;
    margin: 5px auto;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.dva-sub-en.is-loading .dva-ecg-container {
    display: block;
}

.dva-sub-en.is-loading .dva-sub-en-text {
    display: none;
}

.dva-ecg-svg {
    width: 200%;
    height: 100%;
    display: block;
    animation: dva-ecg-scroll 3s linear infinite;
}

.dva-ecg-path {
    fill: none;
    stroke: #ff3366;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 4px #ff3366);
}

@keyframes dva-ecg-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.dva-idle-cover {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(229, 9, 20, 0.16), transparent 46%),
                radial-gradient(circle at 80% 80%, rgba(213, 0, 85, 0.12), transparent 46%),
                #07090f;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.dva-idle-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(7, 9, 15, 0.25) 0%, rgba(7, 9, 15, 0.78) 100%);
    pointer-events: none;
}

.dva-cover-img {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.46;
}

.dva-cover-text {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 30px 32px;
    background: var(--dva-surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--dva-border);
    border-radius: var(--dva-radius-lg);
    box-shadow: var(--dva-shadow);
}

.dva-spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto 14px;
    border: 3px solid rgba(255, 255, 255, 0.18);
    border-top-color: var(--dva-accent);
    border-right-color: var(--dva-accent-pink);
    border-radius: 50%;
    animation: dva-spin 0.85s linear infinite;
}

.dva-idle-cover.dva-hidden .dva-spinner {
    animation-play-state: paused !important;
    animation: none !important;
}

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

.dva-unmute-gate {
    position: fixed;
    left: 50%;
    top: 50%;
    -webkit-transform: translate(-50%, -50%) translateZ(0);
    transform: translate(-50%, -50%) translateZ(0);
    z-index: 2147483060;
    background: var(--dva-surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--dva-border);
    border-radius: var(--dva-radius-lg);
    color: #ffffff;
    padding: 30px 32px;
    max-width: 90%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--dva-shadow);
}

.dva-unmute-gate .dva-unmute-title {
    margin-top: 10px;
}

.dva-unmute-gate .dva-unmute-sub {
    margin-top: 8px;
}

.dva-unmute-gate:focus,
.dva-unmute-gate.dva-tv-focused {
    outline: none !important;
    border-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25), var(--dva-shadow);
}

.dva-unmute-title {
    font-size: 16px;
    font-weight: 700;
}

.dva-unmute-sub {
    font-size: 13px;
    color: var(--dva-muted);
}

/* ================================================================
   HUD Layout (Top Bar + Left Vertical Dock + Bottom Timeline Bar)
   ================================================================ */
.dva-hud {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2147483050;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 22px 26px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.65) 0%, transparent 25%, transparent 72%, rgba(0, 0, 0, 0.72) 100%);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.22s ease, visibility 0s linear 0s;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

.dva-player-wrap.dva-hidden .dva-hud {
    display: none !important;
}

.dva-player-wrap.dva-hud-idle .dva-hud {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.24s ease, visibility 0s linear 0.24s;
    pointer-events: none !important;
}

.dva-player-wrap.dva-hud-idle .dva-hud * {
    pointer-events: none !important;
}

/* --- 1. TOP BAR --- */
.dva-hud-top {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dva-hud-meta {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 65%;
    background: var(--dva-surface);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--dva-border);
    border-radius: var(--dva-radius-lg);
    padding: 10px 22px 10px 12px;
    box-shadow: var(--dva-shadow);
}

.dva-brand-badge {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.dva-brand-play-icon {
    width: 34px;
    height: 34px;
    margin-right: 12px;
    border-radius: 12px;
    background: var(--dva-accent-grad);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(229, 9, 20, 0.42);
    flex-shrink: 0;
}

.dva-brand-name {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.2px;
    white-space: nowrap;
}

.dva-hud-divider {
    width: 1px;
    height: 30px;
    background: rgba(255, 255, 255, 0.16);
    margin: 0 16px;
    flex-shrink: 0;
}

.dva-hud-titles {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dva-movie-title {
    font-size: 16.5px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
}

.dva-status-row {
    display: flex;
    align-items: center;
    margin-top: 2px;
}

.dva-live-dot {
    width: 7.5px;
    height: 7.5px;
    margin-right: 8px;
    border-radius: 50%;
    background: #30d158;
    box-shadow: 0 0 8px rgba(48, 209, 88, 0.75);
    flex-shrink: 0;
}

.dva-live-dot.dva-dot-warn {
    background: #ffd60a;
    box-shadow: 0 0 8px rgba(255, 214, 10, 0.75);
}

.dva-status-line {
    font-size: 12px;
    color: #d0d7e4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dva-hud-top-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.dva-hud-top-actions > * + * {
    margin-left: 10px;
}

.dva-net-pill {
    display: inline-flex;
    align-items: center;
    height: 46px;
    padding: 0 18px;
    border-radius: var(--dva-radius-lg);
    background: var(--dva-surface);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--dva-border);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--dva-shadow);
}

.dva-signal-svg {
    color: #30d158;
    margin-right: 8px;
}

.dva-net-pill.dva-net-warn .dva-signal-svg {
    color: #ffd60a;
}

.dva-top-icon-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--dva-surface);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: none;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--dva-shadow);
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.dva-top-icon-btn:hover,
.dva-top-icon-btn:focus,
.dva-top-icon-btn.dva-tv-focused {
    outline: none !important;
    background: rgba(255, 255, 255, 0.24);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5), 0 10px 26px rgba(229, 9, 20, 0.42);
    transform: scale(1.1);
}

/* --- 2. LEFT VERTICAL DOCK --- */
.dva-hud-middle {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    pointer-events: none;
}

.dva-side-dock {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 9px;
    border-radius: var(--dva-radius-lg);
    background: var(--dva-surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--dva-border);
    box-shadow: var(--dva-shadow);
}

.dva-side-dock > .dva-side-btn + .dva-side-btn {
    margin-top: 10px;
}

.dva-side-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--dva-surface);
    border: none;
    color: #e8ecf4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none !important;
    transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.dva-side-btn-primary {
    width: 46px;
    height: 46px;
    background: rgba(229, 9, 20, 0.26);
    border: none;
    color: #ffffff;
}

.dva-side-btn:hover,
.dva-side-btn:focus,
.dva-side-btn.dva-tv-focused {
    outline: none !important;
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.86), rgba(213, 0, 85, 0.86));
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55), 0 10px 26px rgba(229, 9, 20, 0.5);
    transform: scale(1.12);
}

/* --- 3. BOTTOM TIMELINE & CONTROLS BAR --- */
.dva-hud-bottom {
    pointer-events: auto;
    display: flex;
    align-items: center;
    padding: 11px 18px 11px 12px;
    border-radius: var(--dva-radius-lg);
    background: var(--dva-surface);
    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);
    border: 1px solid var(--dva-border);
    box-shadow: var(--dva-shadow);
}

.dva-hud-bottom > * + * {
    margin-left: 16px;
}

.dva-hud-thumb-box {
    width: 74px;
    height: 44px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--dva-surface);
    border: none;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.dva-hud-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dva-hud-thumb-fallback {
    color: rgba(255, 255, 255, 0.75);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dva-time-pill {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    white-space: nowrap;
}

.dva-cur-time {
    color: #ffffff;
    font-weight: 700;
}

.dva-time-sep {
    margin: 0 6px;
    color: rgba(176, 184, 200, 0.65);
}

.dva-dur-time {
    color: var(--dva-muted);
    font-weight: 500;
}

/* Interactive Progress Scrubber */
.dva-progress-wrap {
    flex: 1;
    min-width: 100px;
    height: 32px;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0 4px;
    border-radius: var(--dva-radius-sm);
}

.dva-progress-wrap:focus,
.dva-progress-wrap.dva-tv-focused {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35), 0 0 18px rgba(229, 9, 20, 0.35);
}

.dva-progress-track {
    width: 100%;
    height: 6px;
    border-radius: var(--dva-radius-sm);
    background: rgba(255, 255, 255, 0.18);
    position: relative;
    overflow: visible;
}

.dva-progress-fill {
    width: 0%;
    height: 100%;
    border-radius: var(--dva-radius-sm);
    background: linear-gradient(90deg, #e50914 0%, #d50055 100%);
    box-shadow: 0 0 14px rgba(229, 9, 20, 0.55);
    position: relative;
    transition: width 0.12s linear;
}

.dva-progress-thumb {
    position: absolute;
    right: -7px;
    top: 50%;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #e50914;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.65);
    transition: transform 0.15s ease;
}

.dva-progress-wrap:hover .dva-progress-thumb,
.dva-progress-wrap:focus .dva-progress-thumb {
    -webkit-transform: translateY(-50%) scale(1.25);
    transform: translateY(-50%) scale(1.25);
}

.dva-hud-controls {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.dva-hud-controls > * + * {
    margin-left: 10px;
}

.dva-ctl-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--dva-surface);
    border: none;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none !important;
    box-shadow: var(--dva-shadow);
    transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), background 0.18s ease, box-shadow 0.18s ease;
}

.dva-ctl-icon-btn:hover,
.dva-ctl-icon-btn:focus,
.dva-ctl-icon-btn.dva-tv-focused {
    outline: none !important;
    background: rgba(255, 255, 255, 0.24);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5), 0 10px 26px rgba(229, 9, 20, 0.42);
    transform: scale(1.1);
}

.dva-ctl-btn {
    display: inline-flex;
    align-items: center;
    background: var(--dva-surface);
    color: #ffffff;
    border: none;
    border-radius: var(--dva-radius-sm);
    padding: 10px 18px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    outline: none !important;
    white-space: nowrap;
    box-shadow: var(--dva-shadow);
    transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease, background 0.18s ease;
}

.dva-ctl-btn:hover,
.dva-ctl-btn:focus,
.dva-ctl-btn.dva-tv-focused {
    outline: none !important;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5), 0 10px 24px rgba(0, 0, 0, 0.55);
    transform: scale(1.05);
}

.dva-ctl-danger {
    background: rgba(229, 9, 20, 0.18);
    border: none;
    color: #ff9c9c;
}

.dva-ctl-danger:hover,
.dva-ctl-danger:focus,
.dva-ctl-danger.dva-tv-focused {
    outline: none !important;
    background: var(--dva-accent-grad);
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55), 0 10px 26px rgba(229, 9, 20, 0.55);
    transform: scale(1.1);
}

/* --- TOAST & NOTICE MODAL --- */
.dva-toast {
    position: fixed;
    left: 50%;
    top: 86px;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    z-index: 2147483070;
    display: inline-flex;
    align-items: center;
    background: var(--dva-surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--dva-border);
    border-radius: var(--dva-radius-sm);
    color: #ffffff;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    max-width: min(92vw, 480px);
    box-shadow: var(--dva-shadow);
}

.dva-toast .dva-svg {
    margin-right: 8px;
}

.dva-notice-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    z-index: 2147483200;
    background: rgba(5, 7, 12, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dva-notice-card {
    width: 100%;
    max-width: 440px;
    background: var(--dva-surface);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid var(--dva-border);
    border-radius: var(--dva-radius-lg);
    padding: 30px 32px;
    text-align: center;
    box-shadow: var(--dva-shadow);
}

.dva-notice-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 14px;
    border-radius: 18px;
    background: var(--dva-surface);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffd60a;
}

.dva-notice-title {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: #ffffff;
    margin-bottom: 8px;
}

.dva-notice-msg {
    font-size: 14px;
    line-height: 1.55;
    color: #cfd6e3;
    margin-bottom: 22px;
    white-space: pre-line;
}

.dva-notice-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.dva-notice-btn {
    flex: 1;
    min-width: 115px;
    justify-content: center;
}

.dva-notice-btn-primary {
    background: rgba(229, 9, 20, 0.25);
    border-color: rgba(255, 255, 255, 0.38);
    font-weight: 700;
}

@media (max-width: 820px) {
    .dva-card {
        padding: 22px 20px;
        border-radius: 28px;
    }
    .dva-wait-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .dva-hud {
        padding: 14px 16px;
    }
    .dva-hud-meta {
        max-width: 58%;
    }
    .dva-hud-thumb-box {
        display: none;
    }
    .dva-net-pill span {
        display: none;
    }
    .dva-net-pill {
        padding: 0 13px;
    }
}

/* ================================================================
   Tối ưu GPU & Render khi phát video (Cách 3: Thay blur bằng rgba)
   ================================================================ */
body.dva-playing-perf .dva-player-wrap {
    --dva-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.dva-player-wrap .dva-cover-text,
.dva-player-wrap .dva-unmute-gate,
.dva-player-wrap .dva-hud-meta,
.dva-player-wrap .dva-net-pill,
.dva-player-wrap .dva-top-icon-btn,
.dva-player-wrap .dva-side-dock,
.dva-player-wrap .dva-hud-bottom,
body.dva-playing-perf .dva-toast,
body.dva-playing-perf .dva-notice-overlay,
body.dva-playing-perf .dva-notice-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.dva-player-wrap .dva-hud-meta,
.dva-player-wrap .dva-net-pill,
.dva-player-wrap .dva-top-icon-btn,
.dva-player-wrap .dva-side-dock,
.dva-player-wrap .dva-hud-bottom {
    background: rgba(10, 12, 18, 0.72);
    contain: layout style;
}

.dva-player-wrap .dva-cover-text,
.dva-player-wrap .dva-unmute-gate,
body.dva-playing-perf .dva-toast,
body.dva-playing-perf .dva-notice-card {
    background: rgba(12, 14, 22, 0.88);
}

body.dva-playing-perf .dva-notice-overlay {
    background: rgba(5, 7, 12, 0.84);
}
