:root {
    --bg: #171210;
    --bg-elevated: #1e1613;
    --border: #322721;
    --text: #f4f2ee;
    --text-muted: #9a9186;
    --brand: #ff7a1a;
    --brand-hover: #d16415;
    --live: #ff4655;
    --radius: 3px;
}

:root[data-theme="light"] {
    --bg: #faf6f2;
    --bg-elevated: #ffffff;
    --border: #ecdfd4;
    --text: #1c1512;
    --text-muted: #7d6f63;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    transition: background-color 0.15s ease, color 0.15s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    padding: 16px 20px;
}

@media (max-width: 640px) {
    .header-inner {
        gap: 10px 16px;
        padding: 12px 20px;
    }

    .logo {
        order: 1;
        font-size: 1.2rem;
    }

    .header-actions {
        order: 2;
    }

    .theme-toggle,
    .social-icon-btn {
        width: 32px;
        height: 32px;
    }

    .main-nav {
        order: 3;
        flex: 1 1 100%;
        gap: 16px;
    }

    .search-form {
        order: 4;
        flex: 1 1 100%;
        max-width: none;
    }
}

.logo {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--brand);
}

.logo-suffix {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-secondary, currentColor);
    opacity: 0.75;
}

.main-nav {
    display: flex;
    gap: 20px;
}

.main-nav a {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

.main-nav a:hover {
    color: var(--text);
}

.main-nav a.active {
    color: var(--brand);
}

.nav-link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
}

.nav-link-btn:hover {
    color: var(--text);
}

.search-form {
    display: flex;
    flex: 1;
    min-width: 0;
    max-width: 420px;
}

.search-form input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border-radius: var(--radius) 0 0 var(--radius);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}

.search-form button {
    padding: 8px 16px;
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
}

.search-form button:hover {
    background: var(--brand-hover);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle,
.social-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    cursor: pointer;
}

.theme-toggle:hover,
.social-icon-btn:hover {
    color: var(--text);
    border-color: var(--brand);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
}

:root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
}

:root[data-theme="light"] .theme-toggle .icon-moon {
    display: block;
}

/* Sections */
.section {
    padding: 24px 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0 0 16px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header .section-title {
    margin: 0;
}

/* Carousels */
.carousel-arrows {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.carousel-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.carousel-btn:hover:not(:disabled) {
    border-color: var(--brand);
    color: var(--brand);
}

.carousel-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.carousel {
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -20px;
    padding: 0 20px;
}

.carousel::-webkit-scrollbar {
    display: none;
}

.carousel-track {
    display: flex;
    gap: 14px;
    scroll-snap-type: x proximity;
    padding-bottom: 4px;
    margin-top: 16px;
}

/* Sport tiles */
.sport-tile {
    flex: 0 0 130px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.sport-tile:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
}

.sport-tile-icon {
    font-size: 1.8rem;
}

/* Scoreboard rows — crest-to-crest matchups instead of poster tiles */
.day-group {
    margin-bottom: 22px;
}

.day-label {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.74rem;
    color: var(--text-muted);
    margin: 0 0 10px;
}

.row-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.match-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-elevated);
    color: var(--text);
    padding: 12px 16px;
    transition: background-color 0.15s ease;
}

.match-row:hover {
    background: color-mix(in srgb, var(--brand) 8%, var(--bg-elevated));
}

.match-row-live {
    border-left: 3px solid var(--live);
}

.row-live-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.68rem;
    color: var(--live);
    flex-shrink: 0;
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--live);
    flex-shrink: 0;
}

.matchup {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.matchup-single {
    min-width: 0;
}

.crest {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    background: var(--bg);
}

.crest-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.62rem;
    color: #fff;
    letter-spacing: 0.02em;
}

