/* ==========================================================================
   STADIUM EDITION — full redesign
   ==========================================================================
   - Tokens (theme + accent + density)
   - Backdrop / ambient
   - Login gate
   - Layout: rail + main + tabbar
   - Topbar / date strip / quick chips
   - Hero / rails / cards
   - Sport grid / favorites / search
   - Modal / channel browser / settings / shortcuts / mini player
   - Toasts / live ticker / quick-edit
   - TV scaling + responsive
   ========================================================================== */

/* ---------- RESET ---------- */
*,*::before,*::after { box-sizing: border-box; }
html, body { margin:0; padding:0; }
button { background:none; border:none; padding:0; font:inherit; color:inherit; cursor:pointer; }
input, select, textarea { font:inherit; color:inherit; }
a { color:inherit; text-decoration:none; }
img { max-width:100%; display:block; }
:focus:not(:focus-visible) { outline:none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- TOKENS ---------- */
:root {
    /* Type */
    --font-display: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
    --font-body:    'Inter', system-ui, -apple-system, sans-serif;

    /* Radius */
    --r-xs: 6px;
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;
    --r-2xl: 36px;
    --r-pill: 999px;

    /* Motion */
    --dur-fast: 120ms;
    --dur-base: 200ms;
    --dur-slow: 360ms;
    --ease-out: cubic-bezier(.16,1,.3,1);
    --ease-io: cubic-bezier(.65,0,.35,1);

    /* Layout */
    --rail-w: 240px;
    --rail-w-collapsed: 76px;
    --tabbar-h: 64px;
    --topbar-h: 68px;
    --datestrip-h: 64px;

    /* Status colors */
    --live: #FF2B4D;
    --live-2: #FF5C5C;
    --soon: #FFB020;
    --finished: #5A5A7A;
    --success: #22E09A;
    --warn: #FFB020;

    /* Sport accents */
    --sp-soccer:    #10B981;
    --sp-hockey:    #3B82F6;
    --sp-basketball:#F97316;
    --sp-baseball:  #06B6D4;
    --sp-football:  #EF4444;
    --sp-tennis:    #EAB308;
    --sp-golf:      #22C55E;
    --sp-motor:     #F59E0B;
    --sp-rugby:     #8B5CF6;
    --sp-cricket:   #14B8A6;
    --sp-mma:       #EC4899;
    --sp-esports:   #A855F7;

    /* Shadows / Elevation */
    --sh-sm: 0 2px 8px rgba(0,0,0,.40);
    --sh-md: 0 8px 24px rgba(0,0,0,.50);
    --sh-lg: 0 24px 60px rgba(0,0,0,.65);
}

/* ---------- THEMES ---------- */
body[data-theme="oled"] {
    --bg-0: #010308;
    --bg-1: #060a16;
    --bg-2: #0c1022;
    --bg-3: #141832;
    --bg-4: #1c2246;
    --bg-5: #262e5e;
    --glass: rgba(8,11,22,0.78);
    --glass-strong: rgba(1,3,10,0.88);
    --border-soft: rgba(255,255,255,0.03);
    --border-mid:  rgba(255,255,255,0.07);
    --border-strong: rgba(255,255,255,0.14);
    --text-1: #eeeef6;
    --text-2: #b4b8d4;
    --text-3: #5a5e84;
    --text-4: #3a3e60;
}
body[data-theme="dark"] {
    --bg-0: #04060e;
    --bg-1: #0a0c1a;
    --bg-2: #121528;
    --bg-3: #1a1e36;
    --bg-4: #24284a;
    --bg-5: #303464;
    --glass: rgba(10,12,28,0.75);
    --glass-strong: rgba(4,6,14,0.85);
    --border-soft: rgba(255,255,255,0.035);
    --border-mid:  rgba(255,255,255,0.08);
    --border-strong: rgba(255,255,255,0.15);
    --text-1: #f0f2fa;
    --text-2: #c0c4de;
    --text-3: #666a90;
    --text-4: #444868;
}
body[data-theme="dim"] {
    --bg-0: #0e0e1a;
    --bg-1: #141428;
    --bg-2: #1c1e36;
    --bg-3: #262848;
    --bg-4: #32325c;
    --bg-5: #3e3e74;
    --glass: rgba(20,20,40,0.78);
    --glass-strong: rgba(14,14,26,0.85);
    --border-soft: rgba(255,255,255,0.04);
    --border-mid:  rgba(255,255,255,0.09);
    --border-strong: rgba(255,255,255,0.16);
    --text-1: #f4f4fc;
    --text-2: #c8cae4;
    --text-3: #7276a0;
    --text-4: #505478;
}

/* ---------- ACCENTS ---------- */
/* ── ACCENTS ── Each transforms the entire app feel ── */
body[data-accent="blue"] {
    --accent: #3366ff; --accent-2: #6688ff; --accent-rgb: 51,102,255;
    --accent-bg: rgba(51,102,255,.06); --accent-glow: rgba(51,102,255,.35);
    --bg-0: #000000; --bg-1: #030308; --bg-2: #060610; --bg-3: #0a0a18;
    --bg-4: #101028; --bg-5: #181840;
    --border-soft: rgba(51,102,255,.04); --border-mid: rgba(51,102,255,.08);
    --border-strong: rgba(51,102,255,.16);
    --text-1: #eef0ff; --text-2: #c0c8ee; --text-3: #6470a0; --text-4: #404868;
}
body[data-accent="red"] {
    --accent: #ff2244; --accent-2: #ff5577; --accent-rgb: 255,34,68;
    --accent-bg: rgba(255,34,68,.06); --accent-glow: rgba(255,34,68,.35);
    --bg-0: #000000; --bg-1: #030308; --bg-2: #060610; --bg-3: #0a0a18;
    --bg-4: #101028; --bg-5: #181840;
    --border-soft: rgba(255,34,68,.04); --border-mid: rgba(255,34,68,.08);
    --border-strong: rgba(255,34,68,.16);
    --text-1: #ffeef0; --text-2: #eec0c4; --text-3: #a0646e; --text-4: #684046;
}
body[data-accent="white"] {
    --accent: #e8e8f0; --accent-2: #ffffff; --accent-rgb: 232,232,240;
    --accent-bg: rgba(255,255,255,.05); --accent-glow: rgba(255,255,255,.15);
    --bg-0: #000000; --bg-1: #030308; --bg-2: #060610; --bg-3: #0a0a18;
    --bg-4: #101028; --bg-5: #181840;
    --border-soft: rgba(255,255,255,.04); --border-mid: rgba(255,255,255,.08);
    --border-strong: rgba(255,255,255,.16);
    --text-1: #f4f4f8; --text-2: #d0d0e0; --text-3: #8888aa; --text-4: #606080;
}
body[data-accent="cyan"] {
    --accent: #00ccff; --accent-2: #66eeff; --accent-rgb: 0,204,255;
    --accent-bg: rgba(0,204,255,.06); --accent-glow: rgba(0,204,255,.35);
    --bg-0: #000000; --bg-1: #030308; --bg-2: #060610; --bg-3: #0a0a18;
    --bg-4: #101028; --bg-5: #181840;
    --border-soft: rgba(0,204,255,.04); --border-mid: rgba(0,204,255,.08);
    --border-strong: rgba(0,204,255,.16);
    --text-1: #eef8fc; --text-2: #c0e4ee; --text-3: #5e8a9e; --text-4: #3e5e6c;
}
body[data-accent="green"] {
    --accent: #00dd66; --accent-2: #44ff88; --accent-rgb: 0,221,102;
    --accent-bg: rgba(0,221,102,.06); --accent-glow: rgba(0,221,102,.35);
    --bg-0: #000000; --bg-1: #030308; --bg-2: #060610; --bg-3: #0a0a18;
    --bg-4: #101028; --bg-5: #181840;
    --border-soft: rgba(0,221,102,.04); --border-mid: rgba(0,221,102,.08);
    --border-strong: rgba(0,221,102,.16);
    --text-1: #eefcf2; --text-2: #c0eec8; --text-3: #5e9e6c; --text-4: #3c6c46;
}
body[data-accent="orange"] {
    --accent: #ff8800; --accent-2: #ffaa44; --accent-rgb: 255,136,0;
    --accent-bg: rgba(255,136,0,.06); --accent-glow: rgba(255,136,0,.35);
    --bg-0: #000000; --bg-1: #030308; --bg-2: #060610; --bg-3: #0a0a18;
    --bg-4: #101028; --bg-5: #181840;
    --border-soft: rgba(255,136,0,.04); --border-mid: rgba(255,136,0,.08);
    --border-strong: rgba(255,136,0,.16);
    --text-1: #fcf4ee; --text-2: #eedcc0; --text-3: #9e825e; --text-4: #6c563e;
}
body[data-accent="void"] {
    --accent: #9944ff; --accent-2: #cc77ff; --accent-rgb: 153,68,255;
    --accent-bg: rgba(153,68,255,.06); --accent-glow: rgba(153,68,255,.35);
    --bg-0: #000000; --bg-1: #030308; --bg-2: #060610; --bg-3: #0a0a18;
    --bg-4: #101028; --bg-5: #181840;
    --border-soft: rgba(153,68,255,.04); --border-mid: rgba(153,68,255,.08);
    --border-strong: rgba(153,68,255,.16);
    --text-1: #f0eeff; --text-2: #c8c0ee; --text-3: #6a5c96; --text-4: #443868;
}

/* ---------- FIXED CARD SCALE (no density toggle) ---------- */
:root {
    --pad-card: 16px;
    --gap-rail: 16px;
    --card-w: 300px;
    --card-h: 240px;
}

body {
    background: var(--bg-0);
    color: var(--text-1);
    font-family: var(--font-body);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
    min-height: 100vh;
    scroll-behavior: smooth;
}

/* ---------- BACKDROP ---------- */
.bg-stage {
    position: fixed; inset: 0; z-index: -10; pointer-events: none;
    overflow: hidden; background: var(--bg-0);
}
.bg-grain {
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 4px 4px; opacity: .35; mix-blend-mode: overlay;
}
.bg-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .35; }
.bg-orb-1 { width: 60vw; height: 60vw; left: -10vw; top: -20vh; background: radial-gradient(circle, rgba(var(--accent-rgb), .35), transparent 70%); }
.bg-orb-2 { width: 50vw; height: 50vw; right: -15vw; top: 30vh; background: radial-gradient(circle, rgba(99,102,241,.18), transparent 70%); }
.bg-orb-3 { width: 40vw; height: 40vw; left: 30vw; bottom: -10vh; background: radial-gradient(circle, rgba(168,85,247,.15), transparent 70%); }
#bgCanvas { position: absolute; inset: 0; width:100%; height:100%; }
body.reduce-motion .bg-orb { animation: none; }
body.reduce-motion #bgCanvas { display: none; }

