/* ═══════════════════════════════════════════════════════════════
   AURA STREAM — Design System v3.0
   Modern Minimal Dark • Outfit Font • #ff1f5a Accent
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* ── Core Backgrounds ── */
    --bg-base:    #07070f;
    --bg-surface: #0e0e1c;
    --bg-card:    #12121f;
    --bg-elevated:#181828;
    --bg-hover:   #1c1c30;

    /* ── Accent (red-pink) ── */
    --accent-primary:   #ff1f5a;
    --accent-secondary: #ff5c38;
    --accent-gradient:  linear-gradient(135deg, #ff1f5a 0%, #ff5c38 100%);
    --accent-glow:      rgba(255, 31, 90, 0.25);
    --accent-subtle:    rgba(255, 31, 90, 0.10);
    --accent-border:    rgba(255, 31, 90, 0.30);

    /* ── Text ── */
    --text-primary: #eeeeff;
    --text-secondary: #9b9bbf;
    --text-muted:   #5a5a7a;

    /* ── Borders ── */
    --border:       rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(255, 31, 90, 0.35);

    /* ── Status ── */
    --ok:   #22d3a0;
    --warn: #f59e0b;
    --err:  #f45b69;

    /* ── Easings ── */
    --ease:        cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-out:    cubic-bezier(0.0, 0, 0.2, 1);

    /* ── Radii ── */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 20px;
    --r-pill: 999px;

    /* ── Player Vars (kept for JS compat) ── */
    --ac:  #ff1f5a;
    --ac2: #ff5c38;
    --acg: rgba(255, 31, 90, 0.28);
    --bg0: #07070f;
    --bg1: #0e0e1c;
    --bg2: #12121f;
    --bgc: #181828;
    --t1:  #eeeeff;
    --t2:  #9b9bbf;
    --t3:  #44445a;
    --br:  rgba(255, 255, 255, 0.06);
    --bra: rgba(255, 31, 90, 0.35);
    --ok:  #22d3a0;
    --warn:#f59e0b;
    --err: #f45b69;
}

/* ── Reset & Base ── */
*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   APP LAYOUT & VIEWS
   ═══════════════════════════════════════════════════════════════ */
.app-container {
    width: 100vw; height: 100vh;
    overflow: hidden;
    position: relative;
    background: var(--bg-base);
}

.view {
    position: absolute; inset: 0;
    display: none;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.4s var(--ease);
}
.view.active {
    display: flex;
    opacity: 1;
}

/* ── Focus States (Smart TV) ── */
.focusable {
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
    outline: none !important;
}
.focusable:focus, .focusable.focused {
    transform: scale(1.05);
    box-shadow: 0 0 0 4px #fca311, 0 10px 30px rgba(0,0,0,0.5);
    z-index: 50;
}

/* ═══════════════════════════════════════════════════════════════
   HOME VIEW
   ═══════════════════════════════════════════════════════════════ */
.spotlight {
    position: absolute; top: -20%; left: 30%;
    width: 80vw; height: 80vh;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 60%);
    pointer-events: none; z-index: 0;
}
.home-top {
    display: flex; justify-content: space-between; align-items: center;
    padding: 40px 60px; z-index: 10;
}
.home-logo {
    font-size: 32px; color: #fff;
    display: flex; align-items: baseline;
}
.home-user {
    display: flex; align-items: center; gap: 20px;
}
.icon-btn {
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
    color: #fff; display: flex; align-items: center; justify-content: center;
    cursor: pointer; backdrop-filter: blur(10px);
}
.icon-btn.active {
    background: rgba(255,255,255,0.2); border-color: #fff;
}
.user-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255,255,255,0.1); overflow: hidden;
    cursor: pointer; border: 2px solid transparent;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.home-cards-wrapper {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 0 60px; z-index: 10;
}
.home-cards {
    display: flex; gap: 40px; align-items: center; justify-content: center;
    max-width: 1400px; width: 100%;
}
.h-card {
    flex: 1; aspect-ratio: 16/10;
    background: rgba(30,35,45,0.4);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px; padding: 40px;
    display: flex; flex-direction: column; justify-content: center;
    text-align: left; cursor: pointer; position: relative;
    backdrop-filter: blur(20px); overflow: hidden;
}
.h-card .hc-glow {
    position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(252,163,17,0.15) 0%, transparent 50%);
    opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.h-card:focus .hc-glow, .h-card:hover .hc-glow { opacity: 1; }
