:root {
    color-scheme: dark;
    --bg: #061426;
    --bg-deep: #030b15;
    --panel: rgba(12, 34, 57, .9);
    --panel-strong: #0d2842;
    --line: rgba(103, 170, 220, .22);
    --cyan: #20c9e5;
    --blue: #1477df;
    --gold: #c8995f;
    --text: #f5f9ff;
    --muted: #9fb4cb;
    --success: #3ddc97;
    --danger: #ff7180;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg-deep); }

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 70% 0%, rgba(14, 114, 210, .17), transparent 33rem),
        linear-gradient(145deg, var(--bg-deep), var(--bg) 58%, #071c31);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

.ambient {
    position: fixed;
    z-index: 0;
    width: 34rem;
    height: 34rem;
    border: 1px solid rgba(25, 190, 230, .08);
    border-radius: 50%;
    pointer-events: none;
}

.ambient-one { left: -19rem; top: 10rem; box-shadow: 0 0 0 5rem rgba(15, 89, 181, .035); }
.ambient-two { right: -23rem; bottom: -12rem; box-shadow: 0 0 0 6rem rgba(25, 190, 230, .025); }

.shell {
    position: relative;
    z-index: 1;
    width: min(100% - 48px, 1280px);
    margin: 0 auto;
    padding: 26px 0 34px;
}

.topbar {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(159, 180, 203, .13);
}

.brand { display: inline-flex; align-items: center; }
.brand img { display: block; width: 230px; max-height: 84px; object-fit: contain; object-position: left center; }

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 0 17px;
    border: 1px solid rgba(32, 201, 229, .65);
    border-radius: 999px;
    background: rgba(10, 50, 79, .72);
    color: var(--cyan);
    font-size: .8rem;
    font-weight: 850;
    letter-spacing: .08em;
}

.live-pill span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 5px rgba(61, 220, 151, .1);
}

.hero { max-width: 900px; margin: 54px auto 34px; text-align: center; }
.eyebrow { margin: 0 0 10px; color: var(--gold); font-size: .72rem; font-weight: 850; letter-spacing: .18em; }
.hero h1 { margin: 0; font-size: clamp(2.25rem, 5vw, 4.45rem); line-height: 1.02; letter-spacing: -.045em; }
.hero h1 span { color: var(--cyan); }
.hero > p:last-child { max-width: 680px; margin: 17px auto 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.22rem); line-height: 1.6; }

.on-air { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 30px; }
.status-card {
    min-width: 0;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    min-height: 142px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(15, 43, 70, .96), rgba(7, 25, 43, .9));
    box-shadow: 0 18px 46px rgba(0, 0, 0, .24);
}
.now-card { border-top: 2px solid var(--cyan); }
.next-card { border-top: 2px solid var(--gold); }
.status-icon {
    width: 76px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(17, 119, 223, .58), rgba(32, 201, 229, .16));
    color: white;
    font-size: 1.7rem;
}
.next-card .status-icon { background: linear-gradient(145deg, rgba(200, 153, 95, .5), rgba(31, 78, 116, .35)); }
.status-label { display: block; margin-bottom: 8px; color: var(--cyan); font-size: .7rem; font-weight: 900; letter-spacing: .12em; }
.next-card .status-label { color: #efbb70; }
.status-label i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--success); }
.status-card strong { display: block; overflow: hidden; color: var(--text); font-size: clamp(1.05rem, 2vw, 1.35rem); text-overflow: ellipsis; white-space: nowrap; }
.status-card small { display: block; margin-top: 6px; color: var(--muted); }

.library {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(8, 28, 48, .78);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
    backdrop-filter: blur(12px);
}

.library-heading {
    display: grid;
    grid-template-columns: 1fr minmax(320px, 520px);
    align-items: end;
    gap: 28px;
    margin-bottom: 24px;
}
.library-heading h2 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.25rem); letter-spacing: -.025em; }

.search-wrap { position: relative; display: block; }
.search-wrap svg {
    position: absolute;
    left: 17px;
    top: 50%;
    width: 22px;
    height: 22px;
    transform: translateY(-50%);
    fill: none;
    stroke: var(--muted);
    stroke-linecap: round;
    stroke-width: 1.8;
}
.search-wrap input {
    width: 100%;
    min-height: 54px;
    padding: 0 18px 0 52px;
    border: 1px solid #315775;
    border-radius: 14px;
    outline: 0;
    background: rgba(3, 16, 29, .8);
    color: white;
    font-size: 1rem;
    transition: border-color .18s, box-shadow .18s;
}
.search-wrap input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(32, 201, 229, .12); }
.search-wrap input::placeholder { color: #7e96ae; }

.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.video-card {
    min-width: 0;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-rows: minmax(66px, auto) auto;
    column-gap: 15px;
    padding: 12px;
    border: 1px solid rgba(82, 135, 174, .32);
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(15, 43, 70, .9), rgba(6, 25, 43, .92));
    transition: transform .18s, border-color .18s, box-shadow .18s;
}
.video-card:hover { transform: translateY(-2px); border-color: rgba(32, 201, 229, .58); box-shadow: 0 14px 28px rgba(0, 0, 0, .22); }
.video-card[hidden] { display: none; }

