:root {
    --bg-main: #050712;
    --bg-elevated: rgba(18, 22, 40, 0.9);
    --bg-elevated-softer: rgba(25, 30, 60, 0.8);
    --border-subtle: rgba(255, 255, 255, 0.06);

    --accent: #ff4d6a;
    --accent-soft: rgba(255, 77, 106, 0.18);
    --accent-strong: #ff2e53;

    --text-main: #f7f7ff;
    --text-muted: #b0b3c6;
    --text-soft: #8b8fa7;
    --text-strong: #ffffff;

    --success: #3dd68c;
    --warning: #ffc857;

    --radius-lg: 1.2rem;
    --radius-pill: 999px;

    --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.55);

    --transition-fast: 0.18s ease-out;
    --transition-med: 0.25s ease-out;

    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    color: var(--text-main);
    background: radial-gradient(circle at top left, #292a59 0, #050712 38%) fixed;
    min-height: 100vh;
}

body.theme-dark {
    color-scheme: dark;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6.25rem 1.25rem 3rem;
}

/* Header */

.site-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, 1200px);
    z-index: 20;
    backdrop-filter: blur(16px);
    background: rgba(5, 7, 18, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    padding-bottom: 0.35rem;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.75rem 0.25rem 1rem;
}

.branding {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.branding-link {
    color: inherit;
    text-decoration: none;
}

.logo-pill {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 0, #ff9fad 0, #ff2b55 45%, #7b2cff 100%);
    color: #050712;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.site-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.site-subtitle {
    margin: 0.1rem 0 0;
    font-size: 0.85rem;
    color: var(--text-soft);
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-left: auto;
    justify-content: flex-end;
}

.header-now-playing {
    min-width: 0;
    display: inline-flex;
    flex: 0 1 24rem;
    width: min(24rem, 100%);
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.7rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(11, 15, 32, 0.88);
    color: var(--text-main);
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-0.35rem);
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}

.header-now-playing-badge {
    flex-shrink: 0;
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.header-now-playing-badge.is-live {
    background: rgba(61, 214, 140, 0.16);
    color: var(--success);
}

.header-now-playing-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    text-align: left;
}

.header-now-playing-copy strong,
.header-now-playing-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-now-playing-copy strong {
    font-size: 0.82rem;
}

.header-now-playing-copy span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.9rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    border: 1px solid transparent;
}

.pill-accent {
    background: var(--accent-soft);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--accent-strong);
}

/* Main layout */

.main-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.now-playing-banner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1.2rem 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(circle at top right, rgba(255, 77, 106, 0.24), transparent 30%),
        linear-gradient(135deg, rgba(18, 22, 40, 0.96), rgba(31, 38, 76, 0.92));
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    position: relative;
    transition: opacity var(--transition-med), transform var(--transition-med), max-height var(--transition-med), padding var(--transition-med), margin var(--transition-med);
}

.now-playing-banner.is-idle {
    background:
        radial-gradient(circle at top right, rgba(61, 214, 140, 0.12), transparent 30%),
        linear-gradient(135deg, rgba(18, 22, 40, 0.96), rgba(22, 28, 50, 0.92));
}

