﻿/* =============================================================================
   Live Sport Streaming - Full Player Styles
   Premium dark theme for sports streaming
   Premium dark theme for sports streaming
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-body: #0a0e1a;
    --bg-header: #0d1117;
    --bg-card: #111827;
    --bg-card-alt: #1a2236;
    --bg-input: #0d1117;
    --bg-hover: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --text: #e8eaf0;
    --text-dim: #8892a4;
    --text-muted: #4c5770;
    --accent: #00d4ff;
    --accent2: #7c4dff;
    --accent-glow: rgba(0, 212, 255, 0.25);
    --live: #ff3b5c;
    --live-glow: rgba(255, 59, 92, 0.35);
    --success: #00e676;
    --warning: #ffab40;
    --gold: #ffd700;
    --home: #e74c3c;
    --away: #3498db;
    --r: 10px;
    --r-sm: 6px;

    /* Glassmorphism Variables */
    --glass-bg: rgba(17, 24, 39, 0.45);
    --glass-bg-hover: rgba(30, 41, 59, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.25);
    --glass-shadow: rgba(0, 0, 0, 0.25);
    --glass-shadow-hover: rgba(0, 0, 0, 0.4);
    --glass-highlight: rgba(255, 255, 255, 0.05);
    --glass-highlight-hover: rgba(255, 255, 255, 0.1);
    --live-glass: rgba(17, 24, 39, 0.55);
}

.light-theme {
    --bg-body: #f1f5f9;
    --bg-header: rgba(255, 255, 255, 0.85);
    --bg-card: #ffffff;
    --bg-card-alt: #f8fafc;
    --bg-input: rgba(255, 255, 255, 0.6);
    --bg-hover: rgba(0, 0, 0, 0.05);
    --border: rgba(0, 0, 0, 0.1);
    --border-light: rgba(0, 0, 0, 0.15);
    --text: #0f172a;
    --text-dim: #334155;
    --text-muted: #64748b;
    --accent: #0284c7;
    --accent2: #4f46e5;
    --accent-glow: rgba(2, 132, 199, 0.25);

    /* Light Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-bg-hover: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-border-hover: rgba(255, 255, 255, 1);
    --glass-shadow: rgba(30, 41, 59, 0.06);
    --glass-shadow-hover: rgba(30, 41, 59, 0.12);
    --glass-highlight: rgba(255, 255, 255, 0.8);
    --glass-highlight-hover: rgba(255, 255, 255, 1);
    --live-glass: rgba(255, 255, 255, 0.75);
}

.light-theme .ambient-bg {
    background-color: #e2e8f0;
}

.light-theme .blob-1 {
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 30%, transparent) 0%, transparent 70%);
}

.light-theme .blob-2 {
    background: radial-gradient(circle, color-mix(in srgb, var(--accent2) 30%, transparent) 0%, transparent 70%);
}

.light-theme .blob-3 {
    background: radial-gradient(circle, rgba(236, 72, 153, 0.25) 0%, rgba(236, 72, 153, 0) 70%);
}

.light-theme .blob-4 {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, rgba(245, 158, 11, 0) 70%);
}

.light-theme .blob-5 {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0) 70%);
}

.light-theme .blob-6 {
    background: radial-gradient(circle, rgba(236, 72, 153, 0.2) 0%, rgba(236, 72, 153, 0) 70%);
}

.light-theme .blob-7 {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0) 70%);
}

.light-theme .blob-8 {
    background: radial-gradient(circle, rgba(20, 184, 166, 0.2) 0%, rgba(20, 184, 166, 0) 70%);
}

.light-theme .blob-9 {
    background: radial-gradient(circle, rgba(244, 63, 94, 0.2) 0%, rgba(244, 63, 94, 0) 70%);
}

/* ===== Light Theme Comprehensive Overrides ===== */

/* Header */
.light-theme #header {
    background: rgba(255, 255, 255, 0.97);
    border-bottom-color: rgba(0, 0, 0, 0.12);
}

.light-theme #header::after {
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
    opacity: 0.3;
}

/* Match banner */
.light-theme .match-banner {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.light-theme .match-banner::before {
    opacity: 0.4;
}

/* Score gradient — dark text in light mode */
.light-theme .score {
    background: linear-gradient(180deg, #0f172a 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Live indicator */
.light-theme .live-indicator {
    color: #dc2626;
}

.light-theme .live-dot-lg {
    background: #dc2626;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.5);
}

/* Overlay — lighter background in light mode */
.light-theme .overlay {
    background: radial-gradient(ellipse at center, rgba(241, 245, 249, 0.92) 0%, rgba(226, 232, 240, 0.96) 100%);
}

.light-theme .overlay p {
    color: var(--text-dim);
}

.light-theme .spinner {
    border-color: rgba(0, 0, 0, 0.08);
    border-top-color: var(--accent);
    border-right-color: var(--accent2);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Chat section */
.light-theme .chat-section {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.light-theme .chat-header {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

.light-theme .chat-input-area {
    border-top-color: rgba(0, 0, 0, 0.06);
}

/* Theme toggle in light mode */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    backdrop-filter: blur(10px);
    position: relative;
    padding: 0;
    flex: 0 0 36px;
}

.theme-toggle-btn:hover {
    transform: rotate(15deg) scale(1.08);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 12px var(--glass-shadow-hover);
}

.theme-toggle-icon {
    width: 18px;
    height: 18px;
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -9px;
    margin-top: -9px;
    transform: rotate(0deg) scale(1);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.theme-toggle-icon.hidden {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

.theme-toggle-icon.visible {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.light-theme .theme-toggle-btn {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.1);
}

.light-theme .theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Viewer count badge */
.light-theme .viewer-count {
    color: var(--text-dim);
}

/* Related matches sidebar */
.light-theme .related-match {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.06);
}

.light-theme .related-match:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.12);
}

.light-theme .related-league {
    color: var(--text-muted);
}

.light-theme .related-teams {
    color: var(--text);
}

.light-theme .related-blv {
    color: var(--text-muted);
}

/* Stats tabs and content */
.light-theme .tab-bar {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.06);
}

.light-theme .stat-label {
    color: var(--text-dim);
}

/* Filter bar in light mode */
.light-theme .filter-bar {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.light-theme .filter-btn {
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--text-dim);
}

.light-theme .filter-btn.active {
    color: #fff;
}

/* Match card badge overrides */
.light-theme .match-card-badge.live {
    color: #fff;
}

/* Hero glow orb - lighter in light mode */
.light-theme .hero-banner::before {
    background: radial-gradient(ellipse, color-mix(in srgb, var(--accent) 8%, transparent) 0%, transparent 70%);
}

/* Hero title gradient for light mode */
.light-theme .hero-title {
    background: linear-gradient(135deg, #0f172a 0%, var(--accent) 40%, var(--accent2) 60%, #dc2626 80%, #0f172a 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: heroTextGradient 6s ease-in-out infinite;
}

/* Settings menu */
.light-theme .settings-menu {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.08);
}

.light-theme .settings-menu-item:hover,
.light-theme .settings-menu-item.active {
    background: rgba(0, 0, 0, 0.05);
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: transparent;
    color: var(--text);
    min-height: 100vh; min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

/* =============================================
   PREMIUM SCROLLBAR
   ============================================= */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--accent) 50%, transparent);
}

.hidden {
    display: none !important;
}

/* =============================================
   AMBIENT BACKGROUND (Liquid Glass)
   ============================================= */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh; height: 100dvh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background-color: #050b14;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    -webkit-filter: blur(80px);
    opacity: 0.3;
    will-change: transform;
}