.cover {
    position: relative;
    grid-row: 1 / span 2;
    width: 96px;
    min-height: 116px;
    overflow: hidden;
    border-radius: 11px;
    background:
        linear-gradient(145deg, hsla(var(--hue), 86%, 53%, .84), hsla(calc(var(--hue) + 46), 77%, 23%, .95));
}
.cover::after { content: ""; position: absolute; inset: auto -18px -25px auto; width: 76px; height: 76px; border: 10px solid rgba(255,255,255,.08); border-radius: 50%; }
.cover-number { position: absolute; top: 9px; left: 10px; color: rgba(255,255,255,.75); font-size: .66rem; font-weight: 900; letter-spacing: .08em; }
.cover-logo {
    position: absolute;
    z-index: 1;
    inset: 50% auto auto 50%;
    width: 78%;
    max-height: 82%;
    object-fit: contain;
    filter: drop-shadow(0 7px 12px rgba(0, 0, 0, .34));
    transform: translate(-50%, -45%);
}
.tone-0 { --hue: 193; }.tone-1 { --hue: 213; }.tone-2 { --hue: 31; }
.tone-3 { --hue: 175; }.tone-4 { --hue: 232; }.tone-5 { --hue: 202; }

.video-copy { align-self: center; min-width: 0; }
.video-copy h3 { display: -webkit-box; overflow: hidden; margin: 0; color: white; font-size: .98rem; line-height: 1.28; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.video-copy p { overflow: hidden; margin: 7px 0 0; color: var(--muted); font-size: .77rem; text-overflow: ellipsis; white-space: nowrap; }
.request-button {
    align-self: end;
    width: 100%;
    min-height: 39px;
    margin-top: 10px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(90deg, #19c6df, #23d9df);
    color: #02131f;
    cursor: pointer;
    font-size: .82rem;
    font-weight: 900;
    transition: filter .16s, transform .16s;
}
.request-button:hover { filter: brightness(1.08); }
.request-button:active { transform: scale(.98); }
.request-button:focus-visible, .pager button:focus-visible { outline: 3px solid rgba(32, 201, 229, .4); outline-offset: 3px; }
.request-button:disabled { cursor: default; opacity: .78; }
.request-button.added { background: var(--success); }

.pager { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 26px; }
.pager button { width: 42px; height: 42px; border: 1px solid #315775; border-radius: 50%; background: #0b2640; color: white; cursor: pointer; font-size: 1.65rem; line-height: 1; }
.pager button:disabled { cursor: default; opacity: .35; }
.pager span { min-width: 170px; color: var(--muted); text-align: center; font-size: .88rem; font-weight: 700; }
.empty-state { margin: 34px 0; color: var(--muted); text-align: center; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px 4px 0; color: #7189a1; font-size: .75rem; }

#notice {
    position: fixed;
    z-index: 10;
    right: 22px;
    bottom: 22px;
    width: min(390px, calc(100% - 28px));
    display: none;
    padding: 15px 17px;
    border: 1px solid rgba(61, 220, 151, .42);
    border-radius: 13px;
    background: rgba(8, 37, 52, .97);
    color: white;
    box-shadow: 0 18px 50px rgba(0,0,0,.42);
    font-weight: 750;
}
#notice.error { border-color: rgba(255, 113, 128, .55); background: rgba(55, 18, 30, .97); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 1020px) {
    .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .library-heading { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 720px) {
    .shell { width: min(100% - 28px, 1280px); padding-top: 14px; }
    .topbar { min-height: 66px; }
    .brand img { width: 175px; max-height: 68px; }
    .live-pill { min-height: 36px; padding: 0 12px; font-size: .68rem; }
    .hero { margin: 38px auto 26px; }
    .on-air { grid-template-columns: 1fr; gap: 12px; }
    .status-card { grid-template-columns: 62px minmax(0,1fr); min-height: 112px; padding: 15px; }
    .status-icon { width: 62px; border-radius: 13px; }
    .library { padding: 18px; border-radius: 18px; }
    .video-grid { grid-template-columns: 1fr; }
    .video-card { grid-template-columns: 82px minmax(0, 1fr); }
    .cover { width: 82px; min-height: 108px; }
    footer { flex-direction: column; text-align: center; }
}

@media (max-width: 430px) {
    .shell { width: min(100% - 20px, 1280px); }
    .topbar { align-items: flex-start; }
    .brand img { width: 144px; }
    .live-pill { margin-top: 5px; padding: 0 10px; letter-spacing: .04em; }
    .hero h1 { font-size: 2.2rem; }
    .library { padding: 14px; }
    .library-heading { gap: 14px; }
    .pager { gap: 12px; }
    .pager span { min-width: 145px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
