/* ==========================================================================
   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;

    /* Fallback accent (admin.html ships a data-accent value with no matching
       block below; every var(--accent-rgb)/(--aurora-*) use elsewhere passes
       its own fallback too, this is just the :root default) */
    --accent-rgb: 59,130,246;
    --aurora-a: 59,130,246;
    --aurora-b: 139,92,246;

    /* Shadows / Elevation — dual-layer: black depth + colored accent bloom */
    --sh-sm: 0 2px 10px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.04);
    --sh-md: 0 12px 32px rgba(0,0,0,.55), 0 0 28px rgba(var(--accent-rgb,59,130,246),.10);
    --sh-lg: 0 30px 70px rgba(0,0,0,.65), 0 0 60px rgba(var(--accent-rgb,59,130,246),.14);

    /* Glass system */
    --glass-blur-sm: 16px;
    --glass-blur-md: 26px;
    --glass-blur-lg: 42px;
    --glass-sat: 170%;
    --glass-sheen: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,0) 45%);
    --glass-hairline: rgba(255,255,255,.10);

    /* Ambient glow */
    --live-glow: 0 0 4px rgba(255,43,77,.9), 0 0 24px rgba(255,43,77,.55), 0 0 48px rgba(255,43,77,.25);
    --card-glow: 0 0 0 1px rgba(var(--sc-rgb,99,102,241),.14), 0 18px 40px rgba(0,0,0,.5), 0 0 46px rgba(var(--sc-rgb,99,102,241),.16);
}

