@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");


/* =========================================================
   SPORTS TV
   Flat, sharp layout modeled on streamed.pk:
   near-black page, no gradients/glass/shadows, small radii,
   borderless cards with the title and meta under the thumbnail,
   light square sport tiles, and square arrow buttons.
   ========================================================= */

:root {
    --accent: 245, 245, 247;
    --accent-solid: rgb(var(--accent));
    --accent-contrast: #0a0a0a;

    --bg: #0a0a0a;
    --bg-elevated: #111111;

    --surface: #161616;
    --surface-hover: #1e1e1e;
    --surface-strong: #262626;

    --border: #262626;
    --border-hover: #3d3d3d;

    --text: #fafafa;
    --text-secondary: #b0b0b0;
    --text-muted: #858585;

    --live: #e8452c;
    --live-soft: rgba(232, 69, 44, 0.14);
    --star: #f5b82e;

    /* One small radius scale: sharp, not pill-shaped */
    --radius: 10px;
    --radius-small: 6px;
    --radius-pill: 6px;

    --transition: 0.15s ease;

    /* Card + tile sizing */
    --card-w: 280px;
    --card-gap: 16px;
    --tile-size: 160px;
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}


html {
    min-height: 100%;

    background: var(--bg);

    color-scheme: dark;

    scroll-behavior: smooth;

    scrollbar-color: #3a3a3a transparent;
}


body {
    margin: 0;

    min-height: 100vh;

    background: var(--bg);

    color: var(--text);

    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overscroll-behavior: none;
}


button,
input {
    font: inherit;
    accent-color: var(--accent-solid);
}


button {
    color: inherit;
}


img {
    display: block;
    max-width: 100%;
}


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


::selection {
    background: rgba(var(--accent), 0.25);
    color: var(--accent-solid);
}


/* =========================================================
   APP
   ========================================================= */

.app {
    min-height: 100vh;
}


/* =========================================================
   HEADER  (matches <header class="site-header">)
   ========================================================= */

.site-header {
    position: sticky;

    top: 0;

    z-index: 100;

    padding: 12px 32px;

    background: var(--bg);

    border-bottom: 1px solid var(--border);
}


.header-inner {
    width: 100%;

    max-width: 1800px;

    margin: 0 auto;

    display: flex;
    align-items: center;

    gap: 28px;
}


.logo {
    display: flex;
    align-items: center;

    gap: 10px;

    flex-shrink: 0;

    font-size: 18px;
    font-weight: 700;

    letter-spacing: -0.01em;
}


.logo-icon {
    width: 32px;
    height: 32px;

    display: grid;
    place-items: center;

    border-radius: var(--radius-small);

    background: transparent;

    font-size: 20px;
}


.logo-text {
    color: var(--text);
}


/* =========================================================
   SEARCH
   ========================================================= */

.header-actions {
    flex: 1;

    display: flex;
    justify-content: flex-end;
}


.search-wrapper {
    position: relative;

    width: 100%;

    max-width: 340px;
}


.search-icon {
    position: absolute;

    left: 14px;
    top: 50%;

    transform: translateY(-50%);

    color: var(--text-muted);

    font-size: 14px;

    pointer-events: none;
}


#search {
    width: 100%;

    height: 40px;

    padding: 0 14px 0 38px;

    border: 1px solid var(--border);

    border-radius: var(--radius-small);

    outline: none;

    color: var(--text);

    background: var(--bg);

    transition: border-color var(--transition);
}


#search::placeholder {
    color: var(--text-muted);
}


#search:hover {
    border-color: var(--border-hover);
}


#search:focus {
    border-color: #5a5a5a;
}


/* =========================================================
   MAIN
   ========================================================= */

.main-content {
    width: 100%;

    max-width: 1800px;

    margin: 0 auto;

    padding: 24px 32px 80px;
}


/* =========================================================
   PAGE HEADER  (eyebrow / h1 / subtitle / game-count)
   ========================================================= */

.page-header {
    margin-bottom: 24px;
}