.blob-1 {
    width: 38vw;
    height: 38vw;
    max-width: 512px;
    max-height: 512px;
    background: var(--accent);
    top: -8%;
    left: -5%;
    animation: float1 15s ease-in-out infinite alternate;
}

.blob-2 {
    width: 32vw;
    height: 32vw;
    max-width: 448px;
    max-height: 448px;
    background: var(--accent2);
    bottom: -15%;
    right: -5%;
    animation: float2 18s ease-in-out infinite alternate;
}

.blob-3 {
    width: 45vw;
    height: 45vw;
    max-width: 576px;
    max-height: 576px;
    background: #ff3b5c;
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    animation: float3 22s ease-in-out infinite alternate;
    opacity: 0.2;
}

.blob-4 {
    width: 28vw;
    height: 28vw;
    max-width: 380px;
    max-height: 380px;
    background: #ffab40;
    top: 10%;
    right: 20%;
    animation: float4 20s ease-in-out infinite alternate;
    opacity: 0.22;
}

.blob-5 {
    width: 35vw;
    height: 35vw;
    max-width: 460px;
    max-height: 460px;
    background: #00e676;
    bottom: 10%;
    left: 25%;
    animation: float5 17s ease-in-out infinite alternate;
    opacity: 0.18;
}

.blob-6 {
    width: 30vw;
    height: 30vw;
    max-width: 400px;
    max-height: 400px;
    background: #ec4899;
    top: 60%;
    right: -8%;
    animation: float6 25s ease-in-out infinite alternate;
    opacity: 0.2;
}

.blob-7 {
    width: 26vw;
    height: 26vw;
    max-width: 350px;
    max-height: 350px;
    background: #6366f1;
    top: -5%;
    left: 40%;
    animation: float7 19s ease-in-out infinite alternate;
    opacity: 0.18;
}

.blob-8 {
    width: 33vw;
    height: 33vw;
    max-width: 430px;
    max-height: 430px;
    background: #14b8a6;
    bottom: -10%;
    left: -8%;
    animation: float8 23s ease-in-out infinite alternate;
    opacity: 0.2;
}

.blob-9 {
    width: 29vw;
    height: 29vw;
    max-width: 390px;
    max-height: 390px;
    background: #f43f5e;
    top: 25%;
    right: 35%;
    animation: float9 16s ease-in-out infinite alternate;
    opacity: 0.15;
}

@keyframes float1 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(20%, 20%) scale(1.1);
    }
}

@keyframes float2 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-20%, -20%) scale(1.2);
    }
}

@keyframes float3 {
    0% {
        transform: translate(-50%, 0) scale(1);
    }

    100% {
        transform: translate(-40%, -10%) scale(1.15);
    }
}

@keyframes float4 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-15%, 25%) scale(1.1);
    }
}

@keyframes float5 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(25%, -15%) scale(1.15);
    }
}

@keyframes float6 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-20%, -25%) scale(1.1);
    }
}

@keyframes float7 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(15%, 20%) scale(1.2);
    }
}

@keyframes float8 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(20%, -10%) scale(1.1);
    }
}

@keyframes float9 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-10%, 15%) scale(1.15);
    }
}

/* =============================================
   ARTPLAYER NOTICE OVERRIDES
   ============================================= */