/* ---------- THEMES ---------- */
body[data-theme="oled"] {
    --bg-0: #000000;
    --bg-1: #05070f;
    --bg-2: #0a0d1c;
    --bg-3: #121631;
    --bg-4: #1b2044;
    --bg-5: #252c5c;
    --glass: rgba(9,12,24,.44);
    --glass-strong: rgba(3,5,12,.62);
    --border-soft: rgba(255,255,255,.04);
    --border-mid:  rgba(255,255,255,.09);
    --border-strong: rgba(255,255,255,.16);
    --text-1: #eeeef6;
    --text-2: #b4b8d4;
    --text-3: #5a5e84;
    --text-4: #3a3e60;
}
body[data-theme="dark"] {
    --bg-0: #04060e;
    --bg-1: #090b18;
    --bg-2: #111527;
    --bg-3: #191d35;
    --bg-4: #232849;
    --bg-5: #2e3362;
    --glass: rgba(12,15,30,.42);
    --glass-strong: rgba(6,8,18,.60);
    --border-soft: rgba(255,255,255,.045);
    --border-mid:  rgba(255,255,255,.10);
    --border-strong: rgba(255,255,255,.18);
    --text-1: #f0f2fa;
    --text-2: #c0c4de;
    --text-3: #666a90;
    --text-4: #444868;
}
body[data-theme="dim"] {
    --bg-0: #0e0e1a;
    --bg-1: #131426;
    --bg-2: #1b1d34;
    --bg-3: #252746;
    --bg-4: #313459;
    --bg-5: #3e4270;
    --glass: rgba(22,22,42,.46);
    --glass-strong: rgba(15,15,28,.64);
    --border-soft: rgba(255,255,255,.05);
    --border-mid:  rgba(255,255,255,.11);
    --border-strong: rgba(255,255,255,.19);
    --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: #3B82F6; --accent-2: #60A5FA; --accent-rgb: 59,130,246;
    --accent-bg: rgba(59,130,246,.06); --accent-glow: rgba(59,130,246,.45);
    --aurora-a: 59,130,246; --aurora-b: 139,92,246;
    --bg-0: #000000; --bg-1: #030308; --bg-2: #060610; --bg-3: #0a0a18;
    --bg-4: #101028; --bg-5: #181840;
    --border-soft: rgba(59,130,246,.05); --border-mid: rgba(59,130,246,.10);
    --border-strong: rgba(59,130,246,.20);
    --text-1: #eef0ff; --text-2: #c0c8ee; --text-3: #6470a0; --text-4: #404868;
}
body[data-accent="red"] {
    --accent: #FF3358; --accent-2: #FF6B85; --accent-rgb: 255,51,88;
    --accent-bg: rgba(255,51,88,.06); --accent-glow: rgba(255,51,88,.45);
    --aurora-a: 255,51,88; --aurora-b: 255,138,61;
    --bg-0: #000000; --bg-1: #030308; --bg-2: #060610; --bg-3: #0a0a18;
    --bg-4: #101028; --bg-5: #181840;
    --border-soft: rgba(255,51,88,.05); --border-mid: rgba(255,51,88,.10);
    --border-strong: rgba(255,51,88,.20);
    --text-1: #ffeef0; --text-2: #eec0c4; --text-3: #a0646e; --text-4: #684046;
}
body[data-accent="white"] {
    --accent: #EAF0FF; --accent-2: #FFFFFF; --accent-rgb: 234,240,255;
    --accent-bg: rgba(255,255,255,.05); --accent-glow: rgba(234,240,255,.30);
    --aurora-a: 234,240,255; --aurora-b: 125,211,252;
    --bg-0: #000000; --bg-1: #030308; --bg-2: #060610; --bg-3: #0a0a18;
    --bg-4: #101028; --bg-5: #181840;
    --border-soft: rgba(255,255,255,.05); --border-mid: rgba(255,255,255,.10);
    --border-strong: rgba(255,255,255,.18);
    --text-1: #f4f4f8; --text-2: #d0d0e0; --text-3: #8888aa; --text-4: #606080;
}
body[data-accent="cyan"] {
    --accent: #00D4FF; --accent-2: #5CE7FF; --accent-rgb: 0,212,255;
    --accent-bg: rgba(0,212,255,.06); --accent-glow: rgba(0,212,255,.45);
    --aurora-a: 0,212,255; --aurora-b: 34,224,200;
    --bg-0: #000000; --bg-1: #030308; --bg-2: #060610; --bg-3: #0a0a18;
    --bg-4: #101028; --bg-5: #181840;
    --border-soft: rgba(0,212,255,.05); --border-mid: rgba(0,212,255,.10);
    --border-strong: rgba(0,212,255,.20);
    --text-1: #eef8fc; --text-2: #c0e4ee; --text-3: #5e8a9e; --text-4: #3e5e6c;
}
body[data-accent="green"] {
    --accent: #16E08A; --accent-2: #5CFFAF; --accent-rgb: 22,224,138;
    --accent-bg: rgba(22,224,138,.06); --accent-glow: rgba(22,224,138,.45);
    --aurora-a: 22,224,138; --aurora-b: 125,211,252;
    --bg-0: #000000; --bg-1: #030308; --bg-2: #060610; --bg-3: #0a0a18;
    --bg-4: #101028; --bg-5: #181840;
    --border-soft: rgba(22,224,138,.05); --border-mid: rgba(22,224,138,.10);
    --border-strong: rgba(22,224,138,.20);
    --text-1: #eefcf2; --text-2: #c0eec8; --text-3: #5e9e6c; --text-4: #3c6c46;
}
body[data-accent="orange"] {
    --accent: #FF8F1F; --accent-2: #FFB65C; --accent-rgb: 255,143,31;
    --accent-bg: rgba(255,143,31,.06); --accent-glow: rgba(255,143,31,.45);
    --aurora-a: 255,143,31; --aurora-b: 255,68,120;
    --bg-0: #000000; --bg-1: #030308; --bg-2: #060610; --bg-3: #0a0a18;
    --bg-4: #101028; --bg-5: #181840;
    --border-soft: rgba(255,143,31,.05); --border-mid: rgba(255,143,31,.10);
    --border-strong: rgba(255,143,31,.20);
    --text-1: #fcf4ee; --text-2: #eedcc0; --text-3: #9e825e; --text-4: #6c563e;
}
body[data-accent="void"] {
    --accent: #A855F7; --accent-2: #D18AFF; --accent-rgb: 168,85,247;
    --accent-bg: rgba(168,85,247,.06); --accent-glow: rgba(168,85,247,.45);
    --aurora-a: 168,85,247; --aurora-b: 236,72,153;
    --bg-0: #000000; --bg-1: #030308; --bg-2: #060610; --bg-3: #0a0a18;
    --bg-4: #101028; --bg-5: #181840;
    --border-soft: rgba(168,85,247,.05); --border-mid: rgba(168,85,247,.10);
    --border-strong: rgba(168,85,247,.20);
    --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: 272px;
}

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(100px); opacity: .4; will-change: transform; }
.bg-orb-1 {
    width: 60vw; height: 60vw; left: -10vw; top: -20vh;
    background: radial-gradient(circle, rgba(var(--aurora-a,59,130,246), .38), transparent 70%);
    animation: orbDrift1 22s var(--ease-io) infinite alternate;
}
.bg-orb-2 {
    width: 50vw; height: 50vw; right: -15vw; top: 30vh;
    background: radial-gradient(circle, rgba(var(--aurora-b,139,92,246), .24), transparent 70%);
    animation: orbDrift2 26s var(--ease-io) infinite alternate;
}
.bg-orb-3 {
    width: 40vw; height: 40vw; left: 30vw; bottom: -10vh;
    background: radial-gradient(circle, rgba(var(--aurora-a,59,130,246), .18), transparent 70%);
    animation: orbDrift3 19s var(--ease-io) infinite alternate;
}
.bg-orb-4 {
    width: 34vw; height: 34vw; right: 10vw; bottom: 5vh;
    background: radial-gradient(circle, rgba(var(--aurora-b,139,92,246), .16), transparent 70%);
    animation: orbDrift2 31s var(--ease-io) infinite alternate-reverse;
}
@keyframes orbDrift1 {
    0%   { transform: translate(0,0) scale(1); }
    100% { transform: translate(6vw,8vh) scale(1.12); }
}
@keyframes orbDrift2 {
    0%   { transform: translate(0,0) scale(1); }
    100% { transform: translate(-7vw,-6vh) scale(.92); }
}
@keyframes orbDrift3 {
    0%   { transform: translate(0,0) scale(1); }
    100% { transform: translate(4vw,-9vh) scale(1.08); }
}
#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(--glass);
    backdrop-filter: blur(var(--glass-blur-md)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur-md)) saturate(var(--glass-sat));
    border-right: 1px solid var(--glass-hairline);
    box-shadow: var(--sh-md);
    z-index: 50;
    overflow-y: auto;
    overflow-x: hidden;
}
    display: flex; flex-direction: column;
    padding: 24px 16px 20px;
    background: var(--glass);
    border-right: 1px solid var(--glass-hairline);
    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: 10px; padding: 9px 12px; border-radius: 12px; color: var(--text-2); font-size: .85rem; font-weight: 500; transition: all .15s ease; position: relative; }
.rail-item:hover { background: rgba(255,255,255,.05); color: var(--text-1); }
.rail-item.active {
    background: linear-gradient(135deg, rgba(var(--accent-rgb),.22), rgba(var(--accent-rgb),.08));
    color: var(--text-1);
    box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb),.30), 0 0 20px rgba(var(--accent-rgb),.18);
}
.rail-item.active .rail-icon { opacity: 1; color: var(--accent-2); filter: drop-shadow(0 0 6px rgba(var(--accent-rgb),.6)); }
.rail-icon { width: 18px; height: 18px; flex-shrink: 0; color: currentColor; display: inline-flex; align-items: center; justify-content: center; opacity: .8; transition: opacity .15s ease, color .15s ease, filter .15s ease; }
.rail-live-icon { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; position: relative; }
/* Static glow + animated opacity (compositor-only) instead of an animated
   spreading box-shadow ring — same "alive" feel, no per-frame repaint. This
   dot appears in many places at once (rail nav, cards, scores rows), so the
   per-instance cost matters. */
