/* ============================================
   StreamZone — Glassmorphism Sports Streaming
   Multi-device: PC, Phone, Tablet, TV
   ============================================ */

/* ---------- Design Tokens ---------- */
:root {
    --bg-darker: #050508;
    --bg-surface: rgba(255, 255, 255, 0.025);
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-bg-hover: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --color-primary: #00e5ff;
    --color-primary-glow: rgba(0, 229, 255, 0.35);
    --color-secondary: #ff1744;
    --color-accent: #7c4dff;
    --color-live: #00e676;
    --color-text: #f0f0f0;
    --color-text-muted: #888;
    --color-text-dim: #555;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* Plyr Theme */
    --plyr-color-main: #00e5ff;
    --plyr-video-control-color: #fff;
    --plyr-video-control-background-hover: rgba(0, 229, 255, 0.15);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--bg-darker);
    color: var(--color-text);
    line-height: 1.6;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

/* ---------- Background ---------- */
.app-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--color-primary);
    top: -10%;
    left: -5%;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--color-accent);
    bottom: -10%;
    right: -5%;
    animation-delay: -7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: var(--color-secondary);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    opacity: 0.15;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(30px, -40px);
    }

    50% {
        transform: translate(-20px, 30px);
    }

    75% {
        transform: translate(20px, 20px);
    }
}

/* ============================================
   APP CONTAINER
   ============================================ */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    /* Dynamic viewport height for mobile */
    position: relative;
    overflow: hidden;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.6rem 1.5rem;
    background: rgba(10, 10, 14, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
    flex-shrink: 0;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.logo i {
    color: var(--color-primary);
    font-size: 1.1rem;
}

.logo .highlight {
    color: var(--color-primary);
}

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active {
    color: var(--color-primary);
    background: rgba(0, 229, 255, 0.08);
}

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.45rem 0.9rem;
    min-width: 200px;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 12px var(--color-primary-glow);
}

.search-box i {
    color: var(--color-text-dim);
    font-size: 0.8rem;
}

.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--color-text);
    font-size: 0.82rem;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--color-text-dim);
}

.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--color-text);
    font-size: 1rem;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 1rem;
}

/* Show sidebar only when player is active */
.main-content.player-active {
    display: grid;
    grid-template-columns: 1fr 320px;
    grid-template-rows: 1fr;
    gap: 1rem;
    overflow: hidden;
}

/* ============================================
   HOME VIEW
   ============================================ */
.home-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Sport Pills */
.sport-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0.25rem 0;
    scrollbar-width: none;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}

.sport-pills::-webkit-scrollbar {
    display: none;
}

.sport-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition);
    flex-shrink: 0;
}

.sport-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text);
    border-color: var(--glass-border-hover);
}

.sport-pill.active {
    background: var(--color-primary);
    color: #000;
    border-color: var(--color-primary);
    box-shadow: 0 0 14px var(--color-primary-glow);
}

.sport-pill.active i {
    color: #000;
}

.sport-pill i {
    font-size: 0.75rem;
}

/* -- Section Header -- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.25rem;
    flex-shrink: 0;
}

.section-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.section-header h2 i {
    color: var(--color-primary);
    font-size: 1rem;
}

.match-count {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* -- Cards Grid -- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.loading-grid {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem 2rem;
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

.loader {
    width: 36px;
    height: 36px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Live TV Channel Buttons */
.livetv-channels {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
    overflow-y: auto;
    max-height: 100%;
}

.livetv-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    width: 100%;
}

.livetv-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--glass-border-hover);
}

.livetv-btn.active-ch {
    border-color: var(--color-primary);
    background: rgba(0, 229, 255, 0.08);
}

.livetv-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.livetv-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.livetv-icon i {
    font-size: 1rem;
    color: var(--color-text-dim);
}

.livetv-info {
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
    font-weight: 500;
    overflow: hidden;
}

.livetv-info span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-live {
    font-size: 0.6rem;
    color: var(--color-live);
    font-weight: 700;
    margin-top: 2px;
}

/* ============================================
   SPORT CARD (WatchFooty-inspired + Glass)
   ============================================ */
