* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: #090b10;
    color: #f5f7fb;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(390px, 100%);
    background: #121620;
    border: 1px solid #242a38;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 24px 80px rgba(0,0,0,.35);
}

.brand {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .08em;
}

.login-card p {
    color: #939cad;
    margin: 6px 0 24px;
}

.login-card label {
    display: block;
    margin: 14px 0;
    color: #c5ccda;
}

.login-card input,
.sidebar input {
    width: 100%;
    margin-top: 7px;
    border: 1px solid #30384a;
    background: #0d1119;
    color: white;
    border-radius: 10px;
    padding: 12px 13px;
    outline: none;
}

.login-card button {
    width: 100%;
    margin-top: 12px;
    border: 0;
    border-radius: 10px;
    padding: 13px;
    font-weight: 700;
}

.error {
    min-height: 22px;
    margin-top: 12px;
    color: #ff8b8b;
    font-size: 14px;
}

.topbar {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    border-bottom: 1px solid #202633;
    background: #0d1017;
    position: sticky;
    top: 0;
    z-index: 5;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #929cad;
}

.secondary {
    border: 1px solid #30384a;
    background: transparent;
    color: #dce2ee;
    padding: 8px 12px;
    border-radius: 9px;
}

.layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: calc(100vh - 64px);
}

.sidebar {
    border-right: 1px solid #202633;
    padding: 18px;
    overflow: auto;
}

.categories {
    display: grid;
    gap: 7px;
    margin-top: 16px;
}

.category {
    border: 0;
    border-radius: 9px;
    text-align: left;
    padding: 10px 11px;
    background: transparent;
    color: #aeb7c7;
}

.category:hover,
.category.active {
    background: #1d2431;
    color: white;
}

.content {
    padding: 20px;
    min-width: 0;
}

.player-shell {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 64vh;
    background: black;
    border-radius: 14px;
    overflow: hidden;
}

.player-shell video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: black;
}

.player-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
    color: #788295;
}

.now-playing {
    position: absolute;
    left: 14px;
    bottom: 12px;
    background: rgba(0,0,0,.65);
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 13px;
    pointer-events: none;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0 12px;
}

.section-title h2 {
    margin: 0;
    font-size: 19px;
}

.section-title span {
    color: #828c9e;
    font-size: 13px;
}

.channels {
    display: grid;
    grid-template-columns:
        repeat(auto-fill, minmax(190px, 1fr));
    gap: 8px;
}

.channel {
    min-height: 48px;
    border: 1px solid #222a39;
    border-radius: 10px;
    padding: 10px 12px;
    background: #121720;
    color: #e8edf5;
    text-align: left;
}

.channel:hover {
    background: #1a2130;
}

@media (max-width: 800px) {
    .layout {
        display: block;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid #202633;
    }

    .categories {
        display: flex;
        overflow-x: auto;
        gap: 7px;
        padding-bottom: 3px;
    }

    .category {
        white-space: nowrap;
    }

    .content {
        padding: 12px;
    }

    .channels {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .channels {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 0 14px;
    }
}