.eyebrow {
    margin: 0 0 6px;

    color: var(--text-muted);

    font-size: 13px;
    font-weight: 600;
}


.page-header h1 {
    margin: 0;

    font-size: clamp(26px, 3vw, 34px);

    line-height: 1.1;

    font-weight: 700;

    letter-spacing: -0.02em;
}


.subtitle {
    margin: 8px 0 0;

    color: var(--text-secondary);

    font-size: 15px;
}


.game-count {
    display: inline-flex;

    align-items: center;

    min-height: 28px;

    margin-top: 12px;

    padding: 4px 10px;

    border: 1px solid var(--border);

    border-radius: var(--radius-small);

    color: var(--text-secondary);

    background: var(--bg-elevated);

    font-size: 12px;
    font-weight: 600;
}


/* =========================================================
   SECTION ARROWS  (square, like streamed.pk)
   ========================================================= */

.section-arrows {
    display: flex;

    gap: 6px;

    flex-shrink: 0;
}


.section-arrow {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border: 1px solid var(--border);

    border-radius: var(--radius-small);

    background: var(--bg-elevated);

    color: var(--text-secondary);

    cursor: pointer;

    font-size: 20px;
    line-height: 1;

    transition: background var(--transition),
        color var(--transition),
        border-color var(--transition);
}


.section-arrow:hover {
    color: var(--text);

    background: var(--surface-strong);

    border-color: var(--border-hover);
}


/* =========================================================
   SPORTS PICKER  (<nav class="sport-tiles"><button class="sport-tile">)
   ========================================================= */

.sports-picker {
    margin-bottom: 28px;
}


.sports-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 14px;
}


.sports-picker-header h2 {
    margin: 0;

    color: var(--text);

    font-size: 26px;
    font-weight: 700;

    letter-spacing: -0.015em;
}


.sport-tiles {
    display: flex;

    gap: 14px;

    overflow-x: auto;

    scroll-snap-type: x proximity;

    padding-bottom: 4px;

    scrollbar-width: none;
}


.sport-tiles::-webkit-scrollbar {
    display: none;
}


.sport-tile {
    flex: 0 0 auto;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    gap: 10px;

    padding: 0;

    border: 0;

    background: transparent;

    cursor: pointer;

    scroll-snap-align: start;
}


.sport-tile-box {
    width: var(--tile-size);
    height: var(--tile-size);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 14px;

    border-radius: 8px;

    background: #fdf1f0;

    color: #0a0a0a;

    font-size: 22px;
    font-weight: 800;

    line-height: 1.2;

    text-align: center;

    transition: filter var(--transition);
}


.sport-tile:hover .sport-tile-box {
    filter: brightness(0.94);
}


/* Active tile (Live Now is selected by default): the highlight is drawn
   inside the tile so it stays exactly the same size as the others. */
.sport-tile.active .sport-tile-box {
    box-shadow: inset 0 0 0 3px #0a0a0a;
}

.sport-tile.active .sport-tile-label {
    color: var(--accent-solid);
}


.sport-tile-label {
    width: var(--tile-size);

    color: var(--text);

    font-size: 15px;
    font-weight: 700;

    line-height: 1.35;

    text-align: left;
}


/* =========================================================
   SECTIONS
   ========================================================= */

.game-section {
    margin-bottom: 28px;
}


.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 14px;
}


.section-heading {
    display: flex;
    align-items: baseline;

    gap: 10px;
}


.section-heading h2 {
    margin: 0;

    font-size: 26px;

    font-weight: 700;

    letter-spacing: -0.015em;
}


/* The game count next to a section title: plain muted text,
   not a pill */
.section-heading span {
    color: var(--text-muted);

    font-size: 15px;
    font-weight: 600;
}


/* =========================================================
   DATE ROWS — used by individual sport tabs, grouping cards
   under a date instead of one flat grid.
   ========================================================= */

.date-row {
    display: flex;
    align-items: flex-start;

    gap: 20px;

    margin-bottom: 28px;
}