.now-playing-art {
    width: 82px;
    height: 82px;
    border-radius: 1.25rem;
    overflow: hidden;
    background: rgba(5, 7, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.now-playing-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.now-playing-logo-fallback {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--text-main);
}

.now-playing-copy {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.now-playing-kicker {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #ff93a5;
}

.now-playing-title {
    margin: 0;
    font-size: 1.35rem;
}

.now-playing-meta,
.now-playing-show {
    margin: 0;
    color: var(--text-muted);
}

.now-playing-show {
    color: var(--text-main);
    font-weight: 600;
}

.now-playing-recent {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.now-playing-recent.is-hidden {
    display: none;
}

.now-playing-recent-compact {
    margin-top: 0.75rem;
}

.now-playing-recent-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.now-playing-recent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.now-playing-recent-pill {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
}

.now-playing-recent-pill:hover {
    border-color: rgba(255, 255, 255, 0.24);
}

.now-playing-recent-pill:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.now-playing-status {
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-end;
}

.now-playing-controls {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.stream-status-panel {
    width: min(100%, 23rem);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.65rem;
    align-items: center;
    padding: 0.7rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(5, 7, 18, 0.7);
    color: var(--text-main);
    text-align: left;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.stream-status-panel[hidden] {
    display: none;
}

.stream-status-indicator {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: var(--warning);
    box-shadow: 0 0 0 0 rgba(255, 200, 87, 0.36);
}

.stream-status-panel.is-working .stream-status-indicator {
    animation: streamStatusPulse 1.35s infinite;
}

.stream-status-panel.is-success .stream-status-indicator {
    background: var(--success);
    box-shadow: 0 0 18px rgba(61, 214, 140, 0.3);
}

.stream-status-panel.is-warning .stream-status-indicator {
    background: var(--warning);
}

.stream-status-panel.is-error .stream-status-indicator {
    background: var(--accent);
    box-shadow: 0 0 18px rgba(255, 77, 106, 0.3);
}

.stream-status-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.15rem;
}

.stream-status-copy strong,
.stream-status-copy span {
    overflow-wrap: anywhere;
}

.stream-status-copy strong {
    font-size: 0.78rem;
}

.stream-status-copy span {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.account-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.account-panel,
.account-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
}

.account-panel {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
}

.account-kicker {
    margin: 0 0 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #ff93a5;
}

.account-form {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.account-form-stack {
    flex-direction: column;
    align-items: stretch;
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.account-card {
    padding: 1rem;
}

.account-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.account-card-head h3 {
    margin: 0;
    font-size: 1rem;
}

.mini-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.mini-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: 0.9rem;
    background: rgba(5, 7, 18, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.mini-card-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.mini-card strong {
    display: block;
    margin-bottom: 0.2rem;
}

.mini-card p,
.empty-state {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.team-fixture-card {
    align-items: stretch;
}

.team-tv-group {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.team-tv-group + .team-tv-group {
    margin-top: 1rem;
}

.team-tv-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
}

.team-tv-toggle-title {
    font-size: 0.95rem;
    font-weight: 700;
}

.team-tv-toggle-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.team-tv-body[hidden] {
    display: none;
}

.team-fixture-table {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.team-fixture-table-head {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(8rem, 0.9fr) minmax(11rem, 1fr) minmax(0, 2.2fr);
    gap: 1rem;
    padding: 0 0.85rem;
}

.team-fixture-table-head span {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.team-fixture-row {
    padding: 0.85rem 0.95rem;
}

.team-fixture-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(8rem, 0.9fr) minmax(11rem, 1fr) minmax(0, 2.2fr);
    gap: 1rem;
    align-items: start;
}

.team-fixture-main {
    min-width: 0;
}

.team-fixture-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.2rem;
}

.team-fixture-head strong {
    line-height: 1.35;
}

.team-fixture-meta {
    min-width: 0;
}

.team-fixture-meta p {
    margin: 0;
    color: var(--text-main);
    line-height: 1.4;
}

.team-fixture-meta-channels {
    min-width: 0;
}

.team-fixture-label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.team-fixture-score {
    margin: 0;
    font-size: 0.76rem;
    color: var(--text-soft);
}

.team-fixture-progress {
    margin-top: 0.55rem;
}

.team-channel-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.7rem;
}

.team-channel-chip {
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
}

.team-channel-chip:hover {
    border-color: rgba(255, 255, 255, 0.24);
}

.team-channel-chip:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.team-channel-chip-static {
    cursor: default;
}

.team-channel-chip-static:hover {
    border-color: rgba(255, 255, 255, 0.08);
}

.team-channel-chip-static:focus-visible {
    outline: none;
}

.team-channel-chip,
.team-channel-chip-static {
    background: rgba(255, 255, 255, 0.05);
    text-transform: none;
    letter-spacing: normal;
}

.team-channel-chip-static {
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

@media (max-width: 980px) {
    .team-fixture-table-head {
        display: none;
    }

    .team-fixture-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .team-fixture-head {
        align-items: center;
    }
}

.btn-mini {
    padding: 0.35rem 0.7rem;
    font-size: 0.68rem;
}

.now-playing-badge {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border-color: rgba(255, 255, 255, 0.08);
}

.now-playing-badge.is-live {
    background: rgba(61, 214, 140, 0.16);
    color: var(--success);
    border-color: rgba(61, 214, 140, 0.38);
}

/* Filters */

.filter-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding-top: 0.4rem;
    grid-column: span 4;
}

.filters-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.25rem 1rem;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    width: min(100%, 1200px);
    margin: 0 auto;
}

.filters-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-strip {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) auto;
    gap: 0.9rem;
    align-items: end;
    padding: 0.2rem 0 0.4rem;
}

.filter-grid-secondary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.playlist-switcher {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.playlist-switcher .filter-group {
    min-width: min(280px, 100%);
}

.playlist-switcher-note {
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.4;
    padding-bottom: 0.55rem;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

input[type="text"],
select {
    border-radius: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(5, 7, 18, 0.9);
    padding: 0.55rem 0.75rem;
    font: inherit;
    color: var(--text-main);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

input[type="text"]::placeholder {
    color: var(--text-soft);
}

input[type="text"]:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(255, 77, 106, 0.7);
    background: rgba(10, 12, 30, 0.98);
}

.program-search-row {
    display: flex;
    gap: 0.5rem;
}

.filter-actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.5rem;
}

@media (max-width: 700px) {
    .playlist-switcher {
        align-items: stretch;
        flex-direction: column;
    }

    .playlist-switcher-note {
        padding-bottom: 0;
    }
}

/* Buttons */

.btn {
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    background: transparent;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    border-color: transparent;
    color: #050712;
    box-shadow: 0 10px 25px rgba(255, 77, 106, 0.4);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(255, 77, 106, 0.5);
}

.btn-secondary {
    background: rgba(57, 68, 120, 0.9);
    border-color: rgba(255, 255, 255, 0.06);
}

.btn-secondary:hover {
    background: rgba(82, 93, 150, 1);
}

.btn-ghost {
    border-color: rgba(255, 255, 255, 0.14);
    background: transparent;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* Channel section */

.channel-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: min(100%, 1200px);
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.25rem 1rem;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
}

.section-header {
    padding: 0 0.15rem;
}

.section-title {
    margin: 0;
    font-size: 1.2rem;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 0.15rem;
    flex-wrap: wrap;
}

.section-heading-copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.section-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem;
    border-radius: 999px;
    background: rgba(8, 11, 26, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.view-toggle-button {
    border: 0;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.view-toggle-button:hover {
    color: var(--text-main);
}

.view-toggle-button.is-active {
    background: linear-gradient(135deg, rgba(255, 77, 106, 0.22), rgba(79, 127, 255, 0.24));
    color: var(--text-main);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
}

/* Grid */

.channel-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
}

/* Channel card */

.channel-card {
    background: var(--bg-elevated-softer);
    border-radius: var(--radius-lg);
    padding: 0.9rem 0.95rem 0.85rem;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    position: relative;
    overflow: hidden;
    cursor: default;
    transition: transform var(--transition-med), box-shadow var(--transition-med), border-color var(--transition-med), background var(--transition-med);
}

.channel-card::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at 0 0, rgba(255, 77, 106, 0.25), transparent 55%);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-med);
}

.channel-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.75);
    background: rgba(30, 35, 70, 0.96);
}

.channel-card:hover::before {
    opacity: 1;
}

.channel-card-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.filter-group-search label {
    font-size: 0.74rem;
    color: #ff93a5;
}

.filter-group-search input[type="text"] {
    min-height: 3.2rem;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    border-radius: 1rem;
    background: rgba(7, 10, 25, 0.96);
}

.search-strip-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.channel-logo-wrapper {
    width: 54px;
    height: 54px;
    border-radius: 1rem;
    overflow: hidden;
    background: radial-gradient(circle at 30% 0, #333c7a 0, #101428 50%, #050712 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    justify-content: center;
}

.channel-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
}

.logo-fallback {
    display: none;
}

.channel-logo-placeholder {
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.95rem;
}

.channel-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1;
    min-width: 0;
}

.channel-number {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-soft);
}