.art-notice-inner {
    background: rgba(10, 15, 30, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    font-family: inherit;
    font-size: 13px !important;
    color: #e0e6ed !important;
    padding: 8px 16px !important;
}

.art-notice {
    font-family: inherit;
}

/* =============================================
   APP MENU (xemgi.net style — transparent button, glass dropdown)
   ============================================= */
.app-menu-btn {
    /* First item in the header row (xemgi style) — sits at the left, before the
     * logo, inline in .header-inner (not a floating overlay). */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: transparent;
    border: none;
    border-radius: 10px;
    padding: 0;
    color: var(--text);
    cursor: pointer;
    transition: background 0.18s ease, opacity 0.18s ease, transform 0.12s ease;
}
.app-menu-btn:hover { background: rgba(255, 255, 255, 0.08); }
.app-menu-btn:active { transform: scale(0.92); }
.light-theme .app-menu-btn { color: #1a1a1a; }
.light-theme .app-menu-btn:hover { background: rgba(0, 0, 0, 0.06); }
.app-menu-btn svg { width: 22px; height: 22px; pointer-events: none; }

/* Legacy overlay element — kept in DOM but never displayed; JS disables it */
.app-menu-overlay { display: none !important; }

.app-menu-drawer {
    /* Compact dropdown anchored BELOW the hamburger button. Does NOT extend
     * into the header area and does NOT touch the page logo. Pure menu list
     * — no inner X / logo. Closes when button is clicked again, outside is
     * clicked, or Esc pressed. */
    position: fixed;
    left: 8px;
    top: 60px;          /* below the header (~52-58px tall) */
    width: 180px;
    max-width: calc(100vw - 16px);
    background: rgba(13, 17, 23, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #ffffff;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}
.app-menu-drawer.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.light-theme .app-menu-drawer {
    background: rgba(245, 247, 250, 0.97);
    border-color: rgba(0, 0, 0, 0.08);
    color: #1a1a1a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

/* Inner header (X close + logo) is no longer used — hide via CSS so even
 * if JS still injects it we get a clean dropdown. */
.app-menu-header, .app-menu-close, .app-menu-logo, .app-menu-spacer { display: none; }
.app-menu-nav { padding: 6px 0; }

.app-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.app-menu-list li { margin: 0; }
.app-menu-list a {
    display: block;
    padding: 12px 18px;
    color: inherit;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.15s ease;
}
.app-menu-list a:hover { background: rgba(255, 255, 255, 0.06); }
.light-theme .app-menu-list a:hover { background: rgba(0, 0, 0, 0.05); }
/* "Tải App" coming-soon item — non-navigating, with an accent badge. */
.app-menu-soon {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 18px; font-size: 15px; font-weight: 500;
    color: var(--text-dim); cursor: default;
}
.app-menu-badge {
    font-size: 10px; font-weight: 800; letter-spacing: 0.3px;
    padding: 2px 8px; border-radius: 999px; white-space: nowrap;
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    color: var(--accent);
}

/* =============================================
   HEADER
   ============================================= */
#header {
    /* Sized + styled to match the xemgi header: opaque glass, heavy blur +
       saturate (stronger on desktop), slim bar. Shared by all 5 skins. */
    background: rgba(18, 18, 20, 0.78);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 200;
    transition: transform 0.22s ease;
    will-change: transform;
}
@media (min-width: 768px) {
    #header {
        backdrop-filter: blur(56px) saturate(220%);
        -webkit-backdrop-filter: blur(56px) saturate(220%);
    }
}

.header-inner {
    /* Full-width slim bar like xemgi: hamburger + logo at the left edge,
       actions at the right. (py-[0.25rem], max-h 5rem, w-full). */
    max-width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    padding: 6px 18px;
    gap: 14px;
    min-height: 52px;
    max-height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    display: none;
    /* Keep for fallback if needed, but hide by default */
}

.logo-img {
    /* Responsive logo like xemgi (clamp height, contain, left-aligned).
       Logos are tightly cropped (no transparent padding) so they fill this height. */
    height: clamp(34px, 3.6vh, 46px);
    width: auto;
    max-width: 210px;
    border-radius: 0;
    object-fit: contain;
    box-shadow: none;
    border: none;
    background: transparent;
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

.logo-accent {
    color: var(--accent);
}

.header-forum-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    padding: 8px 13px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 10%, transparent);
    white-space: nowrap;
    transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.header-forum-link::before {
    content: "";
    width: 15px;
    height: 15px;
    display: inline-block;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 5.8C4 4.25 5.25 3 6.8 3h10.4C18.75 3 20 4.25 20 5.8v7.4c0 1.55-1.25 2.8-2.8 2.8h-4.66l-4.08 3.12A.9.9 0 0 1 7 18.4V16h-.2C5.25 16 4 14.75 4 13.2V5.8Zm4 1.7a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2H8Zm0 4a1 1 0 1 0 0 2h5.5a1 1 0 1 0 0-2H8Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 5.8C4 4.25 5.25 3 6.8 3h10.4C18.75 3 20 4.25 20 5.8v7.4c0 1.55-1.25 2.8-2.8 2.8h-4.66l-4.08 3.12A.9.9 0 0 1 7 18.4V16h-.2C5.25 16 4 14.75 4 13.2V5.8Zm4 1.7a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2H8Zm0 4a1 1 0 1 0 0 2h5.5a1 1 0 1 0 0-2H8Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.header-forum-link:hover,
.header-forum-link.active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 24%, transparent);
    transform: translateY(-1px);
}

.main-nav {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}

.main-nav::-webkit-scrollbar {
    display: none;
}

.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--r-sm);
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    letter-spacing: 0.5px;
    position: relative;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    transition: transform 0.3s ease;
    box-shadow: 0 0 8px var(--accent);
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: translateX(-50%) scale(1);
}

.nav-link.active {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.header-right {
    margin-left: auto;
    flex-shrink: 0;
}

.viewer-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-dim);
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255, 59, 92, 0.1);
    border: 1px solid rgba(255, 59, 92, 0.2);
}

.live-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--live);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 var(--live-glow);
    }

    50% {
        box-shadow: 0 0 0 6px transparent;
    }
}

.settings-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.settings-menu {
    position: absolute;
    bottom: 50px;
    right: -20px;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 200px;
    padding: 8px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform-origin: bottom right;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 100;
}

.settings-menu.hidden {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
    pointer-events: none;
}

.settings-menu-header {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 4px;
}

.settings-menu-list {
    max-height: 250px;
    overflow-y: auto;
}

.settings-menu-item {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 14px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-menu-item:hover,
.settings-menu-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.settings-menu-item .check {
    opacity: 0;
}

.settings-menu-item.active .check {
    opacity: 1;
    color: var(--accent);
}

/* =============================================
   SPORT TABS BAR
   ============================================= */
.sport-tabs-bar {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    max-width: min(1980px, 86vw);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sport-tabs {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 8px 0 0;
}

.sport-tabs::-webkit-scrollbar {
    display: none;
}

.sport-tab {
    padding: 8px 16px;
    border: none;
    border-radius: 8px 8px 0 0;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    color: var(--text-dim);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sport-tab:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.sport-tab.active {
    color: var(--accent);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom: none;
}

.live-count {
    background: var(--live);
    color: white;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.filter-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.filter-tab {
    padding: 5px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--text-dim);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-tab:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-tab.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.live-dot-sm {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--live);
    display: inline-block;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.3;
    }
}

/* =============================================
   MAIN LAYOUT
   ============================================= */
.main-layout {
    max-width: min(1980px, 86vw);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 16px;
    padding: 8px 20px 16px;
    align-items: start;
}

.content-column {
    min-width: 0;
}

/* =============================================
   MATCH BANNER
   ============================================= */
.match-banner-wrap {
    max-width: min(1980px, 86vw);
    margin: 0 auto;
    padding: 16px 20px 0;
}

.match-banner {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 12px;
    box-shadow: 0 8px 32px var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.match-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent));
    background-size: 200% 100%;
    animation: bannerTopGlow 4s ease-in-out infinite;
    opacity: 0.7;
}

@keyframes bannerTopGlow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.league-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.league-badge {
    font-size: 18px;
}

.league-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.match-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
    font-weight: 500;
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 0 1 120px;
    text-align: center;
    min-width: 0;
}

.team-logo {
    font-size: 40px;
    width: 64px !important;
    height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;
    min-width: 64px;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.team-logo:hover {
    transform: scale(1.08);
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
    box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 15%, transparent);
}