.date-row-label {
    display: flex;
    flex-direction: column;
    align-items: center;

    flex: 0 0 84px;

    padding: 12px 8px;

    border: 1px solid var(--border);
    border-radius: var(--radius-small);

    background: var(--bg-elevated);

    text-align: center;

    position: sticky;
    top: 84px;
}


.date-row-weekday {
    color: var(--live);

    font-size: 12px;
    font-weight: 700;
}


.date-row-daynum {
    margin-top: 2px;

    color: var(--text);

    font-size: 28px;
    font-weight: 700;

    line-height: 1.1;
}


.date-row-month {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 12px;
    font-weight: 600;
}


.date-row-games {
    flex: 1;

    min-width: 0;

    display: flex;
    flex-wrap: wrap;

    gap: 24px var(--card-gap);
}


.date-row-games .game-card {
    width: var(--card-w);

    flex: 0 1 var(--card-w);
}


/* =========================================================
   GAME GRID  (horizontal rows with arrows)
   ========================================================= */

.pinned-section {
    margin-bottom: 28px;
}


.games-grid,
.game-grid {
    display: flex;

    flex-wrap: nowrap;

    gap: var(--card-gap);

    overflow-x: auto;

    scroll-snap-type: x proximity;

    padding-bottom: 4px;

    scrollbar-width: none;
}


.games-grid::-webkit-scrollbar,
.game-grid::-webkit-scrollbar {
    display: none;
}


.games-grid .game-card,
.game-grid .game-card {
    flex: 0 0 var(--card-w);

    width: var(--card-w);

    scroll-snap-align: start;
}


/* =========================================================
   GAME CARD — no box at all: thumbnail on top, bold title and
   gray "Sport | Time" line underneath. The whole card is clickable.
   ========================================================= */

.game-card {
    position: relative;

    display: flex;
    flex-direction: column;

    min-width: 0;

    padding: 0;

    border: 0;

    border-radius: 0;

    background: none;

    cursor: pointer;
}


.game-card:focus-visible {
    outline: 2px solid rgba(var(--accent), 0.6);
    outline-offset: 4px;

    border-radius: var(--radius-small);
}


/* =========================================================
   THUMBNAIL
   ========================================================= */

.game-thumb {
    position: relative;

    aspect-ratio: 16 / 9;

    border-radius: var(--radius-small);

    background: #1a1a1a;

    overflow: hidden;
}


/* Subtle lightening on hover */
.game-thumb::after {
    content: "";

    position: absolute;

    inset: 0;

    background: #fff;

    opacity: 0;

    pointer-events: none;

    transition: opacity var(--transition);
}


.game-card:hover .game-thumb::after {
    opacity: 0.07;
}