/* ============ LOGIN GATE ============ */
.login-gate {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    z-index: 100;
    background: var(--bg-0);
}
.login-card {
    width: 100%; max-width: 440px;
    background: var(--bg-2);
    border: 1px solid var(--border-mid);
    border-radius: 28px;
    padding: 44px 36px;
    box-shadow: 0 24px 64px rgba(0,0,0,.7);
    animation: loginIn .7s var(--ease-out);
}
@keyframes loginIn { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }
.login-shake { animation: shake .42s ease; }
@keyframes shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
.login-brand-row { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.login-logo-wrap { width: 56px; height: 56px; border-radius: 14px; background: rgba(var(--accent-rgb),.12); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.login-logo { width: 40px; height: 40px; object-fit: contain; }
.login-brand-text { flex: 1; min-width: 0; }
.login-title { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; margin: 0; letter-spacing: -.02em; color: var(--text-1); }
.login-sub { margin: 2px 0 0; color: var(--text-3); font-size: .78rem; font-weight: 500; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 16px; color: var(--text-4); font-size: .62rem; font-weight: 700; letter-spacing: .15em; }
.login-divider::before, .login-divider::after { content: ''; flex:1; height: 1px; background: var(--border-soft); }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-label { font-size: .68rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.login-input-wrap { position: relative; display: flex; align-items: center; background: rgba(255,255,255,.015); border: 1.5px solid var(--border-mid); border-radius: 12px; transition: all var(--dur-base); }
.login-input-wrap:focus-within { border-color: var(--accent); background: rgba(var(--accent-rgb),.03); box-shadow: 0 0 0 4px rgba(var(--accent-rgb),.10); }
.login-field-icon { width: 16px; height: 16px; margin-left: 14px; color: var(--text-3); flex-shrink:0; }
.login-input { flex: 1; min-width: 0; padding: 14px 14px 14px 10px; border: none; background: transparent; color: var(--text-1); font-size: .9rem; font-weight: 500; }
.login-input::placeholder { color: var(--text-4); }
.login-error { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: rgba(255,43,77,.10); border: 1px solid rgba(255,43,77,.25); border-radius: 10px; color: #fca5a5; font-size: .76rem; font-weight: 500; }
.login-error svg { width: 14px; height: 14px; flex-shrink:0; }
.login-btn { margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 15px 18px; background: var(--accent); color: #000; font-weight: 700; font-size: .94rem; border-radius: 12px; box-shadow: 0 8px 28px rgba(var(--accent-rgb),.35); transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base); }
.login-btn svg { width: 16px; height: 16px; transition: transform var(--dur-base); }
.login-btn:hover:not(:disabled), .login-btn:focus { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(var(--accent-rgb),.50); }
.login-btn:hover:not(:disabled) svg { transform: translateX(3px); }
.login-btn:disabled { opacity: 0.6; cursor: wait; }
.login-foot { margin-top: 16px; text-align: center; color: var(--text-4); font-size: .7rem; }
.login-foot kbd { display: inline-block; padding: 2px 6px; background: var(--bg-3); border: 1px solid var(--border-mid); border-radius: 4px; font-family: ui-monospace, monospace; font-size: .68rem; color: var(--text-2); }

/* ============ APP LAYOUT ============ */
.app {
    display: grid;
    grid-template-columns: var(--rail-w) 1fr;
    min-height: 100vh;
    transition: grid-template-columns var(--dur-base) var(--ease-out);
}
.rail {
    grid-column: 1;
    position: sticky; top: 0; align-self: start;
    height: 100vh;
    width: var(--rail-w);
    display: flex; flex-direction: column;
    padding: 24px 16px 20px;
    background: var(--bg-1);
    border-right: 1px solid var(--border-soft);
    z-index: 50;
    overflow-y: auto;
    overflow-x: hidden;
}
    display: flex; flex-direction: column;
    padding: 24px 16px 20px;
    background: var(--bg-1);
    border-right: 1px solid var(--border-soft);
    z-index: 50;
    overflow-y: auto;
    overflow-x: hidden;
}
.rail::-webkit-scrollbar { width: 0; }
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 20px; margin-bottom: 6px; border-bottom: 1px solid var(--border-soft); border-radius: 0; transition: none; }
.rail-brand:hover, .rail-brand:focus { background: none; }
.rail-logo-img { width: 42px; height: 42px; object-fit: contain; border-radius: 12px; background: rgba(var(--accent-rgb),.10); padding: 4px; flex-shrink: 0; }
.rail-logo-text { display: flex; flex-direction: column; min-width: 0; }
.rail-name { font-family: var(--font-display); font-weight: 700; font-size: .88rem; line-height: 1.1; color: var(--text-1); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-sub { font-size: .62rem; color: var(--text-3); font-weight: 500; }
.rail-section { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.rail-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; color: var(--text-2); font-size: .85rem; font-weight: 500; transition: all .15s ease; position: relative; }
.rail-item:hover { background: rgba(var(--accent-rgb),.06); color: var(--text-1); }
.rail-item:focus { background: rgba(var(--accent-rgb),.10); color: var(--text-1); box-shadow: inset 0 0 0 1.5px rgba(var(--accent-rgb),.50); }
.rail-item.active { background: rgba(var(--accent-rgb),.12); color: var(--accent); font-weight: 600; }
.rail-item.active::before { content: ''; position: absolute; left: 0; top: 25%; bottom: 25%; width: 3px; background: var(--accent); border-radius: 0 3px 3px 0; box-shadow: 0 0 12px var(--accent); }
.rail-icon { width: 20px; height: 20px; flex-shrink: 0; color: currentColor; display: inline-flex; align-items: center; justify-content: center; opacity: .8; }
.rail-item.active .rail-icon { opacity: 1; }
.rail-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-badge { background: #ff2b4d; color: #fff; font-size: .62rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; min-width: 20px; text-align: center; }
.rail-live-icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.live-pulse { width: 9px; height: 9px; background: #ff2b4d; border-radius: 50%; animation: pulseRed 1.8s ease-in-out infinite; }
@keyframes pulseRed { 0% { box-shadow: 0 0 0 0 rgba(255,43,77,.6); } 70% { box-shadow: 0 0 0 10px rgba(255,43,77,0); } 100% { box-shadow: 0 0 0 0 rgba(255,43,77,0); } }
.rail-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 3px; }
.rail-cp { color: #ff2b4d !important; font-weight: 600; }
.rail-cp:hover { background: rgba(255,43,77,.10) !important; }
.rail-logout { color: #f87171; }
.rail-logout:hover { background: rgba(248,113,113,.10) !important; }
.rail-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-top: 6px; background: rgba(255,255,255,.02); border-radius: 12px; }
.rail-user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; color: #000; flex-shrink: 0; }
.rail-user-info { display: flex; flex-direction: column; min-width: 0; }
.rail-user-name { font-weight: 600; color: var(--text-1); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-user-meta { display: flex; gap: 5px; align-items: center; font-size: .64rem; color: var(--text-3); }
#userExpiry.warn { color: var(--warn); }

/* ============ MAIN ============ */
.main {
    grid-column: 2;
    display: flex; flex-direction: column;
    min-width: 0;            /* critical — without this the grid track
                                expands to fit any wide child (rail-rows,
                                hero) and pushes a horizontal scrollbar
                                onto the body, which is the bar we were
                                seeing across the top of the LIVE ticker */
    overflow-x: clip;        /* belt-and-braces clip in case any descendant
                                is positioned absolutely outside its bounds */
    padding-bottom: 60px;
}

/* ============ TOPBAR ============ */
.topbar {
    position: sticky; top: 0; z-index: 40;
    height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
    display: flex; align-items: center; gap: 16px;
    padding: env(safe-area-inset-top, 0px) 28px 0;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border-soft);
}
.topbar::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .25; pointer-events: none; }
.tb-menu {
    display: none;
    width: 40px; height: 40px;
    border-radius: var(--r-sm);
    background: rgba(255,255,255,0.04);
    color: var(--text-2);
}
.tb-menu svg { width: 18px; height: 18px; margin: auto; display: block; }
.tb-view-title { display: flex; flex-direction: column; min-width: 0; }
.tb-title {
    font-family: var(--font-display);
    font-weight: 700; font-size: 1.45rem;
    margin: 0; line-height: 1.1; letter-spacing: -0.02em;
    color: var(--text-1);
}
.tb-subtitle {
    font-size: 0.74rem; color: var(--text-3); font-weight: 500;
    margin-top: 2px;
}

.tb-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tb-icon-btn {
    width: 40px; height: 40px;
    border-radius: var(--r-sm);
    background: rgba(255,255,255,0.04);
    color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
    transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.tb-icon-btn:hover, .tb-icon-btn:focus {
    background: rgba(var(--accent-rgb),0.15); color: var(--text-1);
}
.tb-icon-btn:focus { box-shadow: inset 0 0 0 1.5px rgba(var(--accent-rgb),.55); }
.tb-icon-btn svg { width: 17px; height: 17px; }

.tb-search {
    position: relative; display: flex; align-items: center;
    width: 280px;
    background: rgba(255,255,255,0.04);
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    transition: border-color var(--dur-fast), background var(--dur-fast), width var(--dur-base);
}
.tb-search:focus-within {
    background: rgba(255,255,255,0.06);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.15);
}
.tb-search-icon {
    width: 15px; height: 15px; color: var(--text-3); margin-left: 14px; flex-shrink: 0;
}
.tb-search-input {
    flex: 1; min-width: 0;
    padding: 9px 14px 9px 10px;
    background: transparent; border: none;
    color: var(--text-1); font-size: 0.85rem;
}
.tb-search-input::placeholder { color: var(--text-4); }
.tb-search-clear {
    width: 22px; height: 22px; margin-right: 6px;
    border-radius: 50%; color: var(--text-3); font-size: 1.1rem; line-height: 1;
}
.tb-search-clear:hover { color: var(--text-1); background: rgba(255,255,255,.06); }

/* ============ DATE STRIP ============ */
.date-strip {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 28px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--bg-1);
    flex-wrap: wrap;
    min-height: 0;
}
.tb-date-pills { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* ============ QUICK CHIPS (sport filter) ============ */
.quick-chips-row { padding: 10px 28px 4px; }
.quick-chips { display: flex; gap: 8px; overflow-x: auto; overflow-y: visible; scrollbar-width: none; padding: 6px 4px; margin: -2px 0; }
.quick-chips::-webkit-scrollbar { display: none; }
.filter-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    background: transparent;
    border: 2px solid var(--border-mid);
    border-radius: 99px;
    color: var(--text-2); font-size: .76rem; font-weight: 500;
    flex-shrink: 0; white-space: nowrap; outline: none;
    transition: all var(--dur-fast);
}
.filter-chip:hover { border-color: var(--border-strong); color: var(--text-1); }
.filter-chip:focus { box-shadow: 0 0 0 2px rgba(var(--accent-rgb),.6); }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: #000; box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.20); }
.chip-count { background: rgba(255,255,255,.10); color: #fff; padding: 1px 6px; border-radius: 99px; font-size: .62rem; font-weight: 700; }
.filter-chip.active .chip-count { background: rgba(0,0,0,.15); }
.ds-arrow { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.03); color: var(--text-2); display: flex; align-items: center; justify-content: center; transition: all var(--dur-fast); }
.ds-arrow:hover, .ds-arrow:focus { background: rgba(var(--accent-rgb),.12); color: var(--accent); }
.ds-arrow svg { width: 15px; height: 15px; }
.ds-pills { display: flex; gap: 6px; overflow-x: auto; overflow-y: visible; scrollbar-width: none; padding: 6px 2px; margin: -2px 0; }
.ds-pills::-webkit-scrollbar { display: none; }
.date-pill { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 15px; background: transparent; border: 2px solid var(--border-mid); border-radius: 99px; color: var(--text-2); font-weight: 600; transition: all var(--dur-fast); flex-shrink: 0; min-width: 58px; }
.dp-day { font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.dp-num { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--text-1); line-height: 1; }
.date-pill:hover { border-color: rgba(var(--accent-rgb),.40); }
.date-pill:focus { box-shadow: 0 0 0 2px rgba(var(--accent-rgb),.50); }
.date-pill.active { background: var(--accent); color: #000; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.20), 0 4px 16px rgba(var(--accent-rgb),.40); }
.date-pill.active .dp-day, .date-pill.active .dp-num { color: #000; }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: #000; box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.20); }
    border-radius: var(--r-pill);
    color: var(--text-2); font-size: 0.82rem; font-weight: 500;
    flex-shrink: 0;
    transition: all var(--dur-fast);
    white-space: nowrap;
    outline: none;
}
.filter-chip:hover { background: rgba(255,255,255,.07); border-color: var(--border-mid); color: var(--text-1); }
.filter-chip:focus { box-shadow: 0 0 0 2px rgba(var(--accent-rgb),.7); }
.filter-chip.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent; color: #fff;
}
.chip-count {
    background: rgba(255,255,255,0.16);
    color: #fff; padding: 1px 7px; border-radius: 999px;
    font-size: 0.66rem; font-weight: 700;
}
.filter-chip:not(.active) .chip-count { background: rgba(255,255,255,.06); color: var(--text-3); }

/* ============ VIEWPORT / VIEWS ============ */
.viewport {
    min-height: 60vh; padding: 0 0 28px;
}
.view { display: none; animation: viewIn .45s var(--ease-out); }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ HERO ============ */
.hero { display: none !important; }
.hero-inner { display: block; position: relative; max-width: 100%; }
.hero-slide {
    display: grid;
    /* `minmax(0, …)` is the critical bit — without it the 1fr track expands
       to fit the team-block content, blowing the slide wider than its parent
       and creating the page-level horizontal scrollbar. */
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    min-height: 380px;
    background: linear-gradient(135deg, var(--bg-2), var(--bg-1));
    position: relative; overflow: hidden;
    isolation: isolate;
    width: 100%;
    max-width: 100%;
}
.hero-slide::before {
    content:''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(var(--sc-rgb,255,77,109),0.45), transparent 60%);
    z-index: 0;
}
.hero-info {
    padding: 36px 36px 32px;
    display: flex; flex-direction: column; gap: 16px;
    position: relative; z-index: 2;
    min-width: 0;             /* allow shrinking inside the grid track */
    overflow: hidden;
}
.hero-actions { row-gap: 12px; flex-wrap: wrap; }
.hero-watch-btn, .hero-action-btn { white-space: nowrap; }
/* Hero buttons must NOT scale on focus — the focus ring + scale would
   otherwise extend past .hero's overflow:hidden boundary and look chopped.
   Use a flat focus ring instead. */
.hero-watch-btn:focus, .hero-action-btn:focus,
body.is-tv .hero-watch-btn:focus, body.is-tv .hero-action-btn:focus {
    transform: none;
    box-shadow: 0 0 0 3px var(--accent), 0 0 18px rgba(var(--accent-rgb),.45);
}
.hero-meta {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.74rem; font-weight: 600; color: var(--text-3);
}
.hero-status-tag {
    /* `align-self: flex-start` is required — the parent `.hero-info` is a
       flex column and would otherwise stretch this pill across the entire
       column width, ignoring `display: inline-flex`. */
    align-self: flex-start;
    width: fit-content; max-width: 100%;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    font-size: 0.70rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
/* Same trick for the meta row + time pill so they don't get stretched
   to full column width either. */
.hero-meta, .hero-time { align-self: flex-start; width: fit-content; max-width: 100%; }
.hero-status-tag.live { background: var(--live); color: #fff; box-shadow: 0 0 16px rgba(255,43,77,.6); }
.hero-status-tag.live .live-pulse { background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.7); }
@keyframes pulseWhite {
    0%   { box-shadow: 0 0 0 0 rgba(255,255,255,.7); }
    70%  { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
.hero-status-tag.live .live-pulse { animation: pulseWhite 1.6s var(--ease-out) infinite; }
.hero-status-tag.soon { background: rgba(255,176,32,.18); color: #FFD27A; border: 1px solid rgba(255,176,32,.40); }
.hero-status-tag.upcoming { background: rgba(255,255,255,.06); color: var(--text-2); border: 1px solid var(--border-mid); }
.hero-status-tag.ft { background: rgba(255,255,255,.04); color: var(--text-3); border: 1px solid var(--border-soft); }

.hero-title {
    font-family: var(--font-display); font-weight: 700; font-size: 2.6rem;
    line-height: 1.05; letter-spacing: -0.025em; margin: 0;
    color: var(--text-1);
}
.hero-vs {
    color: var(--text-3); font-weight: 500; padding: 0 12px; font-size: 1.6rem;
}
.hero-sub { color: var(--text-2); font-size: 0.95rem; }
.hero-time {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    background: rgba(255,255,255,.06);
    border-radius: var(--r-pill);
    font-size: 0.85rem; font-weight: 600; color: var(--text-2);
    width: fit-content;
}
.hero-time svg { width: 14px; height: 14px; }
.hero-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.hero-watch-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 22px;
    background: var(--text-1); color: #000;
    font-weight: 700; font-size: 0.9rem;
    border-radius: var(--r-pill);
    transition: transform var(--dur-fast), box-shadow var(--dur-base);
}
.hero-watch-btn:hover, .hero-watch-btn:focus {
    transform: scale(1.04); box-shadow: 0 12px 30px rgba(255,255,255,.20);
}
.hero-watch-btn svg { width: 14px; height: 14px; fill: currentColor; }
.hero-action-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 18px;
    background: rgba(255,255,255,.10);
    color: var(--text-1); font-weight: 600; font-size: 0.85rem;
    border-radius: var(--r-pill);
    border: 1px solid var(--border-mid);
    transition: background var(--dur-fast), transform var(--dur-fast);
}
.hero-action-btn:hover, .hero-action-btn:focus {
    background: rgba(255,255,255,.18); transform: scale(1.04);
}
.hero-action-btn svg { width: 15px; height: 15px; }
.hero-action-btn.is-faved { background: rgba(var(--accent-rgb),0.20); border-color: rgba(var(--accent-rgb),.50); }
.hero-action-btn.is-faved svg { fill: var(--accent); color: var(--accent); }

.hero-art {
    position: relative; overflow: hidden; min-height: 280px;
    display: flex; align-items: center; justify-content: center; padding: 24px;
    z-index: 2;
    min-width: 0;             /* allow shrinking inside the grid track */
}
.hero-teams { max-width: 100%; }
.hero-art::before {
    content:''; position: absolute; inset: 0; z-index: -1;
    background:
        linear-gradient(90deg, var(--bg-1) 0%, transparent 40%),
        radial-gradient(circle at 80% 50%, rgba(var(--sc-rgb,255,77,109),.30), transparent 60%);
}
.hero-teams { display: flex; align-items: center; gap: 18px; }
.hero-team-block {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    text-align: center;
}
.hero-team-logo {
    width: clamp(72px, 11vw, 130px);
    height: clamp(72px, 11vw, 130px);
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.02));
    border: 1px solid var(--border-mid);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-size: clamp(2rem, 4vw, 4rem); font-weight: 700;
    color: var(--text-1);
    overflow: hidden;
    box-shadow: var(--sh-md);
    flex-shrink: 0;
}
.hero-team-logo img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.hero-team-name {
    font-weight: 600; font-size: 0.95rem;
    max-width: clamp(72px, 11vw, 130px);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hero-teams { gap: clamp(8px, 1.5vw, 18px); min-width: 0; }
.hero-vs-cell { width: clamp(36px, 5vw, 56px); height: clamp(36px, 5vw, 56px); flex-shrink: 0; }
.hero-vs-cell {
    width: 56px; height: 56px;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--border-mid);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
    color: var(--text-2);
}
.hero-single {
    font-family: var(--font-display); font-size: 4.5rem;
    color: var(--text-1);
}

.hero-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 5; }
.hero-dot {
    width: 24px; height: 4px; border-radius: 2px;
    background: rgba(255,255,255,.20);
    transition: background var(--dur-base), width var(--dur-base);
    border: none; padding: 0; cursor: pointer;
}
.hero-dot.active { background: var(--text-1); width: 36px; }
.hero-dot:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============ RAILS ============ */
.rails { display: flex; flex-direction: column; gap: 28px; padding: 22px 28px 0; }

.rail-section-block { display: flex; flex-direction: column; gap: 12px; }
.rail-head {
    display: flex; align-items: center; gap: 12px;
    padding: 0 4px;
}
.rail-head-title {
    font-family: var(--font-display); font-weight: 700; font-size: 1.2rem;
    letter-spacing: -0.01em; margin: 0;
    color: var(--text-1);
}
.rail-head-icon {
    width: 30px; height: 30px;
    background: rgba(var(--accent-rgb),0.15);
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
}
.rail-head-icon svg { width: 17px; height: 17px; }
.rail-head-count {
    font-size: 0.74rem; font-weight: 600; color: var(--text-3);
    margin-left: auto;
}
.rail-head-action {
    font-size: 0.78rem; font-weight: 600; color: var(--accent);
    margin-left: auto;
    padding: 4px 10px; border-radius: var(--r-sm);
    transition: background var(--dur-fast);
}
.rail-head-action:hover, .rail-head-action:focus { background: rgba(var(--accent-rgb),.10); }

.rail-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 18px;
    overflow-x: visible;
    padding: 4px 2px 18px;
    margin: 0;
    scrollbar-width: none;
}
.rail-row::-webkit-scrollbar { display: none; }
.rail-row .ev-card { width: 100%; min-width: 0; }

/* ============ EVENT CARDS ============ */
.ev-card {
    flex-shrink: 0;
    width: var(--card-w, 280px);
    height: var(--card-h, 168px);
    background: var(--bg-1);
    border: 1px solid var(--border-mid);
    border-left: 4px solid rgba(var(--sc-rgb,99,102,241), .35);
    border-radius: 22px;
    padding: 18px;
    display: flex; flex-direction: column;
    gap: 8px;
    position: relative; overflow: hidden;
    cursor: pointer;
    transition: transform .25s var(--ease-out), box-shadow .25s, border-color .15s;
    scroll-snap-align: start;
    isolation: isolate;
}
.ev-card::before {
    content:''; position: absolute; top: -20%; right: -20%;
    width: 60%; height: 60%;
    background: radial-gradient(ellipse at 100% 0%, rgba(var(--sc-rgb,99,102,241), .20), transparent 60%);
    z-index: -1;
    opacity: .6;
}
.ev-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--sc-rgb,99,102,241), .40);
    box-shadow: 0 14px 40px rgba(0,0,0,.55), 0 0 40px rgba(var(--sc-rgb,99,102,241), .06);
}
.ev-card:focus {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .7), 0 0 50px rgba(var(--accent-rgb), .25), 0 14px 40px rgba(0,0,0,.6);
    z-index: 3;
}
.ev-card::after { display: none; }
.ev-card:hover {
    transform: translateY(-3px) scale(1.015);
    box-shadow: 0 14px 32px rgba(0,0,0,.45), 0 0 0 1px var(--border-strong);
}
.ev-card:focus {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 16px 36px rgba(0,0,0,.55),
                0 0 0 3px rgba(var(--accent-rgb), .80),
                0 0 30px rgba(var(--accent-rgb), .35);
    border-color: var(--accent);
    z-index: 3;
}
.ev-card-live { border-color: rgba(255,43,77,.40); }
.ev-card-live::after {
    border-radius: inherit;
    box-shadow: inset 0 0 18px rgba(255,43,77,.18);
    pointer-events: none;
    z-index: 1;
}