.team-logo img {
    max-width: 58px !important;
    max-height: 58px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    display: block;
}

.team-name {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.match-score-center {
    text-align: center;
    flex-shrink: 0;
}

.live-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 800;
    color: var(--live);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.live-dot-lg {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--live);
    animation: blink 1s infinite;
    box-shadow: 0 0 8px rgba(255, 59, 92, 0.6);
}

.score {
    font-size: 40px;
    font-weight: 900;
    letter-spacing: 6px;
    background: linear-gradient(180deg, #fff 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.match-minute {
    font-size: 13px;
    color: var(--warning);
    font-weight: 700;
    margin-top: 4px;
    animation: minutePulse 2s ease-in-out infinite;
}

@keyframes minutePulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* =============================================
   VIDEO PLAYER CONTROLS (YouTube-like)
   ============================================= */
#video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--r);
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    cursor: default;
}

#video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Play surface - covers entire video for click-to-play */
.play-surface {
    position: absolute;
    inset: 0;
    z-index: 6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.big-play-btn {
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.big-play-btn.show {
    opacity: 1;
}

/* Overlay */
.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(10, 14, 26, 0.92) 0%, rgba(0, 0, 0, 0.96) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10;
    gap: 16px;
}

.overlay p {
    font-size: 14px;
    color: var(--text-dim);
    font-weight: 500;
    letter-spacing: 0.3px;
    animation: overlayTextPulse 2s ease-in-out infinite;
}

@keyframes overlayTextPulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--accent);
    border-right-color: var(--accent2);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 20px var(--accent-glow);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-icon {
    font-size: 48px;
    animation: errorBounce 0.6s ease-out;
}

@keyframes errorBounce {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-glow);
}

/* Controls container */
.controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 8;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.3) 30%, rgba(0, 0, 0, 0.85) 100%);
    opacity: 0;
    transition: opacity 0.25s;
}

#video-wrapper.show-controls .controls {
    opacity: 1;
}

/* Show on hover — but respect hide-cursor state (auto-hidden in fullscreen) */
#video-wrapper:hover:not(.hide-cursor) .controls {
    opacity: 1;
}

/* --- Progress bar --- */
.progress-bar-container {
    position: relative;
    height: 14px;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    padding: 0 12px;
}

.progress-bar-container:hover .progress-bar {
    height: 5px;
}

.progress-bar-container:hover .progress-scrubber {
    transform: translateX(-50%) scale(1);
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1.5px;
    transition: height 0.15s;
    overflow: visible;
}

.progress-buffered {
    position: absolute;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: inherit;
    width: 0%;
    left: 0;
}

.progress-played {
    position: absolute;
    height: 100%;
    background: #ff0000;
    border-radius: inherit;
    width: 100%;
    left: 0;
}

.progress-scrubber {
    position: absolute;
    left: 100%;
    bottom: 0;
    width: 13px;
    height: 13px;
    background: #ff0000;
    border-radius: 50%;
    transform: translateX(-50%) scale(0);
    transition: transform 0.15s;
    pointer-events: none;
    margin-bottom: -5px;
}

/* --- Controls row --- */
.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 12px 8px;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Control buttons --- */
.ctrl-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.ctrl-icon {
    width: 24px;
    height: 24px;
    display: block;
}

/* --- Volume group --- */
.volume-group {
    display: flex;
    align-items: center;
}

.volume-slider-wrap {
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease;
}

.volume-group:hover .volume-slider-wrap {
    width: 70px;
}

.volume-slider {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    outline: none;
    margin-left: 4px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

/* --- LIVE Badge --- */
.live-badge-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
}

.live-badge-btn:not(.live):hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.live-badge-btn.live {
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.8), rgba(204, 0, 0, 0.8));
    border-color: rgba(255, 68, 68, 0.5);
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.3);
}

.live-badge-btn.live:hover {
    box-shadow: 0 0 25px rgba(255, 68, 68, 0.5);
    transform: translateY(-1px);
}

.live-badge-btn.live .live-dot-ctrl {
    background: #fff;
    box-shadow: 0 0 8px #fff;
    animation: pulse-live-dot 1s infinite alternate;
}

.live-dot-ctrl {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #aaa;
    display: inline-block;
    transition: all 0.3s;
}

@keyframes pulse-live-dot {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

/* --- Time display --- */
.time-display {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-variant-numeric: tabular-nums;
    margin-left: 6px;
    white-space: nowrap;
}

/* --- BLV Volume --- */
.blv-volume-group {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 4px;
}

.blv-label {
    font-size: 14px;
    cursor: pointer;
}

.blv-slider {
    width: 50px;
    height: 3px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

.blv-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    background: #00e676;
    border-radius: 50%;
    cursor: pointer;
}

/* --- Quality selector --- */
.quality-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.quality-select option {
    background: var(--bg-card);
}

/* Hide cursor when controls hidden */
#video-wrapper.hide-cursor {
    cursor: none;
}

#video-wrapper.hide-cursor .play-surface {
    cursor: none;
}

/* Danmu / Bullet chat */
.danmu-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px;
    pointer-events: none;
    overflow: hidden;
    z-index: 5;
}

.danmu-msg {
    position: absolute;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    animation: danmu-slide linear;
}

@keyframes danmu-slide {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(-100%);
    }
}

/* =============================================
   COMMENTATOR BAR
   ============================================= */
.commentator-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow-x: auto;
    scrollbar-width: none;
}

.commentator-bar::-webkit-scrollbar {
    display: none;
}

.commentator-label {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
}

.commentator-tabs {
    display: flex;
    gap: 6px;
}

.comm-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.comm-tab:hover {
    border-color: var(--accent);
    color: var(--text);
}

.comm-tab.active {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-color: transparent;
    color: white;
}

.comm-avatar {
    font-size: 14px;
}

/* BLV Notice Animations */
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }

    15% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    85% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
}

/* Commentator bar fade-in */
.commentator-bar[style*="display: block"],
.commentator-bar:not([style*="display:none"]):not([style*="display: none"]) {
    animation: barFadeIn 0.4s ease-out;
}

@keyframes barFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   DETAIL TABS
   ============================================= */
.detail-tabs {
    display: flex;
    gap: 2px;
    margin-top: 12px;
    padding: 4px;
    background: var(--bg-card);
    border-radius: var(--r);
    border: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}

.detail-tabs::-webkit-scrollbar {
    display: none;
}

