:root {
    --bg: #070709;
    --card: rgba(18, 18, 22, 0.78);
    --line: rgba(255, 255, 255, 0.08);
    --text: #f4f1ea;
    --muted: #9a958c;
    --pink: #fe2c55;
    --cyan: #25f4ee;
    --ok: #7dffb3;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: Sora, system-ui, sans-serif;
    color: var(--text);
    background: var(--bg);
    letter-spacing: -0.02em;
}

.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb {
    position: absolute;
    width: 48vw;
    height: 48vw;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.28;
}
.orb-a { top: -18vw; left: -10vw; background: #fe2c55; }
.orb-b { right: -12vw; bottom: -20vw; background: #25f4ee; }
.grain {
    position: absolute;
    inset: 0;
    opacity: 0.18;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}

.top, main, footer { width: min(980px, calc(100% - 32px)); margin: 0 auto; }
.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 0 8px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #111;
    border: 1px solid var(--line);
}
.brand strong { display: block; font-size: 15px; }
.brand small { color: var(--muted); font-size: 12px; }
.chip {
    margin: 0;
    font-size: 12px;
    color: var(--cyan);
    border: 1px solid rgba(37, 244, 238, 0.28);
    border-radius: 999px;
    padding: 6px 12px;
}

.hero { padding: 42px 0 12px; }
.eyebrow {
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    color: var(--pink);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin: 0 0 14px;
}
h1 {
    font-size: clamp(34px, 6vw, 64px);
    line-height: 0.95;
    margin: 0 0 16px;
    font-weight: 800;
    max-width: 12ch;
}
h1 em {
    font-style: normal;
    background: linear-gradient(90deg, var(--cyan), #fff 40%, var(--pink));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.lede { max-width: 46ch; color: var(--muted); font-size: 17px; line-height: 1.5; margin: 0 0 28px; }

.search {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
}
.field {
    flex: 1 1 280px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 4px 16px;
    min-height: 62px;
}
.at { color: var(--cyan); font-weight: 700; font-size: 22px; }
.field input {
    flex: 1;
    background: none;
    border: 0;
    outline: none;
    color: #fff;
    font: 600 20px/1 Sora, sans-serif;
    width: 100%;
}
.field input::placeholder { color: #5c5853; font-weight: 500; }
.search button, .download-btn {
    border: 0;
    cursor: pointer;
    font: 700 15px/1 Sora, sans-serif;
}
.search button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #111;
    border-radius: 16px;
    padding: 0 22px;
    min-height: 62px;
    transition: transform .15s ease, background .15s ease;
}
.search button:hover { transform: translateY(-1px); background: var(--cyan); }
.search button:disabled { opacity: 0.55; cursor: wait; transform: none; }
.format-pick {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 13px;
}
.format-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px;
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
    background: rgba(255,255,255,0.03);
}
.format-btn input { accent-color: var(--cyan); }
.format-btn:has(input:checked) {
    border-color: rgba(37, 244, 238, 0.5);
    background: rgba(37, 244, 238, 0.1);
    color: var(--cyan);
}
.hint { color: #6f6b66; font-size: 13px; margin: 10px 0 0; }

.panel {
    margin-top: 28px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 22px;
    backdrop-filter: blur(16px);
}
.hidden { display: none !important; }

.live-card { display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; align-items: center; }
.live-card img, .avatar-fallback {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    object-fit: cover;
    background: #1b1b20;
}
.avatar-fallback { display: grid; place-items: center; font-weight: 800; color: var(--cyan); }
.live-card h2 { margin: 0 0 4px; font-size: 20px; }
.meta { color: var(--muted); font-size: 13px; margin: 0; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 6px 10px;
    margin-top: 8px;
}
.badge.live { background: rgba(254, 44, 85, 0.16); color: var(--pink); }
.badge.replay { background: rgba(37, 244, 238, 0.12); color: var(--cyan); }
.badge.offline { background: rgba(255,255,255,0.06); color: var(--muted); }
.pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pink);
    box-shadow: 0 0 0 0 rgba(254, 44, 85, 0.7);
    animation: pulse 1.4s infinite;
}
@keyframes pulse {
    70% { box-shadow: 0 0 0 8px rgba(254, 44, 85, 0); }
    100% { box-shadow: 0 0 0 0 rgba(254, 44, 85, 0); }
}
.download-btn {
    background: linear-gradient(135deg, var(--pink), #ff6b8a);
    color: #fff;
    border-radius: 14px;
    padding: 14px 18px;
    white-space: nowrap;
}
.download-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.live-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    max-height: min(62vh, 560px);
    overflow: auto;
    padding-right: 4px;
}
.live-row {
    display: grid;
    grid-template-columns: 18px 72px 1fr;
    gap: 12px;
    align-items: center;
    width: 100%;
    text-align: left;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px;
    background: rgba(255,255,255,0.02);
    color: inherit;
    font: inherit;
}
.live-row:hover { border-color: rgba(255,255,255,0.18); }
.live-row.selected {
    border-color: rgba(37, 244, 238, 0.55);
    background: rgba(37, 244, 238, 0.08);
}
.pick-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.25);
    justify-self: center;
}
.live-row.selected .pick-dot {
    border-color: var(--cyan);
    background: var(--cyan);
    box-shadow: 0 0 0 4px rgba(37, 244, 238, 0.15);
}
.live-row img, .live-cover {
    width: 72px;
    height: 96px;
    object-fit: cover;
    border-radius: 12px;
    background: #16161b;
}
.live-cover { display: grid; place-items: center; color: var(--cyan); font-size: 11px; font-weight: 700; }
.live-row strong { display: block; font-size: 14px; }
.live-actions { margin-top: 16px; display: flex; justify-content: flex-end; }

.progress-head { display: flex; justify-content: space-between; margin-bottom: 10px; }
#progress-pct { font-family: "IBM Plex Mono", monospace; color: var(--cyan); }
.bar {
    height: 10px;
    background: #17171c;
    border-radius: 99px;
    overflow: hidden;
}
.bar i {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--cyan), var(--pink));
    transition: width .25s ease;
}
#progress-msg { color: var(--muted); font-size: 14px; margin: 0; }
.progress-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}
.stop-btn {
    flex: 0 0 auto;
    background: transparent;
    color: #ff8da3;
    border: 1px solid rgba(254, 44, 85, 0.4);
    border-radius: 999px;
    padding: 8px 14px;
    font: 700 13px/1 Sora, sans-serif;
    cursor: pointer;
}
.stop-btn:hover { background: rgba(254, 44, 85, 0.12); color: #fff; }
.stop-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.error {
    margin-top: 18px;
    background: rgba(254, 44, 85, 0.1);
    border: 1px solid rgba(254, 44, 85, 0.28);
    color: #ffd2db;
    border-radius: 16px;
    padding: 14px 16px;
    line-height: 1.45;
}

.facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 48px 0 36px;
}
.facts article {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px;
    background: rgba(255,255,255,0.02);
}
.facts span { font-family: "IBM Plex Mono", monospace; color: var(--pink); font-size: 12px; }
.facts h2 { margin: 10px 0 8px; font-size: 16px; }
.facts p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }

footer { color: #6a6660; font-size: 13px; padding: 28px 0 48px; line-height: 1.5; }

@media (max-width: 760px) {
    .live-card { grid-template-columns: 64px 1fr; }
    .download-btn { grid-column: 1 / -1; }
    .facts { grid-template-columns: 1fr; }
    h1 { max-width: none; }
}