.team-name {
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vs {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.68rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.row-time {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Live band — the one featured live match, given room to breathe */
.live-band {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 24px;
}

.live-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    color: var(--live);
    margin: 0 0 16px;
}

.hero-match {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.hero-team {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.hero-team.away {
    flex-direction: row-reverse;
    text-align: right;
}

.hero-crest {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    background: var(--bg);
}

.hero-crest.crest-fallback {
    font-size: 0.9rem;
}

.hero-team-name {
    font-weight: 800;
    text-transform: uppercase;
    font-size: 1.02rem;
    letter-spacing: 0.005em;
}

.hero-center {
    text-align: center;
    flex-shrink: 0;
}

.hero-single {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-single-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.watch-btn {
    display: inline-block;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.76rem;
    padding: 10px 18px;
    border-radius: var(--radius);
}

.watch-btn:hover {
    background: var(--brand-hover);
}

@media (max-width: 640px) {
    .section {
        padding: 18px 0;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .sport-tile {
        flex-basis: 104px;
        padding: 16px 8px;
        gap: 6px;
        font-size: 0.8rem;
    }

    .sport-tile-icon {
        font-size: 1.5rem;
    }

    .team-name {
        max-width: 90px;
    }

    .hero-match {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .hero-team.away {
        flex-direction: row;
        text-align: left;
    }

    .hero-center {
        text-align: left;
    }
}

.empty-state,
.empty-state-page {
    color: var(--text-muted);
    padding: 24px 0;
}

.empty-state-page {
    text-align: center;
    padding: 80px 0;
}

.empty-state-page h1 {
    font-size: 4rem;
    margin: 0;
    color: var(--brand);
}

/* Filters */
.schedule-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 28px;
}

.filter-pills {
    display: flex;
    gap: 8px;
}

.filter-pill {
    padding: 8px 18px;
    border-radius: 100px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.76rem;
}

.filter-pill:hover {
    color: var(--text);
}

.filter-pill.active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.filter-pill-live.active {
    background: var(--live);
    border-color: var(--live);
    color: #fff;
}

.filter-pill-popular.active {
    background: #ffb703;
    border-color: #ffb703;
    color: #1a1400;
}

/* Watch page */
.watch-header {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.watch-title {
    font-size: 1.6rem;
    margin: 0 0 8px;
}

.watch-subtitle {
    color: var(--text-muted);
    margin: 0 0 16px;
}

.watch-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.watch-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: start;
}

.watch-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (max-width: 900px) {
    .watch-layout {
        grid-template-columns: 1fr;
    }

    .watch-main {
        order: 1;
    }

    .watch-chat-placeholder {
        order: 2;
        min-height: 220px;
    }
}

.status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--border);
    color: var(--text-muted);
}

.status-pill.status-live {
    background: var(--live);
    color: #fff;
}

.status-pill.status-upcoming {
    background: var(--brand);
    color: #fff;
}

.player-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
}

.player-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.player-play-btn {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
    border: none;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
}

.player-play-btn:hover {
    color: #fff;
}

.player-placeholder {
    padding: 60px 20px;
    text-align: center;
    background: var(--bg-elevated);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
}

.source-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-embed {
    display: block;
    width: 100%;
    text-align: center;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    cursor: pointer;
    margin-top: 4px;
}

.btn-embed:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 0.88rem;
}

.source-item.active,
.source-item:hover {
    border-color: var(--brand);
}

.source-item-name {
    font-weight: 600;
}

.source-item-meta {
    color: var(--text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.source-item-official {
    border-color: #ffb703;
}

.source-item-official.active,
.source-item-official:hover {
    border-color: #ffb703;
    background: rgba(255, 183, 3, 0.1);
}

.watch-chat-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 400px;
    padding: 24px;
    background: var(--bg-elevated);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    text-align: center;
}

.watch-chat-placeholder svg {
    opacity: 0.5;
}

.watch-chat-placeholder p {
    margin: 0;
    font-size: 0.85rem;
}

.watch-chat-placeholder .watch-chat-title {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--brand);
    color: #fff;
    border-radius: var(--radius);
    margin-top: 12px;
}

.btn:hover {
    background: var(--brand-hover);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    margin-top: 40px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Modal */
body.modal-open {
    overflow: hidden;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}

.modal-dialog-wide {
    max-width: 600px;
}

.modal-dialog h2 {
    margin: 0 0 8px;
    font-size: 1.2rem;
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0 0 16px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    background: var(--border);
    color: var(--text);
}

.modal-dialog textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.modal-actions {
    margin-top: 14px;
}

.modal-actions .btn {
    width: 100%;
    border: none;
    cursor: pointer;
    margin-top: 0;
}

.modal-actions .btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.modal-status {
    min-height: 1.2em;
    margin: 10px 0 0;
    font-size: 0.85rem;
    text-align: center;
}

.modal-status-success {
    color: #4ade80;
}

.modal-status-error {
    color: var(--live);
}