.detail-tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: var(--r-sm);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--text-dim);
    white-space: nowrap;
    transition: all 0.2s;
}

.detail-tab:hover {
    color: var(--text);
}

.detail-tab.active {
    background: var(--bg-card-alt);
    color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.detail-panel {
    display: none;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0 0 var(--r) var(--r);
    border-top: none;
}

.detail-panel.active {
    display: block;
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Stats */
.stat-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.stat-home,
.stat-away {
    width: 32px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
}

.stat-home {
    color: var(--home);
}

.stat-away {
    color: var(--away);
}

.stat-bar-container {
    flex: 1;
}

.stat-label {
    font-size: 11px;
    color: var(--text-dim);
    text-align: center;
    margin-bottom: 4px;
}

.stat-bar {
    height: 6px;
    background: var(--away);
    border-radius: 3px;
    overflow: hidden;
}

.stat-fill.home {
    background: var(--home);
    height: 100%;
    border-radius: 3px;
}

/* Lineup */
.lineup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.lineup-team h4 {
    font-size: 13px;
    margin-bottom: 6px;
}

.lineup-formation {
    font-size: 11px;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 8px;
}

.lineup-list {
    list-style: none;
}

.lineup-list li {
    padding: 5px 8px;
    font-size: 12px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.shirt {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-card-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--text);
    flex-shrink: 0;
}

/* Events / Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.event-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    background: var(--bg-card-alt);
}

.event-item.goal {
    border-left: 3px solid var(--success);
}

.event-item.card {
    border-left: 3px solid var(--warning);
}

.event-item.sub {
    border-left: 3px solid var(--accent);
}

.event-minute {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    width: 30px;
    text-align: center;
}

.event-icon {
    font-size: 16px;
}

.event-detail {
    flex: 1;
    font-size: 12px;
    color: var(--text-dim);
}

.event-detail strong {
    color: var(--text);
}

.event-team {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.event-team.home {
    background: rgba(231, 76, 60, 0.2);
    color: var(--home);
}

.event-team.away {
    background: rgba(52, 152, 219, 0.2);
    color: var(--away);
}

/* H2H */
.h2h-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.h2h-row {
    display: grid;
    grid-template-columns: 80px 1fr auto 1fr;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    font-size: 12px;
    border-radius: var(--r-sm);
    background: var(--bg-card-alt);
}

.h2h-row span:first-child {
    color: var(--text-muted);
    font-size: 11px;
}

.h2h-score {
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: 700;
    text-align: center;
}

.h2h-score.home-win {
    background: rgba(0, 230, 118, 0.15);
    color: var(--success);
}

.h2h-score.away-win {
    background: rgba(231, 76, 60, 0.15);
    color: var(--home);
}

.h2h-score.draw {
    background: rgba(255, 171, 64, 0.15);
    color: var(--warning);
}

/* Odds */
.odds-table {
    margin-bottom: 10px;
}

.odds-header {
    padding: 8px 12px;
    background: var(--bg-card-alt);
    border-radius: var(--r-sm) var(--r-sm) 0 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}

.odds-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-card-alt);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--r-sm) var(--r-sm);
}

.odds-label {
    font-size: 12px;
    color: var(--text-dim);
    flex: 1;
}

.odds-value {
    font-size: 16px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 4px;
}

.odds-value.highlight {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
}

.odds-rate {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.odds-box {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    background: var(--bg-body);
    border-radius: var(--r-sm);
    font-size: 12px;
    color: var(--text-dim);
}

.odds-box strong {
    color: var(--gold);
    font-size: 16px;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 16px;
    /* Align chat with video player (below match banner) */
    align-self: start;
}

/* Chat */
.chat-section {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    height: calc(56.25vw * 0.72);
    max-height: 560px;
    min-height: 350px;
    box-shadow: 0 8px 32px var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.chat-header h3 {
    font-size: 13px;
    font-weight: 600;
}

.chat-online {
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.chat-msg {
    font-size: 13px;
    line-height: 1.5;
    padding: 6px 10px;
    margin: 3px 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    animation: chatSlideIn 0.25s ease-out;
}

@keyframes chatSlideIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-user {
    font-weight: 600;
    color: var(--accent);
    margin-right: 6px;
}

.chat-user.vip {
    color: var(--gold);
}

.chat-user.blv {
    color: var(--live);
    text-shadow: 0 0 6px rgba(255, 59, 92, 0.3);
}

.chat-user.admin {
    color: var(--gold);
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.3);
}

.chat-input-area {
    border-top: 1px solid var(--border);
    padding: 8px;
}

.chat-emoji-bar {
    display: flex;
    gap: 2px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.emoji-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--bg-hover);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.15s;
}

.emoji-btn:hover {
    transform: scale(1.2);
    background: var(--bg-card-alt);
}

.chat-input-row {
    display: flex;
    gap: 6px;
}

#chat-input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 12px;
    outline: none;
}

#chat-input:focus {
    border-color: var(--accent);
}

.btn-send {
    padding: 8px 16px;
    background: var(--accent);
    border: none;
    border-radius: var(--r-sm);
    color: #000;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* Related matches */
.related-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 14px;
}

.related-section h3 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.related-matches {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.related-match {
    padding: 10px 12px;
    background: var(--bg-card-alt);
    border-radius: var(--r-sm);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.related-match:hover {
    border-color: var(--accent);
}

.related-league {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.related-time {
    float: right;
    color: var(--text-dim);
}

.related-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
}

.related-score {
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
}

.related-score.live {
    background: var(--live);
    color: #fff;
}

.related-score.upcoming {
    background: var(--bg-card);
    color: var(--text-dim);
}

.related-blv {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Tech stats */
.tech-stats {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 14px;
}

.tech-stats h3 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.tech-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.tech-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    background: var(--bg-card-alt);
    border-radius: var(--r-sm);
}

.tech-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.tech-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
    }

    .chat-section {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .header-inner {
        /* Reserve 52px on the left so the fixed hamburger button (left:14 +
         * width:30 = right edge 44px, plus 8px breathing room) doesn't
         * overlap the logo. Without this, the ☰ icon sits on top of the
         * "L" of LiveGì on phones. */
        padding: 8px 12px;
        gap: 8px;
    }

    .main-nav {
        gap: 0;
    }

    .nav-link {
        font-size: 11px;
        padding: 6px 8px;
    }

    .main-layout {
        padding: 8px 10px;
    }

    .match-teams {
        gap: 10px;
    }

    .team-logo {
        font-size: 28px;
        width: 48px;
        height: 48px;
    }

    .score {
        font-size: 28px;
    }

    .lineup-grid {
        grid-template-columns: 1fr;
    }

    .sport-tabs-bar {
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 16px;
    }

    .viewer-count {
        display: none;
    }

    .match-banner {
        padding: 10px 12px;
    }

    .team-name {
        font-size: 12px;
    }

    .detail-tab {
        font-size: 11px;
        padding: 6px 8px;
    }

    /* Player controls: hide less critical items in portrait */
    .time-display,
    .blv-volume-group {
        display: none !important;
    }

    .controls-row {
        flex-wrap: nowrap;
    }

    /* Ensure fullscreen button never gets clipped */
    #fullscreen-btn {
        flex-shrink: 0;
    }
}