.ev-card-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
}
.ev-status-area { display: flex; align-items: center; gap: 6px; }
.ev-status-live, .ev-status-soon, .ev-status-ft, .ev-status-ppd {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px; border-radius: var(--r-pill);
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.ev-status-live { background: rgba(255,43,77,.15); color: #ff6b81; box-shadow: 0 0 12px rgba(255,43,77,.25); }
.ev-status-live .live-dot { width: 6px; height: 6px; background: #ff6b81; box-shadow: 0 0 6px #ff6b81; }
.ev-status-soon { background: rgba(245,158,11,.15); color: #fbbf24; border: 1px solid rgba(245,158,11,.30); }
.ev-status-ft { background: rgba(255,255,255,.05); color: var(--text-3); }
.ev-status-ppd { background: rgba(255,255,255,.05); color: var(--text-3); }

.ev-league-row {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px;
    background: rgba(255,255,255,.03);
    border: 1px solid var(--border-soft);
    border-radius: 99px;
    font-size: .65rem; font-weight: 600; color: var(--text-2);
    letter-spacing: .03em; white-space: nowrap;
    margin: 0 auto;
}
.ev-league-row img {
    width: 14px; height: 14px; border-radius: 3px;
    object-fit: contain; flex-shrink: 0;
}
.ev-league-row span {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px;
}

.ev-time-block {
    display: flex; align-items: baseline; gap: 3px;
    font-family: var(--font-display); color: var(--text-1);
}
.ev-time-num { font-weight: 700; font-size: 1.15rem; }
.ev-time-ampm { font-weight: 600; font-size: 0.65rem; color: var(--text-3); }

.ev-vs-layout {
    display: grid; grid-template-columns: 1fr auto 1fr;
    gap: 10px; flex: 1; align-items: center;
}
.ev-team-side {
    display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
    min-width: 0;
}
.ev-team-logo, .ev-team-ph {
    width: 60px; height: 60px; border-radius: 14px;
    background: rgba(255,255,255,.04);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border-soft);
}
.ev-team-logo { object-fit: contain; padding: 4px; }
.ev-team-ph {
    font-family: var(--font-display); font-weight: 700; font-size: 1.2rem;
    color: var(--text-1);
}
.ev-team-label {
    font-size: 0.78rem; font-weight: 600; color: var(--text-1);
    line-height: 1.15; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ev-team-tag { display: none; }
.ev-vs-center {
    color: var(--text-3); font-family: var(--font-display); font-weight: 700;
    font-size: 0.95rem;
}
.ev-vs-text { padding: 0 4px; }
.ev-vs-divider { display: none; }

.ev-single-layout {
    display: flex; align-items: center; gap: 10px; flex: 1;
}
.ev-single-icon {
    width: 44px; height: 44px;
    background: rgba(var(--sc-rgb,99,102,241),.20);
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.ev-single-info { min-width: 0; flex: 1; }
.ev-single-name {
    font-weight: 600; font-size: 0.92rem; color: var(--text-1);
    line-height: 1.2;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.ev-single-venue { font-size: 0.7rem; color: var(--text-3); margin-top: 3px; }

.ev-channels-row {
    display: flex; gap: 5px; flex-wrap: wrap;
    align-items: center; min-height: 22px;
    margin-top: auto;
    padding-top: 8px;            /* breathing room above 2nd row of channel
                                    pills when they wrap */
    max-height: 60px;            /* cap at ~2 rows; extra spill into +N more */
    overflow: hidden;
}
.ch-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px;
    background: rgba(255,255,255,.05);
    border-radius: var(--r-pill);
    font-size: 0.65rem; font-weight: 600;
    color: var(--text-3);
    max-width: 88px;
    overflow: hidden;
}
.ch-pill .ch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-pill-playable { background: rgba(var(--accent-rgb),.16); color: var(--accent); font-weight: 600; }
.ch-flag { font-size: 0.74rem; flex-shrink: 0; }
.ch-more {
    font-size: 0.65rem; font-weight: 700; color: var(--text-3);
    padding: 3px 7px; background: rgba(255,255,255,.04); border-radius: var(--r-pill);
}

/* Admin action bar inside event modal — uses inline styles via JS */

/* Hidden event card — dimmed for admin visibility */
.ev-card-hidden { opacity: 0.5; }
.ev-card-hidden:hover { opacity: 0.75; }

/* Favorite star button on card */
.ev-fav-btn, .ev-remind-btn {
    position: absolute; top: 8px; left: 8px;
    width: 28px; height: 28px;
    background: rgba(0,0,0,.45);
    border: 1px solid var(--border-mid);
    border-radius: 50%;
    color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transition: opacity var(--dur-fast), background var(--dur-fast), color var(--dur-fast);
    z-index: 4;
}
.ev-remind-btn { left: 40px; }
.ev-card:hover .ev-fav-btn, .ev-card:focus .ev-fav-btn, .ev-fav-btn:focus,
.ev-card:hover .ev-remind-btn, .ev-card:focus .ev-remind-btn, .ev-remind-btn:focus { opacity: 1; }
.ev-fav-btn.is-faved { opacity: 1; color: var(--accent); background: rgba(var(--accent-rgb), 0.20); }
.ev-remind-btn.is-reminded { opacity: 1; color: var(--soon); background: rgba(255,176,32,0.20); }
.ev-fav-btn svg, .ev-remind-btn svg { width: 13px; height: 13px; }

/* ============ SPORT GRID (sports view) ============ */
.sport-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
    padding: 22px 28px;
}
.sport-card {
    aspect-ratio: 1.1;
    background: linear-gradient(135deg, var(--sc), color-mix(in srgb, var(--sc) 30%, var(--bg-2)));
    border-radius: var(--r-xl);
    padding: 20px;
    display: flex; flex-direction: column; justify-content: space-between;
    color: #fff;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,.08);
    transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base);
    overflow: hidden;
    position: relative;
}
.sport-card::before {
    content: ''; position: absolute; top: -20%; right: -20%;
    width: 60%; height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,.18), transparent 60%);
}
.sport-card:hover, .sport-card:focus {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 16px 36px rgba(0,0,0,.5), 0 0 0 3px rgba(var(--accent-rgb),.55);
}
.sport-card-icon { font-size: 2.6rem; line-height: 1; }
.sport-card-name {
    font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
    line-height: 1.1; letter-spacing: -0.01em;
    text-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.sport-card-count {
    font-size: 0.78rem; font-weight: 600; opacity: .9;
}

/* ============ FAVORITES VIEW ============ */
.fav-tabs {
    display: flex; gap: 8px; padding: 18px 28px 0;
    border-bottom: 1px solid var(--border-soft);
}
.fav-tab {
    padding: 11px 18px;
    color: var(--text-3); font-weight: 600; font-size: 0.88rem;
    border-bottom: 2px solid transparent;
    transition: all var(--dur-fast);
    position: relative;
    margin-bottom: -1px;
}
.fav-tab:hover { color: var(--text-1); }
.fav-tab.active { color: var(--text-1); border-bottom-color: var(--accent); }
.fav-tab:focus { color: var(--text-1); background: rgba(var(--accent-rgb),.10); border-radius: var(--r-sm) var(--r-sm) 0 0; }
.fav-list { padding: 22px 28px; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.fav-list .ev-card { width: 100%; min-width: 0; }
.fav-empty {
    padding: 60px 28px; text-align: center; color: var(--text-3);
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.fav-empty .icon { font-size: 3rem; opacity: .5; }
.fav-empty h3 { font-family: var(--font-display); margin: 0; color: var(--text-2); font-size: 1.25rem; }
.fav-empty p { margin: 0; font-size: 0.88rem; }

/* ============ SEARCH VIEW ============ */
.search-hero { padding: 32px 28px 16px; }
.search-big-wrap {
    position: relative; display: flex; align-items: center;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-xl);
    transition: border-color var(--dur-fast), background var(--dur-fast);
    max-width: 880px;
}
.search-big-wrap:focus-within {
    background: rgba(255,255,255,.08); border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb),.12);
}
.search-big-icon { width: 22px; height: 22px; margin-left: 22px; color: var(--text-3); flex-shrink: 0; }
.search-big-input {
    flex: 1; min-width: 0;
    padding: 18px 22px 18px 14px;
    background: transparent; border: none;
    font-family: var(--font-display); font-size: 1.4rem; font-weight: 600;
    color: var(--text-1);
}
.search-big-input::placeholder { color: var(--text-4); font-weight: 500; }
.search-voice-btn {
    width: 42px; height: 42px; margin-right: 12px; border-radius: 50%;
    background: rgba(var(--accent-rgb),.15);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: all var(--dur-fast);
}
.search-voice-btn:hover, .search-voice-btn:focus { background: var(--accent); color: #fff; transform: scale(1.06); }
.search-voice-btn.recording { background: var(--live); color: #fff; animation: pulseRed 1.4s infinite; }
.search-voice-btn svg { width: 18px; height: 18px; }
.search-hist {
    margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; max-width: 880px;
}
.search-hist-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-pill);
    font-size: 0.78rem; color: var(--text-2);
    transition: background var(--dur-fast);
}
.search-hist-pill:hover, .search-hist-pill:focus { background: rgba(var(--accent-rgb),.15); color: var(--text-1); }
.search-hist-pill svg { width: 11px; height: 11px; opacity: .6; }
#searchResults { padding: 8px 28px 28px; }

/* ============ STATE MESSAGES ============ */
.state-msg {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 60px 24px; gap: 14px; color: var(--text-3);
}
.state-msg-icon { font-size: 2.5rem; opacity: .45; }
.state-msg-title { font-family: var(--font-display); font-size: 1.15rem; margin: 0; color: var(--text-2); font-weight: 600; }
.state-msg-sub, .state-msg-text { font-size: .82rem; margin: 0; }
.loader-ring { width: 44px; height: 44px; border: 3px solid var(--bg-4); border-top-color: var(--accent); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ MODAL ============ */
.modal {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn .25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-sheet {
    position: relative;
    width: 100%; max-width: 900px; max-height: 92vh;
    background: var(--bg-1);
    border: 1px solid var(--border-mid);
    border-radius: 28px 28px 0 0;
    overflow: hidden auto;
    box-shadow: 0 -8px 50px rgba(0,0,0,.7);
    animation: sheetIn .35s var(--ease-out);
}
.modal-close {
    position: absolute; top: 14px; right: 14px; z-index: 3;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(0,0,0,.40); border: 1px solid var(--border-mid);
    color: var(--text-1);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: all var(--dur-fast);
}
.modal-close svg { width: 16px; height: 16px; }
.modal-close:hover, .modal-close:focus { background: var(--live); border-color: var(--live); }

.modal-matchup {
    display: grid; grid-template-columns: 1fr auto 1fr;
    gap: 18px; align-items: center;
}
.modal-team { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.modal-team-badge {
    width: 84px; height: 84px; border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.02));
    border: 1px solid var(--border-mid);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    box-shadow: var(--sh-sm);
}
.modal-team-badge img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.modal-team-name {
    font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
    color: var(--text-1); line-height: 1.15;
}
.modal-vs {
    width: 50px; height: 50px;
    background: rgba(255,255,255,.08);
    border: 1px solid var(--border-mid);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
    color: var(--text-2);
}
.modal-event-name {
    font-family: var(--font-display); font-weight: 700; font-size: 1.5rem;
    color: var(--text-1); text-align: center;
    line-height: 1.15;
}

.modal-meta {
    display: flex; flex-wrap: wrap; gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-mid);
    border-bottom: 1px solid var(--border-mid);
    background: rgba(255,255,255,.01);
}
.meta-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border-mid);
    border-radius: 99px;
    font-size: .76rem; font-weight: 600;
    color: var(--text-2);
}
.modal-actions {
    display: flex; gap: 8px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border-mid);
    flex-wrap: wrap;
}
.meta-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-pill);
    font-size: 0.78rem; font-weight: 600;
    color: var(--text-2);
}
.meta-tag svg { width: 12px; height: 12px; }

