:root {
    --bg: #0d0f14;
    --surface: #151922;
    --surface-2: #1c212c;
    --border: #262c39;
    --text: #e9ecf2;
    --muted: #97a0b1;
    --accent: #ff5a36;
    --accent-ink: #ffffff;
    --ok: #3ecf8e;
    --warn: #f5b942;
    --off: #6b7385;
    --radius: 14px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
code { font-family: var(--mono); font-size: 0.92em; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* Topbar */
.topbar {
    position: sticky; top: 0; z-index: 10;
    background: rgba(13, 15, 20, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { text-decoration: none; font-size: 1.05rem; letter-spacing: 0.01em; white-space: nowrap; }
.brand strong { color: var(--accent); }
.nav { display: flex; gap: 22px; }
.nav a { text-decoration: none; color: var(--muted); font-size: 0.95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); padding-bottom: 4px; }

/* Hero */
.hero {
    padding: 72px 0 40px;
    background:
        radial-gradient(900px 300px at 15% 0%, rgba(255, 90, 54, 0.14), transparent 70%),
        linear-gradient(180deg, #11141b, var(--bg));
}
.eyebrow { margin: 0 0 10px; color: var(--accent); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; }
.hero h1 { margin: 0 0 14px; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; letter-spacing: -0.02em; max-width: 16ch; }
.lead { margin: 0; max-width: 60ch; color: var(--muted); font-size: 1.1rem; }
.hero-stats { display: inline-flex; align-items: center; gap: 10px; margin-top: 26px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 0.95rem; }
.hero-stats .sep { color: var(--off); }

/* Sections */
.section { padding: 36px 20px 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title { margin: 0 0 18px; font-size: 1.35rem; letter-spacing: -0.01em; }
.section-head .section-title { margin-bottom: 6px; }
.more { color: var(--accent); text-decoration: none; font-weight: 600; white-space: nowrap; }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}
.card h3 { margin: 6px 0 8px; font-size: 1.2rem; line-height: 1.3; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.game-tag { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 18px; }

/* Status */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 0.88rem; color: var(--muted); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--off); flex: none; }
.status.is-online { color: var(--ok); }
.status.is-online .dot, .dot--live { background: var(--ok); box-shadow: 0 0 0 4px rgba(62, 207, 142, 0.15); }
.status.is-offline { color: var(--off); }

/* AC card */
.ac { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); padding: 0; overflow: hidden; }
.ac-media { background: #0a0c10; display: flex; align-items: center; justify-content: center; min-height: 220px; border-right: 1px solid var(--border); }
.ac-media img { width: 100%; height: 100%; object-fit: contain; padding: 18px; }
.ac-body { padding: 24px; }
.ac-track { font-size: 1.6rem !important; letter-spacing: -0.01em; }
.ac-event { margin: 0 0 4px; color: var(--muted); }

.facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 18px 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.facts dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.drivers h4 { margin: 0 0 8px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.drivers ul { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.drivers li { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 0.9rem; }
.drivers li span { color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 42px; padding: 0 18px;
    border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface-2); color: var(--text);
    font: 600 0.95rem var(--font); text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: #3a4254; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.links { display: flex; flex-wrap: wrap; gap: 18px; margin: 16px 0 0; font-size: 0.92rem; }
.links a { color: var(--muted); }
.links a:hover { color: var(--text); }
.hint { margin: 14px 0 0; font-size: 0.88rem; color: var(--muted); }

/* Voting */
.countdown { font-size: 0.88rem; color: var(--warn); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vote-top { list-style: none; margin: 12px 0 14px; padding: 0; display: grid; gap: 6px; }
.vote-top li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--surface-2); border-radius: 8px; }
.vote-top li span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Car pool */
.car-grid { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.car { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.car-img { aspect-ratio: 16 / 9; background: #0a0c10; }
.car-img img { width: 100%; height: 100%; object-fit: cover; }
.car-name { padding: 10px 12px; font-size: 0.92rem; font-weight: 600; line-height: 1.3; }
.car-name small { display: block; color: var(--muted); font-weight: 400; font-size: 0.8rem; margin-top: 2px; }

/* Tools */
.tool { display: flex; gap: 16px; align-items: center; text-decoration: none; }
.tool:hover { border-color: #3a4254; }
.tool strong { display: block; margin-bottom: 2px; }
.tool-icon { width: 44px; height: 44px; flex: none; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 90, 54, 0.14); color: var(--accent); font-size: 1rem; }

/* Footer */
.footer { margin-top: 56px; border-top: 1px solid var(--border); padding: 24px 0 40px; color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); }

/* Unterseiten: Seitenkopf */
.page-hero { padding: 48px 0 8px; background: radial-gradient(900px 260px at 15% 0%, rgba(255, 90, 54, 0.12), transparent 70%); }
.page-hero h1 { margin: 0 0 8px; font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -0.02em; line-height: 1.15; }
.page-hero .lead { font-size: 1.02rem; }

.stack > * + * { margin-top: 18px; }
.card h2 { margin: 0 0 14px; font-size: 1.15rem; }
.hidden { display: none !important; }

/* Formulare */
label { font-size: 0.9rem; color: var(--muted); }
.form-control, select, input[type="text"], input[type="number"], input[type="search"] {
    width: 100%; min-height: 42px; padding: 0 12px;
    background: var(--surface-2); color: var(--text);
    border: 1px solid var(--border); border-radius: 10px;
    font: 0.95rem var(--font);
}
.form-control:focus, select:focus, input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 90, 54, 0.2); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--secondary { background: var(--surface-2); }
.full-width { width: 100%; }
kbd {
    display: inline-block; min-width: 1.6em; padding: 1px 6px; margin-right: 6px;
    font: 0.8rem var(--mono); text-align: center;
    background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px;
}

/* Modal */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5, 6, 9, 0.7); backdrop-filter: blur(3px); }
.modal-content { position: relative; width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.modal-header, .modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; }
.modal-header { border-bottom: 1px solid var(--border); }
.modal-footer { border-top: 1px solid var(--border); justify-content: flex-end; }
.modal-title { margin: 0; font-size: 1.05rem; }
.modal-close { background: none; border: 0; color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 18px; }

.fade-in { animation: fade-in 0.25s ease both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Toast */
.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 16px; font-size: 0.92rem; opacity: 0; pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* Hinweis-Einblendung des Video-Clippers (wird per JS erzeugt) */
.keyboard-notification {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 16px; font-size: 0.92rem; animation: fade-in 0.2s ease both;
}

@media (max-width: 820px) {
    .ac { grid-template-columns: 1fr; }
    .ac-media { min-height: 160px; border-right: 0; border-bottom: 1px solid var(--border); }
}
@media (max-width: 560px) {
    .wrap { padding: 0 16px; }
    .section { padding: 28px 16px 4px; }
    .nav { gap: 14px; }
    .brand { font-size: 0.98rem; }
    .hero { padding: 48px 0 28px; }
    .hero-stats { flex-wrap: wrap; border-radius: 12px; }
    .car-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .ac-body, .card { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .toast { transition: none; }
    .fade-in, .keyboard-notification { animation: none; }
}