/* ═══ Fullscreen with Chat ═══ */
#video-wrapper:fullscreen {
    border-radius: 0;
}

/* In fullscreen, controls follow show-controls class only (auto-hide) */
#video-wrapper:fullscreen .controls {
    opacity: 0;
}
#video-wrapper:fullscreen.show-controls .controls {
    opacity: 1;
}

/* Fullscreen: main-layout becomes fullscreen container */
.main-layout:fullscreen,
.main-layout:-webkit-full-screen {
    display: flex;
    flex-direction: row;
    background: #000;
    width: 100vw;
    height: 100vh; height: 100dvh;
    position: relative;
}

.main-layout:fullscreen .content-column,
.main-layout:-webkit-full-screen .content-column {
    flex: 1;
    min-width: 0;
    height: 100vh; height: 100dvh;
    overflow: hidden;
}

.main-layout:fullscreen #video-wrapper,
.main-layout:-webkit-full-screen #video-wrapper {
    width: 100%;
    height: 100vh; height: 100dvh;
    border-radius: 0;
}

.main-layout:fullscreen #video-wrapper video,
.main-layout:-webkit-full-screen #video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Hide non-essential elements in fullscreen */
.main-layout:fullscreen .blv-bar,
.main-layout:fullscreen .match-tabs,
.main-layout:fullscreen .match-tab-content,
.main-layout:fullscreen .related-section,
.main-layout:-webkit-full-screen .blv-bar,
.main-layout:-webkit-full-screen .match-tabs,
.main-layout:-webkit-full-screen .match-tab-content,
.main-layout:-webkit-full-screen .related-section {
    display: none !important;
}

/* Hide real sidebar in fullscreen */
.main-layout:fullscreen .sidebar,
.main-layout:-webkit-full-screen .sidebar {
    display: none !important;
}

/* Fullscreen video takes full width */
.main-layout:fullscreen .content-column,
.main-layout:-webkit-full-screen .content-column {
    margin-right: 0;
}

/* ═══ Fullscreen Chat Overlay — transparent messages floating on video ═══ */
/* ═══ Fullscreen Chat Overlay — bubble style like live streaming ═══ */
.fs-chat-overlay {
    display: none;
    position: absolute;
    left: calc(12px + 1rem);
    bottom: 56px;
    width: 380px;
    max-height: 50vh;
    z-index: 9998;
    pointer-events: auto;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none; /* Firefox */
    /* Fade out at top */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 15%);
}

.main-layout:fullscreen .fs-chat-overlay.visible,
.main-layout:-webkit-full-screen .fs-chat-overlay.visible,
body.is-fullscreen .fs-chat-overlay.visible {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 3px;
}

.fs-chat-overlay .fs-chat-msg {
    display: inline-block;
    padding: 6px 12px;
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(0, 0, 0, 0.55);
    border-radius: 16px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fsChatSlideIn 0.3s ease;
    word-break: break-word;
    max-width: 100%;
    width: fit-content;
}

.fs-chat-overlay .fs-chat-msg .fs-chat-user {
    font-weight: 700;
    margin-right: 6px;
}

/* User colors are set inline via JS hash — no nth-child rotation */

.fs-chat-overlay .fs-chat-msg .fs-chat-user.vip {
    color: #ffd700;
}
.fs-chat-overlay .fs-chat-msg .fs-chat-user.vip::before {
    content: '\2B50 ';
}

@keyframes fsChatSlideIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Hide scrollbar */
.fs-chat-overlay::-webkit-scrollbar {
    display: none;
}

/* Auto-hide chat overlay with controls */
.fs-chat-overlay {
    transition: opacity 0.4s ease;
}
.fs-chat-overlay.fs-chat-hidden {
    opacity: 0;
}

/* Fullscreen chat toggle — now a ctrl-btn in control bar */
#fs-chat-toggle.active {
    color: #00c8ff;
}
#fs-chat-toggle.active .ctrl-icon {
    fill: #00c8ff;
}

/* Sticky player on mobile scroll */
@media (max-width: 1024px) {
    #video-wrapper.sticky {
        position: fixed;
        top: 48px;
        left: 0;
        right: 0;
        z-index: 150;
        border-radius: 0;
        max-height: 35vh;
    }
}

/* =============================================================================
   SCORE UPDATE ANIMATION
   ============================================================================= */
@keyframes scoreFlash {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.3);
        text-shadow: 0 0 30px var(--gold), 0 0 60px var(--gold);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        text-shadow: none;
    }
}

.score.score-updated {
    animation: scoreFlash 0.8s ease-out;
}

/* Match banner shimmer on live */
@keyframes bannerShimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

.match-banner.is-live {
    border-color: rgba(255, 59, 92, 0.2);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(255, 59, 92, 0.05) 50%, var(--bg-card-alt) 100%);
}

.match-banner.is-live::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 59, 92, 0.03), transparent);
    background-size: 200% 100%;
    animation: bannerShimmer 4s ease-in-out infinite;
    pointer-events: none;
    border-radius: var(--r);
}

.match-banner {
    position: relative;
    overflow: hidden;
}

/* P2P Buffer indicator on progress bar */
.progress-p2p {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(0, 230, 118, 0.3);
    border-radius: 3px;
    transition: width 0.3s;
    pointer-events: none;
}

