:root {
    --bg: #0b0d12;
    --bg-elevated: #12151c;
    --bg-panel: #161a23;
    --border: #232733;
    --text: #eef0f4;
    --text-muted: #8b91a3;
    --accent: #6c5ce7;
    --accent-2: #00d2a8;
    --live: #ff4757;
    --radius: 12px;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3 {
    color: var(--text);
}

a {
    color: var(--accent);
}

/* Header */

.site-header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.site-header__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
    font-size: 1.25rem;
}

.brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-weight: 700;
}

.brand__name strong {
    color: var(--accent-2);
}

.category-nav {
    display: flex;
    gap: 0.5rem;
}

.category-nav__link {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.category-nav__link:hover {
    color: var(--text);
    background: var(--bg-panel);
}

.category-nav__link.is-active {
    color: #fff;
    background: var(--accent);
}

/* Main layout */

.site-main {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
}

.watch-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    align-items: start;
}

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

/* Channel panel */

.channel-panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
}

.channel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.channel-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0.6rem 0.7rem;
    cursor: pointer;
    text-align: left;
    color: var(--text);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.channel-item:hover {
    background: var(--bg-panel);
}

.channel-item.is-active {
    background: var(--bg-panel);
    border-color: var(--accent);
}

.channel-item__logo {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
}

.channel-item__meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.channel-item__name {
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-item__quality {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.channel-item__live {
    flex: none;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--live);
    border: 1px solid var(--live);
    border-radius: 999px;
    padding: 0.15rem 0.4rem;
}

.channel-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.channel-empty p {
    margin: 0 0 0.25rem;
    color: var(--text);
    font-weight: 600;
}

.channel-empty span {
    font-size: 0.85rem;
}

/* Player panel */

.player-panel {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.player-shell {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.player-video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-muted);
    background: radial-gradient(circle at center, #1a1e29 0%, #05060a 100%);
    pointer-events: none;
}

.player-overlay__icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.player-status {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(5, 6, 10, 0.75);
    color: var(--text-muted);
}

.spinner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    animation: spin 0.8s linear infinite;
}

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

.now-playing {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
}

.now-playing__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 0 4px rgba(255, 71, 87, 0.15);
}

.now-playing__name {
    font-weight: 700;
}

.now-playing__quality {
    color: var(--text-muted);
    font-size: 0.85rem;
}

[hidden] {
    display: none !important;
}

/* Footer */

.site-footer {
    text-align: center;
    padding: 1.25rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}