.live-pulse { width: 9px; height: 9px; background: #ff2b4d; border-radius: 50%; animation: pulseRed 1.8s ease-in-out infinite; box-shadow: var(--live-glow); will-change: opacity; }
@keyframes pulseRed { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.rail-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--glass-hairline); 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: var(--glass); border: 1px solid var(--glass-hairline); border-radius: 12px; }
.rail-user-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 16px rgba(var(--accent-rgb),.4); 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(--glass);
    backdrop-filter: blur(var(--glass-blur-md)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur-md)) saturate(var(--glass-sat));
    border-bottom: 1px solid var(--glass-hairline);
}
.topbar::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent); opacity: .4; pointer-events: none; box-shadow: 0 0 12px rgba(var(--accent-rgb),.5); }
.tb-menu {
    display: none;
    width: 40px; height: 40px;
    border-radius: var(--r-sm);
    background: var(--glass);
    border: 1px solid var(--glass-hairline);
    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: var(--glass);
    border: 1px solid var(--glass-hairline);
    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), box-shadow var(--dur-fast);
}
.tb-icon-btn:hover, .tb-icon-btn:focus {
    background: rgba(var(--accent-rgb),0.18); color: var(--text-1);
    box-shadow: 0 0 16px rgba(var(--accent-rgb),.30);
}
.tb-icon-btn:focus { box-shadow: inset 0 0 0 1.5px rgba(var(--accent-rgb),.55), 0 0 16px rgba(var(--accent-rgb),.30); }
.tb-icon-btn svg { width: 17px; height: 17px; }

.tb-search {
    position: relative; display: flex; align-items: center;
    width: 280px;
    background: var(--glass);
    backdrop-filter: blur(var(--glass-blur-sm));
    -webkit-backdrop-filter: blur(var(--glass-blur-sm));
    border: 1px solid var(--glass-hairline);
    border-radius: var(--r-pill);
    transition: border-color var(--dur-fast), background var(--dur-fast), width var(--dur-base), box-shadow var(--dur-fast);
}
.tb-search:focus-within {
    background: var(--glass-strong);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.15), 0 0 24px rgba(var(--accent-rgb),.25);
}
.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(--glass-hairline);
    background: var(--glass);
    backdrop-filter: blur(var(--glass-blur-sm));
    -webkit-backdrop-filter: blur(var(--glass-blur-sm));
    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;
    /* No backdrop-filter — a chip row can have a dozen of these. */
    background: var(--glass-strong);
    border: 1px solid var(--glass-hairline);
    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); background: rgba(255,255,255,.07); }
.filter-chip:focus { box-shadow: 0 0 0 2px rgba(var(--accent-rgb),.6); }
.filter-chip.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #000; box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.20), 0 0 22px rgba(var(--accent-rgb),.35); }
.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,.18); }
.ds-arrow { width: 34px; height: 34px; border-radius: 10px; background: var(--glass); border: 1px solid var(--glass-hairline); 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),.16); color: var(--accent); box-shadow: 0 0 14px rgba(var(--accent-rgb),.30); }
.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: var(--glass-strong); border: 1px solid var(--glass-hairline); 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: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #000; border-color: transparent; box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.20), 0 0 24px rgba(var(--accent-rgb),.40); }
.date-pill.active .dp-day, .date-pill.active .dp-num { color: #000; }

/* ============ 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%),
        radial-gradient(ellipse at 85% 20%, rgba(var(--aurora-b,139,92,246),.22), transparent 55%);
    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: var(--live-glow); }
.hero-status-tag.live .live-pulse { background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.7); }
@keyframes pulseWhite {
    0%, 100% { opacity: 1; }
    50%      { opacity: .5; }
}
.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: var(--glass);
    backdrop-filter: blur(var(--glass-blur-sm));
    -webkit-backdrop-filter: blur(var(--glass-blur-sm));
    border: 1px solid var(--glass-hairline);
    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: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #000;
    font-weight: 700; font-size: 0.9rem;
    border-radius: var(--r-pill);
    box-shadow: 0 0 24px rgba(var(--accent-rgb),.35);
    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 34px rgba(var(--accent-rgb),.5);
}
.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: var(--glass);
    backdrop-filter: blur(var(--glass-blur-sm));
    -webkit-backdrop-filter: blur(var(--glass-blur-sm));
    color: var(--text-1); font-weight: 600; font-size: 0.85rem;
    border-radius: var(--r-pill);
    border: 1px solid var(--glass-hairline);
    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: var(--glass-strong);
    backdrop-filter: blur(var(--glass-blur-sm)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur-sm)) saturate(var(--glass-sat));
    border: 1px solid var(--glass-hairline);
    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: 1px solid rgba(var(--accent-rgb),.25);
    box-shadow: 0 0 14px rgba(var(--accent-rgb),.25);
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent-2);
}
.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);
    min-height: var(--card-h, 168px);
    /* No backdrop-filter here on purpose — a rail can show dozens of these
       at once, and blur is a per-instance GPU cost. A solid tinted panel
       (--glass-strong, already used elsewhere for higher-opacity surfaces)
       reads the same at this alpha without the compositing cost. */
    background: var(--glass-strong);
    border: 1px solid rgba(var(--sc-rgb,99,102,241), .30);
    border-top: 2px solid rgba(var(--sc-rgb,99,102,241), .55);
    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;
    box-shadow: var(--card-glow);
}
.ev-card::before {
    content:''; position: absolute; inset: 0;
    background: var(--glass-sheen), radial-gradient(ellipse at 100% 0%, rgba(var(--sc-rgb,99,102,241), .22), transparent 60%);
    z-index: -1;
    opacity: .8;
    pointer-events: none;
}
.ev-card:hover {
    transform: translateY(-4px) scale(1.015);
    border-color: rgba(var(--sc-rgb,99,102,241), .55);
    box-shadow: 0 18px 44px rgba(0,0,0,.5), 0 0 0 1px rgba(var(--sc-rgb,99,102,241),.20), 0 0 44px rgba(var(--sc-rgb,99,102,241), .28);
}
.ev-card:focus {
    transform: translateY(-4px) scale(1.03);
    border-color: var(--accent);
    box-shadow: 0 18px 44px rgba(0,0,0,.55), 0 0 0 3px rgba(var(--accent-rgb), .75), 0 0 50px rgba(var(--accent-rgb), .35);
    z-index: 3;
}
/* Pulse lives on the ::after layer (opacity only) rather than animating the
   card's own box-shadow directly — animating box-shadow forces a full repaint
   of the card (team logos, text, channel pills, backdrop-filter) every frame;
   opacity on a small contentless pseudo-element is compositor-only (GPU),
   no repaint, and looks identical. */
