:root {
    color-scheme: dark;
    --bg: #050b14;
    --surface: #0b1625;
    --surface-2: #101e30;
    --line: rgba(148, 163, 184, .16);
    --text: #edf5ff;
    --muted: #8da2bb;
    --cyan: #22d3ee;
    --green: #34d399;
    --red: #fb7185;
    --amber: #fbbf24;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 0%, rgba(34, 211, 238, .11), transparent 32rem),
        radial-gradient(circle at 90% 12%, rgba(59, 130, 246, .10), transparent 30rem),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 56px 0 28px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.eyebrow, .card-kicker { color: var(--cyan); font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 7px 0 4px; font-size: clamp(2.3rem, 6vw, 4.4rem); line-height: .95; letter-spacing: -.06em; }
.subtitle { margin: 12px 0 0; color: var(--muted); font-size: 1rem; }
.server-pill, .badge { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 999px; background: rgba(11, 22, 37, .78); }
.server-pill { padding: 11px 15px; color: var(--muted); font-size: .88rem; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px rgba(141, 162, 187, .1); }
.status-dot.online { background: var(--green); box-shadow: 0 0 0 4px rgba(52, 211, 153, .12), 0 0 18px rgba(52, 211, 153, .6); }
.status-dot.offline { background: var(--red); box-shadow: 0 0 0 4px rgba(251, 113, 133, .12); }
.status-dot.pending { background: var(--amber); box-shadow: 0 0 0 4px rgba(251, 191, 36, .1); }

.summary { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 18px; background: rgba(11, 22, 37, .72); overflow: hidden; margin-bottom: 20px; }
.summary article { padding: 19px 22px; border-right: 1px solid var(--line); }
.summary article:last-child { border: 0; }
.summary-label { display: block; color: var(--muted); font-size: .78rem; margin-bottom: 7px; }
.summary strong { font-size: 1.7rem; letter-spacing: -.03em; }
.summary .summary-time { font-size: 1rem; font-variant-numeric: tabular-nums; }

.stream-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.stream-card { position: relative; overflow: hidden; min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg, rgba(16, 30, 48, .96), rgba(8, 18, 31, .96)); box-shadow: 0 18px 60px rgba(0, 0, 0, .22); transition: transform .2s ease, border-color .2s ease; }
.stream-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--red); opacity: .85; }
.stream-card.online::before { background: linear-gradient(90deg, var(--green), var(--cyan)); }
.stream-card:hover { transform: translateY(-2px); border-color: rgba(148, 163, 184, .28); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
h2 { margin: 5px 0 0; font-size: 1.45rem; letter-spacing: -.03em; }
.badge { padding: 7px 10px; font-size: .72rem; color: var(--muted); }
.metric-row { display: grid; grid-template-columns: 1.2fr .8fr 1fr; gap: 8px; padding: 26px 0 20px; }
.metric-row div { min-width: 0; }
.metric-row span { display: block; color: var(--muted); font-size: .7rem; margin-bottom: 7px; }
.metric-row strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: .96rem; font-variant-numeric: tabular-nums; }
.tracks { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; min-height: 49px; padding: 12px 0; border-top: 1px solid var(--line); }
.track, .track-placeholder { border-radius: 7px; padding: 5px 8px; background: rgba(148, 163, 184, .08); color: var(--muted); font-size: .7rem; }
.track { color: #c9d9eb; }
.url-box { display: flex; align-items: center; gap: 8px; padding: 8px; margin-top: 6px; border: 1px solid var(--line); border-radius: 12px; background: rgba(3, 9, 17, .65); }
.stream-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c5d7ea; font-size: .72rem; }
.copy-button { border: 0; border-radius: 8px; padding: 8px 10px; color: var(--text); background: var(--surface-2); cursor: pointer; font: inherit; font-size: .72rem; font-weight: 700; }
.copy-button:hover { background: #19304a; }
.copy-button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 24px; padding: 0 4px; color: var(--muted); font-size: .75rem; }
.empty-state { padding: 42px 22px; border: 1px dashed rgba(148, 163, 184, .25); border-radius: 22px; text-align: center; background: rgba(11, 22, 37, .45); }
.empty-state strong, .empty-state span { display: block; }
.empty-state span { margin-top: 8px; color: var(--muted); }
.empty-state code { color: #c5d7ea; }

@media (max-width: 900px) {
    .stream-grid { grid-template-columns: 1fr; }
    .metric-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 620px) {
    .shell { width: min(100% - 24px, 1180px); padding-top: 30px; }
    .topbar { flex-direction: column; }
    .summary { grid-template-columns: 1fr 1fr; }
    .summary article { border-bottom: 1px solid var(--line); }
    .summary article:nth-child(2) { border-right: 0; }
    .summary article:last-child { grid-column: 1 / -1; border-bottom: 0; }
    footer { flex-direction: column; }
}

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