.sport-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    animation: fadeInUp 0.4s ease both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sport-card:hover {
    transform: translateY(-4px);
    border-color: var(--glass-border-hover);
    background: var(--glass-bg-hover);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Pinned card (e.g. Sri Lanka matches) */
.sport-card.pinned {
    border-color: rgba(255, 193, 7, 0.5);
    box-shadow: 0 0 18px rgba(255, 193, 7, 0.15), 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.sport-card.pinned::after {
    content: '📌 PINNED';
    position: absolute;
    top: 0.45rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #ffc107;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    z-index: 5;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.sport-card.pinned:hover {
    border-color: rgba(255, 193, 7, 0.7);
    box-shadow: 0 0 28px rgba(255, 193, 7, 0.25), 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Card Top: Teams vs Teams */
.card-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    gap: 1rem;
    background-color: rgba(10, 10, 20, 0.85);
    background-blend-mode: darken;
    border-bottom: 1px solid var(--glass-border);
    min-height: 130px;
    overflow: hidden;
}

/* Dark overlay when poster background is set */
.card-top::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(5, 5, 12, 0.8), rgba(10, 10, 25, 0.75));
    z-index: 0;
}

.card-top>* {
    position: relative;
    z-index: 1;
}

.card-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.team-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    object-fit: contain;
    padding: 4px;
    flex-shrink: 0;
    transition: opacity 0.3s ease;
}

.team-logo-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--color-text-dim);
    flex-shrink: 0;
}

.team-name {
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.card-vs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    min-width: 50px;
}

.card-vs-text {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--color-text-dim);
    letter-spacing: 1px;
}

.card-score {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-minute {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--color-live);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Card Badges */
.card-badge {
    position: absolute;
    top: 0.6rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.card-badge.live {
    left: 0.6rem;
    background: var(--color-secondary);
    color: #fff;
    animation: pulse 2s ease-in-out infinite;
}

.card-badge.live i {
    font-size: 0.4rem;
    margin-right: 3px;
}

.card-badge.time {
    right: 0.6rem;
    background: rgba(0, 0, 0, 0.55);
    color: var(--color-text);
    backdrop-filter: blur(6px);
}

/* Card Thumbnail */
.card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.05), rgba(124, 77, 255, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--glass-border);
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-thumb i {
    font-size: 2.5rem;
    color: var(--color-text-dim);
    opacity: 0.4;
}

.card-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Team Logos in Thumb */
.team-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    height: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
}

.team-logo-sm {
    width: 64px;
    height: 64px;
    object-fit: contain !important;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    padding: 8px;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease;
}

.sport-card:hover .team-logo-sm {
    transform: scale(1.1);
    border-color: var(--color-primary);
}

.vs-label {
    font-size: 0.8rem;
    font-weight: 900;
    color: var(--color-text-dim);
    letter-spacing: 2px;
    opacity: 0.6;
}

.team-placeholder {
    font-size: 2rem !important;
    opacity: 0.2 !important;
}

/* Card Bottom */
.card-bottom {
    padding: 0.8rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.card-league {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.card-league img {
    width: 14px;
    height: 14px;
    border-radius: 2px;
}

.card-title {
    font-size: 0.85rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.7rem;
    color: var(--color-text-dim);
}

.card-meta .hd-tag {
    color: var(--color-primary);
    font-weight: 700;
}

/* ============================================
   PLAYER VIEW
   ============================================ */
.player-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
    overflow: hidden;
}

.player-top-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.nav-back-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
    flex-shrink: 0;
}

.nav-back-btn:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
}

.player-match-info {
    min-width: 0;
}

.player-match-info h1 {
    font-size: 1.1rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.2rem;
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    background: var(--color-secondary);
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    animation: pulse 2s ease-in-out infinite;
}

.live-badge i {
    font-size: 0.35rem;
}

.league-badge {
    font-size: 0.72rem;
    color: var(--color-accent);
    font-weight: 500;
}

/* Score Bar */
.score-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 0.65rem 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.score-team {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 0;
}

.score-team span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-logo-lg {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
}

.team-logo-lg-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--color-text-dim);
    flex-shrink: 0;
}

.score-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.score-num {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-sep {
    color: var(--color-text-dim);
    font-weight: 300;
}

/* Stream Controls */
.stream-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
}

.stream-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.stream-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.stream-btn.active-stream {
    background: rgba(0, 229, 255, 0.1);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.hd-tag {
    background: rgba(0, 229, 255, 0.15);
    color: var(--color-primary);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
}

/* Stream Area Wrapper */
.stream-area {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Video Container */
.video-container {
    flex: 1;
    min-height: 350px;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--glass-border);
}

.placeholder-stream {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 0.75rem;
    color: var(--color-text-dim);
    padding: 2rem;
    text-align: center;
}

.placeholder-stream i {
    font-size: 2.5rem;
    opacity: 0.4;
}

.placeholder-stream p {
    font-size: 0.9rem;
    font-weight: 500;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--color-primary);
    color: #000;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.82rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.cta-btn:hover {
    box-shadow: 0 0 20px var(--color-primary-glow);
    transform: translateY(-1px);
}