/* =============================================================================
   RESPONSIVE — TABLET (≤1024px)
   ============================================================================= */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        padding: 8px 12px;
        gap: 12px;
    }

    .header-inner {
        /* Reserve left-padding for the fixed hamburger button (left:14 + w:30). */
        padding: 8px 12px;
        gap: 12px;
    }

    .logo-text {
        font-size: 16px;
    }

    .match-banner {
        padding: 12px 16px;
        margin-bottom: 8px;
    }

    .score {
        font-size: 28px;
    }

    .team-logo {
        width: 48px;
        height: 48px;
        max-width: 48px;
        max-height: 48px;
        min-width: 48px;
        min-height: 48px;
        font-size: 32px;
    }

    .team-name {
        font-size: 12px;
    }

    .match-teams {
        gap: 12px;
    }

    /* Chat panel below video */
    .sidebar-column {
        max-height: 400px;
    }

    /* Controls */
    .controls-row {
        padding: 6px 10px;
    }

    .ctrl-btn {
        width: 32px;
        height: 32px;
    }

    .ctrl-icon {
        width: 18px;
        height: 18px;
    }

    /* Tabs */
    .sport-tabs-bar {
        padding: 0 12px;
    }

    /* Match grid for home */
    .match-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* =============================================================================
   RESPONSIVE — MOBILE PHONE (≤640px)
   ============================================================================= */
@media (max-width: 640px) {
    .header-inner {
        max-width: 100%;
        width: 100%;
        /* Same left-reserve as 768px breakpoint — keep logo clear of the
         * fixed hamburger button. */
        padding: 6px 12px;
        gap: 8px;
    }

    .logo-icon {
        font-size: 20px;
    }

    .logo-text {
        font-size: 14px;
    }

    .header-forum-link {
        padding: 7px 10px;
        font-size: 12px;
        gap: 5px;
    }

    .header-forum-link::before {
        width: 14px;
        height: 14px;
    }

    .header-right {
        min-width: 0;
        gap: 6px !important;
    }

    .main-nav {
        display: none;
    }

    .viewer-count {
        font-size: 10px;
        padding: 4px 10px;
    }

    .main-layout {
        padding: 4px 6px;
        gap: 8px;
    }

    /* Match banner compact */
    .match-banner {
        padding: 10px 12px;
        margin-bottom: 6px;
    }

    .league-info {
        margin-bottom: 8px;
        gap: 6px;
    }

    .league-badge {
        font-size: 14px;
    }

    .league-name {
        font-size: 11px;
    }

    .match-time {
        font-size: 10px;
    }

    .match-teams {
        gap: 8px;
    }

    .team-logo {
        width: 40px;
        height: 40px;
        max-width: 40px;
        max-height: 40px;
        min-width: 40px;
        min-height: 40px;
        font-size: 26px;
    }

    .team-name {
        font-size: 11px;
    }

    .score {
        font-size: 24px;
        letter-spacing: 2px;
    }

    .match-minute {
        font-size: 11px;
    }

    .live-indicator {
        font-size: 9px;
    }

    /* Video controls — larger tap targets for touch */
    .controls-row {
        padding: 4px 8px;
        gap: 2px;
    }

    .ctrl-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .ctrl-icon {
        width: 20px;
        height: 20px;
    }

    /* Hide less important controls on mobile */
    #skip-back-btn,
    #skip-fwd-btn,
    #pip-btn,
    #danmu-btn {
        display: none;
    }

    /* Show mute toggle but hide volume slider on mobile */
    .volume-slider-wrap {
        display: none;
    }

    /* Ensure settings gear is tappable on touch */
    .settings-wrap .ctrl-btn {
        min-width: 40px;
        min-height: 40px;
    }

    /* Settings menu opens above controls — ensure visible on mobile */
    .settings-menu {
        bottom: 44px;
        right: 0;
        min-width: 160px;
    }

    .quality-select {
        max-width: 70px;
        font-size: 10px;
        padding: 4px 6px;
    }

    .live-badge-btn {
        font-size: 10px;
        padding: 4px 10px;
    }

    .blv-volume-group {
        max-width: 80px;
    }

    .blv-slider {
        width: 50px;
    }

    .blv-label {
        font-size: 14px;
    }

    /* Progress bar larger for touch */
    .progress-bar-container {
        padding: 10px 0 4px;
    }

    .progress-bar {
        height: 6px;
    }

    .progress-scrubber {
        width: 16px;
        height: 16px;
        top: -5px;
    }

    /* Time display */
    .time-display {
        font-size: 10px;
    }

    /* Chat compact */
    .chat-section {
        border-radius: var(--r-sm);
    }

    .chat-header {
        padding: 8px 12px;
        font-size: 13px;
    }

    .chat-messages {
        max-height: 250px;
    }

    .chat-input-row {
        padding: 6px 8px;
        gap: 6px;
    }

    .chat-input {
        font-size: 13px;
        padding: 8px 10px;
    }

    /* BLV tabs */
    .blv-tabs {
        gap: 2px;
    }

    .blv-tab {
        font-size: 11px;
        padding: 6px 10px;
    }

    /* Match info section */
    .match-info-section {
        padding: 12px;
    }

    /* Stats section */
    .stats-section {
        padding: 10px;
    }
}

/* =============================================================================
   RESPONSIVE — SMALL PHONE (≤400px)
   ============================================================================= */
@media (max-width: 400px) {
    .header-inner {
        padding: 4px 6px;
    }

    .logo-text {
        font-size: 12px;
    }

    /* Icon-only on narrow phones: the "Cộng đồng" label was pushing the header
       action cluster ~10px past the viewport edge (horizontal scroll on iPhone
       SE / 360px Android). The ::before icon is sized by width/height, so
       font-size:0 drops only the text label and keeps the icon. */
    .header-forum-link {
        padding: 8px;
        font-size: 0;
        gap: 0;
    }

    .score {
        font-size: 20px;
        letter-spacing: 1px;
    }

    .team-logo {
        width: 32px;
        height: 32px;
        max-width: 32px;
        max-height: 32px;
        min-width: 32px;
        min-height: 32px;
        font-size: 22px;
    }

    .team-name {
        font-size: 10px;
    }

    .match-banner {
        padding: 8px 10px;
    }

    .controls-row {
        padding: 2px 6px;
    }

    .ctrl-btn {
        width: 32px;
        height: 32px;
    }

    .blv-volume-group {
        display: none;
    }
}

/* =============================================================================
   LANDSCAPE PHONE OPTIMIZATION
   ============================================================================= */
@media (max-height: 500px) and (orientation: landscape) {
    #header {
        padding: 2px 0;
    }

    .header-inner {
        padding: 4px 12px;
    }

    .match-banner {
        display: none;
    }

    .main-layout {
        padding: 4px 8px;
    }

    #video-wrapper {
        max-height: 85vh;
    }
}