.modal-actions {
    display: flex; gap: 8px;
    padding: 14px 30px;
    border-bottom: 1px solid var(--border-soft);
    flex-wrap: wrap;
}
.modal-action-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 14px;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-pill);
    font-size: 0.82rem; font-weight: 600;
    color: var(--text-2);
    transition: all var(--dur-fast);
}
.modal-action-btn:hover, .modal-action-btn:focus { background: rgba(var(--accent-rgb),.15); color: var(--text-1); border-color: rgba(var(--accent-rgb),.40); }
.modal-action-btn:focus { box-shadow: 0 0 0 2px rgba(var(--accent-rgb),.50); }
.modal-action-btn svg { width: 13px; height: 13px; }
.modal-action-btn.is-active { background: rgba(var(--accent-rgb),.20); color: var(--accent); border-color: var(--accent); }

.modal-player-section { padding: 16px 30px 14px; background: var(--bg-1); }
.modal-player-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 10px;
}
.modal-player-label { font-weight: 600; color: var(--text-1); font-size: 0.95rem; }
.modal-player-close {
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255,255,255,.06); color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--dur-fast);
}
.modal-player-close:hover { background: var(--live); color: #fff; }
.modal-player-wrap { background: #000; border-radius: var(--r-md); overflow: hidden; }
.modal-player-url {
    display: flex; gap: 8px; margin-top: 8px;
}
.modal-player-url-input {
    flex: 1; padding: 8px 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-sm);
    color: var(--text-2); font-size: 0.78rem;
    font-family: ui-monospace, monospace;
}
.modal-player-copy {
    padding: 8px 14px;
    background: var(--accent); color: #fff;
    border-radius: var(--r-sm);
    font-size: 0.78rem; font-weight: 700;
    transition: all var(--dur-fast);
}
.modal-player-copy:hover, .modal-player-copy:focus { background: var(--accent-2); transform: scale(1.04); }

.quality-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px; margin-top: 10px; padding: 0 0;
}
.quality-btn {
    padding: 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-sm);
    color: var(--text-1); font-weight: 600; font-size: 0.85rem;
    transition: all var(--dur-fast);
}
.quality-btn:hover, .quality-btn:focus { background: rgba(var(--accent-rgb),.18); border-color: var(--accent); transform: translateY(-1px); }

.ext-player-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}
.ext-player-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-md);
    color: var(--text-1); font-weight: 600; font-size: 0.88rem;
    transition: all var(--dur-fast);
}
.ext-player-btn:hover, .ext-player-btn:focus {
    background: rgba(var(--accent-rgb),.18); border-color: var(--accent); transform: translateY(-1px);
}
.ext-player-native-msg {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 14px;
    background: rgba(var(--accent-rgb),.10);
    border: 1px solid rgba(var(--accent-rgb),.30);
    border-radius: var(--r-md);
    color: var(--text-1); font-size: 0.88rem;
}

.modal-ch-section { padding: 16px 30px 28px; }
.modal-ch-title {
    font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
    margin-bottom: 12px;
}
.modal-ch-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 8px;
}
.modal-ch-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border-mid);
    border-radius: 12px;
    transition: all var(--dur-fast);
}
.modal-ch-details { flex: 1; min-width: 0; }
.modal-ch-name { font-weight: 600; font-size: .78rem; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-ch-flag { font-size: 1.1rem; flex-shrink: 0; }
.modal-ch-play-icon { color: var(--accent); flex-shrink: 0; margin-left: auto; }
.modal-ch-country { font-size: .6rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; background: rgba(255,255,255,.03); padding: 2px 6px; border-radius: 4px; flex-shrink: 0; }
.modal-ch-details { flex: 1; min-width: 0; }
.modal-ch-name { font-weight: 700; font-size: .88rem; color: var(--text-1); word-break: break-word; }
.modal-hero {
    padding: 24px 24px 16px;
    display: flex; flex-direction: column; gap: 14px;
    background: linear-gradient(180deg, rgba(var(--sc-rgb,99,102,241),.06), transparent 50%);
}
.modal-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-league-info {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 8px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border-mid);
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,.3);
}
.modal-league-info img { width: 28px; height: 28px; object-fit: contain; border-radius: 8px; background: rgba(255,255,255,.04); padding: 3px; flex-shrink: 0; }
.modal-league-text { display: flex; flex-direction: column; min-width: 0; }
.modal-league-name { font-weight: 700; font-size: .82rem; color: var(--text-1); line-height: 1.2; }
.modal-sport-name { font-size: .64rem; color: var(--text-3); font-weight: 500; }
.modal-ch-id { font-size: 0.66rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-ch-playable.ch-playing .modal-ch-id { color: rgba(255,255,255,.8); }
.modal-ch-play-icon { color: var(--accent); flex-shrink: 0; }
.modal-ch-playable.ch-playing .modal-ch-play-icon { color: #fff; }
.modal-ch-country {
    font-size: 0.62rem; font-weight: 700; color: var(--text-3); text-transform: uppercase;
    background: rgba(255,255,255,.04); padding: 2px 6px; border-radius: 4px;
}

/* ============ CHANNEL BROWSER ============ */
.ch-browser {
    position: fixed; inset: 0; z-index: 250;
    display: none;
}
.ch-browser.ch-open { display: block; }
.ch-browser-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.78);
    backdrop-filter: blur(8px);
    animation: fadeIn .25s ease;
}
.ch-browser-panel {
    position: absolute; top: 5vh; left: 50%; transform: translateX(-50%);
    width: 92%; max-width: 1100px; height: 90vh;
    background: var(--bg-1);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-2xl);
    overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: var(--sh-lg);
    animation: sheetIn .35s var(--ease-out);
}
.ch-browser-header {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-soft);
}
.ch-browser-back {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
    color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--dur-fast);
}
.ch-browser-back:hover, .ch-browser-back:focus { background: rgba(var(--accent-rgb),.20); color: var(--text-1); }
.ch-browser-back svg { width: 16px; height: 16px; }
.ch-browser-title-wrap { flex: 1; min-width: 0; }
.ch-browser-title {
    display: block;
    font-family: var(--font-display); font-weight: 700; font-size: 1.25rem;
    color: var(--text-1); line-height: 1.1;
}
.ch-browser-subtitle {
    display: block;
    font-size: 0.74rem; color: var(--text-3); font-weight: 500;
    margin-top: 2px;
}
.ch-browser-close {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
    color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--dur-fast);
}
.ch-browser-close:hover, .ch-browser-close:focus { background: var(--live); color: #fff; }
.ch-browser-close svg { width: 16px; height: 16px; }

.ch-browser-search-row {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 22px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--bg-2);
}
.ch-browser-search-row svg { width: 16px; height: 16px; color: var(--text-3); flex-shrink: 0; }
.ch-browser-search {
    flex: 1; padding: 10px 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-sm);
    color: var(--text-1); font-size: 0.9rem;
}
.ch-browser-search:focus { border-color: var(--accent); background: rgba(255,255,255,.07); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.15); }

.ch-browser-player-section { padding: 16px 22px; border-bottom: 1px solid var(--border-soft); background: var(--bg-2); }
.ch-browser-player-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.ch-browser-player-label { font-weight: 700; color: var(--text-1); font-size: 0.95rem; flex: 1; }
.ch-browser-player-actions { display: flex; align-items: center; gap: 6px; }
.ch-browser-stream-url {
    width: 220px; padding: 5px 10px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border-mid);
    border-radius: 6px;
    color: var(--text-2); font-size: 0.72rem;
    font-family: ui-monospace, monospace;
}
.ch-browser-copy-btn {
    padding: 5px 12px;
    background: var(--accent); color: #fff;
    border-radius: 6px;
    font-size: 0.72rem; font-weight: 700;
    transition: all var(--dur-fast);
}
.ch-browser-copy-btn:hover, .ch-browser-copy-btn:focus { background: var(--accent-2); }
.ch-browser-player-close {
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255,255,255,.06);
    color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
}
.ch-browser-player-close:hover, .ch-browser-player-close:focus { background: var(--live); color: #fff; }
.ch-browser-player-close svg { width: 13px; height: 13px; }
.ch-browser-player-wrap { background: #000; border-radius: var(--r-md); overflow: hidden; }

.ch-browser-body {
    flex: 1; overflow-y: auto;
    padding: 16px 22px 22px;
}
.ch-browser-loading, .ch-browser-empty {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 60px 20px; color: var(--text-3); font-size: 0.9rem;
}
.ch-browser-spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--border-mid); border-top-color: var(--accent);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
.ch-cat-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}
.ch-cat-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(var(--accent-rgb),.10), var(--bg-2));
    border: 1px solid var(--border-mid);
    border-radius: var(--r-md);
    color: var(--text-1); font-weight: 600; font-size: 0.9rem;
    text-align: left;
    transition: all var(--dur-fast);
}
.ch-cat-btn svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
.ch-cat-btn:hover, .ch-cat-btn:focus {
    background: linear-gradient(135deg, rgba(var(--accent-rgb),.20), var(--bg-3));
    border-color: var(--accent); transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--accent-rgb),.20);
}
.ch-cat-btn:focus { box-shadow: 0 0 0 2px var(--accent), 0 8px 20px rgba(var(--accent-rgb),.20); }