.ev-card-live { border-color: rgba(255,43,77,.55); }
.ev-card-live::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 24px rgba(255,43,77,.22), 0 0 26px 4px rgba(255,43,77,.30);
    pointer-events: none;
    z-index: 1;
    animation: cardLivePulse 2.4s ease-in-out infinite;
    will-change: opacity;
}
@keyframes cardLivePulse {
    0%, 100% { opacity: .55; }
    50%      { opacity: 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;
}
/* Static box-shadow (cheap, painted once) + animated opacity (compositor-only,
   no repaint) instead of animating box-shadow's blur/spread every frame. */
.ev-status-live { background: rgba(255,43,77,.18); color: #ff6b81; box-shadow: 0 0 4px rgba(255,43,77,.9), 0 0 20px rgba(255,43,77,.45), 0 0 40px rgba(255,43,77,.2); animation: statusLivePulse 1.8s ease-in-out infinite; will-change: opacity; }
.ev-status-live .live-dot { width: 6px; height: 6px; background: #ff6b81; box-shadow: 0 0 6px #ff6b81; }
@keyframes statusLivePulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .78; }
}
.ev-status-soon { background: rgba(245,158,11,.15); color: #fbbf24; border: 1px solid rgba(245,158,11,.30); }
.ev-status-ft { background: var(--glass); color: var(--text-3); border: 1px solid var(--glass-hairline); }
.ev-status-ppd { background: var(--glass); color: var(--text-3); border: 1px solid var(--glass-hairline); }

.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: var(--glass);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    border: 1px solid var(--glass-hairline);
}
.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: 76px;            /* 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: var(--glass);
    border: 1px solid var(--glass-hairline);
    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),.18); border-color: rgba(var(--accent-rgb),.35); color: var(--accent-2); font-weight: 600; box-shadow: 0 0 10px rgba(var(--accent-rgb),.25); }
.ch-flag { font-size: 0.74rem; flex-shrink: 0; display: inline-flex; align-items: center; }
.ch-flag-img { width: 16px; height: 12px; object-fit: cover; border-radius: 2px; vertical-align: middle; display: block; }
.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;
    /* No backdrop-filter — two of these exist per card, same repeat-count
       problem as .ev-card itself. */
    background: var(--glass-strong);
    border: 1px solid var(--glass-hairline);
    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), box-shadow 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,.12);
    box-shadow: 0 14px 34px rgba(0,0,0,.4), 0 0 30px rgba(var(--sc-rgb,99,102,241),.20);
    transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base);
    overflow: hidden;
    position: relative;
}
.sport-card::before {
    content: ''; position: absolute; inset: 0;
    background: var(--glass-sheen), radial-gradient(circle at 90% -10%, rgba(255,255,255,.22), transparent 60%);
}
.sport-card:hover, .sport-card:focus {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 20px 44px rgba(0,0,0,.5), 0 0 0 3px rgba(var(--accent-rgb),.55), 0 0 50px rgba(var(--sc-rgb,99,102,241),.4);
}
.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); text-shadow: 0 0 12px rgba(var(--accent-rgb),.6); }
.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: var(--glass);
    backdrop-filter: blur(var(--glass-blur-md)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur-md)) saturate(var(--glass-sat));
    border: 1px solid var(--glass-hairline);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-sm);
    transition: border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast);
    max-width: 880px;
}
.search-big-wrap:focus-within {
    background: var(--glass-strong); border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb),.15), 0 0 34px rgba(var(--accent-rgb),.3);
}
.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-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:
        radial-gradient(ellipse at 50% 0%, rgba(var(--aurora-a,59,130,246),.10), transparent 60%),
        rgba(0,0,0,.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    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(--glass-strong);
    backdrop-filter: blur(var(--glass-blur-lg)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur-lg)) saturate(var(--glass-sat));
    border: 1px solid var(--glass-hairline);
    border-radius: 28px 28px 0 0;
    overflow: hidden auto;
    box-shadow: 0 -8px 50px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.06);
    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: var(--glass-strong); border: 1px solid var(--glass-hairline);
    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); box-shadow: var(--live-glow); }

.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; display: inline-flex; align-items: center; }
.modal-ch-flag .ch-flag-img { width: 22px; height: 16px; }
.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,.72);
    backdrop-filter: blur(14px);
    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(--glass-strong);
    backdrop-filter: blur(var(--glass-blur-lg)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur-lg)) saturate(var(--glass-sat));
    border: 1px solid var(--glass-hairline);
    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;
    /* No backdrop-filter — a category grid can show 10-20 of these at once. */
    background: var(--glass-strong);
    border: 1px solid var(--glass-hairline);
    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-2); flex-shrink: 0; }