.channel-name {
    margin: 0;
    font-size: 1rem;
}

.channel-country-pill {
    font-size: 0.7rem;
    padding: 0.1rem 0.55rem;
    border-radius: var(--radius-pill);
    align-self: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 19, 40, 0.9);
    color: var(--text-muted);
}

.metadata-link {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: #8fc5ff;
    text-decoration: none;
}

.metadata-link:hover {
    text-decoration: underline;
}

body.is-scrolled .header-now-playing {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

body.is-scrolled .header-now-playing.is-idle {
    opacity: 0.78;
}

body.is-scrolled .now-playing-banner {
    opacity: 0;
    transform: translateY(-16px) scale(0.98);
    pointer-events: none;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    overflow: hidden;
    border-width: 0;
}

.favorite-toggle {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-pill);
    padding: 0.3rem 0.7rem;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
}

.favorite-toggle.is-active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: rgba(255, 77, 106, 0.4);
}

/* EPG */

.epg-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.35rem;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.epg-item {
    padding: 0.35rem 0.35rem 0.45rem;
    border-radius: 0.8rem;
    background: rgba(5, 7, 18, 0.65);
    border: 1px solid transparent;
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.epg-item--highlight {
    border-color: rgba(255, 215, 120, 0.9);
    background: rgba(60, 48, 12, 0.75);
}

.epg-item:hover {
    transform: translateY(-1px);
    background: rgba(14, 18, 38, 0.95);
}

.epg-item-empty {
    border-style: dashed;
    border-color: rgba(120, 146, 190, 0.26);
    background: rgba(8, 11, 24, 0.48);
}

.epg-load-more {
    border: 1px dashed rgba(140, 194, 255, 0.28);
    border-radius: 0.9rem;
    padding: 0.7rem 0.85rem;
    background: rgba(9, 14, 31, 0.78);
    color: #9fd2ff;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.epg-load-more:hover {
    background: rgba(18, 28, 54, 0.9);
    border-color: rgba(159, 210, 255, 0.52);
    color: var(--text-main);
}

.epg-load-more.is-loading {
    opacity: 0.7;
    cursor: progress;
}

.epg-now,
.epg-upcoming {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.epg-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-soft);
}