.ch-channel-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}
.ch-channel-tile {
    display: flex; align-items: center; gap: 10px;
    padding: 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    color: var(--text-1); font-weight: 500; font-size: 0.86rem;
    text-align: left;
    transition: all var(--dur-fast);
    overflow: hidden;
}
.ch-channel-tile:hover, .ch-channel-tile:focus { background: rgba(var(--accent-rgb),.15); border-color: var(--accent); transform: translateY(-1px); }
.ch-channel-tile:focus { box-shadow: 0 0 0 2px var(--accent); }
.ch-channel-tile.ch-playing { background: var(--accent); color: #fff; border-color: var(--accent); }
.ch-channel-logo, .ch-channel-logo-placeholder {
    width: 40px; height: 32px; border-radius: 6px;
    background: rgba(0,0,0,.30);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    object-fit: contain; padding: 3px;
}
.ch-channel-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ SETTINGS PANEL ============ */
.settings { position: fixed; inset: 0; z-index: 220; display: none; }
.settings.open { display: block; }
.settings-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(8px);
    animation: fadeIn .25s ease;
}
.settings-sheet {
    position: absolute; top: 0; right: 0;
    width: 100%; max-width: 480px; height: 100vh;
    background: var(--bg-1);
    border-left: 1px solid var(--border-mid);
    overflow-y: auto;
    box-shadow: var(--sh-lg);
    animation: panelInRight .35s var(--ease-out);
}
@keyframes panelInRight { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.settings-header {
    position: sticky; top: 0; z-index: 2;
    display: flex; align-items: center; justify-content: space-between;
    padding: 22px 26px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-soft);
}
.settings-title { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; margin: 0; letter-spacing: -0.02em; }
.settings-subtitle { color: var(--text-3); font-size: 0.78rem; margin: 4px 0 0; }
.settings-close {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,.06); color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
}
.settings-close:hover, .settings-close:focus { background: var(--live); color: #fff; }
.settings-close svg { width: 16px; height: 16px; }

.settings-body { padding: 18px 26px 40px; display: flex; flex-direction: column; gap: 22px; }
.settings-group { display: flex; flex-direction: column; gap: 10px; }
.settings-group-label {
    font-size: 0.72rem; font-weight: 700;
    color: var(--text-3); letter-spacing: 0.10em; text-transform: uppercase;
}
.settings-theme-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-btn {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 14px 8px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-md);
    font-size: 0.8rem; font-weight: 600; color: var(--text-2);
    transition: all var(--dur-fast);
}
.theme-btn span { width: 100%; height: 32px; border-radius: 6px; border: 1px solid var(--border-mid); }
.theme-btn-oled span { background: #000; }
.theme-btn-dark span { background: linear-gradient(135deg, #050811, #1B2034); }
.theme-btn-dim  span { background: linear-gradient(135deg, #15161F, #383E5C); }
.theme-btn:hover { border-color: var(--text-3); color: var(--text-1); }
.theme-btn.active { border-color: var(--accent); background: rgba(var(--accent-rgb),.10); color: var(--text-1); }
.theme-btn:focus { box-shadow: 0 0 0 2px rgba(var(--accent-rgb),.55); }

.settings-accent-row { display: flex; gap: 10px; flex-wrap: wrap; }
.accent-btn {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--ac);
    border: 2px solid transparent;
    transition: all var(--dur-fast);
    box-shadow: 0 0 12px var(--ac);
}
.accent-btn:hover { transform: scale(1.15); }
.accent-btn:focus { box-shadow: 0 0 0 3px #fff, 0 0 20px var(--ac); }
.accent-btn.active {
    border-color: #fff; transform: scale(1.15);
    box-shadow: 0 0 0 4px var(--ac), 0 0 30px var(--ac);
}

.settings-seg {
    display: flex; gap: 0;
    background: rgba(255,255,255,.04);
    border-radius: var(--r-md);
    padding: 4px;
    border: 1px solid var(--border-mid);
}
.seg-btn {
    flex: 1; padding: 10px;
    background: transparent;
    border-radius: var(--r-sm);
    color: var(--text-3); font-weight: 600; font-size: 0.84rem;
    transition: all var(--dur-fast);
}
.seg-btn:hover { color: var(--text-1); }
.seg-btn.active { background: var(--accent); color: #fff; }
.seg-btn:focus { box-shadow: inset 0 0 0 1.5px rgba(var(--accent-rgb),.55); }

.settings-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0; gap: 14px;
    border-bottom: 1px solid var(--border-soft);
    outline: none;
}
.settings-row:last-child { border-bottom: none; }
.settings-toggle-row:focus { outline: 2px solid rgba(var(--accent-rgb),.65); outline-offset: 3px; border-radius: 8px; }
.settings-toggle-row:focus .settings-switch span { background: rgba(var(--accent-rgb),.30); }
.settings-row-title { font-weight: 600; color: var(--text-1); font-size: 0.92rem; }
.settings-row-sub { font-size: 0.74rem; color: var(--text-3); margin-top: 2px; }
.settings-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.settings-switch input { opacity: 0; width: 0; height: 0; }
.settings-switch span {
    position: absolute; inset: 0;
    background: var(--bg-4); border-radius: 999px;
    transition: background var(--dur-fast);
    cursor: pointer;
}
.settings-switch span::before {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%; background: #fff;
    transition: transform var(--dur-fast);
    box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.settings-switch input:checked + span { background: var(--accent); }
.settings-switch input:checked + span::before { transform: translateX(20px); }
.settings-switch input:focus + span { box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.40); }
.settings-btn-sm {
    padding: 8px 16px;
    background: rgba(var(--accent-rgb),.18);
    border: 1px solid rgba(var(--accent-rgb),.40);
    border-radius: var(--r-sm);
    color: var(--accent); font-weight: 700; font-size: 0.78rem;
    transition: all var(--dur-fast);
}
.settings-btn-sm:hover, .settings-btn-sm:focus { background: var(--accent); color: #fff; }

.settings-select {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-sm);
    color: var(--text-1); font-size: 0.9rem; font-weight: 500;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%238A8AAE' stroke-width='1.5' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
.settings-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.18); }

.settings-about-row { display: flex; align-items: center; gap: 14px; padding: 8px 0; }
.settings-about-logo { width: 52px; height: 52px; object-fit: contain; border-radius: var(--r-sm); background: rgba(255,255,255,.04); padding: 4px; }
.settings-about-name { font-family: var(--font-display); font-weight: 700; color: var(--text-1); }
.settings-about-sub { font-size: 0.78rem; color: var(--text-3); }
.settings-about-ver { font-size: 0.7rem; color: var(--text-4); margin-top: 4px; font-family: ui-monospace, monospace; }

/* ============ SHORTCUTS OVERLAY ============ */
.shortcuts { position: fixed; inset: 0; z-index: 240; display: none; }
.shortcuts.open { display: block; }
.shortcuts-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.78); backdrop-filter: blur(10px);
    animation: fadeIn .2s ease;
}
.shortcuts-sheet {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 92%; max-width: 720px;
    max-height: 90vh; overflow-y: auto;
    background: var(--bg-1);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-2xl);
    padding: 28px 30px 24px;
    box-shadow: var(--sh-lg);
    animation: sheetIn .3s var(--ease-out);
}
.shortcuts-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 18px;
}
.shortcuts-header h2 { font-family: var(--font-display); margin: 0; font-size: 1.4rem; letter-spacing: -0.02em; }
.shortcuts-close {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,.06); color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
}
.shortcuts-close svg { width: 14px; height: 14px; }
.shortcuts-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.shortcuts-col h3 {
    margin: 0 0 12px;
    font-size: 0.78rem; font-weight: 700;
    color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em;
}
.shortcut-row {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 0; font-size: 0.82rem; color: var(--text-2);
    border-bottom: 1px dashed var(--border-soft);
}
.shortcut-row:last-child { border-bottom: none; }
.shortcut-row span:last-child { margin-left: auto; color: var(--text-3); font-size: 0.78rem; }
kbd, .rkey {
    display: inline-block; padding: 3px 7px;
    background: var(--bg-3); border: 1px solid var(--border-mid);
    border-radius: 6px; font-family: ui-monospace, monospace; font-size: 0.72rem;
    color: var(--text-1); font-weight: 600;
    min-width: 22px; text-align: center;
}
.rkey {
    background: rgba(var(--accent-rgb),.15); border-color: rgba(var(--accent-rgb),.40); color: var(--text-1);
}

/* ============ MINI PLAYER ============ */
.mini-player {
    position: fixed; bottom: 20px; right: 20px;
    width: 320px;
    background: var(--bg-1);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-md);
    overflow: hidden;
    z-index: 180;
    box-shadow: var(--sh-lg);
    animation: miniIn .35s var(--ease-out);
}
@keyframes miniIn { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.mini-player-handle {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    background: rgba(0,0,0,.35);
    cursor: grab;
    font-size: 0.78rem; font-weight: 600;
}
.mini-live-dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--live);
    box-shadow: 0 0 8px var(--live); animation: pulseRed 1.6s infinite;
}
.mini-player-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-player-wrap { background: #000; }
.mini-player-actions {
    display: flex; gap: 4px;
    padding: 6px;
    background: rgba(0,0,0,.35);
    justify-content: flex-end;
}
.mini-btn {
    width: 28px; height: 28px; border-radius: 6px;
    background: rgba(255,255,255,.06); color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--dur-fast);
}
.mini-btn:hover, .mini-btn:focus { background: rgba(255,255,255,.12); color: var(--text-1); }
.mini-btn svg { width: 13px; height: 13px; }

/* ============ TOASTS ============ */
.toasts {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; gap: 8px; align-items: center;
    z-index: 300; pointer-events: none;
}
.toast {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 18px;
    background: var(--bg-3);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-pill);
    color: var(--text-1); font-weight: 500; font-size: 0.86rem;
    box-shadow: var(--sh-md);
    pointer-events: auto;
    animation: toastIn .3s var(--ease-out);
}
.toast.toast-out { animation: toastOut .3s ease forwards; }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast.success { border-color: rgba(34,224,154,.4); color: #B8FFE0; }
.toast.success svg { color: var(--success); }
.toast.error { border-color: rgba(255,43,77,.4); color: #FFB6C0; }
.toast.error svg { color: var(--live); }
.toast.info svg { color: var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(20px); } }

/* ============ LIVE TICKER ============ */
.live-ticker {
    position: relative;
    display: flex; align-items: center;
    gap: 16px;
    padding: 10px 14px;
    background: rgba(var(--accent-rgb),.04);
    border-bottom: 1px solid rgba(var(--accent-rgb),.08);
    overflow: hidden; max-width: 100%;
    min-width: 0;
}
.live-ticker-label {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.74rem; font-weight: 700; color: #fff;
    background: #ff2b4d; padding: 5px 12px; border-radius: var(--r-pill);
    flex-shrink: 0;
    box-shadow: 0 0 14px rgba(255,43,77,.50);
    z-index: 2;
}
.live-ticker-label .live-pulse { background: #fff; }
.live-ticker-clip {
    flex: 1; min-width: 0;
    overflow: hidden;              /* hard clip — content never bleeds left into badge */
    /* Fade the right edge only; left is already hard-clipped by overflow:hidden */
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 40px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 40px), transparent 100%);
}
.live-ticker-track {
    display: inline-flex; gap: 28px;
    animation: tickerScroll 30s linear infinite;
    white-space: nowrap;
    font-size: 0.84rem; color: var(--text-2); font-weight: 500;
    padding-left: 20px;            /* small gap after the LIVE badge */
}
.live-ticker-item { display: inline-flex; align-items: center; gap: 8px; }
.live-ticker-item strong { color: var(--text-1); font-weight: 700; }
.live-ticker-item .dot { color: var(--accent); }
@keyframes tickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============ MOBILE TAB BAR (floating glass design) ============ */
.tab-bar {
    display: none;
    position: fixed; bottom: 12px; left: 12px; right: 12px;
    height: var(--tabbar-h);
    background: var(--glass-strong);
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-xl);
    z-index: 50;
    padding: 0 4px env(safe-area-inset-bottom, 4px);
    box-shadow: var(--sh-lg), inset 0 1px 0 rgba(255,255,255,0.05);
    margin-bottom: env(safe-area-inset-bottom, 0px);
    overflow: hidden;
}
.tab-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 4px;
    color: var(--text-3); font-size: 0.65rem; font-weight: 600;
    transition: color var(--dur-fast);
    position: relative;
    border-radius: var(--r-md);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.tab-btn svg { width: 22px; height: 22px; flex-shrink: 0; transition: transform var(--dur-fast); }
.tab-btn.active { color: var(--accent); }
.tab-btn.active svg { stroke-width: 2.4; transform: scale(1.1); }
.tab-live-icon {
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
}
.tab-btn:active { transform: scale(0.92); }