.ch-cat-btn:hover, .ch-cat-btn:focus {
    background: rgba(var(--accent-rgb),.16);
    border-color: var(--accent); transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--accent-rgb),.28);
}
.ch-cat-btn:focus { box-shadow: 0 0 0 2px var(--accent), 0 8px 24px rgba(var(--accent-rgb),.28); }

.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: var(--glass);
    border: 1px solid var(--glass-hairline);
    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),.16); 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: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #000; border-color: transparent; box-shadow: 0 0 14px 2px rgba(var(--accent-rgb),.4); animation: tilePlayingPulse 2.2s ease-in-out infinite; will-change: opacity; }
@keyframes tilePlayingPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .85; }
}
.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; }

/* ============ MULTI-VIEWING ============ */
.mv-tabs { display: flex; gap: 6px; padding: 12px 22px 0; }
.mv-tab {
    padding: 8px 16px; border-radius: var(--r-pill);
    background: rgba(255,255,255,.04); color: var(--text-2);
    font-size: 0.82rem; font-weight: 600;
    transition: all var(--dur-fast);
}
.mv-tab:hover, .mv-tab:focus { background: rgba(var(--accent-rgb),.16); color: var(--text-1); }
.mv-tab.active { background: var(--accent); color: #fff; }
.mv-conn-banner {
    margin: 12px 22px 0; padding: 8px 14px;
    background: rgba(var(--accent-rgb),.12); border: 1px solid rgba(var(--accent-rgb),.25);
    border-radius: var(--r-sm); color: var(--text-2); font-size: 0.78rem; font-weight: 500;
}
.mv-conn-banner.warn { background: rgba(255,176,32,.14); border-color: rgba(255,176,32,.4); color: #FFD8A0; }
.ch-channel-tile.mv-tile { position: relative; }
.ch-channel-tile.mv-selected { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #000; border-color: transparent; }
.ch-channel-tile.mv-disabled { opacity: .4; pointer-events: none; }
/* Multi-View reuses the All-Channels tile classes above, but its labels (event
   matchups, "Boxing: A vs B") run much longer than a channel name like "ESPN"
   — wider columns + 2-line wrap instead of the single-line ellipsis truncation. */
.ch-channel-grid.mv-ch-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.mv-ch-grid .ch-channel-tile { align-items: flex-start; min-height: 52px; }
.mv-ch-grid .ch-channel-name {
    white-space: normal; overflow: visible; text-overflow: clip;
    line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.mv-tile-check {
    margin-left: auto; width: 18px; height: 18px; flex-shrink: 0;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 800; color: #fff;
    background: rgba(0,0,0,.25);
}
.mv-picker-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 22px; border-top: 1px solid var(--border-soft);
    background: var(--bg-2);
}
.mv-selected-count { font-size: 0.8rem; color: var(--text-3); font-weight: 600; }
.mv-start-btn {
    padding: 10px 22px; border-radius: var(--r-sm);
    background: var(--accent); color: #fff;
    font-weight: 700; font-size: 0.86rem;
    transition: all var(--dur-fast);
}
.mv-start-btn:hover, .mv-start-btn:focus { background: var(--accent-2); }
.mv-start-btn:disabled { opacity: .4; pointer-events: none; }

.mv-grid-overlay {
    position: fixed; inset: 0; z-index: 260;
    background: #000;
    display: flex; flex-direction: column;
}
.mv-grid-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; background: rgba(0,0,0,.6);
}
.mv-grid-title { font-family: var(--font-display); font-weight: 700; color: var(--text-1); font-size: 1.05rem; }
.mv-grid-close {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255,255,255,.08); color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
}
.mv-grid-close:hover, .mv-grid-close:focus { background: var(--live); color: #fff; }
.mv-grid-close svg { width: 15px; height: 15px; }
.mv-grid-tiles {
    flex: 1; display: grid; gap: 3px; padding: 3px;
    grid-template-columns: 1fr; grid-template-rows: 1fr;
}
.mv-grid-tiles.mv-grid-count-2 { grid-template-columns: 1fr 1fr; }
.mv-grid-tiles.mv-grid-count-3, .mv-grid-tiles.mv-grid-count-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.mv-tile-player {
    position: relative; background: #000; overflow: hidden;
    border: 2px solid transparent; border-radius: var(--r-sm);
    cursor: pointer;
}
.mv-tile-player.focused { border-color: var(--accent); box-shadow: 0 0 20px rgba(var(--accent-rgb),.35); }
.mv-tile-player .video-js,
.mv-tile-player .vjs-tech,
.mv-tile-player video {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
}
.mv-tile-header {
    position: absolute; top: 0; left: 0; right: 0; z-index: 2;
    display: flex; align-items: center; gap: 6px;
    padding: 8px 10px;
    background: linear-gradient(to bottom, rgba(0,0,0,.75) 0%, rgba(0,0,0,.4) 60%, transparent 100%);
}
.mv-tile-name {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text-1); font-size: 0.8rem; font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,.8);
}
.mv-tile-mute-btn, .mv-tile-close-btn {
    width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
    background: rgba(255,255,255,.14); color: var(--text-1);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--dur-fast);
}
.mv-tile-mute-btn svg, .mv-tile-close-btn svg { width: 12px; height: 12px; }
.mv-tile-mute-btn:hover, .mv-tile-mute-btn:focus { background: rgba(var(--accent-rgb),.5); }
.mv-tile-close-btn:hover, .mv-tile-close-btn:focus { background: var(--live); color: #fff; }
.mv-tile-error {
    position: absolute; inset: 0; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    text-align: center; padding: 20px;
    color: var(--text-3); font-size: 0.8rem; font-weight: 600;
    background: var(--bg-1);
    pointer-events: none;
}

/* ============ 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,.60);
    backdrop-filter: blur(14px);
    animation: fadeIn .25s ease;
}
.settings-sheet {
    position: absolute; top: 0; right: 0;
    width: 100%; max-width: 480px; height: 100vh;
    background: var(--glass-strong);
    backdrop-filter: blur(var(--glass-blur-lg)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur-lg)) saturate(var(--glass-sat));
    border-left: 1px solid var(--glass-hairline);
    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(var(--glass-blur-md)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur-md)) saturate(var(--glass-sat));
    border-bottom: 1px solid var(--glass-hairline);
}
.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: var(--glass);
    backdrop-filter: blur(var(--glass-blur-sm));
    -webkit-backdrop-filter: blur(var(--glass-blur-sm));
    border: 1px solid var(--glass-hairline);
    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),.14); color: var(--text-1); box-shadow: 0 0 18px rgba(var(--accent-rgb),.25); }
.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 16px var(--ac), inset 0 1px 0 rgba(255,255,255,.3);
}
.accent-btn:hover { transform: scale(1.15); box-shadow: 0 0 22px var(--ac), inset 0 1px 0 rgba(255,255,255,.3); }
.accent-btn:focus { box-shadow: 0 0 0 3px #fff, 0 0 24px var(--ac); }
.accent-btn.active {
    border-color: #fff; transform: scale(1.15);
    box-shadow: 0 0 0 4px var(--ac), 0 0 36px 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,.70); backdrop-filter: blur(14px);
    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(--glass-strong);
    backdrop-filter: blur(var(--glass-blur-lg)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur-lg)) saturate(var(--glass-sat));
    border: 1px solid var(--glass-hairline);
    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(--glass-strong);
    backdrop-filter: blur(var(--glass-blur-lg)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur-lg)) saturate(var(--glass-sat));
    border: 1px solid var(--glass-hairline);
    border-radius: var(--r-md);
    overflow: hidden;
    z-index: 210;
    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(--glass-strong);
    backdrop-filter: blur(var(--glass-blur-md)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur-md)) saturate(var(--glass-sat));
    border: 1px solid var(--glass-hairline);
    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,.5); color: #B8FFE0; box-shadow: var(--sh-md), 0 0 24px rgba(34,224,154,.25); }
.toast.success svg { color: var(--success); }
.toast.error { border-color: rgba(255,43,77,.5); color: #FFB6C0; box-shadow: var(--sh-md), 0 0 24px rgba(255,43,77,.25); }
.toast.error svg { color: var(--live); }
.toast.info svg { color: var(--accent-2); }
@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(var(--glass-blur-lg)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur-lg)) saturate(var(--glass-sat));
    border: 1px solid var(--glass-hairline);
    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.06);
    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), text-shadow 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), filter var(--dur-fast); }
.tab-btn.active { color: var(--accent-2); }
.tab-btn.active svg { stroke-width: 2.4; transform: scale(1.1); filter: drop-shadow(0 0 6px rgba(var(--accent-rgb),.7)); }
.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,.60); backdrop-filter: blur(var(--glass-blur-md)); animation: fadeIn .25s ease; }
.qe-drawer {
    position: absolute; right: 0; top: 0;
    width: 100%; max-width: 540px; height: 100vh;
    background: var(--glass-strong);
    backdrop-filter: blur(var(--glass-blur-lg)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur-lg)) saturate(var(--glass-sat));
    border-left: 1px solid var(--glass-hairline);
    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: 14px; }
body.is-tv .rail { width: 240px; }
body.is-tv .app { grid-template-columns: 240px 1fr; }
body.is-tv .tb-title { font-size: 1.05rem; }
body.is-tv .topbar { height: 48px; gap: 8px; padding: 0 14px; }
body.is-tv .date-pill { padding: 3px 9px; min-width: 42px; }
body.is-tv .dp-num { font-size: .9rem; }
body.is-tv .dp-day { font-size: .5rem; }
body.is-tv .ds-arrow { width: 24px; height: 24px; }
body.is-tv .tb-menu { width: 30px; height: 30px; }
body.is-tv .tb-icon-btn { width: 30px; height: 30px; }
body.is-tv .tb-search { width: 160px; }
body.is-tv .tb-search-input { height: 28px; font-size: .7rem; }
body.is-tv .filter-chip { padding: 4px 10px; font-size: .65rem; }
body.is-tv .rails { padding: 8px 14px 0; gap: 18px; }
body.is-tv .rail-head-title { font-size: .85rem; }
body.is-tv .ev-card { --card-w: 230px; --card-h: 180px; padding: 12px; gap: 6px; }
body.is-tv .ev-team-logo, .is-tv .ev-team-ph { width: 42px; height: 42px; }
body.is-tv .ev-team-label { font-size: .62rem; }
body.is-tv .ev-league-row { font-size: .6rem; }
/* 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; min-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; min-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; min-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-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; min-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(var(--glass-blur-md)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur-md)) saturate(var(--glass-sat));
    border-bottom: 1px solid var(--glass-hairline);
}
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(--glass);
    backdrop-filter: blur(var(--glass-blur-sm)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur-sm)) saturate(var(--glass-sat));
    border: 1px solid var(--glass-hairline);
    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(--glass-hairline);
}
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;
}

/* ---- Status page ---- */
.status-page { max-width: 1100px; margin: 0 auto; padding: 28px; display: flex; flex-direction: column; gap: 24px; }
.status-banner {
    display: flex; align-items: center; gap: 16px;
    padding: 20px 24px; border-radius: var(--r-xl);
    background: var(--glass-strong);
    backdrop-filter: blur(var(--glass-blur-lg)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur-lg)) saturate(var(--glass-sat));
    border: 1px solid var(--glass-hairline);
    box-shadow: var(--sh-lg);
}
.status-banner-dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; }
.status-banner-text { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--text-1); }
.status-banner-sub { font-size: 0.82rem; color: var(--text-3); margin-top: 2px; }
.status-banner-ok .status-banner-dot { background: var(--success); box-shadow: 0 0 4px var(--success), 0 0 22px rgba(34,224,154,.55); }
.status-banner-degraded .status-banner-dot { background: var(--warn); box-shadow: 0 0 4px var(--warn), 0 0 22px rgba(255,176,32,.55); }
.status-banner-down .status-banner-dot { background: var(--live); box-shadow: var(--live-glow); animation: statusLivePulse 1.8s ease-in-out infinite; }