.epg-now-pill {
    font-size: 0.7rem;
    padding: 0.08rem 0.45rem;
    border-radius: var(--radius-pill);
    background: rgba(61, 214, 140, 0.18);
    color: var(--success);
    border: 1px solid rgba(61, 214, 140, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.epg-label {
    font-size: 0.7rem;
    padding: 0.08rem 0.45rem;
    border-radius: var(--radius-pill);
    background: rgba(91, 103, 170, 0.35);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.epg-time {
    font-variant-numeric: tabular-nums;
}

.epg-title {
    margin: 0.1rem 0 0;
    font-size: 0.88rem;
    color: var(--text-strong);
}

.epg-description {
    margin: 0.15rem 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

body.channel-view-rows .channel-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

body.channel-view-rows .channel-card {
    display: grid;
    grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
    align-items: stretch;
    gap: 0.85rem;
    padding: 0.8rem;
    border-radius: 1.1rem;
}

body.channel-view-rows .channel-card:hover {
    transform: translateY(-2px);
}

body.channel-view-rows .channel-card-header {
    align-items: flex-start;
    gap: 0.85rem;
    padding-right: 0.35rem;
}

body.channel-view-rows .channel-logo-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 0.85rem;
}

body.channel-view-rows .channel-meta {
    gap: 0.2rem;
}

body.channel-view-rows .channel-name {
    font-size: 1.05rem;
    line-height: 1.2;
}

body.channel-view-rows .favorite-toggle {
    align-self: flex-start;
}

body.channel-view-rows .epg-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(170px, 1fr);
    gap: 0.5rem;
    margin-top: 0;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.2rem 0.15rem 0.35rem 0.05rem;
    scrollbar-width: thin;
}

body.channel-view-rows .epg-item {
    min-height: 100%;
    padding: 0.7rem 0.8rem;
    border-radius: 0.9rem;
    background: linear-gradient(180deg, rgba(24, 50, 90, 0.92), rgba(10, 22, 44, 0.94));
    border-color: rgba(140, 194, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.channel-view-rows .epg-load-more {
    min-height: 100%;
    white-space: nowrap;
    align-self: stretch;
}

body.channel-view-rows .epg-description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

body.channel-view-rows .progress-bar-container {
    margin-top: auto;
}

body.channel-view-rows .epg-list:empty::before {
    content: "No programme information available";
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 98px;
    padding: 0.85rem 1rem;
    border-radius: 0.9rem;
    background: rgba(8, 11, 26, 0.78);
    color: var(--text-muted);
    font-size: 0.9rem;
    border: 1px dashed rgba(255, 255, 255, 0.12);
}

.logo-pill {
    width: 2.6rem;
    height: 2.6rem;
    overflow: hidden;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none; /* Remove radial gradient */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.logo-pill img.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* or cover */
}

/* Progress bar */

.progress-bar-container {
    position: relative;
    height: 0.38rem;
    border-radius: var(--radius-pill);
    overflow: hidden;
    background: rgba(35, 40, 75, 0.9);
    margin-top: 0.25rem;
}

.progress-bar-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent);
    opacity: 0.5;
}

.progress-bar {
    position: absolute;
    inset: 0;
    width: 0%;
    background: linear-gradient(90deg, #ffd65a, #ff4d6a);
    transition: width 0.6s ease-out;
}

/* Pagination controls */

.pagination-controls {
    display: flex;
    justify-content: center;
    margin-top: 0.4rem;
}

/* Skeleton loader */

.hidden {
    display: none !important;
}

.skeleton-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 0.9rem;
    background: rgba(10, 12, 28, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 0.75rem;
}

.skeleton-logo {
    width: 52px;
    height: 52px;
    border-radius: 1rem;
    background: rgba(35, 39, 70, 1);
}

.skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.1rem;
}

.skeleton-line {
    height: 0.6rem;
    border-radius: 0.4rem;
    background: rgba(35, 39, 70, 1);
}

.skeleton-line.short {
    width: 50%;
}

/* Shimmer effect */

.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::before {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(
            120deg,
            transparent 0,
            rgba(255, 255, 255, 0.1) 40%,
            rgba(255, 255, 255, 0.2) 50%,
            transparent 80%
    );
    animation: shimmer 1.4s infinite;
}

.channel-card.playing {
    border: 2px solid #00ff9d;
    box-shadow: 0 0 15px #00ff9d;
    transition: 0.3s ease;
}

/* Optional glowing animation */
@keyframes playingGlow {
    0%   { box-shadow: 0 0 10px #00ff9d; }
    50%  { box-shadow: 0 0 20px #00ff9d; }
    100% { box-shadow: 0 0 10px #00ff9d; }
}

.channel-card.playing {
    animation: playingGlow 2s infinite;
}


@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

@keyframes streamStatusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 200, 87, 0.36);
    }
    70% {
        box-shadow: 0 0 0 0.55rem rgba(255, 200, 87, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 200, 87, 0);
    }
}

/* Responsive */

@media (max-width: 900px) {
    .account-grid {
        grid-template-columns: 1fr;
    }

    .account-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .search-strip {
        grid-template-columns: 1fr;
    }

    .search-strip-actions {
        justify-content: flex-start;
    }

    .filter-grid-secondary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-now-playing {
        width: 100%;
    }

    .header-meta {
        align-self: stretch;
        justify-content: flex-start;
        margin-left: 0;
    }

    .channel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .now-playing-banner {
        grid-template-columns: auto 1fr;
    }

    .now-playing-status {
        grid-column: 1 / -1;
        align-items: flex-start;
    }

    .stream-status-panel {
        width: 100%;
    }

    body.channel-view-rows .channel-card {
        grid-template-columns: 1fr;
    }

    body.channel-view-rows .channel-card-header {
        padding-right: 0;
    }
}

@media (max-width: 640px) {
    #app {
        padding: 7rem 1rem 2.5rem;
    }

    .filters-grid {
        gap: 0.85rem;
    }

    .filter-grid-secondary {
        grid-template-columns: 1fr;
    }

    .account-form {
        grid-template-columns: 1fr;
        display: grid;
    }

    .channel-card {
        padding: 0.85rem;
    }

    .channel-grid {
        grid-template-columns: 1fr;
    }

    .channel-section {
        padding: 1rem;
    }

    .now-playing-banner {
        grid-template-columns: 1fr;
    }

    .now-playing-art {
        width: 68px;
        height: 68px;
    }

    .section-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .view-toggle {
        width: 100%;
        justify-content: stretch;
    }

    .view-toggle-button {
        flex: 1;
        text-align: center;
    }

    body.channel-view-rows .epg-list {
        grid-auto-columns: minmax(150px, 72vw);
    }
}