/* Per-sport colors for games with no real thumbnail */
.game-thumb[data-sport-bg="football"] {
    background: linear-gradient(135deg, #7c2d12, #1c1917);
}

.game-thumb[data-sport-bg="soccer"] {
    background: linear-gradient(135deg, #14532d, #052e13);
}

.game-thumb[data-sport-bg="basketball"] {
    background: linear-gradient(135deg, #9a3412, #1c1917);
}

.game-thumb[data-sport-bg="baseball"] {
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
}

.game-thumb[data-sport-bg="hockey"] {
    background: linear-gradient(135deg, #0f766e, #042f2e);
}

.game-thumb[data-sport-bg="mma"],
.game-thumb[data-sport-bg="boxing"] {
    background: linear-gradient(135deg, #7f1d1d, #1a0505);
}

.game-thumb[data-sport-bg="tennis"],
.game-thumb[data-sport-bg="golf"] {
    background: linear-gradient(135deg, #365314, #14210a);
}

.game-thumb[data-sport-bg="cricket"],
.game-thumb[data-sport-bg="rugby"] {
    background: linear-gradient(135deg, #78350f, #1c0f02);
}

.game-thumb[data-sport-bg^="motorsport"] {
    background: linear-gradient(135deg, #b45309, #1c0f02);
}

/* Real match photo from TheSportsDB (set inline as background-image).
   The extra attribute selector is needed to beat the per-sport
   `background:` shorthand rules above, which reset size/position. */
.game-thumb.game-thumb--photo[data-sport-bg] {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}


.game-thumb-badges {
    position: absolute;

    top: 10px;
    left: 10px;
    right: 10px;

    z-index: 2;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}


/* LIVE badge */
.live-badge {
    display: inline-flex;
    align-items: center;

    padding: 5px 10px;

    border-radius: var(--radius-small);

    color: #fff;

    background: var(--live);

    font-size: 12px;
    font-weight: 700;

    line-height: 1.2;
}


/* Date badge on upcoming games */
.game-date {
    display: inline-flex;
    align-items: center;

    padding: 5px 10px;

    border-radius: var(--radius-small);

    color: #fff;

    background: rgba(0, 0, 0, 0.78);

    font-size: 12px;
    font-weight: 700;

    line-height: 1.2;
}


/* Star badge (decorative, no persistence yet) */
.fav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;

    border-radius: var(--radius-small);

    color: #fff;

    background: var(--star);

    font-size: 15px;
    line-height: 1;
}


.game-thumb-teams {
    position: absolute;

    inset: 0;

    display: grid;

    grid-template-columns: 1fr auto 1fr;

    align-items: center;
    justify-items: center;

    gap: 8px;

    padding: 0 18px;
}


.team-logo {
    width: 52px;
    height: 52px;

    object-fit: contain;

    padding: 6px;

    border-radius: 8px;

    background: rgba(255, 255, 255, 0.08);
}


.team-placeholder {
    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 22px;
}


.thumb-vs {
    color: rgba(255, 255, 255, 0.55);

    font-size: 16px;

    line-height: 1;
}


/* =========================================================
   PINNED CHANNEL CARD  (e.g. 24/7 NFL Network)
   ========================================================= */

.game-thumb--pinned {
    background: linear-gradient(135deg, #2a2a2a, #121212);
}


.game-thumb-teams--single {
    grid-template-columns: 1fr;
}


.channel-logo {
    width: 56px;
    height: 56px;

    font-size: 26px;
}


.pinned-badge {
    display: inline-flex;
    align-items: center;

    padding: 5px 10px;

    border-radius: var(--radius-small);

    color: var(--accent-contrast);

    background: var(--accent-solid);

    font-size: 12px;
    font-weight: 700;

    line-height: 1.2;
}


/* =========================================================
   CARD INFO — full wrapping title + gray "Sport | Time" line
   ========================================================= */

.game-info {
    flex: 1 1 auto;

    padding: 12px 0 0;
}


.game-title {
    margin: 0;

    color: var(--text);

    font-size: 16px;
    font-weight: 700;

    line-height: 1.35;

    /* Show the full "Team 1 vs Team 2" title, wrapping onto
       extra lines instead of cutting it off with "...". */
    white-space: normal;
    overflow-wrap: break-word;
}


.game-meta {
    margin: 2px 0 0;

    color: var(--text-muted);

    font-size: 15px;
    font-weight: 500;

    line-height: 1.35;
}


.game-meta-dot {
    margin: 0 6px;

    opacity: 0.6;
}


/* =========================================================
   BUTTONS
   The whole card is clickable (like streamed.pk), so the Watch
   button is hidden on cards. Delete the next rule to show it again.
   ========================================================= */

.game-card .watch-btn,
.game-card .watch-button {
    display: none;
}


.watch-btn,
.watch-button {
    min-height: 38px;

    padding: 0 18px;

    border: 0;

    border-radius: var(--radius-small);

    color: var(--accent-contrast);

    background: var(--accent-solid);

    cursor: pointer;

    font-size: 14px;
    font-weight: 700;

    transition: background var(--transition);
}


.watch-btn:hover,
.watch-button:hover {
    background: #ffffff;
}


/* =========================================================
   EMPTY / ERROR
   ========================================================= */

.empty-state,
.error-state {
    padding: 80px 20px;

    text-align: center;

    color: var(--text-secondary);
}


.empty-icon,
.error-icon {
    margin-bottom: 12px;

    font-size: 36px;
}


.empty-state h2,
.error-state h2 {
    margin: 0 0 8px;

    color: var(--text);

    font-size: 22px;
}


.empty-state p,
.error-state p {
    margin: 0 0 16px;

    color: var(--text-muted);

    font-size: 14px;
}


/* =========================================================
   LOADING STATES
   ========================================================= */

.loading-state {
    display: flex;

    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 16px;

    min-height: 240px;

    color: var(--text-muted);

    font-size: 14px;
}


.loading-spinner {
    width: 34px;
    height: 34px;

    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--accent-solid);

    border-radius: 50%;

    animation: spin 0.8s linear infinite;
}


/* Loading text inside the stream-picker modal */
.loading {
    display: flex;

    align-items: center;
    justify-content: center;

    min-height: 120px;

    color: var(--text-muted);

    font-size: 14px;
}


/* =========================================================
   STREAM PICKER + VIDEO PLAYER OVERLAYS
   app.js builds these entirely in JS (createStreamPicker /
   openStream), so these selectors must match the classes
   app.js actually sets.
   ========================================================= */

.stv-modal {
    position: fixed;

    inset: 0;

    z-index: 99999;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 24px;

    background: rgba(0, 0, 0, 0.82);
}


/* Stream-picker card */
.stv-modal-card {
    width: min(560px, 100%);

    max-height: calc(100vh - 48px);

    overflow: auto;

    padding: 22px;

    border: 1px solid var(--border);

    border-radius: var(--radius);

    background: var(--bg-elevated);
}


.stv-modal-header {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;
}


.stv-modal-kicker {
    margin-bottom: 4px;

    color: var(--text-muted);

    font-size: 13px;
    font-weight: 600;
}


.stv-stream-title {
    margin: 0;

    color: var(--text);

    font-size: 20px;
    font-weight: 700;

    letter-spacing: -0.01em;
}


.stv-close {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    padding: 0;

    border: 1px solid var(--border);

    border-radius: var(--radius-small);

    color: var(--text-secondary);

    background: var(--bg);

    cursor: pointer;

    font-size: 20px;

    line-height: 1;

    transition: background var(--transition),
        color var(--transition);
}


.stv-close:hover {
    color: var(--text);

    background: var(--surface-strong);
}


.stv-stream-list {
    display: flex;

    flex-direction: column;

    gap: 8px;
}


/* Individual stream choice buttons, appended by openMatch() */
.stream-option {
    width: 100%;

    display: flex;

    align-items: center;

    gap: 14px;

    padding: 13px 14px;

    border: 1px solid var(--border);

    border-radius: var(--radius-small);

    background: var(--surface);

    color: var(--text);

    cursor: pointer;

    text-align: left;

    transition: background var(--transition),
        border-color var(--transition);
}


.stream-option:hover {
    background: var(--surface-strong);

    border-color: var(--border-hover);
}


.stream-source {
    font-size: 14px;
    font-weight: 600;
}


.stream-language {
    margin-left: auto;

    color: var(--text-muted);

    font-size: 13px;
}


.stream-hd {
    padding: 3px 7px;

    border-radius: 4px;

    color: var(--text-secondary);

    background: rgba(255, 255, 255, 0.08);

    font-size: 11px;

    font-weight: 700;
}


/* "Watch in Multiview" option in the picker */
.stream-option--multiview {
    border-color: rgba(var(--accent), 0.35);

    background: rgba(var(--accent), 0.06);
}


.stream-option--multiview .stream-source {
    color: var(--accent-solid);
}


.stream-option--multiview.stream-option--active {
    border-color: transparent;

    background: var(--accent-solid);
}

.stream-option--multiview.stream-option--active .stream-source,
.stream-option--multiview.stream-option--active .stream-language {
    color: var(--accent-contrast);
}


/* =========================================================
   VIDEO PLAYER OVERLAY  (openStream())
   ========================================================= */

.stv-player-modal {
    padding: 20px;
}


.stv-player-card {
    position: relative;

    width: 90vw;

    max-width: 1400px;

    padding: 0;

    overflow: hidden;

    border: 1px solid var(--border);

    border-radius: var(--radius);

    background: #000;
}


.stv-player-frame {
    position: relative;

    width: 100%;

    aspect-ratio: 16 / 9;

    background: #000;

    overflow: hidden;
}


.stv-player-frame iframe {
    display: block;

    width: 100%;
    height: 100%;

    border: 0;
}


.stv-player-close {
    position: absolute;

    top: 12px;
    right: 12px;

    z-index: 10;

    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.16);

    border-radius: var(--radius-small);

    color: #fff;

    background: rgba(0, 0, 0, 0.75);

    cursor: pointer;

    font-size: 22px;

    line-height: 1;

    transition: background var(--transition),
        color var(--transition);
}


.stv-player-close:hover {
    background: var(--accent-solid);

    color: var(--accent-contrast);
}


/* =========================================================
   SOURCES BAR (under the single-stream player)
   Header row: label on the left, Multiview button on the right.
   Source groups sit side by side below; the bar scrolls on its
   own if it still gets too tall.
   ========================================================= */

.stv-source-bar {
    flex: 0 1 auto;

    min-height: 0;
    max-height: 30vh;

    overflow-y: auto;

    background: var(--bg-elevated);

    border-top: 1px solid var(--border);

    scrollbar-width: thin;
}


.stv-source-bar-header {
    position: sticky;

    top: 0;

    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    padding: 10px 14px 8px;

    background: var(--bg-elevated);
}


.stv-source-bar-label {
    color: var(--text-muted);

    font-size: 13px;
    font-weight: 600;
}


.stv-source-bar-label[hidden] {
    display: none;
}


.stv-multiview-toggle {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    height: 30px;

    padding: 0 12px;

    border: 1px solid var(--border-hover);

    border-radius: var(--radius-small);

    color: var(--text);

    background: var(--bg);

    cursor: pointer;

    font-size: 12px;
    font-weight: 600;

    line-height: 1;

    transition: background var(--transition),
        color var(--transition);
}


.stv-multiview-toggle:hover {
    background: var(--accent-solid);

    color: var(--accent-contrast);
}


.stv-multiview-toggle:disabled {
    cursor: not-allowed;

    opacity: 0.4;
}


.stv-source-bar-header .stv-multiview-toggle {
    margin-left: auto;
}


.stv-source-groups {
    display: grid;

    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));

    gap: 10px 16px;

    padding: 0 14px 12px;
}


.stv-source-groups[hidden] {
    display: none;
}


.stv-source-group {
    display: flex;
    flex-direction: column;

    gap: 5px;

    min-width: 0;
}


.stv-source-group-name {
    color: var(--text-secondary);

    font-size: 12px;
    font-weight: 700;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.stv-source-group-list {
    display: flex;
    flex-wrap: wrap;

    gap: 5px;
}


.stv-source-btn {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    padding: 5px 9px;

    border: 1px solid var(--border);

    border-radius: var(--radius-small);

    background: var(--surface);

    color: var(--text);

    cursor: pointer;

    font-size: 12px;
    font-weight: 600;

    transition: background var(--transition),
        border-color var(--transition);
}


.stv-source-btn:hover {
    background: var(--surface-strong);

    border-color: var(--border-hover);
}


.stv-source-btn--active {
    background: var(--accent-solid);

    color: var(--accent-contrast);

    border-color: transparent;
}


.stv-source-btn--active:hover {
    background: var(--accent-solid);
}


.stv-source-language {
    color: var(--text-muted);

    font-size: 11px;
    font-weight: 500;
}


.stv-source-quality {
    padding: 1px 5px;

    border-radius: 4px;

    background: rgba(255, 255, 255, 0.1);

    font-size: 10px;
    font-weight: 700;
}


.stv-source-btn--active .stv-source-language {
    color: rgba(10, 10, 10, 0.7);
}


.stv-source-btn--active .stv-source-quality {
    background: rgba(10, 10, 10, 0.14);
}


/* Single-stream player: stack the video and the bar, and cap the card
   so both fit on screen. The video keeps its 16:9 size and the bar
   gets whatever height is left (scrolling if needed). */
.stv-player-modal:not(.stv-player-modal--multiview) .stv-player-card {
    display: flex;
    flex-direction: column;

    width: min(90vw, 1400px, calc((100vh - 190px) * 16 / 9));

    max-height: calc(100vh - 40px);
}


.stv-player-modal:not(.stv-player-modal--multiview) .stv-player-frame {
    flex: 0 0 auto;
}


/* =========================================================
   MULTIVIEW PROMPT  (auto-dismisses after 10s — see app.js)
   ========================================================= */

.stv-multiview-prompt {
    position: absolute;

    left: 50%;
    bottom: 20px;

    z-index: 11;

    display: flex;
    align-items: center;

    gap: 14px;

    max-width: calc(100% - 40px);

    padding: 12px 12px 12px 16px;

    border: 1px solid var(--border-hover);

    border-radius: var(--radius-small);

    background: var(--bg-elevated);

    opacity: 0;

    transform: translate(-50%, 8px);

    transition: opacity 200ms ease,
        transform 200ms ease;
}


.stv-multiview-prompt--visible {
    opacity: 1;

    transform: translate(-50%, 0);
}


.stv-multiview-prompt p {
    margin: 0;

    color: var(--text);

    font-size: 13px;
    font-weight: 600;

    white-space: nowrap;
}


.stv-multiview-prompt-actions {
    display: flex;
    align-items: center;

    gap: 8px;

    flex-shrink: 0;
}


.stv-multiview-prompt-yes {
    height: 32px;

    padding: 0 14px;

    border: 0;

    border-radius: var(--radius-small);

    color: var(--accent-contrast);

    background: var(--accent-solid);

    cursor: pointer;

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;
}


.stv-multiview-prompt-yes:hover {
    background: #ffffff;
}


.stv-multiview-prompt-dismiss {
    width: 28px;
    height: 28px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    border: 0;

    border-radius: var(--radius-small);

    color: var(--text-muted);

    background: var(--surface-strong);

    cursor: pointer;

    font-size: 16px;

    line-height: 1;
}


.stv-multiview-prompt-dismiss:hover {
    color: var(--text);

    background: var(--border-hover);
}


/* =========================================================
   MULTIVIEW GRID
   ========================================================= */

.stv-player-modal--multiview .stv-player-card {
    width: 94vw;

    max-width: 1600px;
}


.stv-multiview-card {
    display: flex;

    flex-direction: column;
}


.stv-multiview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    padding: 10px 14px;

    background: var(--bg-elevated);

    border-bottom: 1px solid var(--border);
}


.stv-multiview-count {
    color: var(--text-secondary);

    font-size: 13px;
    font-weight: 600;
}


.stv-multiview-toolbar-actions {
    display: flex;
    align-items: center;

    gap: 10px;
}


.stv-multiview-toolbar-actions .stv-multiview-toggle {
    position: static;
}


.stv-multiview-toolbar-actions .stv-player-close {
    position: static;

    width: 30px;
    height: 30px;

    font-size: 18px;
}


.stv-multiview-grid {
    display: grid;

    gap: 3px;

    background: #000;
}


.stv-multiview-grid--count-1 {
    grid-template-columns: 1fr;
}


.stv-multiview-grid--count-2 {
    grid-template-columns: repeat(2, 1fr);
}


.stv-multiview-grid--count-3,
.stv-multiview-grid--count-4 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}


.stv-multiview-tile {
    position: relative;

    display: flex;
    flex-direction: column;

    background: #000;

    aspect-ratio: 16 / 9;

    overflow: hidden;
}


.stv-multiview-grid--count-3 .stv-multiview-tile,
.stv-multiview-grid--count-4 .stv-multiview-tile {
    aspect-ratio: auto;
}


.stv-multiview-tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;

    padding: 6px 8px;

    background: var(--bg-elevated);
}


.stv-multiview-tile-title {
    overflow: hidden;

    color: var(--text-secondary);

    font-size: 12px;
    font-weight: 600;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.stv-multiview-tile-remove {
    width: 22px;
    height: 22px;

    flex-shrink: 0;

    display: grid;
    place-items: center;

    border: 0;

    border-radius: 4px;

    color: var(--text-muted);

    background: var(--surface-strong);

    cursor: pointer;

    font-size: 14px;

    line-height: 1;

    transition: background var(--transition),
        color var(--transition);
}


.stv-multiview-tile-remove:hover {
    color: #fff;

    background: var(--live);
}


.stv-multiview-tile iframe {
    flex: 1;

    display: block;

    width: 100%;
    height: 100%;

    border: 0;
}


@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   SCROLLBARS
   ========================================================= */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}


::-webkit-scrollbar-track {
    background: transparent;
}


::-webkit-scrollbar-corner {
    background: transparent;
}


::-webkit-scrollbar-thumb {
    background: #333;

    border: 2px solid var(--bg);

    border-radius: var(--radius-small);
}


::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}


/* =========================================================
   FOCUS
   ========================================================= */

button:focus-visible,
input:focus-visible {
    outline: 2px solid rgba(var(--accent), 0.6);
    outline-offset: 3px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {

    .site-header {
        padding: 12px 20px;
    }

    .main-content {
        padding: 20px 20px 60px;
    }
}


@media (max-width: 650px) {

    :root {
        --card-w: 240px;
        --tile-size: 128px;
    }

    .header-inner {
        gap: 14px;
    }

    .logo-text {
        display: none;
    }

    .search-wrapper {
        max-width: none;
    }

    .main-content {
        padding: 16px 14px 50px;
    }

    .sports-picker-header h2,
    .section-heading h2 {
        font-size: 21px;
    }

    .sport-tile-box {
        font-size: 18px;
    }

    .section-arrow {
        width: 34px;
        height: 34px;
    }

    .date-row {
        flex-direction: column;

        gap: 12px;
    }

    .date-row-label {
        flex-direction: row;
        justify-content: center;

        gap: 8px;

        width: 100%;

        padding: 10px;

        position: static;
    }

    .date-row-daynum {
        margin-top: 0;

        font-size: 20px;
    }

    .date-row-games .game-card {
        width: 100%;

        flex: 1 1 100%;
    }

    .stv-modal {
        padding: 12px;
    }

    .stv-modal-card {
        padding: 18px;
    }

    .stv-player-modal {
        padding: 8px;
    }

    .stv-player-card {
        width: 96vw;
    }

    .stv-player-modal--multiview .stv-player-card {
        width: 96vw;
    }

    .stv-source-group-name {
        white-space: normal;
    }

    .stv-multiview-grid--count-2,
    .stv-multiview-grid--count-3,
    .stv-multiview-grid--count-4 {
        grid-template-columns: 1fr;
        grid-template-rows: none;
    }

    .stv-multiview-grid--count-3 .stv-multiview-tile,
    .stv-multiview-grid--count-4 .stv-multiview-tile {
        aspect-ratio: 16 / 9;
    }

    .stv-multiview-prompt {
        left: 12px;
        right: 12px;
        bottom: 12px;

        transform: translateY(8px);

        flex-wrap: wrap;

        max-width: none;
    }

    .stv-multiview-prompt--visible {
        transform: translateY(0);
    }

    .stv-multiview-prompt p {
        white-space: normal;
    }

    .stv-player-close {
        top: 8px;
        right: 8px;

        width: 34px;
        height: 34px;

        font-size: 20px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;

        animation-duration: 0.01ms !important;
    }
}