:root {
    --banner-image-desktop: url("/publicuploads/banner.webp");

    --bg: #09090b;
    --surface: #111114;
    --surface-hover: #17171c;
    --line: rgba(255, 255, 255, 0.07);
    --line-strong: rgba(255, 255, 255, 0.15);
    --text: #f4f2fa;
    --text-dim: #908d9e;
    --text-faint: #5b5866;
    --accent: #9a6bff;
    --accent-bright: #c9b1ff;
    --accent-soft: rgba(154, 107, 255, 0.13);
    --live: #ff3d51;

    --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

    --radius: 8px;
    --content-width: 880px;
}

*, ::before, ::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scrollbar-color: #26262d var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}

/* ambient glow behind everything */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(900px 420px at 50% -120px, rgba(154, 107, 255, 0.16), transparent 70%),
        radial-gradient(700px 500px at 88% 112%, rgba(255, 61, 81, 0.05), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* film grain over everything */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
    z-index: 100;
}

a {
    color: inherit;
    text-decoration: none;
}

::selection {
    background: var(--accent);
    color: #0b0714;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-thumb {
    background: #26262d;
    border-radius: 5px;
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

/* ============================================================
   Header
   ============================================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgb(0 0 0 / 0.82);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0px 3px 12px 0px #000000b0;
}

.header-inner {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 24px;
}

/* signature gradient edge along the very top */
.site-header::after {
    content: "";
    display: block;
    height: 2px;
    background: linear-gradient(90deg,
    transparent,
    color-mix(in srgb, var(--accent) 50%, transparent) 18%,
    color-mix(in srgb, var(--accent-bright) 50%, transparent) 50%,
    color-mix(in srgb, var(--accent) 50%, transparent) 82%,
    transparent);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.brand-lockup {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-name {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.brand-name em {
    font-style: normal;
    color: var(--accent);
}

.brand-sub {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.36em;
    color: var(--text-dim);
    margin-top: 1px;
}

.header-nav {
    display: flex;
    gap: 2px;
    margin-left: auto;
}

.nav-link {
    position: relative;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.14em;
    color: var(--text-dim);
    padding: 9px 12px;
    border-radius: 6px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 4px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link:hover::after {
    transform: scaleX(1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.icon-btt:hover {
    color: var(--text);
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.04);
}

.icon-btt img,
.icon-btt svg {
    width: 16px;
    height: 16px;
    display: block;
}

/*
   Filter tray (toggled by streamlist.js: display none <-> block)
    */

#checkboxes {
    display: none;
    border-top: 1px solid var(--line);
    padding: 12px 20px 14px;
    text-align: center;
    animation: tray-in 0.22s ease;
}

@keyframes tray-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

#checkboxes label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 4px 3px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

#checkboxes label::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-faint);
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

#checkboxes label:hover {
    border-color: var(--line-strong);
    color: var(--text);
}

#checkboxes label:has(input:checked) {
    border-color: rgba(154, 107, 255, 0.5);
    background: var(--accent-soft);
    color: var(--text);
}

#checkboxes label:has(input:checked)::before {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

#checkboxes input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* ============================================================
   Page layout / banner
   ============================================================ */

.page {
    position: relative;
    z-index: 1;
    width: min(100% - 32px, var(--content-width));
    margin: 0 auto;
    flex: 1;
}

.banner-link {
}

.navigation-banner {
    height: 135px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background-image: var(--banner-image-desktop);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-color: var(--surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.banner-link:hover .navigation-banner {
}

.stream-container {
    padding: 28px 0 44px;
}

.page-heading {
    padding: 38px 2px 22px;
}

.page-kicker {
    display: block;
    margin-bottom: 6px;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.28em;
}

.page-heading h1 {
    margin: 0;
    font-size: clamp(28px, 5vw, 42px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

/* ============================================================
   Section headers (generated by streamlist.js)
   ============================================================ */

.section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 2px 12px;
}

.section-head::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--line-strong), transparent);
}

.section-title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: var(--text);
}

.section-offline .section-title {
    color: var(--text-dim);
}

.section-count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 1px 9px;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--live);
    animation: live-pulse 1.8s ease-out infinite;
}

@keyframes live-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 61, 81, 0.45);
    }
    70% {
        box-shadow: 0 0 0 9px rgba(255, 61, 81, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 61, 81, 0);
    }
}

/* ============================================================
   Platform colors (badge classes set by streamlist.js)
   ============================================================ */