/* ============ QUICK EDIT (mod/admin) ============ */
.qe-panel { position: fixed; inset: 0; z-index: 230; display: none; }
.qe-panel.qe-open { display: block; }
.qe-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.65); backdrop-filter: blur(8px); animation: fadeIn .25s ease; }
.qe-drawer {
    position: absolute; right: 0; top: 0;
    width: 100%; max-width: 540px; height: 100vh;
    background: var(--bg-1);
    border-left: 1px solid var(--border-mid);
    display: flex; flex-direction: column;
    animation: panelInRight .35s var(--ease-out);
    box-shadow: var(--sh-lg);
}
.qe-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px; border-bottom: 1px solid var(--border-soft);
    flex-shrink: 0;
}
.qe-header-left { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; }
.qe-header-left svg { width: 16px; height: 16px; color: var(--accent); }
.qe-header-actions { display: flex; align-items: center; gap: 8px; }
.qe-full-cp-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px;
    background: rgba(var(--accent-rgb),.15);
    border-radius: var(--r-sm); font-size: 0.75rem; font-weight: 700; color: var(--accent);
}
.qe-full-cp-link svg { width: 11px; height: 11px; }
.qe-close-btn { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.06); color: var(--text-2); display: flex; align-items: center; justify-content: center; }
.qe-close-btn:hover, .qe-close-btn:focus { background: var(--live); color: #fff; }
.qe-close-btn svg { width: 16px; height: 16px; }
.qe-body { flex: 1; overflow-y: auto; padding: 18px 22px; }
.qe-loading { padding: 40px; text-align: center; color: var(--text-3); }
.qe-loading .spinner { width: 28px; height: 28px; border: 3px solid var(--border-mid); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 12px; }
.qe-error { padding: 30px; text-align: center; color: #FFB6C0; }
.qe-form { display: flex; flex-direction: column; gap: 14px; }
.qe-section-label { font-size: 0.72rem; font-weight: 700; color: var(--text-3); letter-spacing: 0.08em; text-transform: uppercase; }
.qe-type-toggle { display: flex; gap: 6px; background: rgba(255,255,255,.04); padding: 4px; border-radius: var(--r-md); border: 1px solid var(--border-mid); }
.qe-type-btn { flex: 1; padding: 10px; border-radius: var(--r-sm); font-weight: 600; font-size: 0.85rem; color: var(--text-3); transition: all var(--dur-fast); }
.qe-type-btn.active { background: var(--accent); color: #fff; }
.qe-type-btn:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.qe-field { display: flex; flex-direction: column; gap: 6px; }
.qe-hidden { display: none !important; }
.qe-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qe-label { font-size: 0.72rem; font-weight: 600; color: var(--text-3); }
.qe-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qe-input { padding: 10px 14px; background: rgba(255,255,255,.04); border: 1px solid var(--border-mid); border-radius: var(--r-sm); color: var(--text-1); font-size: 0.88rem; }
.qe-input:focus { border-color: var(--accent); background: rgba(255,255,255,.07); box-shadow: 0 0 0 2px rgba(var(--accent-rgb),.18); }
.qe-ch-add-row { position: relative; flex: 1; max-width: 280px; }
.qe-ch-search { width: 100%; }
.qe-ch-dropdown {
    position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px;
    background: var(--bg-2); border: 1px solid var(--border-mid); border-radius: var(--r-sm);
    box-shadow: var(--sh-md); z-index: 5;
    max-height: 220px; overflow-y: auto;
}
.qe-ch-opt { padding: 9px 12px; cursor: pointer; font-size: 0.84rem; transition: background var(--dur-fast); }
.qe-ch-opt:hover, .qe-ch-opt:focus { background: rgba(var(--accent-rgb),.18); }
.qe-ch-list { display: flex; flex-direction: column; gap: 5px; max-height: 220px; overflow-y: auto; padding: 6px; background: rgba(255,255,255,.03); border-radius: var(--r-sm); border: 1px solid var(--border-soft); }
.qe-ch-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: rgba(255,255,255,.03); border-radius: 6px; }
.qe-ch-name { flex: 1; font-size: 0.82rem; }
.qe-ch-remove { width: 22px; height: 22px; border-radius: 4px; background: rgba(255,43,77,.15); color: #FF8C9C; display: flex; align-items: center; justify-content: center; }
.qe-ch-remove:hover { background: var(--live); color: #fff; }
.qe-ch-empty { color: var(--text-4); font-size: 0.82rem; text-align: center; padding: 14px; font-style: italic; }
.qe-msg { padding: 10px 14px; border-radius: var(--r-sm); font-size: 0.82rem; font-weight: 600; }
.qe-msg-ok { background: rgba(34,224,154,.10); color: #B8FFE0; border: 1px solid rgba(34,224,154,.30); }
.qe-msg-err { background: rgba(255,43,77,.10); color: #FFB6C0; border: 1px solid rgba(255,43,77,.30); }
.qe-footer { display: flex; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border-soft); }
.qe-cancel-btn { flex: 1; padding: 11px; background: rgba(255,255,255,.04); border-radius: var(--r-sm); font-weight: 600; color: var(--text-2); }
.qe-cancel-btn:hover, .qe-cancel-btn:focus { background: rgba(255,255,255,.08); color: var(--text-1); }
.qe-save-btn { flex: 1; padding: 11px; background: var(--accent); color: #fff; border-radius: var(--r-sm); font-weight: 700; }
.qe-save-btn:hover, .qe-save-btn:focus { background: var(--accent-2); }

/* ============ TV MODE (Android TV / large screens) ============ */
body.is-tv { font-size: 17px; }
body.is-tv .rail { width: 280px; }
body.is-tv .app { grid-template-columns: 280px 1fr; }
/* Cards: no scale — .rail-row overflow-x:auto forces overflow-y:auto which clips scaled cards.
   Use a high-contrast outline instead for better TV visibility. */
body.is-tv .ev-card:focus {
    transform: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent), 0 0 32px rgba(var(--accent-rgb),.55);
    z-index: 10;
    outline: 2px solid #fff;
    outline-offset: -4px;
}
body.is-tv .filter-chip:focus,
body.is-tv .date-pill:focus,
body.is-tv .ch-cat-btn:focus,
body.is-tv .ch-channel-tile:focus,
body.is-tv .modal-ch-playable:focus,
body.is-tv .quality-btn:focus,
body.is-tv .ext-player-btn:focus,
body.is-tv .hero-watch-btn:focus,
body.is-tv .hero-action-btn:focus {
    transform: scale(1.06);
    box-shadow: 0 0 0 4px var(--accent), 0 18px 40px rgba(var(--accent-rgb),.45);
    z-index: 10;
    outline: 2px solid #fff;
    outline-offset: 2px;
}
/* Extra padding so focus ring on first/last card clears the rail-row clip boundary */
body.is-tv .rail-row { padding: 8px 8px 20px; margin: -2px -2px 0; }
body.is-tv .rail-item:focus { transform: scale(1.04) translateX(2px); outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r-md); }
body.is-tv .modal-close, body.is-tv .ch-browser-close { width: 48px; height: 48px; }
body.is-tv .tb-icon-btn { width: 48px; height: 48px; }
body.is-tv .tb-search { width: 320px; }
body.is-tv .ev-card { transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
/* Keep date strip on one row — prevents status pills wrapping below arrows and becoming unreachable */
body.is-tv .date-strip { flex-wrap: nowrap; }
/* Status filter pills, finished toggle and spacer removed from UI */
.ds-status-pills, .ds-finished-toggle, .ds-spacer, .ds-stats { display: none; }

/* Card overlay buttons — not reachable by D-pad on TV */
/* body.is-tv .modal-admin-bar { display: none; } */
body.is-tv .ev-fav-btn,
body.is-tv .ev-remind-btn { pointer-events: none; }

/* Hero — compact for TV viewport */
body.is-tv .hero { margin: 8px 20px 4px; }
body.is-tv .hero-slide { min-height: 220px; }
body.is-tv .hero-info { padding: 20px 24px 16px; gap: 8px; }
body.is-tv .hero-title { font-size: 1.85rem; }
body.is-tv .hero-time { padding: 6px 12px; font-size: 0.82rem; }
body.is-tv .hero-watch-btn { padding: 10px 18px; font-size: 0.88rem; }
body.is-tv .hero-action-btn { padding: 10px 14px; font-size: 0.82rem; }
body.is-tv .hero-team-logo { width: 72px; height: 72px; font-size: 1.9rem; }
body.is-tv .hero-vs-cell { width: 42px; height: 42px; font-size: 0.9rem; }
body.is-tv .hero-team-name { font-size: 0.82rem; max-width: 72px; }
body.is-tv .hero-single { font-size: 3.2rem; }
body.is-tv .hero-dot { width: 18px; height: 4px; }
body.is-tv .hero-dot.active { width: 26px; }
body.is-tv .hero-dot:focus { outline: 3px solid var(--accent); outline-offset: 4px; transform: scaleY(1.8); }
body.is-tv .fav-tab:focus { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; background: rgba(var(--accent-rgb),.12); }
body.is-tv .settings-toggle-row:focus { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 10px; }
body.is-tv .login-btn:focus { outline: 3px solid #fff; outline-offset: 3px; }
body.is-tv .tb-menu:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
body.is-tv .sport-card:focus { transform: translateY(-4px) scale(1.03); box-shadow: 0 0 0 4px var(--accent), 0 16px 36px rgba(0,0,0,.5); outline: 2px solid #fff; outline-offset: -4px; }
body.is-tv .rail-brand:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-md); }
body.is-tv .search-hist-pill:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
body.is-tv .modal-action-btn:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
body.is-tv .ch-browser-back:focus,
body.is-tv .ch-browser-close:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 50%; }
body.is-tv .ds-switch input:focus + .ds-switch-slider { box-shadow: 0 0 0 3px var(--accent); }
body.is-tv .accent-btn:focus { box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--accent); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
    body { font-size: 14.5px; }
    .rails { padding: 18px 20px 0; }
    .quick-chips-row, .topbar, .date-strip { padding-left: 20px; padding-right: 20px; }
    .hero { margin: 14px 20px 6px; }
    .hero-slide { min-height: 320px; }
    .hero-title { font-size: 2.1rem; }
    .hero-team-logo { width: 100px; height: 100px; font-size: 3rem; }
}

@media (max-width: 900px) {
    .app, body.is-tv .app { grid-template-columns: 1fr; }
    .rail {
        position: fixed; top: 0; bottom: 0; left: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(-100%);
        transition: transform var(--dur-base) var(--ease-out);
        z-index: 100;
    }
    .rail.open { transform: none; box-shadow: var(--sh-lg); }
    .main { grid-column: 1; padding-bottom: calc(var(--tabbar-h) + 28px); }
    .tb-menu { display: flex; }
    .tb-search, body.is-tv .tb-search { width: 180px; }
    .tab-bar { display: flex; }
    .hero-slide { grid-template-columns: 1fr; }
    .hero-art { padding: 14px; min-height: 200px; }
    .hero-team-logo { width: 80px; height: 80px; font-size: 2.2rem; }
    .hero-info { padding: 22px 22px 18px; }
    .hero-title { font-size: 1.8rem; }
    .topbar { padding: env(safe-area-inset-top, 0px) 14px 0; gap: 10px; }
    .date-strip { padding: 12px 14px; }
    .quick-chips-row, .rails { padding-left: 14px; padding-right: 14px; }
    .hero { margin: 14px; }
    .ds-finished-toggle { display: none; }
    .ds-status-pills .stat:not(.stat-active):not(.stat-all) { display: none; }
    .modal { padding: 0; }
    .modal-sheet { max-height: 100vh; height: 100vh; max-width: 100%; border-radius: 0; }
    .ch-browser-panel { top: 0; left: 0; transform: none; width: 100%; height: 100vh; border-radius: 0; }
    .settings-sheet { max-width: 100%; }
    .mini-player { width: 240px; bottom: calc(var(--tabbar-h) + 28px); right: 12px; }
    .shortcuts-body { grid-template-columns: 1fr; }
    .ev-card { width: 240px; height: 218px; }
}

@media (max-width: 600px) {
    .tb-view-title { display: none; }
    .tb-search, body.is-tv .tb-search { flex: 1; width: auto; }
    .tb-refresh-btn { display: none; }
    .ev-card { width: 220px; height: 210px; }
    .hero-title { font-size: 1.5rem; }
    .ds-pills .date-pill { padding: 6px 12px; min-width: 60px; }
    .dp-num { font-size: 1.15rem; }
    .login-card { padding: 28px 22px; }
    .search-big-input { font-size: 1.1rem; padding: 14px 16px 14px 12px; }
    .modal-hero { padding: 20px 18px; }
    .modal-meta, .modal-actions, .modal-ch-section, .modal-player-section { padding-left: 18px; padding-right: 18px; }
    .modal-team-badge { width: 64px; height: 64px; }
    .topbar { height: 56px; }
    .date-strip { padding: 10px 14px; gap: 8px; }
    .rail { width: 280px; }
}

/* ============ COMPACT PHONE (≤480px) ============ */
@media (max-width: 480px) {
    body { font-size: 14px; }
    .login-card { padding: 24px 18px; border-radius: var(--r-xl); max-width: 100%; }
    .login-title { font-size: 1.3rem; }
    .login-logo-wrap { width: 48px; height: 48px; }
    .login-logo { width: 36px; height: 36px; }
    .login-input { padding: 12px 12px 12px 8px; font-size: 16px; }
    .login-btn { padding: 13px 16px; font-size: 0.9rem; }
    .login-foot { font-size: 0.65rem; }
    .app { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
    .topbar { padding: env(safe-area-inset-top, 0px) 10px 0; height: 56px; gap: 8px; }
    .tb-title { font-size: 1.1rem; }
    .tb-actions { gap: 4px; }
    .tb-icon-btn { width: 36px; height: 36px; }
    .tb-search-input { font-size: 0.82rem; padding: 7px 10px 7px 8px; }
    .date-strip { padding: 8px 10px; gap: 6px; }
    .ds-pills { gap: 4px; }
    .date-pill { padding: 6px 10px; min-width: 52px; }
    .dp-num { font-size: 1rem; }
    .dp-day { font-size: 0.58rem; }
    .ds-arrow { width: 30px; height: 30px; }
    .quick-chips-row { padding: 8px 10px 2px; }
    .filter-chip { padding: 6px 10px; font-size: 0.74rem; gap: 4px; }
    .chip-count { padding: 0 5px; font-size: 0.6rem; }
    .hero { margin: 8px 10px; border-radius: var(--r-lg); }
    .hero-slide { grid-template-columns: 1fr; min-height: auto; }
    .hero-info { padding: 16px 16px 12px; gap: 6px; }
    .hero-art { display: none; }
    .hero-title { font-size: 1.25rem; }
    .hero-vs { padding: 0 6px; font-size: 1rem; }
    .hero-meta { font-size: 0.68rem; }
    .hero-time { padding: 4px 10px; font-size: 0.74rem; }
    .hero-watch-btn { padding: 8px 14px; font-size: 0.82rem; }
    .hero-action-btn { padding: 8px 12px; font-size: 0.78rem; }
    .hero-dot { width: 14px; height: 3px; }
    .hero-dot.active { width: 20px; }
    .rails { padding: 12px 10px 0; gap: 18px; }
    .rail-head-title { font-size: 1rem; }
    .rail-head-icon { width: 24px; height: 24px; }
    .rail-head-count { font-size: 0.68rem; }
    .ev-card { width: 200px; height: 190px; padding: 12px; gap: 6px; }
    .ev-team-logo, .ev-team-ph { width: 36px; height: 36px; }
    .ev-team-label { font-size: 0.7rem; }
    .ev-time-num { font-size: 1rem; }
    .ev-league-row { font-size: 0.62rem; }
    .ev-league-row img { width: 14px; height: 14px; }
    .ev-channels-row { max-height: 44px; padding-top: 4px; }
    .ch-pill { padding: 2px 6px; font-size: 0.58rem; }
    .ev-fav-btn, .ev-remind-btn { width: 24px; height: 24px; top: 6px; left: 6px; }
    .ev-remind-btn { left: 34px; }
    .ev-fav-btn svg, .ev-remind-btn svg { width: 11px; height: 11px; }
    /* admin buttons use inline styles */
    .main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
    .tab-bar { height: 56px; padding: 0 4px env(safe-area-inset-bottom, 2px); }
    .tab-btn { padding: 6px 2px; gap: 2px; font-size: 0.58rem; }
    .tab-btn svg { width: 20px; height: 20px; }
    .tab-live-icon { width: 20px; height: 20px; }
    .sport-grid { padding: 12px 10px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
    .sport-card { padding: 14px; }
    .sport-card-icon { font-size: 2rem; }
    .sport-card-name { font-size: 0.95rem; }
    .fav-tabs { padding: 12px 10px 0; gap: 4px; overflow-x: auto; }
    .fav-tab { padding: 8px 12px; font-size: 0.78rem; white-space: nowrap; }
    .fav-list { padding: 12px 10px; grid-template-columns: 1fr; gap: 14px; }
    .search-hero { padding: 16px 10px 10px; }
    .search-big-input { font-size: 1rem; padding: 12px 14px 12px 10px; }
    .search-big-icon { width: 18px; height: 18px; margin-left: 14px; }
    .search-voice-btn { width: 34px; height: 34px; margin-right: 8px; }
    .search-voice-btn svg { width: 15px; height: 15px; }
    .search-hist { margin-top: 8px; }
    #searchResults { padding: 6px 10px 16px; }
    .modal { padding: 0; }
    .modal-sheet { max-height: 100vh; height: 100vh; max-width: 100%; border-radius: 0; }
    .modal-hero { padding: 16px 14px; }
    .modal-matchup { gap: 10px; }
    .modal-team-badge { width: 56px; height: 56px; }
    .modal-team-name { font-size: 0.9rem; }
    .modal-vs { width: 38px; height: 38px; font-size: 0.8rem; }
    .modal-meta, .modal-actions, .modal-ch-section, .modal-player-section { padding-left: 14px; padding-right: 14px; }
    .modal-ch-grid { grid-template-columns: 1fr; }
    .settings-sheet { max-width: 100%; }
    .ch-browser-panel { top: 0; left: 0; transform: none; width: 100%; height: 100vh; border-radius: 0; }
    .settings-body { padding: 14px 16px 120px; }
    .shortcuts-body { grid-template-columns: 1fr; }
    .shortcuts-sheet { padding: 20px 18px; }
    .live-ticker { padding: 6px 8px; gap: 10px; }
    .live-ticker-label { font-size: 0.65rem; padding: 3px 8px; }
    .live-ticker-track { font-size: 0.74rem; gap: 18px; }
    .mini-player { width: 200px; bottom: calc(var(--tabbar-h) + 8px); right: 8px; }
    .rail { width: 260px; }
    .rail-item { padding: 10px 12px; font-size: 0.84rem; }
    .rail-icon { width: 20px; height: 20px; }
    .rail-logo-img { width: 36px; height: 36px; }
    .rail-name { font-size: 0.88rem; }
    .rail-user { padding: 8px 10px; }
    .rail-user-avatar { width: 32px; height: 32px; font-size: 0.85rem; }
    .view { animation-duration: .3s; }
    .hero-dots { bottom: 8px; }
    /* Override the 600px card shrink for even smaller screens */
    .ev-card { width: 180px; height: 178px; }
    .ev-vs-layout { gap: 6px; }
    .ev-single-icon { width: 36px; height: 36px; font-size: 1.1rem; }
    .ev-single-name { font-size: 0.82rem; }
    .state-msg { padding: 40px 16px; }
    .state-msg-icon { font-size: 2.4rem; }
    .state-msg-title { font-size: 1.1rem; }
    .toasts { bottom: calc(var(--tabbar-h) + 8px); }
    .toast { padding: 10px 14px; font-size: 0.8rem; }
}

/* ============ TOUCH-SPECIFIC (coarse pointer, no hover) ============ */
@media (pointer: coarse) and (hover: none) {
    .tab-bar { display: flex; }
    .tab-btn { touch-action: manipulation; -webkit-tap-highlight-color: transparent;
               min-height: 44px; min-width: 44px; }
    .filter-chip { min-height: 40px; }
    .date-pill { min-height: 40px; }
    .ev-fav-btn, .ev-remind-btn { min-width: 32px; min-height: 32px; }
    .rail-item { min-height: 48px; }
    .modal-close, .ch-browser-close { min-width: 44px; min-height: 44px; }
}

@media (pointer: coarse) and (hover: none) and (min-width: 1200px) {
    body:not(.is-tv) { font-size: 16px; }
    body:not(.is-tv) .ev-card:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
}

/* ============ SKELETONS ============ */
.skel-rail { display: flex; flex-direction: column; gap: 28px; padding: 22px 28px 0; }
.skel-row { display: flex; flex-direction: column; gap: 12px; }
.skel-row-head {
    width: 30%; height: 22px;
    background: linear-gradient(90deg, var(--bg-2), var(--bg-3), var(--bg-2));
    background-size: 200% 100%;
    border-radius: 6px;
    animation: shimmer 1.4s infinite;
}
.skel-row-cards { display: flex; gap: 14px; }
.skel-card {
    flex-shrink: 0;
    width: var(--card-w, 280px);
    height: var(--card-h, 168px);
    background: linear-gradient(90deg, var(--bg-2), var(--bg-3), var(--bg-2));
    background-size: 200% 100%;
    border-radius: var(--r-lg);
    animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ============ VIDEO.JS POLISH ============ */
.video-js .vjs-control-bar {
    background: linear-gradient(0deg, rgba(0,0,0,.85), transparent);
    height: 48px;
}
.video-js .vjs-big-play-button {
    background: rgba(0,0,0,.55) !important;
    border: 2px solid #fff !important;
    border-radius: 50% !important;
    width: 80px !important; height: 80px !important;
    line-height: 76px !important;
    top: 50% !important; left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
}
.video-js .vjs-big-play-button:hover { background: var(--accent) !important; border-color: var(--accent) !important; }

/* ==========================================================================
   ADMIN CONTROL PANEL
   Restyles the existing admin.html DOM/JS to match the Stadium design.
   All class names here must match the original admin.html so no JS changes
   are needed.
   ========================================================================== */

body.admin-page {
    background: var(--bg-0);
    color: var(--text-1);
    min-height: 100vh;
}

#adminApp { min-height: 100vh; display: flex; flex-direction: column; }

/* ---- Admin header ---- */
body.admin-page .header {
    position: sticky; top: 0; z-index: 50;
    background: var(--glass);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border-bottom: 1px solid var(--border-soft);
}
body.admin-page .header-inner {
    max-width: 1400px; margin: 0 auto;
    display: flex; align-items: center; gap: 18px;
    padding: 14px 28px;
}
body.admin-page .logo { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
body.admin-page .logo-mark {
    width: 46px; height: 46px;
    object-fit: contain; padding: 4px;
    border-radius: var(--r-sm);
    background: linear-gradient(135deg, rgba(var(--accent-rgb),.20), rgba(255,255,255,.04));
    border: 1px solid var(--border-mid);
}
body.admin-page .logo-text { display: flex; flex-direction: column; }
body.admin-page .logo-title {
    font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
    line-height: 1.1; color: var(--text-1); letter-spacing: -0.01em;
}
body.admin-page .logo-sub {
    font-size: 0.7rem; color: var(--accent); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.12em;
}
body.admin-page .admin-header-center { flex: 1; display: flex; justify-content: center; }
body.admin-page .cp-user-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px;
    background: rgba(var(--accent-rgb),.10);
    border: 1px solid rgba(var(--accent-rgb),.30);
    border-radius: var(--r-pill);
    color: var(--accent); font-weight: 700; font-size: 0.78rem;
}
body.admin-page .admin-header-actions { display: flex; align-items: center; gap: 10px; }
body.admin-page .admin-back-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 16px;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-pill);
    font-size: 0.84rem; font-weight: 600; color: var(--text-2);
    transition: all var(--dur-fast);
}
body.admin-page .admin-back-btn:hover, body.admin-page .admin-back-btn:focus {
    background: rgba(var(--accent-rgb),.15); border-color: var(--accent); color: var(--text-1);
    transform: translateX(-2px);
}
body.admin-page .admin-back-btn svg { width: 14px; height: 14px; }

/* ---- Admin main area ---- */
body.admin-page .main {
    grid-column: auto;
    display: block;                 /* override main-app's flex column */
    overflow-x: visible;
    padding: 24px 0 60px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ---- Tabs ---- */
body.admin-page .admin-tabs {
    display: flex; gap: 6px;
    padding: 0 28px 18px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 22px;
    flex-wrap: wrap;
}
body.admin-page .admin-tab {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 18px;
    background: rgba(255,255,255,.04);
    border: 1px solid transparent;
    border-radius: var(--r-md) var(--r-md) 0 0;
    color: var(--text-3); font-weight: 600; font-size: 0.88rem;
    transition: all var(--dur-fast);
    margin-bottom: -1px;
}
body.admin-page .admin-tab svg { width: 15px; height: 15px; }
body.admin-page .admin-tab:hover { background: rgba(255,255,255,.07); color: var(--text-1); }
body.admin-page .admin-tab:focus { box-shadow: 0 0 0 2px rgba(var(--accent-rgb),.55); color: var(--text-1); }
body.admin-page .admin-tab.active {
    background: var(--bg-2);
    border-color: var(--border-mid);
    border-bottom-color: var(--bg-2);
    color: var(--text-1);
    position: relative;
}
body.admin-page .admin-tab.active::after {
    content: ''; position: absolute; left: 14px; right: 14px; bottom: -2px;
    height: 2px; background: var(--accent); border-radius: 2px;
    box-shadow: 0 0 12px var(--accent);
}
body.admin-page .admin-tab-content { display: none; }
body.admin-page .admin-tab-content.active { display: block; animation: viewIn .35s var(--ease-out); }

/* ---- Grid + cards ---- */
body.admin-page .admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 18px;
    padding: 0 28px;
    max-width: 1400px; margin: 0 auto;
}
body.admin-page .admin-card {
    background: var(--bg-1);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-xl);
    padding: 22px;
    box-shadow: var(--sh-md);
    display: flex; flex-direction: column;
    min-width: 0;
}
body.admin-page .admin-card-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
}
body.admin-page .admin-card-header svg {
    width: 18px; height: 18px; color: var(--accent); flex-shrink: 0;
}
body.admin-page .admin-card-header h2 {
    font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
    margin: 0; letter-spacing: -0.01em;
    flex: 1;
}
body.admin-page .admin-count {
    background: rgba(var(--accent-rgb),.18);
    color: var(--accent);
    padding: 3px 10px; border-radius: var(--r-pill);
    font-size: 0.74rem; font-weight: 700;
}
body.admin-page .admin-empty {
    color: var(--text-4); font-size: 0.86rem; text-align: center;
    padding: 40px 14px; font-style: italic;
}

/* ---- Forms ---- */
body.admin-page .admin-form { display: flex; flex-direction: column; gap: 14px; }
body.admin-page .form-row { display: flex; flex-direction: column; gap: 6px; }
body.admin-page .form-row-2 {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
body.admin-page .form-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
body.admin-page .form-label {
    font-size: 0.72rem; font-weight: 700; color: var(--text-3);
    letter-spacing: 0.06em; text-transform: uppercase;
}
body.admin-page .form-input {
    padding: 11px 14px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-sm);
    color: var(--text-1); font-size: 0.9rem;
    width: 100%;
    transition: all var(--dur-fast);
}
body.admin-page .form-input::placeholder { color: var(--text-4); }
body.admin-page .form-input:focus {
    border-color: var(--accent);
    background: rgba(255,255,255,.07);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.15);
}
body.admin-page select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%238A8AAE' stroke-width='1.5' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* ---- Form toggle (Team / Single) ---- */
body.admin-page .form-toggle {
    display: flex; gap: 6px;
    background: rgba(255,255,255,.04); padding: 4px;
    border-radius: var(--r-md);
    border: 1px solid var(--border-mid);
}
body.admin-page .toggle-btn {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 12px;
    background: transparent;
    border-radius: var(--r-sm);
    color: var(--text-3); font-weight: 600; font-size: 0.86rem;
    transition: all var(--dur-fast);
}
body.admin-page .toggle-btn svg { width: 14px; height: 14px; }
body.admin-page .toggle-btn:hover { color: var(--text-1); }
body.admin-page .toggle-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 4px 14px rgba(var(--accent-rgb),.30);
}
body.admin-page .toggle-btn:focus { box-shadow: inset 0 0 0 1.5px rgba(var(--accent-rgb),.55); }