/* =============================================
   CUSTOM SETTINGS MENU
   ============================================= */
.settings-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.settings-menu {
    position: absolute;
    bottom: 50px;
    right: -20px;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 200px;
    padding: 8px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform-origin: bottom center;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 100;
}

.settings-menu.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.95);
}

.settings-menu-header {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    text-transform: uppercase;
    padding: 4px 16px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.settings-menu-list {
    display: flex;
    flex-direction: column;
}

.settings-menu-item {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 10px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-menu-item:hover,
.settings-menu-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.settings-menu-item .check {
    opacity: 0;
}

.settings-menu-item.active .check {
    opacity: 1;
    color: var(--accent);
}

/* =============================================
   RELATED MATCHES SIDEBAR (GLASSMORPHISM)
   ============================================= */
.related-match {
    background: rgba(17, 24, 39, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--r);
    padding: 14px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

.related-match:hover {
    transform: translateY(-4px) scale(1.02);
    background: rgba(30, 41, 59, 0.65);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.related-league {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.related-time {
    color: var(--warning);
    font-weight: 600;
}

.related-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 13px;
    gap: 8px;
}

.related-score {
    font-size: 14px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
}

.related-score.text-danger {
    color: #ff4444;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.2);
}

.related-blv {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
}

/* =============================================================================
   MOBILE UX ENHANCEMENTS
   ============================================================================= */

/* Safe area support for notched phones (iPhone X+) */
@supports (padding: env(safe-area-inset-bottom)) {
    body { padding-bottom: 0; }
    #header { padding-top: env(safe-area-inset-top); }
    .chat-input-area { padding-bottom: env(safe-area-inset-bottom); }
}

/* Smooth scrolling on mobile */
html { scroll-behavior: auto; -webkit-overflow-scrolling: touch; }

/* Mobile bottom navigation bar */
.mobile-bottom-nav {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    z-index: 200; padding: 6px 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.mobile-bottom-nav .nav-items {
    display: flex; justify-content: space-around; align-items: center;
}
.mobile-bottom-nav .nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    text-decoration: none; color: var(--text-muted);
    font-size: 10px; font-weight: 500; padding: 4px 12px;
    border-radius: 10px; transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.mobile-bottom-nav .nav-item.active { color: var(--accent); }
.mobile-bottom-nav .nav-item .nav-icon { font-size: 20px; line-height: 1; }
.mobile-bottom-nav .nav-item:active { transform: scale(0.92); }

/* Mobile chat toggle button (floating) */
.mobile-chat-toggle {
    display: none;
    position: fixed; bottom: 16px; right: 12px;
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff; border: none; z-index: 190;
    font-size: 22px; cursor: pointer;
    box-shadow: 0 4px 20px var(--accent-glow);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s, box-shadow 0.2s;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mobile-chat-toggle:active { transform: scale(0.9); }
.mobile-chat-toggle .badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--live); color: #fff; font-size: 10px; font-weight: 700;
    min-width: 18px; height: 18px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
}

@media (max-width: 768px) {
    body { padding-bottom: 0; }

    /* Header: thinner on mobile */
    #header { position: sticky; top: 0; z-index: 180; }
    #header.header-hidden {
        transform: translateY(-110%);
    }

    /* Hide desktop nav on mobile */
    .main-nav { display: none; }

    /* Sidebar chat: slide-up panel on mobile — keep video visible */
    .sidebar {
        position: fixed; bottom: 0; left: 0; right: 0;
        z-index: 250; max-height: 45vh; height: 45vh;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
        overflow: hidden;
    }
    .sidebar.mobile-visible {
        transform: translateY(0);
    }
    .sidebar .chat-section {
        height: 100%; max-height: 100%;
        border-radius: 20px 20px 0 0;
    }
    .sidebar .chat-header {
        cursor: grab; position: relative;
    }
    /* Pull handle for chat panel */
    .sidebar .chat-header::before {
        content: ''; display: block;
        width: 40px; height: 4px; border-radius: 2px;
        background: rgba(255,255,255,0.2);
        margin: 0 auto 8px;
    }
    .sidebar .related-section { display: none; }

    .mobile-chat-toggle { display: flex; align-items: center; justify-content: center; }

    /* Chat messages: larger text for readability */
    .chat-msg { font-size: 14px; padding: 6px 12px; }
    .chat-input { font-size: 16px !important; } /* prevent iOS zoom on focus */
    .btn-send { min-width: 60px; min-height: 40px; font-size: 14px; }

    /* Emoji bar: horizontally scrollable */
    .chat-emoji-bar {
        overflow-x: auto; flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .chat-emoji-bar::-webkit-scrollbar { display: none; }
    .emoji-btn {
        min-width: 36px; min-height: 36px; font-size: 18px;
        flex-shrink: 0;
    }

    /* Detail tabs: scrollable on mobile */
    .detail-tabs {
        overflow-x: auto; flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; padding-bottom: 4px;
    }
    .detail-tabs::-webkit-scrollbar { display: none; }
    .detail-tab { flex-shrink: 0; white-space: nowrap; }

    /* Touch-friendly tap targets */
    .ctrl-btn { min-width: 44px; min-height: 44px; }
    .filter-btn { min-height: 40px; }

    /* Match card: full width + larger touch */
    .match-card { padding: 14px; }
    .match-card-watch { min-height: 36px; padding: 8px 18px; font-size: 13px; }
}

@media (max-width: 480px) {
    /* Even more compact header */
    .header-inner { min-height: 44px; }
    .logo-img { height: 24px; width: auto; max-width: 130px; }

    /* Match banner: compact layout */
    .match-banner { padding: 8px 10px; gap: 6px; }

    /* Controls: essential only */
    .controls-left { gap: 0; }
    .controls-right { gap: 0; }

    /* Larger progress bar touch area */
    .progress-bar-container { padding: 14px 0 6px; min-height: 28px; }
    .progress-bar { height: 6px; }
    .progress-scrubber { width: 18px; height: 18px; }

    /* Chat overlay on small phones — still keep video visible */
    .sidebar { max-height: 50vh; height: 50vh; }
}

/* Pull-to-refresh visual hint (overscroll glow) */
@media (max-width: 768px) {
    body { overscroll-behavior-y: contain; }
}

/* Dark mode improvements for OLED screens */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #000000;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .blob { display: none; }
}