/* ============================================
   SIDEBAR (Glass Panel)
   ============================================ */
.sidebar {
    display: none;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
}

.main-content.player-active .sidebar {
    display: flex;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.tab-btn {
    flex: 1;
    padding: 0.7rem;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-muted);
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
}

.tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.tab-content.active {
    display: flex;
}

/* Chat */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.message {
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.03);
}

.message.system {
    color: var(--color-primary);
    font-style: italic;
    background: rgba(0, 229, 255, 0.05);
}

.message .user {
    font-weight: 600;
    color: var(--color-accent);
    margin-right: 0.3rem;
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-top: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.7rem;
    color: var(--color-text);
    font-size: 0.78rem;
    outline: none;
}

.chat-input-area input:focus {
    border-color: var(--color-primary);
}

.chat-input-area button {
    padding: 0.45rem 0.7rem;
    background: var(--color-primary);
    color: #000;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    transition: var(--transition);
}

.chat-input-area button:hover {
    box-shadow: 0 0 12px var(--color-primary-glow);
}

/* Stats */
.stats-card {
    padding: 1rem;
}

.stats-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.6rem;
}

.stats-card p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* ============================================
   SCROLLBARS
   ============================================ */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   RESPONSIVE — TV / Large Screens (1920px+)
   ============================================ */
@media (min-width: 1600px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 2rem;
    }

    .sport-pill {
        padding: 0.65rem 1.3rem;
        font-size: 0.9rem;
    }

    .main-content {
        padding: 1.5rem 2.5rem;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    .navbar {
        padding: 0.8rem 2.5rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .nav-links a {
        font-size: 0.95rem;
        padding: 0.6rem 1.1rem;
    }

    .video-container {
        min-height: 500px;
    }

    .card-title {
        font-size: 1rem;
    }

    .team-name {
        font-size: 0.9rem;
    }

    .team-logo,
    .team-logo-placeholder {
        width: 56px;
        height: 56px;
    }

    .card-top {
        min-height: 150px;
        padding: 2rem 1.5rem;
    }

    .player-match-info h1 {
        font-size: 1.4rem;
    }

    .score-num {
        font-size: 2rem;
    }
}

/* TV — Extra large / 4K (2560px+) */
@media (min-width: 2400px) {
    :root {
        font-size: 18px;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
        gap: 2.5rem;
    }

    .main-content {
        padding: 2rem 4rem;
    }

    .navbar {
        padding: 1rem 4rem;
    }

    .main-content.player-active {
        grid-template-columns: 1fr 400px;
    }

    .video-container {
        min-height: 650px;
    }

    .team-logo,
    .team-logo-placeholder {
        width: 64px;
        height: 64px;
    }
}

/* ============================================
   RESPONSIVE — Tablet (769px - 1024px)
   ============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }

    .main-content.player-active {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }

    .sidebar {
        max-height: 400px;
    }

    .video-container {
        min-height: 360px;
    }
}

/* ============================================
   RESPONSIVE — Mobile (768px and below)
   ============================================ */
@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }

    .logo {
        font-size: 1rem;
    }

    .nav-links {
        display: none;
    }

    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 10, 14, 0.95);
        backdrop-filter: blur(20px);
        padding: 0.5rem;
        border-bottom: 1px solid var(--glass-border);
        z-index: 99;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .search-box {
        display: none;
    }

    .main-content {
        padding: 0.6rem;
    }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .sport-pills {
        gap: 0.35rem;
        padding: 0.15rem 0;
    }

    .sport-pill {
        padding: 0.35rem 0.65rem;
        font-size: 0.68rem;
    }

    .sport-pill i {
        font-size: 0.65rem;
    }

    .section-header h2 {
        font-size: 1rem;
    }

    .section-header h2 i {
        font-size: 0.85rem;
    }

    .video-container {
        min-height: 220px;
    }

    .card-top {
        min-height: 100px;
        padding: 1rem 0.6rem;
        gap: 0.5rem;
    }

    .team-logo,
    .team-logo-placeholder {
        width: 36px;
        height: 36px;
    }

    .team-name {
        font-size: 0.65rem;
    }

    .card-vs-text {
        font-size: 0.7rem;
    }

    .card-score {
        font-size: 1rem;
    }

    .card-bottom {
        padding: 0.5rem 0.6rem;
    }

    .card-title {
        font-size: 0.72rem;
    }

    .card-league {
        font-size: 0.58rem;
    }

    .card-meta {
        font-size: 0.6rem;
    }

    .card-badge {
        font-size: 0.5rem;
        padding: 0.15rem 0.4rem;
    }

    .score-bar {
        padding: 0.5rem 0.75rem;
        gap: 0.75rem;
    }

    .score-num {
        font-size: 1.2rem;
    }

    .score-team {
        font-size: 0.72rem;
    }

    .player-top-bar {
        gap: 0.5rem;
    }

    .player-match-info h1 {
        font-size: 0.85rem;
    }

    .nav-back-btn {
        font-size: 0.7rem;
        padding: 0.35rem 0.65rem;
    }

    .stream-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.65rem;
    }

    .main-content.player-active {
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    .main-content.player-active .sidebar {
        display: flex;
        max-height: 350px;
    }

    .app-container {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow-y: auto;
    }

    body {
        overflow: auto;
    }
}