.badge_youtube { --pc: #ff3a3a; }
.badge_twitch  { --pc: #9146ff; }
.badge_bitwave { --pc: #0d84dc; }
.badge_dlive   { --pc: #ffd300; }
.badge_robot   { --pc: #969696; }
.badge_trovo   { --pc: #1cb972; }
.badge_goy     { --pc: #fdfbff; }
.badge_ody     { --pc: #ff6a6b; }
.badge_bake    { --pc: #06a2cb; }
.badge_vau     { --pc: #3e6f9e; }
.badge_kick    { --pc: #53fc18; }
.badge_rumble  { --pc: #85c742; }

/* ============================================================
   Stream rows
   ============================================================ */

.table-row {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

/* platform-colored edge */
.table-row::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--pc, #3a3a42);
    opacity: 0.85;
    transition: width 0.15s ease, opacity 0.15s ease;
}

.table-row:hover {
    background: var(--surface-hover);
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

.table-row:hover::before {
    width: 5px;
    opacity: 1;
}

.stream-icon {
    flex: none;
    border-radius: 9px;
    background-color: #000;
    object-fit: cover;
}

.stream-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

/* --- online --- */

.online-row {
    gap: 14px;
    padding: 5px 16px 5px 19px;
    margin-bottom: 8px;
}

.online-row .stream-icon {
    width: 48px;
    height: 48px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.name {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-title {
    color: var(--text-dim);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.viewer-count {
    flex: none;
    display: flex;
    align-items: center;
}

.viewer-count span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.viewer-count span::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 6px rgba(255, 61, 81, 0.6);
}

/* --- offline --- */

.offline-streamers {
    margin-top: 36px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 8px;
}

.offline-streamers .section-head {
    grid-column: 1 / -1;
    margin-bottom: 4px;
}

.offline-row {
    gap: 10px;
    padding: 4px 6px 4px 6px;
    opacity: 0.9;
}

.offline-row::before {
    opacity: 0.35;
}

.offline-row:hover::before {
    opacity: 0.9;
}

.offline-row .stream-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    filter: grayscale(60%);
    transition: filter 0.15s ease;
}

.offline-row:hover .stream-icon {
    filter: none;
}

.offline-name {
    color: #cac7d4;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.offline-time {
    flex: none;
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-faint);
    white-space: nowrap;
}

.unhide-btt {
    grid-column: 1 / -1;
    margin-top: 6px;
    padding: 11px;
    background: transparent;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.unhide-btt:hover {
    color: var(--text);
    border-color: rgba(154, 107, 255, 0.5);
    background: var(--accent-soft);
}

/* everything filtered out */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 70px 20px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
}

.empty-title {
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: 0.4em;
    color: var(--text-dim);
}

.empty-sub {
    font-size: 13px;
    color: var(--text-faint);
}

/* Footer*/

footer {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    padding: 18px 0 22px;
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
}

.footer-details {
    color: var(--text-faint);
    text-transform: uppercase;
    transition: color 0.15s ease;
}

.footer-details:hover {
    color: var(--accent);
}

.footer-sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-faint);
}

/*Responsive*/

@media (min-width: 400px) {
    .header-inner {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
    }

    .header-nav {
        margin-left: 0;
    }

    .header-actions {
        justify-self: end;
    }
}

@media (max-width: 720px) {
    .header-inner {
        gap: 16px;
    }

    .navigation-banner {
        height: clamp(104px, 30vw, 120px);
    }

    .stream-container {
        padding-top: 22px;
    }

    .header-actions .icon-btt:not(.text-action) span {
        display: none;
    }
}

@media (max-width: 620px) {
    .header-inner {
        gap: 10px;
    }

    .nav-link {
        padding-inline: 8px;
        font-size: 10px;
        letter-spacing: 0.08em;
    }
}

@media (max-width: 500px) {
    .brand-lockup {
        display: none;
    }

    .page {
        width: calc(100% - 24px);
    }

    .header-actions .icon-btt:not(.text-action) {
        justify-content: center;
        width: 34px;
        padding: 0;
    }

    .header-nav {
        gap: 0;
    }

    .nav-link {
        padding-inline: 6px;
    }

    .page-heading {
        padding-top: 28px;
    }

    .loading-page .empty-title {
        font-size: 12px;
        letter-spacing: 0.16em;
        text-align: center;
    }
}

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

    .online-row {
        gap: 11px;
        padding: 10px 12px 10px 15px;
    }

    .online-row .stream-icon {
        width: 42px;
        height: 42px;
    }

    .video-title {
        font-size: 12px;
    }
}

@media (max-width: 380px) {
    .page {
        width: calc(100% - 16px);
    }

    .header-inner {
        gap: 5px;
        padding-inline: 6px;
    }

    .nav-link {
        font-size: 9px;
        letter-spacing: 0.04em;
        padding-inline: 4px;
    }

    .header-actions .icon-btt:not(.text-action) {
        width: 32px;
        height: 32px;
    }

    .header-actions .text-action {
        height: 32px;
        padding-inline: 9px;
        font-size: 10px;
        letter-spacing: 0.08em;
    }

    .index-page .online-row {
        gap: 9px;
        padding-right: 10px;
        padding-left: 12px;
    }

    .index-page .viewer-count span {
        gap: 5px;
        font-size: 12px;
    }

    .index-page .viewer-count span::before {
        width: 5px;
        height: 5px;
    }
}

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