@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap');

:root{
    --bg: #0b0a16;
    --panel: #16132a;
    --panel-2: #1c1836;
    --border: rgba(255,255,255,.09);
    --border-hover: rgba(143,140,224,.5);
    --text: #f1f0fa;
    --text-dim: #a6a3c9;
    --text-faint: #726f9c;
    --accent: #8f8ce0;
    --accent-2: #6a67c9;
    --accent-soft: rgba(143,140,224,.14);
}

*{ box-sizing: border-box; }
html,body{ margin: 0; padding: 0; overflow-x: hidden; }

body{
    position: relative;
    background: var(--bg);
    color: var(--text-dim);
    font-family: "Roboto Mono", monospace;
    min-height: 100vh;
}

body::after{
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0px, rgba(255,255,255,.02) 1px, transparent 1px, transparent 3px);
    mix-blend-mode: overlay;
}

#glow-a, #glow-b{
    position: fixed;
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(60px);
}
#glow-a{ top: -12%; left: -8%; width: 40vw; height: 40vw; background: radial-gradient(circle, rgba(129,120,223,.22), transparent 70%); }
#glow-b{ bottom: -18%; right: -10%; width: 46vw; height: 46vw; background: radial-gradient(circle, rgba(85,79,165,.16), transparent 70%); }

a{ text-decoration: none; color: inherit; }
::selection{ background: var(--accent-2); color: #fff; }

::-webkit-scrollbar{ width: 12px; }
::-webkit-scrollbar-track{ background: var(--bg); }
::-webkit-scrollbar-thumb{ background: var(--panel-2); border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover{ background: var(--accent-2); }

.wrap{
    position: relative;
    z-index: 2;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px;
}

#topbar{
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11,10,22,.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
#topbar .wrap{
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 108px;
    padding-top: 16px;
    padding-bottom: 16px;
    gap: 20px;
    flex-wrap: wrap;
}
.brand{ display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.brand img{
    display: block;
    height: 58px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    filter: drop-shadow(0 0 16px rgba(143,140,224,.45));
}
.brand-sub{
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--border-hover);
    border-radius: 999px;
    padding: 9px 18px 9px 14px;
    white-space: nowrap;
}
.brand-sub i{
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 9px var(--accent);
    animation: pulseDot 1.8s ease-out infinite;
}

@keyframes pulseDot{
    0%{ box-shadow: 0 0 0 0 rgba(143,140,224,.55); }
    70%{ box-shadow: 0 0 0 6px rgba(143,140,224,0); }
    100%{ box-shadow: 0 0 0 0 rgba(143,140,224,0); }
}

.tv-mark{ color: var(--accent); font-weight: 700; }

.search-box{
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 14px 22px;
    color: var(--text-faint);
    min-width: 320px;
    transition: border-color .15s ease;
}
.search-box:focus-within{ border-color: var(--border-hover); color: var(--text); }
.search-box input{
    background: none;
    border: 0;
    outline: 0;
    color: var(--text);
    font-family: inherit;
    font-size: 16px;
    width: 100%;
}
.search-box input::placeholder{ color: var(--text-faint); }

.channel{ padding: 40px 0 8px; }
.channel-inner{ max-width: 1160px; }

.player-shell{
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 34px 90px rgba(0,0,0,.55), 0 0 0 1px rgba(143,140,224,.08);
    cursor: pointer;
}
#channel-video{ display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }

.no-signal{
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    background:
        repeating-linear-gradient(45deg, #1c1836 0 2px, #16132a 2px 4px);
    color: var(--text-faint);
}
.no-signal.show{ display: flex; }
.no-signal span{ font-size: 28px; font-weight: 800; letter-spacing: .08em; color: var(--text); }
.no-signal p{ margin: 0; font-size: 14px; }

.player-chip{
    position: absolute;
    top: 18px;
    left: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    color: #fff;
    background: rgba(11,10,22,.55);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    padding: 7px 14px 7px 10px;
    backdrop-filter: blur(6px);
}
.player-chip i{
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ff5c5c;
    box-shadow: 0 0 8px #ff5c5c;
    animation: pulseDot 1.6s ease-out infinite;
}

.player-hint{
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(5,4,10,.45);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .04em;
}
.player-hint.show{ display: flex; }

#newsbar{
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: block;
    width: 100%;
    height: auto;
}

.now-playing{
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 22px;
    padding: 0 4px;
}
.np-label{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent);
    flex-shrink: 0;
}
.np-label i{
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: pulseDot 1.8s ease-out infinite;
}
.np-title{
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.np-copy{
    font-family: "Roboto Mono", monospace;
    font-size: 13px;
    color: var(--text);
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 20px;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color .15s ease, background .15s ease;
}
.np-copy:hover{ border-color: var(--border-hover); background: var(--accent-soft); }

.section-title{
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 24px;
}

main.wrap{ padding: 48px 40px 80px; min-height: 50vh; }

.state{
    text-align: center;
    color: var(--text-faint);
    font-size: 17px;
    padding: 70px 20px;
    line-height: 1.9;
}
.state code{
    display: inline-block;
    max-width: 100%;
    margin-top: 14px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 18px;
    color: var(--accent);
    font-size: 15px;
    word-break: break-all;
    white-space: normal;
}

@keyframes fadeUp{
    from{ opacity: 0; transform: translateY(10px); }
    to{ opacity: 1; transform: translateY(0); }
}

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

.card{
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
    animation: fadeUp .4s ease both;
}
.card:hover{
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 24px 55px rgba(0,0,0,.45);
}
.card-thumb{
    position: relative;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,.08), transparent 60%),
        linear-gradient(145deg, var(--thumb-a, #4b4989), var(--thumb-b, #2c2a52));
    color: rgba(255,255,255,.85);
    font-weight: 700;
    font-size: 44px;
    letter-spacing: .02em;
}
.card-thumb .play{
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(11,10,22,.55);
    border: 1px solid rgba(255,255,255,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.card-thumb .play svg{ width: 24px; height: 24px; fill: #fff; margin-left: 3px; }
.card-body{ padding: 20px 22px 24px; }
.card-title{
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.card-meta{ font-size: 13px; color: var(--text-faint); display: flex; gap: 10px; }

#footer{
    border-top: 1px solid var(--border);
    padding: 32px 0 56px;
    text-align: center;
    color: var(--text-faint);
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.card.playing{ border-color: var(--border-hover); box-shadow: 0 0 0 2px rgba(143,140,224,.25); }
.now-badge{
    position: absolute;
    top: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    color: #fff;
    background: rgba(11,10,22,.6);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    padding: 5px 11px 5px 8px;
    backdrop-filter: blur(4px);
}
.now-badge i{
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff5c5c;
    box-shadow: 0 0 6px #ff5c5c;
    animation: pulseDot 1.6s ease-out infinite;
}

@media (max-width: 640px){
    .wrap{ padding: 0 20px; }
    #topbar .wrap{ min-height: auto; }
    .search-box{ min-width: 0; width: 100%; flex-basis: 100%; }
    main.wrap{ padding: 32px 20px 56px; }
    .channel{ padding: 24px 0 4px; }
    .np-title{ white-space: normal; }
}