#statusGroups { display: flex; flex-direction: column; gap: 18px; }
.status-group { padding: 20px; }
.status-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.status-card {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border-radius: var(--r-md);
    background: var(--glass);
    border: 1px solid rgba(34,224,154,.25);
    box-shadow: 0 0 16px rgba(34,224,154,.10);
}
.status-card-fail { border-color: rgba(255,43,77,.35); box-shadow: 0 0 16px rgba(255,43,77,.18); }
.status-card-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-card-fail .status-card-dot { background: var(--live); box-shadow: var(--live-glow); }
.status-card-body { flex: 1; min-width: 0; }
.status-card-label { font-size: 0.84rem; font-weight: 600; color: var(--text-1); }
.status-card-detail { font-size: 0.72rem; color: var(--text-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-card-latency { font-size: 0.68rem; color: var(--text-4); font-family: var(--font-display); flex-shrink: 0; }

/* ---- Health bar (24h history, green/yellow/red segments) ---- */
.status-healthbar { display: flex; gap: 2px; height: 36px; margin-top: 8px; }
.status-hb-seg { flex: 1; border-radius: 3px; min-width: 2px; cursor: default; transition: transform .1s ease; }
.status-hb-seg:hover { transform: scaleY(1.12); }
.status-hb-ok { background: var(--success); box-shadow: 0 0 6px rgba(34,224,154,.4); }
.status-hb-degraded { background: var(--warn); box-shadow: 0 0 6px rgba(255,176,32,.4); }
.status-hb-down { background: var(--live); box-shadow: 0 0 6px rgba(255,43,77,.4); }
.status-hb-unknown { background: var(--glass); border: 1px dashed var(--glass-hairline); box-shadow: none; }
.status-healthbar-labels { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-4); margin-top: 4px; }

/* ---- Admin System Health tab ---- */
.health-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.health-controls select { background: var(--glass); border: 1px solid var(--glass-hairline); color: var(--text-1);
    border-radius: var(--r-sm); padding: 7px 10px; font-size: 0.82rem; }
.health-toggle { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-3); }
.health-table-wrap { max-height: 480px; overflow-y: auto; border: 1px solid var(--glass-hairline); border-radius: var(--r-md); }
.health-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.health-table th { position: sticky; top: 0; background: var(--bg-2, #111); text-align: left; padding: 8px 10px;
    color: var(--text-3); font-weight: 600; border-bottom: 1px solid var(--glass-hairline); }
.health-table td { padding: 7px 10px; border-bottom: 1px solid var(--glass-hairline); color: var(--text-2); }
.health-row-fail { background: rgba(255,43,77,.08); }
.health-row-fail td:nth-child(4) { color: var(--live); font-weight: 700; }
.health-log-output { max-height: 480px; overflow: auto; background: rgba(0,0,0,.35); border: 1px solid var(--glass-hairline);
    border-radius: var(--r-md); padding: 12px 14px; font-size: 0.74rem; line-height: 1.5; white-space: pre-wrap; word-break: break-all; color: var(--text-2); }

/* ---- Analytics tab ---- */
.az-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px; padding: 0 24px 18px;
}
.az-stat {
    position: relative; overflow: hidden;
    background: var(--glass); border: 1px solid var(--border-soft); border-radius: var(--r-lg);
    padding: 18px 16px; text-align: center;
    transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast);
}
.az-stat:hover { border-color: var(--accent-ghost); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.18); }
.az-stat-accent { border-color: var(--accent-ghost); }
.az-stat-pulse .az-stat-value { animation: azPulse 2s ease-in-out infinite; }
@keyframes azPulse { 0%,100%{opacity:1} 50%{opacity:0.7} }
.az-stat-value {
    font-family: var(--font-display); font-weight: 800; font-size: 1.85rem;
    color: var(--text-1); font-variant-numeric: tabular-nums; line-height: 1.15;
    position: relative; z-index: 1;
}
.az-stat-label {
    font-size: 0.7rem; font-weight: 600; color: var(--text-3); margin-top: 5px;
    text-transform: uppercase; letter-spacing: 0.06em; position: relative; z-index: 1;
}

