:root {
    color-scheme: dark;
    --bg: #0a0a0a;
    --panel: #141414;
    --card: #1a1a1a;
    --border: #2a2a2a;
    --fg: #e0e0e0;
    --muted: #888;
    --accent: #88aacc;
    --ok: #00cc66;
    --off: #cc4444;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--fg);
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    padding: 12px 24px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}
.brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--fg);
    text-decoration: none;
}
.brand-dim { color: var(--accent); font-weight: 400; }

main { flex: 1; padding: 24px; max-width: 1200px; width: 100%; margin: 0 auto; }

footer {
    padding: 10px 24px;
    background: var(--panel);
    border-top: 1px solid var(--border);
    font-size: 11px;
    text-align: center;
}
.footer-dim { color: var(--muted); }

h1 { font-size: 28px; margin: 0 0 12px 0; }
p.muted { color: var(--muted); }
p.error { color: var(--off); }

.track-list { list-style: none; padding: 0; margin: 0; }
.track-list li { margin-bottom: 8px; }
.track-list a {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--fg);
    transition: border-color 0.1s, background 0.1s;
}
.track-list a:hover { border-color: var(--accent); background: var(--panel); }
.track-name { font-size: 16px; font-weight: 600; }
.track-seen { color: var(--muted); font-size: 12px; font-family: Consolas, monospace; }

.track-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.connection {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    font-family: Consolas, monospace;
}
.connection.ok { color: var(--ok); background: rgba(0, 204, 102, 0.1); }
.connection.off { color: var(--off); background: rgba(204, 68, 68, 0.1); }

.scoreboard {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
}
.meta {
    display: flex; gap: 14px; align-items: center;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--muted);
    font-family: Consolas, monospace;
    text-transform: uppercase;
}
.meta .kind { color: var(--accent); font-weight: 700; }
.meta .when { margin-left: auto; }

.lanes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.lane {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
}
.lane .driver { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.lane .row {
    display: flex; justify-content: space-between;
    padding: 4px 0;
    font-family: Consolas, monospace;
    font-size: 15px;
}
.lane .row.big { font-size: 26px; padding: 6px 0; }
.lane .row .lbl { color: var(--muted); }

.back { margin-top: 20px; }
.back a { color: var(--accent); text-decoration: none; }
.back a:hover { text-decoration: underline; }