/* ---- Form messages + submit ---- */
body.admin-page .form-msg {
    padding: 10px 14px; border-radius: var(--r-sm);
    font-size: 0.84rem; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
}
body.admin-page .form-msg.form-msg-ok,
body.admin-page .form-msg.success {
    background: rgba(34,224,154,.10);
    border: 1px solid rgba(34,224,154,.30);
    color: #B8FFE0;
}
body.admin-page .form-msg.form-msg-err,
body.admin-page .form-msg.error {
    background: rgba(255,43,77,.10);
    border: 1px solid rgba(255,43,77,.30);
    color: #FFB6C0;
}
body.admin-page .form-submit {
    margin-top: 6px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff; font-weight: 700; font-size: 0.92rem;
    border-radius: var(--r-md);
    box-shadow: 0 8px 24px rgba(var(--accent-rgb),.30), inset 0 1px 0 rgba(255,255,255,.18);
    transition: transform var(--dur-fast), box-shadow var(--dur-base);
}
body.admin-page .form-submit:hover, body.admin-page .form-submit:focus {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(var(--accent-rgb),.45);
}
body.admin-page .form-submit:disabled { opacity: .65; cursor: wait; transform: none; }
body.admin-page .form-submit svg { width: 16px; height: 16px; }

/* ---- Combo picker (sport / league / team search) ---- */
body.admin-page .combo-picker { position: relative; }
body.admin-page .combo-input { width: 100%; }
body.admin-page .combo-dropdown {
    /* Positioned dynamically via JS (`position:fixed`) so doesn't need
       absolute positioning here, but we style it. */
    background: var(--bg-2);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-sm);
    box-shadow: var(--sh-md);
    z-index: 200;
    max-height: 260px; overflow-y: auto;
    padding: 4px;
}
body.admin-page .combo-list { display: flex; flex-direction: column; gap: 1px; }
body.admin-page .combo-opt {
    padding: 9px 12px;
    cursor: pointer;
    font-size: 0.86rem; color: var(--text-1);
    border-radius: 6px;
    transition: background var(--dur-fast);
}
body.admin-page .combo-opt:hover, body.admin-page .combo-opt:focus {
    background: rgba(var(--accent-rgb),.18);
}
body.admin-page .combo-opt-hint {
    padding: 12px; color: var(--text-4); font-size: 0.82rem; font-style: italic; text-align: center;
}
body.admin-page .combo-loading {
    padding: 16px; text-align: center; color: var(--text-3); font-size: 0.84rem;
}