/* Source pills */
.az-sources {
    display: flex; flex-wrap: wrap; gap: 8px; padding: 0 24px 18px;
}
.az-source-pill {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--glass); border: 1px solid var(--border-soft); border-radius: var(--r-pill);
    padding: 5px 14px; font-size: 0.74rem; font-weight: 600; color: var(--text-2);
    transition: border-color var(--dur-fast), transform var(--dur-fast);
}
.az-source-pill:hover { border-color: var(--accent-ghost); transform: translateY(-1px); }
.az-source-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.az-source-name { color: var(--text-1); letter-spacing: 0.03em; }
.az-source-views { color: var(--text-3); font-weight: 500; }
.az-source-pct {
    font-family: var(--font-display); font-weight: 700;
    color: var(--accent, var(--text-2)); font-size: 0.78rem;
}

/* Per-version cards grid */
.az-versions-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px; padding: 0 24px 20px;
}
.az-version-card {
    background: var(--glass); border: 1px solid var(--border-soft); border-radius: var(--r-lg);
    padding: 16px 18px 14px;
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.az-version-card:hover {
    border-color: var(--accent-ghost);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
.az-version-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
    padding-bottom: 10px; border-bottom: 1px solid var(--border-soft);
}
.az-version-header h3 { font-size: 0.86rem; font-weight: 700; color: var(--text-1); margin: 0; }
.az-version-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.az-version-badge {
    margin-left: auto; font-size: 0.64rem; font-weight: 700;
    background: var(--glass-strong); color: var(--text-4);
    padding: 3px 8px; border-radius: var(--r-pill);
    text-transform: uppercase; letter-spacing: 0.05em;
    border: 1px solid var(--border-soft);
}
.az-version-metrics {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
    margin-bottom: 12px;
}
.az-vm { text-align: center; }
.az-vm-val {
    font-family: var(--font-display); font-weight: 800; font-size: 1.2rem;
    color: var(--text-1); font-variant-numeric: tabular-nums;
}
.az-vm-lbl {
    font-size: 0.6rem; font-weight: 600; color: var(--text-4);
    text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px;
}
.az-version-detail { display: flex; flex-direction: column; gap: 5px; }
.az-vt-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.7rem; color: var(--text-3);
}
.az-vt-label {
    font-weight: 600; color: var(--text-4); min-width: 80px;
    text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.62rem;
}
.az-vt-chip {
    display: inline-block; background: var(--glass-strong);
    border: 1px solid var(--border-soft); border-radius: var(--r-sm);
    padding: 2px 8px; font-weight: 600; color: var(--text-2);
    margin-right: 4px; white-space: nowrap; font-size: 0.69rem;
}
.az-vt-muted { color: var(--text-4); font-style: italic; }