.h-card:focus, .h-card.focused {
    background: rgba(40,45,55,0.6);
    border-color: rgba(252,163,17,0.5);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 0 4px rgba(252,163,17,1);
    transform: translateY(-10px) scale(1.05);
}
.hc-title { font-size: 36px; font-weight: 600; color: #fff; margin-bottom: auto; }
.hc-count { font-size: 16px; color: #fff; margin-bottom: 8px; font-weight: 500; }
.hc-update { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.hc-icon {
    position: absolute; right: 40px; top: 50%; transform: translateY(-50%);
    width: 100px; height: 100px; color: rgba(255,255,255,0.8);
}
.h-card:focus .hc-icon, .h-card.focused .hc-icon { color: #fca311; }

.home-bottom {
    display: flex; justify-content: space-between; align-items: flex-end;
    padding: 40px 60px; z-index: 10;
}
.icon-text-btn {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
    color: #fff; padding: 12px 24px; border-radius: 30px; font-size: 16px;
    cursor: pointer; backdrop-filter: blur(10px);
}
.hb-right { display: flex; align-items: center; gap: 30px; }
.hb-time { font-size: 32px; font-weight: 300; color: #fff; }
.hb-weather { text-align: right; }
.hb-loc { font-size: 18px; font-weight: 600; color: #fff; }
.hb-hum { font-size: 13px; color: var(--text-muted); }
.hb-temp { font-size: 24px; font-weight: 600; color: #fff; display: flex; align-items: center; gap: 8px; }


/* ═══════════════════════════════════════════════════════════════
   BROWSER VIEW (4 Columns)
   ═══════════════════════════════════════════════════════════════ */
#view-browser { flex-direction: row; }
.b-col-nav {
    width: 100px; background: rgba(0,0,0,0.3);
    display: flex; flex-direction: column; align-items: center;
    padding: 40px 0; gap: 30px; border-right: 1px solid rgba(255,255,255,0.05);
}
.b-col-cat {
    width: 320px; background: rgba(15,18,25,0.9);
    display: flex; flex-direction: column; border-right: 1px solid rgba(255,255,255,0.05);
}
.b-col-ch {
    width: 400px; background: rgba(20,24,32,0.9);
    display: flex; flex-direction: column;
}
.b-col-preview {
    flex: 1; position: relative; background: #000;
}

.b-header {
    padding: 40px 30px 20px; font-size: 24px; font-weight: 600; color: #fff;
}
.b-list {
    flex: 1; overflow-y: auto; padding: 0 20px 40px; display: flex; flex-direction: column; gap: 10px;
}
.b-list::-webkit-scrollbar { display: none; }

/* Category Item */
.b-cat-item {
    display: flex; align-items: center; gap: 16px; padding: 16px 20px;
    border-radius: 16px; cursor: pointer; color: var(--text-secondary);
    border: 2px solid transparent; background: transparent; font-size: 16px;
    transition: all 0.2s; text-align: left;
}
.b-cat-item:focus, .b-cat-item.focused {
    border-color: #fff; color: #fff; transform: scale(1.02); z-index: 10;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Channel Item (Horizontal Card) */
.b-ch-item {
    display: flex; align-items: center; gap: 16px; padding: 16px;
    background: rgba(255,255,255,0.03); border: 2px solid transparent;
    border-radius: 16px; cursor: pointer; transition: all 0.2s;
    text-align: left;
}
.b-ch-item:focus, .b-ch-item.focused {
    border-color: #fca311; background: rgba(255,255,255,0.08);
    transform: scale(1.02); z-index: 10;
}
.b-ch-logo { width: 60px; height: 60px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; flex-shrink: 0;}
.b-ch-info { flex: 1; overflow: hidden; }
.b-ch-name { font-size: 16px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-ch-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.b-ch-badges { display: flex; gap: 6px; margin-top: 8px; }
.b-ch-badge {
    font-size: 9px; font-weight: 700; background: rgba(255,255,255,0.1);
    color: #fff; padding: 2px 6px; border-radius: 4px;
}

/* Preview Column */
.b-top-right {
    position: absolute; top: 40px; right: 60px; z-index: 20;
    display: flex; align-items: center; color: #fff;
}
.preview-content {
    position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
}
.pc-bg {
    position: absolute; inset: 0; background-size: cover; background-position: center;
    transition: background-image 0.4s;
}
.pc-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    background-color: rgba(0,0,0,0.2);
}
.pc-info {
    position: relative; z-index: 10; padding: 60px; padding-bottom: 120px; max-width: 800px;
}
.pc-badge { color: #ff1f5a; background: rgba(255,31,90,0.15); display: inline-block; padding: 4px 12px; border-radius: 4px; font-size: 14px; font-weight: 700; margin-bottom: 16px; }
.pc-title { font-size: 48px; font-weight: 700; color: #fff; margin-bottom: 16px; line-height: 1.1; }
.pc-desc { font-size: 16px; color: rgba(255,255,255,0.7); line-height: 1.5; margin-bottom: 30px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pc-prog { margin-bottom: 20px; }
.pc-prog-bar { height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.pc-prog-fill { height: 100%; background: #fff; }
.pc-prog-times { display: flex; justify-content: space-between; font-size: 13px; color: rgba(255,255,255,0.5); }

.pc-controls {
    position: absolute; bottom: 60px; left: 60px; z-index: 10;
    display: flex; gap: 20px; align-items: center;
}
.pc-play-btn { width: 64px; height: 64px; background: rgba(255,255,255,0.2); }
.pc-play-btn:focus, .pc-play-btn.focused { background: #fca311; border-color: #fca311; }
.pc-bottom-right {
    position: absolute; bottom: 60px; right: 60px; z-index: 10;
    display: flex; gap: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   PLAYER MODAL & HUD (Playbox Style)
   ═══════════════════════════════════════════════════════════════ */
.player-modal {
    position: fixed; inset: 0; background: #000;
    z-index: 2000; display: none; flex-direction: column;
    opacity: 0; transition: opacity 0.22s var(--ease);
}
.player-modal.active { display: flex; opacity: 1; }

.pm-header {
    position: absolute; top: 40px; left: 40px; z-index: 2010;
}
.pm-back {
    background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.2);
    color: #fff; width: 48px; height: 48px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}

.pw { flex: 1; position: relative; background: #000; overflow: hidden; width: 100vw; height: 100vh; }
#vid { width: 100%; height: 100%; object-fit: contain; background: #000; }

.p-loading {
    position: absolute; inset: 0; display: none;
    flex-direction: column; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.8); z-index: 3;
}
.p-loading.show { display: flex; }
.spin { width: 42px; height: 42px; border: 3px solid rgba(255,255,255,0.1); border-top-color: #fca311; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Playbox HUD Overlay */
.p-ov {
    position: absolute; inset: 0; pointer-events: none;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 60px;
    background: radial-gradient(circle at center, transparent 40%, rgba(0,0,0,0.6) 100%);
    opacity: 0; transition: opacity 0.3s; z-index: 4;
}
.pw:hover .p-ov.hc, .p-ov.always { opacity: 1; pointer-events: all; }

/* Top HUD */
.hud-top {
    display: flex; justify-content: space-between; color: #fff;
}
.hud-weather { display: flex; align-items: center; }
.hud-time-container { text-align: right; }

/* Bottom HUD */
.hud-bottom {
    display: flex; justify-content: space-between; align-items: flex-end; color: #fff; margin-bottom: 20px;
}
.hud-ch-info { display: flex; align-items: center; gap: 24px; }
.hud-logo-box {
    width: 140px; height: 140px; background: #fff; border-radius: 16px;
    display: flex; align-items: center; justify-content: center; padding: 10px;
}
.hud-logo-box img { width: 100%; height: 100%; object-fit: contain; }
.hud-ch-text { display: flex; flex-direction: column; }
.hud-ch-num { font-size: 48px; font-weight: 700; line-height: 1; margin-bottom: 8px; }
.hud-ch-name { font-size: 28px; font-weight: 600; margin-bottom: 12px; }
.hud-ch-meta { font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.5; }

.hud-epg-info { width: 500px; }
.hud-epg-top { display: flex; justify-content: space-between; margin-bottom: 20px; }
.badge-n { background: #ff1f5a; color: #fff; padding: 4px 12px; border-radius: 4px; font-weight: 600; font-size: 12px; }
.badge-via { background: rgba(255,255,255,0.2); color: #fff; padding: 4px 12px; border-radius: 4px; font-weight: 600; font-size: 12px; }

.hud-epg-rows { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.hud-epg-row { display: flex; align-items: center; gap: 20px; color: rgba(255,255,255,0.6); font-size: 14px; }
.hud-epg-row.current { color: #fff; font-size: 16px; font-weight: 500; }
.hud-epg-row .time { background: rgba(255,255,255,0.1); padding: 4px 12px; border-radius: 4px; }

.hud-epg-prog { height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; margin-bottom: 24px; }
.hud-epg-prog .fill { height: 100%; background: #ff1f5a; border-radius: 2px; }

.hud-indicators { display: flex; gap: 24px; font-size: 13px; font-weight: 500; }
.hud-indicators span { display: flex; align-items: center; gap: 8px; }
.ind-dot { width: 10px; height: 10px; border-radius: 50%; }

.hud-stats { display: flex; align-items: center; font-size: 12px; color: rgba(255,255,255,0.5); }
.stat-bar { width: 100px; height: 3px; background: rgba(255,255,255,0.1); border-radius: 2px; display: inline-block; margin: 0 8px; vertical-align: middle; }
.stat-bar div { height: 100%; background: #3498db; border-radius: 2px; }

/* Keep watermarks hidden in new layout unless needed */
.watermark { display: none; }

/* Empty state */
.p-empty {
    position: absolute; inset: 0; display: flex;
    flex-direction: column; align-items: center; justify-content: center;
    gap: 14px; color: var(--text-muted); background: #000; z-index: 2;
}
.p-ei { font-size: 64px; opacity: 0.08; }
.p-et { font-size: 17px; font-weight: 700; opacity: 0.35; }
.p-es { font-size: 13px; opacity: 0.25; text-align: center; max-width: 240px; }

/* ═══════════════════════════════════════════════════════════════
   MODALS — FIFA Schedule / EPG / PIN
   ═══════════════════════════════════════════════════════════════ */
.ms-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.78);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    z-index: 3000; display: none;
    align-items: center; justify-content: center;
    padding: 20px;
    animation: modal-in 0.25s var(--ease-out);
}
.ms-modal.active { display: flex; }
@keyframes modal-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.ms-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    border-radius: 24px;
    width: 820px; max-width: 100%; max-height: 90vh;
    display: flex; flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7);
    overflow: hidden;
    animation: dialog-in 0.3s var(--ease-spring);
}
@keyframes dialog-in {
    from { opacity: 0; transform: scale(0.96) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.ms-hdr {
    padding: 22px 28px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(0,0,0,0.25);
}
.ms-title {
    font-size: 18px; font-weight: 700;
    display: flex; align-items: center; gap: 10px;
}
.ms-close {
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 34px; height: 34px;
    border-radius: 50%; cursor: pointer;
    transition: all 0.2s; font-size: 15px;
    display: flex; align-items: center; justify-content: center;
}
.ms-close:hover {
    background: rgba(255,31,90,0.2);
    border-color: var(--accent-border);
    color: var(--accent-primary);
}

.ms-filters {
    padding: 14px 28px;
    border-bottom: 1px solid var(--border);
    background: rgba(0,0,0,0.15);
}
.ms-filter-row {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px; flex-wrap: wrap;
}
.ms-filter-label {
    font-size: 11px; color: var(--text-muted);
    font-weight: 700; letter-spacing: 0.6px;
    text-transform: uppercase; width: 55px;
}
.ms-chip {
    padding: 5px 13px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    font-size: 12px; cursor: pointer;
    transition: all 0.18s var(--ease);
    white-space: nowrap; color: var(--text-muted);
    font-family: inherit;
}
.ms-chip:hover { color: var(--text-primary); border-color: var(--border-hover); }
.ms-chip.on {
    background: var(--accent-gradient);
    color: #fff; border-color: transparent;
    box-shadow: 0 2px 10px var(--accent-glow);
}

.ms-body {
    flex: 1; overflow-y: auto; padding: 24px 28px;
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.ms-body::-webkit-scrollbar { width: 4px; }
.ms-body::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }

/* Match rows */
.ms-day-header {
    margin: 24px 0 14px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    display: flex; justify-content: space-between; align-items: flex-end;
}
.ms-day-date { font-size: 17px; font-weight: 700; }
.ms-match {
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 18px; margin-bottom: 12px;
    display: flex; align-items: stretch; gap: 16px;
    transition: all 0.2s var(--ease);
}
.ms-match:hover {
    border-color: var(--border-hover);
    background: rgba(255,255,255,0.04);
}
.ms-match-time {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; min-width: 72px;
}
.ms-match-time-val { font-size: 17px; font-weight: 700; }
.ms-match-time-tz { font-size: 10px; color: var(--text-muted); text-transform: uppercase; }
.ms-match-divider { width: 1px; background: var(--border); }
.ms-teams { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.ms-teams-row {
    display: flex; align-items: center;
    justify-content: space-between; margin-bottom: 6px;
}
.ms-team { display: flex; align-items: center; gap: 8px; flex: 1; }
.ms-team.away { flex-direction: row-reverse; text-align: right; }
.ms-team-flag { font-size: 22px; }
.ms-team-name { font-size: 15px; font-weight: 600; }
.ms-score {
    font-size: 17px; font-weight: 800;
    padding: 0 14px; color: var(--text-muted);
}
.ms-score.live-score { color: var(--accent-primary); animation: pulse-dot 2s infinite; }
.ms-match-meta { font-size: 11px; color: var(--text-muted); }
.ms-match-divider2 { width: 1px; background: var(--border); }
.ms-channels {
    display: flex; flex-direction: column; gap: 6px;
    min-width: 120px; justify-content: center;
}
.ms-ch-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--border);
    border-radius: var(--r-sm); font-size: 12px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.ms-ch-badge:hover {
    background: var(--accent-primary);
    border-color: transparent; color: #fff;
}

/* Match state */
.ms-match.live {
    border-color: rgba(255,31,90,0.4);
    background: rgba(255,31,90,0.06);
    box-shadow: 0 0 0 1px rgba(255,31,90,0.15);
}
.ms-match.finished { opacity: 0.5; }
.ms-live-pill {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--accent-primary); color: #fff;
    font-size: 9px; font-weight: 800;
    padding: 3px 8px; border-radius: var(--r-pill);
    letter-spacing: 0.8px; text-transform: uppercase;
    vertical-align: middle; margin-left: 4px;
    animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,31,90,0.6); }
    50%       { box-shadow: 0 0 0 5px rgba(255,31,90,0); }
}
.ms-live-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #fff; display: inline-block;
    animation: ldot 1.2s ease-in-out infinite;
}
.ms-no-matches {
    text-align: center; padding: 48px 24px;
    color: var(--text-muted); font-size: 15px;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.ms-no-matches span { font-size: 40px; }

/* ── PIN Modal ── */
.pin-otp-row {
    display: flex; gap: 12px;
    justify-content: center; margin-bottom: 20px;
}
.pin-otp-input {
    width: 56px; height: 64px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-primary);
    text-align: center; font-size: 24px; font-weight: 700;
    font-family: inherit; outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    letter-spacing: 2px;
}
.pin-otp-input:focus {
    border-color: var(--accent-border);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* ── EPG ── */
.epg-wrap { overflow-x: auto; }
.epg-timeline {
    display: flex; border-bottom: 1px solid var(--border);
    background: rgba(0,0,0,0.4);
}
.epg-timeline-label {
    width: 150px; padding: 14px;
    border-right: 1px solid var(--border);
    font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.epg-timeline-hours {
    flex: 1; padding: 14px; display: flex; min-width: 600px;
}
.epg-timeline-hour { flex: 1; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.epg-row { display: flex; border-bottom: 1px solid var(--border); }
.epg-ch-label {
    width: 150px; padding: 13px 14px;
    border-right: 1px solid var(--border);
    font-size: 13px; font-weight: 600; flex-shrink: 0;
    display: flex; align-items: center;
}
.epg-programs { flex: 1; display: flex; padding: 7px; gap: 4px; min-width: 600px; }
.epg-program {
    flex: 1; background: rgba(255,255,255,0.05);
    border-radius: var(--r-sm); padding: 8px 10px;
    font-size: 12px; cursor: pointer; transition: background 0.2s;
}
.epg-program:hover { background: rgba(255,31,90,0.12); }
.epg-program.current { background: var(--accent-gradient); }
.epg-program-time { font-size: 10px; color: rgba(255,255,255,0.55); margin-top: 3px; }

/* ═══════════════════════════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════════════════════════ */
.toasts {
    position: fixed; top: 80px; right: 20px;
    z-index: 4000; display: flex; flex-direction: column;
    gap: 10px; pointer-events: none;
    max-width: calc(100vw - 40px);
}
.toast {
    background: rgba(18, 18, 31, 0.96);
    border: 1px solid var(--border-hover);
    border-radius: var(--r-md);
    padding: 14px 18px; font-size: 14px;
    display: flex; align-items: center; gap: 12px;
    min-width: 240px; max-width: 320px;
    box-shadow: 0 10px 32px rgba(0,0,0,0.4);
    animation: toast-in 0.3s var(--ease-spring);
    pointer-events: all; color: var(--text-primary); font-weight: 500;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
@keyframes toast-in {
    from { opacity: 0; transform: translateX(24px) scale(0.96); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
.toast.ok   { border-left: 3px solid var(--ok); }
.toast.err  { border-left: 3px solid var(--err); }
.toast.info { border-left: 3px solid #4facfe; }

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.footer {
    margin-top: 64px;
    padding: 48px 36px 28px;
    border-top: 1px solid var(--border);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px; max-width: 1240px; margin: 0 auto 36px;
}
.footer-brand .logo {
    font-size: 18px; margin-bottom: 14px;
    display: inline-flex;
}
.footer-brand p {
    font-size: 14px; color: var(--text-muted);
    line-height: 1.7; max-width: 260px;
}
.footer-col h4 {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted); margin-bottom: 18px;
}
.footer-col a {
    display: flex; align-items: center; gap: 8px;
    color: var(--text-muted); text-decoration: none;
    font-size: 14px; margin-bottom: 12px;
    transition: color 0.2s var(--ease);
}
.footer-col a:hover { color: var(--text-primary); }
.nav-link-footer { color: var(--text-muted); text-decoration: none; }
.nav-link-footer:hover { color: var(--text-primary); }

.footer-bottom {
    max-width: 1240px; margin: 0 auto;
    padding-top: 24px; border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    font-size: 13px; color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   BACK TO TOP
   ═══════════════════════════════════════════════════════════════ */
.back-to-top {
    position: fixed; bottom: 32px; right: 32px; z-index: 900;
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--accent-gradient); color: #fff;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    box-shadow: 0 6px 20px var(--accent-glow);
    transition: all 0.3s var(--ease-spring);
    opacity: 0; pointer-events: none; transform: translateY(16px);
}
.back-to-top.visible {
    opacity: 1; pointer-events: all; transform: translateY(0);
}
.back-to-top:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 10px 28px rgba(255,31,90,0.5);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
    .hero-title { font-size: 44px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    /* Navbar */
    .navbar { padding: 0 18px; height: 62px; }
    .nav-links { display: none; }
    .search-bar { display: none; }
    .nav-right .btn { display: none; }
    .hamburger { display: flex; }

    /* Categories */
    .categories-wrapper { top: 62px; }
    .categories { padding: 0 18px; }
    .cat-pill { padding: 14px 16px; font-size: 13px; }

    /* Hero */
    .hero { margin-top: 62px; min-height: auto; padding: 36px 0 28px; }
    .hero::before {
        background: linear-gradient(to bottom,
            rgba(7,7,15,0.92) 0%,
            rgba(7,7,15,0.78) 60%,
            rgba(7,7,15,1) 100%
        );
    }
    .hero-split { flex-direction: column; gap: 28px; padding: 0 18px; text-align: center; }
    .hero-image { display: none; }
    .hero-content { max-width: 100%; align-items: center; }
    .hero-badge { margin: 0 auto 18px; }
    .hero-title { font-size: 34px; }
    .hero-desc { font-size: 15px; margin-bottom: 28px; }
    .hero-actions { justify-content: center; gap: 12px; }
    .btn { padding: 11px 22px; font-size: 14px; }

    /* Rails */
    .rail { padding: 10px 18px 28px; }
    .rail-title { font-size: 18px; }
    .rail-items { gap: 12px; }

    /* Channel cards — 2-col grid on mobile */
    .rail-items {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        overflow-x: visible;
        gap: 12px;
    }
    .ch-card {
        min-width: unset; width: 100%;
        padding: 16px 12px;
    }
    .ch-card-skeleton { min-width: unset; width: 100%; }
    .ch-logo-wrap { width: 64px; height: 64px; margin-bottom: 12px; }
    .ch-play-icon { display: none; }

    /* Player */
    .p-ov { }
    .p-top { margin-top: 56px; padding: 60px 18px 12px; }
    .p-bot { padding: 10px 18px 20px; flex-direction: column; gap: 8px; }
    .p-ctrl { gap: 8px; }
    .pvol { width: 72px; }
    .p-name { font-size: 17px; }
    .p-grp { font-size: 12px; }
    .p-logo { width: 44px; height: 44px; }
    .pm-header { padding: 12px 18px; }
    .watermark { font-size: 12px; top: 14px; right: 14px; }
    .p-progress-wrap { margin: 0 18px 6px; }

    /* Modals */
    .ms-dialog { border-radius: 16px; max-height: 94vh; }
    .ms-hdr { padding: 18px 20px; }
    .ms-body { padding: 18px 20px; }
    .ms-match { flex-direction: column; gap: 12px; }
    .ms-match-divider, .ms-match-divider2 { display: none; }
    .ms-match-time { flex-direction: row; gap: 8px; justify-content: flex-start; }
    .ms-channels { flex-direction: row; flex-wrap: wrap; }
    .ms-team-name { font-size: 14px; }

    /* Footer */
    .footer { padding: 32px 18px 20px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .footer-brand { grid-column: 1 / -1; }
    .footer-bottom { flex-direction: column; text-align: center; }

    /* Back to top */
    .back-to-top { bottom: 20px; right: 18px; width: 42px; height: 42px; }

    /* Toasts */
    .toasts { top: auto; bottom: 20px; right: 10px; left: 10px; }
    .toast { min-width: unset; width: 100%; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 28px; }
    .hero-desc { font-size: 14px; }
    .hero-actions { flex-direction: column; width: 100%; }
    .hero-actions .btn { width: 100%; justify-content: center; }
    .rail-items { gap: 10px; }
    .footer-grid { grid-template-columns: 1fr; }
    .ms-team-flag { font-size: 18px; }
    .ms-score { padding: 0 8px; }
    .pin-otp-input { width: 50px; height: 58px; font-size: 20px; }
}

/* ── iOS Safe Area ── */
@supports (padding-top: env(safe-area-inset-top)) {
    .navbar {
        padding-top: env(safe-area-inset-top);
        height: calc(62px + env(safe-area-inset-top));
    }
    .hero { margin-top: calc(62px + env(safe-area-inset-top)); }
    .categories-wrapper { top: calc(62px + env(safe-area-inset-top)); }
    .player-modal { padding-bottom: env(safe-area-inset-bottom); }
    .back-to-top { bottom: calc(20px + env(safe-area-inset-bottom)); }
}

/* ── Touch active states ── */
@media (hover: none) {
    .ch-card:active { transform: scale(0.97); background: var(--bg-elevated); }
    .cat-pill:active { transform: scale(0.97); }
    .btn:active { transform: scale(0.97); }
    .ch-card:hover { transform: none; }
}