/* ---- Channel picker ---- */
body.admin-page .ch-picker {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-md);
    padding: 10px;
    display: flex; flex-direction: column; gap: 10px;
}
body.admin-page .ch-selected {
    display: flex; flex-wrap: wrap; gap: 6px;
    min-height: 8px;
}
body.admin-page .ch-selected:empty { display: none; }
body.admin-page .ch-sel-tag {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 6px 5px 12px;
    background: rgba(var(--accent-rgb),.15);
    border: 1px solid rgba(var(--accent-rgb),.30);
    border-radius: var(--r-pill);
    color: var(--text-1); font-size: 0.8rem; font-weight: 600;
}
body.admin-page .ch-sel-remove {
    width: 20px; height: 20px; border-radius: 50%;
    background: rgba(0,0,0,.40);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background var(--dur-fast);
    flex-shrink: 0;
    border: none; cursor: pointer; line-height: 1;
}
body.admin-page .ch-sel-remove:hover {
    background: var(--live);
}
body.admin-page .ch-sel-remove svg { width: 11px; height: 11px; }
body.admin-page .ch-search-wrap {
    position: relative;
    display: flex; align-items: center;
}
body.admin-page .ch-search-icon {
    position: absolute; left: 12px;
    color: var(--text-3); pointer-events: none;
}
body.admin-page .ch-search-input { padding-left: 34px; }
body.admin-page .ch-dropdown {
    background: var(--bg-2);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-sm);
    box-shadow: var(--sh-md);
    max-height: 260px; overflow-y: auto;
    padding: 4px;
    z-index: 200;
}
body.admin-page .ch-dropdown-list { display: flex; flex-direction: column; gap: 1px; }
body.admin-page .ch-dropdown-list .ch-opt,
body.admin-page .ch-dropdown-opt {
    padding: 9px 12px; cursor: pointer; font-size: 0.86rem;
    border-radius: 6px;
    transition: background var(--dur-fast);
    color: var(--text-1);
}
body.admin-page .ch-dropdown-list .ch-opt:hover,
body.admin-page .ch-dropdown-opt:hover { background: rgba(var(--accent-rgb),.18); }
body.admin-page .ch-opt-selected {
    background: rgba(var(--accent-rgb),.18) !important;
    color: var(--accent) !important;
    font-weight: 700;
}
body.admin-page .sev-load-more {
    width: 100%;
    margin-top: 8px;
    justify-content: center;
}
body.admin-page .aev-tag-team { border-color: rgba(var(--accent-rgb),.30); color: var(--accent); background: rgba(var(--accent-rgb),.10); }
body.admin-page .aev-tag-single { border-color: rgba(99,102,241,.30); color: #818cf8; background: rgba(99,102,241,.10); }
body.admin-page .aev-tag-sport { border-color: rgba(34,224,154,.30); color: #6ee7b7; background: rgba(34,224,154,.08); }
body.admin-page .aev-tag-time { border-color: rgba(255,255,255,.06); color: var(--text-3); }
body.admin-page .aev-tag-ch { border-color: rgba(255,255,255,.06); color: var(--text-2); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.admin-page .cp-role-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: var(--r-pill);
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
}
body.admin-page .cp-role-badge-admin { background: rgba(var(--accent-rgb),.20); color: var(--accent); }
body.admin-page .cp-role-badge-mod { background: rgba(99,102,241,.15); color: #818cf8; }
body.admin-page .ch-dropdown-loading {
    padding: 12px; text-align: center; color: var(--text-3); font-size: 0.82rem;
}

/* ---- Events list (manual events table) ---- */
body.admin-page .admin-events-list {
    display: flex; flex-direction: column; gap: 8px;
    max-height: 560px; overflow-y: auto;
    padding-right: 4px;
}
body.admin-page .aev-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px; align-items: center;
    padding: 12px 14px;
    background: rgba(255,255,255,.03);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    transition: all var(--dur-fast);
}
body.admin-page .aev-item:hover {
    background: rgba(255,255,255,.06);
    border-color: var(--border-mid);
    transform: translateX(2px);
}
body.admin-page .aev-main { min-width: 0; }
body.admin-page .aev-name {
    font-weight: 600; color: var(--text-1); font-size: 0.92rem;
    margin-bottom: 4px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.admin-page .aev-meta {
    display: flex; flex-wrap: wrap; gap: 6px;
    font-size: 0.72rem; color: var(--text-3);
}
body.admin-page .aev-tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    background: rgba(255,255,255,.04);
    border-radius: var(--r-pill);
    color: var(--text-2);
}
body.admin-page .aev-teams {
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
    font-size: 0.78rem; color: var(--text-3); margin-top: 4px;
}
body.admin-page .aev-by {
    font-size: 0.68rem; color: var(--text-4); margin-right: 6px;
    display: inline-flex; align-items: center;
}
body.admin-page .aev-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
body.admin-page .aev-edit, body.admin-page .aev-delete {
    width: 30px; height: 30px;
    border-radius: 6px;
    background: rgba(255,255,255,.05);
    color: var(--text-2);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all var(--dur-fast);
    border: none; cursor: pointer;
}
body.admin-page .aev-edit:hover, body.admin-page .aev-edit:focus {
    background: rgba(var(--accent-rgb),.20); color: var(--accent);
}
body.admin-page .aev-delete:hover, body.admin-page .aev-delete:focus {
    background: rgba(255,43,77,.20); color: #FF8C9C;
}
body.admin-page .aev-edit svg, body.admin-page .aev-delete svg { width: 14px; height: 14px; }

/* ---- Search events bar ---- */
body.admin-page .search-ev-bar {
    position: relative;
    display: flex; align-items: center;
}
body.admin-page .search-ev-bar svg {
    position: absolute; left: 14px;
    color: var(--text-3); pointer-events: none;
}
body.admin-page .search-ev-input { padding-left: 38px; }

/* ---- Sports & Leagues row ---- */
body.admin-page .sl-add-row {
    display: flex; gap: 8px; align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
body.admin-page .sl-add-input { flex: 1; min-width: 140px; }
body.admin-page .sl-add-select { flex: 1; min-width: 120px; }
body.admin-page .sl-checkbox {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.84rem; color: var(--text-2); font-weight: 600;
    cursor: pointer; user-select: none;
    padding: 0 6px;
}
body.admin-page .sl-checkbox input { accent-color: var(--accent); }
body.admin-page .sl-add-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 11px 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff; font-weight: 700; font-size: 0.84rem;
    border-radius: var(--r-sm);
    box-shadow: 0 4px 14px rgba(var(--accent-rgb),.30);
    transition: transform var(--dur-fast);
}
body.admin-page .sl-add-btn:hover, body.admin-page .sl-add-btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(var(--accent-rgb),.45);
}
body.admin-page .sl-add-btn svg { width: 13px; height: 13px; }

body.admin-page .sl-filter-row { margin-bottom: 12px; }
body.admin-page .sl-filter-select { width: 100%; }

body.admin-page .sl-list {
    display: flex; flex-direction: column; gap: 6px;
    max-height: 480px; overflow-y: auto;
    padding-right: 4px;
}
body.admin-page .sl-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px; align-items: center;
    padding: 10px 14px;
    background: rgba(255,255,255,.03);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-sm);
    transition: all var(--dur-fast);
}
body.admin-page .sl-item:hover {
    background: rgba(255,255,255,.06); border-color: var(--border-mid);
}
body.admin-page .sl-item-main {
    display: flex; align-items: center; gap: 8px;
    min-width: 0; flex-wrap: wrap;
}
body.admin-page .sl-item-name {
    font-weight: 600; color: var(--text-1); font-size: 0.86rem;
    min-width: 0;
}
body.admin-page .sl-item-badge {
    font-size: 0.68rem; color: var(--text-3); font-weight: 500;
    padding: 2px 7px; background: rgba(255,255,255,.04);
    border-radius: var(--r-pill);
}
body.admin-page .sl-item-badge-sport {
    color: var(--accent); background: rgba(var(--accent-rgb),.12);
}
body.admin-page .sl-item-count {
    font-size: 0.68rem; color: var(--text-3);
    margin-left: auto;
}
body.admin-page .sl-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
body.admin-page .sl-btn-edit, body.admin-page .sl-btn-delete {
    width: 26px; height: 26px;
    border-radius: 5px;
    background: rgba(255,255,255,.05);
    color: var(--text-2);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all var(--dur-fast);
    border: none; cursor: pointer;
}
body.admin-page .sl-btn-edit:hover, body.admin-page .sl-btn-edit:focus { background: rgba(var(--accent-rgb),.20); color: var(--accent); }
body.admin-page .sl-btn-delete:hover, body.admin-page .sl-btn-delete:focus { background: rgba(255,43,77,.20); color: #FF8C9C; }
body.admin-page .sl-btn-edit svg, body.admin-page .sl-btn-delete svg { width: 12px; height: 12px; }

/* ---- Users hint text ---- */
body.admin-page .cp-users-hint {
    color: var(--text-3); font-size: 0.82rem;
    margin: 0 0 14px;
    padding: 10px 14px;
    background: rgba(var(--accent-rgb),.06);
    border-left: 3px solid var(--accent);
    border-radius: var(--r-sm);
}

/* ---- Edit modal (admin event editor) ---- */
body.admin-page .edit-modal {
    position: fixed; inset: 0; z-index: 250;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
body.admin-page .edit-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.78);
    backdrop-filter: blur(8px);
    animation: fadeIn .25s ease;
}
body.admin-page .edit-modal-sheet {
    position: relative;
    width: 100%; max-width: 760px; max-height: 92vh;
    background: var(--bg-1);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-2xl);
    overflow: hidden auto;
    box-shadow: var(--sh-lg);
    animation: sheetIn .35s var(--ease-out);
    padding: 24px;
}
body.admin-page .edit-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 18px; padding-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
}
body.admin-page .edit-modal-header h2 {
    font-family: var(--font-display); font-weight: 700; font-size: 1.4rem;
    margin: 0; letter-spacing: -0.02em;
}
body.admin-page .modal-close {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,.06); color: var(--text-2);
    border: 1px solid var(--border-mid);
    display: flex; align-items: center; justify-content: center;
}
body.admin-page .modal-close:hover, body.admin-page .modal-close:focus { background: var(--live); color: #fff; }
body.admin-page .modal-close svg { width: 16px; height: 16px; }

/* ---- APK builder console ---- */
body.admin-page #apkConsole {
    background: #000 !important;
    color: #d4d4d4 !important;
    border: 1px solid var(--border-mid) !important;
    font-family: ui-monospace, 'SF Mono', monospace !important;
}
body.admin-page #apkBuildStatus {
    padding: 4px 10px;
    border-radius: var(--r-pill);
    background: rgba(255,255,255,.05);
    color: var(--text-2);
}
body.admin-page #apkBuildStatus.running { background: rgba(255,176,32,.18); color: #FFD27A; }
body.admin-page #apkBuildStatus.success { background: rgba(34,224,154,.18); color: #B8FFE0; }
body.admin-page #apkBuildStatus.failed  { background: rgba(255,43,77,.18); color: #FFB6C0; }

body.admin-page .apk-file-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px; align-items: center;
    padding: 12px 14px;
    background: rgba(255,255,255,.03);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-sm);
    margin-bottom: 6px;
    transition: all var(--dur-fast);
}
body.admin-page .apk-file-row:hover {
    background: rgba(255,255,255,.06); border-color: var(--border-mid);
}
body.admin-page .apk-file-name {
    font-weight: 600; color: var(--text-1); font-size: 0.88rem;
    overflow: hidden; text-overflow: ellipsis;
}
body.admin-page .apk-file-meta { font-size: 0.72rem; color: var(--text-3); margin-top: 3px; }
body.admin-page .apk-file-actions { display: flex; gap: 6px; flex-shrink: 0; }
body.admin-page .apk-file-btn {
    padding: 6px 12px;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-sm);
    font-size: 0.78rem; font-weight: 600; color: var(--text-2);
    transition: all var(--dur-fast);
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 5px;
}
body.admin-page .apk-file-btn:hover, body.admin-page .apk-file-btn:focus {
    background: rgba(var(--accent-rgb),.18); color: var(--text-1); border-color: var(--accent);
}
body.admin-page .apk-file-btn-del:hover { background: rgba(255,43,77,.18); color: #FFB6C0; border-color: rgba(255,43,77,.40); }

/* ---- Admin responsive ---- */
@media (max-width: 900px) {
    body.admin-page .header-inner { padding: 12px 16px; }
    body.admin-page .admin-tabs { padding: 0 16px 14px; }
    body.admin-page .admin-grid { padding: 0 16px; grid-template-columns: 1fr; gap: 14px; }
    body.admin-page .form-row-2 { grid-template-columns: 1fr; }
    body.admin-page .admin-card { padding: 18px; }
    body.admin-page .edit-modal { padding: 0; }
    body.admin-page .edit-modal-sheet { max-height: 100vh; height: 100vh; max-width: 100%; border-radius: 0; }
    body.admin-page .admin-back-btn span { display: none; }
}

/* ============ UTILITIES ============ */
[hidden] { display: none !important; }
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
    border: 0;
}
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--border-mid); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; vertical-align: middle; }

/* Targeted scrollbars only on overflow containers we actually want them on.
   Using `*` here was leaking 8px-tall horizontal bars into the date-strip and
   live-ticker rows, where they visually overlapped the LIVE status tag. */
.modal-sheet::-webkit-scrollbar,
.settings-sheet::-webkit-scrollbar,
.ch-browser-body::-webkit-scrollbar,
.qe-body::-webkit-scrollbar { width: 8px; height: 8px; }
.modal-sheet::-webkit-scrollbar-track,
.settings-sheet::-webkit-scrollbar-track,
.ch-browser-body::-webkit-scrollbar-track,
.qe-body::-webkit-scrollbar-track { background: transparent; }
.modal-sheet::-webkit-scrollbar-thumb,
.settings-sheet::-webkit-scrollbar-thumb,
.ch-browser-body::-webkit-scrollbar-thumb,
.qe-body::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 4px; }

/* No overflow rules on html/body — any of `hidden`, `clip`, `auto`,
   `scroll` here turns the body into a scroll container and that
   silently breaks `position: sticky` on the .rail. Instead each
   horizontal-overflowing element clips its own contents (.main has
   overflow-x: clip, .hero/.hero-slide are overflow:hidden, .live-ticker
   is overflow:hidden, the rail-row scroll containers handle their own). */

/* Defensively hide horizontal scrollbars on the rail rows + chip rows. */
.rail-row, .ds-pills, .quick-chips { -ms-overflow-style: none; scrollbar-width: none; }
.rail-row::-webkit-scrollbar,
.ds-pills::-webkit-scrollbar,
.quick-chips::-webkit-scrollbar { display: none; height: 0; width: 0; }

/* ============ TV: COLLAPSIBLE ICON RAIL ============ */
/* Only on wide screens (≥901px). On phones the @media (max-width:900px) rules
   above already handle the layout; without this guard those rules were being
   overridden here (same specificity, later in file → later wins), which forced
   phones into a 76px+1fr grid, caused horizontal overflow, and triggered
   WebView's setLoadWithOverviewMode zoom-out, making the page appear at ~10%. */
@media (min-width: 901px) {
    /* Override fixed 280px — collapsed by default at --rail-w-collapsed (76px) */
    body.is-tv .app { grid-template-columns: var(--rail-w-collapsed) 1fr; }
    body.is-tv.nav-open .app { grid-template-columns: 280px 1fr; }

    body.is-tv .rail {
        width: var(--rail-w-collapsed);
        padding: 18px 4px 20px;
        align-items: center;
        transition: width var(--dur-base) var(--ease-out), padding var(--dur-base) var(--ease-out);
    }
    body.is-tv .rail.open { width: 280px; padding: 18px 12px 20px; }

    /* Labels / text: hidden when collapsed, visible when open */
    body.is-tv .rail-label,
    body.is-tv .rail-logo-text,
    body.is-tv .rail-user-info { display: none; }
    body.is-tv .rail.open .rail-label { display: block; }
    body.is-tv .rail.open .rail-logo-text { display: flex; }
    body.is-tv .rail.open .rail-user-info { display: flex; }

    /* Live-count badge: hidden when collapsed */
    body.is-tv .rail-badge { display: none; }
    body.is-tv .rail.open .rail-badge { display: inline-block; }

    /* Nav items: centered icons when collapsed, left-aligned with label when open */
    body.is-tv .rail-item { justify-content: center; padding: 12px 8px; gap: 0; }
    body.is-tv .rail.open .rail-item { justify-content: flex-start; padding: 11px 14px; gap: 14px; }

    /* Brand: logo image only when collapsed */
    body.is-tv .rail-brand { justify-content: center; padding: 8px 4px 18px; gap: 0; }
    body.is-tv .rail.open .rail-brand { justify-content: flex-start; padding: 8px 12px 18px; gap: 12px; }

    /* Active left-bar indicator: only show when expanded */
    body.is-tv .rail-item.active::before { display: none; }
    body.is-tv .rail.open .rail-item.active::before { display: block; }

    /* User row: avatar only when collapsed */
    body.is-tv .rail-user { justify-content: center; gap: 0; padding: 10px 4px; }
    body.is-tv .rail.open .rail-user { justify-content: flex-start; gap: 12px; padding: 10px 12px; }

    /* Show the hamburger toggle on TV */
    body.is-tv .tb-menu { display: flex; }
}

/* ── Scores ── */
#scoresBody { padding: 0 28px; }
.sport-pill:hover { background: var(--panel); color: var(--ink); }
.sport-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.sport-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sc-sport-header {
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--muted); padding: 10px 4px 4px; display: flex; align-items: center; gap: 6px;
}
.sc-sport-header:first-child { padding-top: 0; }
.sc-league-label { font-size: 10px; font-weight: 500; color: var(--muted2); letter-spacing: 0.04em; text-transform: none; }

.ev-card-time {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.65rem; font-weight: 600; color: var(--text-3);
    font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.04em;
}
.ev-comp-logo {
    width: 18px; height: 18px; border-radius: 4px; object-fit: contain; flex-shrink: 0;
}
.ev-comp-logo-fallback {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 4px; flex-shrink: 0; line-height: 1;
}


.sc-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px;
    padding-bottom: 8px;
}
@media (max-width: 480px) {
    .sc-grid { grid-template-columns: 1fr; }
    .sc-grid .ev-card { width: 100%; }
}