/* Bar lists */
.az-bar-list { display: flex; flex-direction: column; gap: 10px; }
.az-bar-row {
    display: grid; grid-template-columns: minmax(100px,170px) 1fr 48px; align-items: center; gap: 10px;
    padding: 2px 0;
}
.az-bar-label {
    font-size: 0.8rem; font-weight: 600; color: var(--text-1);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.az-rank {
    font-family: var(--font-display); font-size: 0.66rem; font-weight: 700;
    color: var(--text-4); min-width: 16px; text-align: center;
}
.az-bar-live-dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
    background: var(--live); box-shadow: var(--live-glow);
    animation: statusLivePulse 1.8s ease-in-out infinite;
}
.az-bar-sub { display: block; font-size: 0.66rem; font-weight: 500; color: var(--text-3); margin-top: 1px; }
.az-bar-track {
    height: 12px; border-radius: var(--r-pill); background: var(--glass);
    border: 1px solid var(--border-soft); overflow: hidden;
}
.az-bar-fill {
    height: 100%; min-width: 3px; border-radius: var(--r-pill);
    transition: width var(--dur-slow) var(--ease-out);
    position: relative;
}
.az-bar-fill-glow::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.15) 0%, transparent 60%);
    border-radius: var(--r-pill);
}
.az-bar-value {
    font-family: var(--font-display); font-size: 0.76rem; color: var(--text-2);
    text-align: right; font-variant-numeric: tabular-nums; font-weight: 700;
}

/* Hourly chart */
.az-card-wide { grid-column: 1 / -1; }
.az-hourly-wrap { position: relative; }
.az-hourly {
    display: flex; align-items: flex-end; gap: 4px; height: 140px; padding: 8px 4px 0;
}
.az-hbar-col {
    flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center;
    justify-content: flex-end; position: relative; cursor: pointer;
}
.az-hbar {
    width: 70%; min-height: 4px; border-radius: var(--r-xs) var(--r-xs) 0 0;
    background: var(--accent); transition: height var(--dur-slow) var(--ease-out), background var(--dur-fast);
}
.az-hbar-col:hover .az-hbar {
    background: var(--accent-2, var(--accent)); filter: brightness(1.3);
}
.az-tooltip {
    position: fixed; z-index: 200; pointer-events: none; display: none;
    background: var(--glass-strong); border: 1px solid var(--glass-hairline); border-radius: var(--r-sm);
    padding: 6px 12px; font-size: 0.73rem; color: var(--text-1); white-space: nowrap;
    backdrop-filter: blur(var(--glass-blur-sm)); box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.az-tooltip b { color: var(--accent, var(--text-2)); font-weight: 600; }

/* ---- 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: var(--glass);
    border: 1px solid var(--glass-hairline);
    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: var(--glass-strong);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.15), 0 0 20px rgba(var(--accent-rgb),.2);
}
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(--glass-strong);
    backdrop-filter: blur(var(--glass-blur-md)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur-md)) saturate(var(--glass-sat));
    border: 1px solid var(--glass-hairline);
    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: var(--glass);
    border: 1px solid var(--glass-hairline);
    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: 9px 12px; gap: 10px; }

    /* 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-rgb is set inline on the ancestor .ev-card and inherits down —
       no per-element inline style needed here. */
    background: rgba(var(--sc-rgb,99,102,241), .16);
    color: rgb(var(--sc-rgb,99,102,241));
    font-size: 11px; font-weight: 700;
}

/* Score-row layout (was 16 bare inline-styled elements, zero class hooks) */
.sc-card { padding-bottom: 10px; }
.sc-live-badge { font-size: 10px; margin-left: 6px; vertical-align: middle; }
.live-pulse-sm { width: 8px; height: 8px; display: inline-block; margin-right: 4px; }
.state-msg-icon-sm { font-size: 2rem; }
.sc-body {
    padding: 2px 14px 0; display: flex; flex-direction: column; gap: 4px;
}
.sc-row {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.sc-team {
    display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
}
.sc-team-logo { width: 26px; height: 26px; font-size: 11px; }
.sc-team-name {
    font-size: 14px; font-weight: 600; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.sc-score {
    font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums;
    min-width: 30px; text-align: right;
}
.sc-team-name.sc-score-winner, .sc-score.sc-score-winner {
    color: var(--success);
    text-shadow: 0 0 12px rgba(34,224,154,.35);
}


.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%; }
}