/* ============================================
   RESPONSIVE — Small phones (480px and below)
   ============================================ */
@media (max-width: 480px) {
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .card-top {
        min-height: 110px;
        padding: 1.2rem 0.8rem;
        gap: 0.75rem;
    }

    .team-logo,
    .team-logo-placeholder {
        width: 42px;
        height: 42px;
    }

    .team-name {
        font-size: 0.72rem;
    }

    .card-score {
        font-size: 1.2rem;
    }

    .video-container {
        min-height: 200px;
    }
}

/* ============================================
   LANDSCAPE PHONE / Tablet (when rotated)
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .app-container {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    body {
        overflow: auto;
    }

    .video-container {
        min-height: 55vh;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .sport-pills {
        padding: 0.1rem 0;
    }

    .sport-pill {
        padding: 0.3rem 0.6rem;
        font-size: 0.65rem;
    }
}

/* ============================================
   TV Remote / Focus Navigation
   ============================================ */
.sport-card:focus,
.sport-pill:focus,
.stream-btn:focus,
.nav-back-btn:focus,
.tab-btn:focus,
.nav-links a:focus,
.cta-btn:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    box-shadow: 0 0 16px var(--color-primary-glow);
}

/* For TV browsers — ensure focusable elements are easy to navigate */
@media (hover: none) and (pointer: coarse) {
    .sport-pill {
        padding: 0.5rem 1rem;
        min-height: 40px;
    }

    .stream-btn {
        padding: 0.5rem 1rem;
        min-height: 40px;
    }

    .nav-back-btn {
        min-height: 40px;
    }

    .tab-btn {
        min-height: 44px;
    }
}

/* ---------- Live TV Navigation Link ---------- */
.nav-livetv-link {
    color: var(--color-secondary, #ff3860) !important;
    font-weight: 600 !important;
}

.nav-livetv-link:hover {
    color: #fff !important;
    text-shadow: 0 0 10px rgba(255, 56, 96, 0.5);
}

/* ---------- Live TV Channel Buttons ---------- */
.livetv-channels {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 0.3rem;
}

.livetv-channels::-webkit-scrollbar {
    width: 4px;
}

.livetv-channels::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.livetv-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--color-text-muted, #aaa);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    text-align: left;
    font-family: inherit;
}

.livetv-btn i {
    font-size: 0.85rem;
    width: 1.2rem;
    text-align: center;
    color: var(--color-primary, #6c63ff);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.livetv-btn:hover {
    background: rgba(108, 99, 255, 0.12);
    border-color: rgba(108, 99, 255, 0.35);
    color: #fff;
    transform: translateX(3px);
}

.livetv-btn:hover i {
    opacity: 1;
}

.livetv-btn.active-ch {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.2), rgba(255, 56, 96, 0.15));
    border-color: var(--color-primary, #6c63ff);
    color: #fff;
    box-shadow: 0 0 12px rgba(108, 99, 255, 0.2);
}

.livetv-btn.active-ch i {
    opacity: 1;
    color: var(--color-secondary, #ff3860);
}

.livetv-btn.active-ch::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: var(--color-primary, #6c63ff);
    border-radius: 0 3px 3px 0;
}

.livetv-btn .hd-tag {
    margin-left: auto;
    font-size: 0.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary, #6c63ff), var(--color-secondary, #ff3860));
    color: white;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.livetv-btn.loading-ch {
    pointer-events: none;
    opacity: 0.7;
}

.livetv-btn.loading-ch::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: var(--color-primary, #6c63ff);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}