/* ═══════════════════════════════════════════════════════════════════════════
   KURVENKÖNIG — Carrera Digital 124 Race Theme
   Dark race infographic style: near-black bg, bold yellow / red accents,
   checkered motifs, high-contrast tables, podium gold/silver/bronze.
   Mobile-first. System fonts only (offline-robust).
   ══════════════════════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────────────────────────── */
:root {
    /* Palette */
    --c-bg:           #070707;
    --c-bg-soft:      #0c0c0c;
    --c-surface:      #151515;
    --c-surface-2:    #1a1a1a;
    --c-surface-3:    #222222;
    --c-border:       #2a2a2a;
    --c-text:         #f7f7f7;
    --c-muted:        #a7a7a7;

    /* Accents (Gold statt Orange) */
    --c-yellow:       #FFD54A;
    --c-yellow-dim:   #C89B2A;
    --c-yellow-glow:  rgba(255,213,74,.14);
    --c-red:          #FF4D5A;
    --c-red-dim:      #c8323d;
    --c-green:        #2EE66C;
    --c-orange:       #FFA53C;
    --c-blue:         #2C8DFF;

    /* Status */
    --c-live:         var(--c-red);
    --c-geplant:      var(--c-blue);
    --c-beendet:      var(--c-muted);

    /* Podium */
    --c-gold:         #FFD54A;
    --c-silver:       #d4d4d4;
    --c-bronze:       #cd7f32;

    /* Layout */
    --nav-h:          3.5rem;
    --radius:         6px;
    --radius-lg:      10px;
    --max-w:          1100px;

    /* Fonts */
    --kk-font-display: "Bebas Neue", system-ui, sans-serif;
    --kk-font-numeric: "Rajdhani", system-ui, sans-serif;
    --kk-font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* ── V1 Redesign Tokens ─────────────────────────────── */
    --kk-gold-soft:      rgba(255,213,74,.12);
    --kk-gold-glow:      rgba(255,213,74,.35);
    --kk-gradient-gold:  linear-gradient(180deg, #FFE77D 0%, #D2A622 100%);
    --kk-gradient-panel: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
    --kk-gradient-hero:  radial-gradient(circle at 50% -10%, rgba(255,213,74,.16), transparent 55%);
    --kk-shadow-card:    0 20px 40px rgba(0,0,0,.45);
    --kk-shadow-hover:   0 30px 70px rgba(0,0,0,.55);
    --kk-radius:         18px;
    --kk-radius-xl:      26px;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ──────────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body.carrera-dark {
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--kk-font-body);
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
}

/* Live-Tracking-Seite: body wird zum Spalten-Flex-Container, damit Nav +
   Inhalt zusammen exakt die Fensterhöhe füllen (kein Scrollen der
   Gesamtseite). Strikt auf diese eine Route beschränkt (body.page-live,
   siehe layout.php) - alle anderen Seiten scrollen wie gehabt normal. */
body.page-live {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}
body.page-live .site-nav {
    flex: 0 0 auto;
}

a { color: var(--c-yellow); text-decoration: none; }
a:hover { text-decoration: underline; color: #FFE489; }

img { display: block; max-width: 100%; }

hr {
    border: none;
    border-top: 1px solid var(--c-border);
    margin: 1.5rem 0;
}

h1, h2, h3 {
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: .02em;
    font-family: var(--kk-font-display);
    text-transform: uppercase;
}

h1 { font-size: clamp(1.4rem, 4vw, 2rem); }
h2 { font-size: clamp(1.1rem, 3vw, 1.5rem); color: var(--c-yellow); }
h3 { font-size: 1.1rem; color: var(--c-text); }

small { font-size: .82em; }

input, select, textarea, button {
    font: inherit;
    color: inherit;
}

/* ── Top Navigation ────────────────────────────────────────────────────────── */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    background: var(--c-surface);
    border-bottom: 3px solid var(--c-yellow);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
}

/* Wordmark */
.site-nav__brand {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.4rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--c-yellow);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.site-nav__brand:hover { text-decoration: none; color: #FFE489; }
.site-nav__wordmark { font-family: var(--kk-font-display); }

/* Gold-Krone (SVG via mask, erbt die Brand-Farbe inkl. Hover) */
.site-nav__crown {
    width: 1.5em;
    height: 1.15em;
    flex-shrink: 0;
    background: currentColor;
    -webkit-mask: url(/assets/img/crown.svg) center/contain no-repeat;
            mask: url(/assets/img/crown.svg) center/contain no-repeat;
}

/* Nav-Icons (SVG via mask, erben die Link-Farbe inkl. Hover) */
.nav-ico {
    display: inline-block;
    width: 1.05em;
    height: 1.05em;
    margin-right: .4em;
    vertical-align: -.15em;
    background: currentColor;
    -webkit-mask-position: center;
            mask-position: center;
    -webkit-mask-size: contain;
            mask-size: contain;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
}
.nav-ico--events    { -webkit-mask-image: url(/assets/img/icon-events.svg);    mask-image: url(/assets/img/icon-events.svg); }
.nav-ico--season    { -webkit-mask-image: url(/assets/img/icon-season.svg);    mask-image: url(/assets/img/icon-season.svg); }
.nav-ico--drivers   { -webkit-mask-image: url(/assets/img/icon-drivers.svg);   mask-image: url(/assets/img/icon-drivers.svg); }
.nav-ico--curvesets { -webkit-mask-image: url(/assets/img/icon-curvesets.svg); mask-image: url(/assets/img/icon-curvesets.svg); }

.site-nav__links {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex-wrap: wrap;
    flex: 1;
}

.site-nav__links a,
.site-nav__logout {
    padding: .3em .65em;
    border-radius: var(--radius);
    font-size: .85rem;
    font-weight: 600;
    color: var(--c-text);
    text-decoration: none;
    transition: background .15s, color .15s;
    border: none;
    background: transparent;
    cursor: pointer;
}
.site-nav__links a:hover,
.site-nav__logout:hover {
    background: var(--c-surface-3);
    color: var(--c-yellow);
    text-decoration: none;
}
.site-nav__links a.active {
    color: var(--c-yellow);
    background: var(--c-yellow-glow);
}

.site-nav__logout {
    margin-left: auto;
    color: var(--c-muted);
    font-size: .8rem;
    flex-shrink: 0;
    padding: .3em .7em;
    border: 1px solid var(--c-border);
}
.site-nav__logout:hover {
    color: var(--c-red);
    border-color: var(--c-red);
    background: rgba(204,0,0,.1);
}

/* Hide nav on auth pages using body class */
body.page-auth .site-nav { display: none; }

/* ── Page shell ────────────────────────────────────────────────────────────── */
.site-main {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

/* ── Container (legacy support) ────────────────────────────────────────────── */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

/* ── Page Header ───────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .6rem;
    margin-bottom: 1.25rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid var(--c-border);
}
.page-header h1 {
    flex: 1;
    min-width: 0;
    color: var(--c-text);
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35em;
    padding: .45em 1em;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--c-border);
    background: var(--c-surface-3);
    color: var(--c-text);
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
    line-height: 1.4;
}
.btn:hover:not(:disabled) {
    background: var(--c-surface-2);
    border-color: var(--c-yellow);
    color: var(--c-yellow);
    text-decoration: none;
}
.btn:disabled { opacity: .4; cursor: default; }

.btn-primary {
    background: var(--c-yellow);
    color: #000;
    border-color: var(--c-yellow);
    font-weight: 700;
}
.btn-primary:hover:not(:disabled) {
    background: #FFE489;
    border-color: #FFE489;
    color: #000;
}

.btn-secondary {
    background: transparent;
    border-color: var(--c-muted);
    color: var(--c-muted);
}
.btn-secondary:hover:not(:disabled) {
    border-color: var(--c-yellow);
    color: var(--c-yellow);
    background: var(--c-yellow-glow);
}

.btn-danger {
    background: var(--c-red);
    color: #fff;
    border-color: var(--c-red);
}
.btn-danger:hover:not(:disabled) {
    background: var(--c-red-dim);
    border-color: var(--c-red-dim);
    color: #fff;
}

.btn-invite {
    background: transparent;
    border-color: var(--c-green);
    color: var(--c-green);
}
.btn-invite:hover:not(:disabled) {
    background: rgba(34,170,68,.15);
}

.btn-sm {
    padding: .3em .7em;
    font-size: .8rem;
}

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: .2em .65em;
    border-radius: 3px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1.4;
}

/* Event status */
.badge--live, .badge--LIVE {
    background: var(--c-red);
    color: #fff;
    animation: badge-blink 1.4s step-end infinite;
}
.badge--geplant, .badge--GEPLANT {
    background: var(--c-blue);
    color: #fff;
}
.badge--beendet, .badge--BEENDET {
    background: var(--c-surface-3);
    color: var(--c-muted);
    border: 1px solid var(--c-border);
}

/* User status */
.badge-success {
    background: var(--c-green);
    color: #fff;
}
.badge-warning {
    background: var(--c-yellow-dim);
    color: #000;
}

@keyframes badge-blink { 50% { opacity: .6; } }

/* ── Tables ────────────────────────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}
.table th,
.table td {
    padding: .55rem .75rem;
    text-align: left;
    border-bottom: 1px solid var(--c-border);
    vertical-align: middle;
}
.table thead th {
    background: var(--c-surface-2);
    color: var(--c-yellow);
    font-weight: 700;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 2px solid var(--c-yellow);
    white-space: nowrap;
}
.table tbody tr:hover { background: var(--c-surface-2); }
.table tbody tr:nth-child(even) { background: rgba(255,255,255,.02); }
.table tfoot td {
    background: var(--c-surface-2);
    font-weight: 700;
    color: var(--c-yellow);
    border-top: 2px solid var(--c-border);
}

/* Evaluation matrix */
.eval-matrix td:first-child { font-weight: 600; }
.eval-matrix tfoot td:first-child { color: var(--c-yellow); }

/* ── Eval Sections ─────────────────────────────────────────────────────────── */
.eval-section {
    margin-bottom: 2rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.eval-section > h2 {
    padding: .75rem 1rem;
    background: var(--c-surface-2);
    border-bottom: 2px solid var(--c-yellow);
    font-size: 1rem;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.eval-section > * { padding-left: 1rem; padding-right: 1rem; }
.eval-section > h2,
.eval-section > .table-responsive,
.eval-section > .podium-list,
.eval-section > .special-awards,
.eval-section > .muted,
.eval-section > .crash-display,
.eval-section > form { padding: .75rem 1rem; }
.eval-section > h2 { padding: .75rem 1rem; }
.eval-section > .table-responsive { padding: 0; }

/* ── Podium ────────────────────────────────────────────────────────────────── */
.podium-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: .75rem 1rem !important;
}

.podium-entry {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    background: var(--c-surface-2);
    border-radius: var(--radius);
    border-left: 4px solid var(--c-border);
    position: relative;
}

/* Rank colours */
.podium-entry--rank-1 { border-left-color: var(--c-gold); }
.podium-entry--rank-2 { border-left-color: var(--c-silver); }
.podium-entry--rank-3 { border-left-color: var(--c-bronze); }

.podium-entry__rank {
    font-size: .8rem;
    font-weight: 700;
    min-width: 4.5rem;
    color: var(--c-muted);
}
.podium-entry--rank-1 .podium-entry__rank { color: var(--c-gold); }
.podium-entry--rank-2 .podium-entry__rank { color: var(--c-silver); }
.podium-entry--rank-3 .podium-entry__rank { color: var(--c-bronze); }

.podium-entry__name { flex: 1; font-weight: 600; }

.podium-entry__points {
    font-size: .85rem;
    font-weight: 700;
    color: var(--c-yellow);
    white-space: nowrap;
}

/* ── Special Awards ────────────────────────────────────────────────────────── */
.special-awards {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .4rem 1rem;
    align-items: baseline;
}
.special-awards dt {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--c-muted);
    letter-spacing: .05em;
    white-space: nowrap;
}
.special-awards dd {
    font-weight: 600;
    color: var(--c-text);
}

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: .3rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.form-group input:not([type=file]):not([type=color]),
.form-group select,
.form-group textarea,
.form-stacked input:not([type=file]):not([type=color]),
.form-stacked select,
.form-stacked textarea,
.form-control {
    display: block;
    width: 100%;
    padding: .55em .75em;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    color: var(--c-text);
    font-size: .95rem;
    transition: border-color .15s;
    -webkit-appearance: none;
    appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-stacked input:focus,
.form-stacked select:focus,
.form-stacked textarea:focus,
.form-control:focus {
    outline: none;
    border-color: var(--c-yellow);
    box-shadow: 0 0 0 2px var(--c-yellow-glow);
}
.form-group input[type=file] {
    color: var(--c-muted);
    font-size: .85rem;
}
.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M6 8L0 0h12z' fill='%23888'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75em center;
    padding-right: 2.2em;
}
.form-stacked { display: flex; flex-direction: column; gap: .75rem; }

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1.25rem;
}

.required { color: var(--c-red); }

.field-error {
    display: block;
    margin-top: .25rem;
    font-size: .8rem;
    color: #ff6666;
}

.error {
    background: rgba(204,0,0,.15);
    border: 1px solid var(--c-red);
    border-radius: var(--radius);
    padding: .6rem .9rem;
    color: #ff8888;
    margin-bottom: 1rem;
    font-size: .9rem;
}

.success {
    background: rgba(0,170,80,.15);
    border: 1px solid #1faa50;
    border-radius: var(--radius);
    padding: .6rem .9rem;
    color: #6fe39a;
    margin-bottom: 1rem;
    font-size: .9rem;
}

.login-links {
    margin-top: 1rem;
    font-size: .9rem;
    text-align: center;
}

/* ── Invite Link Box ───────────────────────────────────────────────────────── */
.invite-link-box {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
    margin: 1rem 0;
}
.invite-link-box input[type=text] {
    flex: 1;
    min-width: 0;
    padding: .5em .75em;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    color: var(--c-text);
    font-size: .88rem;
}
.hint {
    font-size: .82rem;
    color: var(--c-muted);
    margin-bottom: 1rem;
}

/* ── Crash display ─────────────────────────────────────────────────────────── */
.crash-display {
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: .75rem 1rem;
    margin-bottom: 1rem;
}

/* ── Crash-Galerie ─────────────────────────────────────────────────────────── */
.crash-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .5rem;
    margin-top: .75rem;
}

.crash-gallery__thumb {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius);
    background: #111;
    cursor: pointer;
    outline: none;
}

.crash-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .2s, opacity .2s;
}

.crash-gallery__thumb:hover img,
.crash-gallery__thumb:focus img {
    transform: scale(1.04);
}

/* Admin: Löschen-Overlay */
.crash-gallery--admin .crash-gallery__thumb--del {
    cursor: default;
}

.crash-gallery__thumb--del input[type="checkbox"] {
    display: none;
}

.crash-gallery__del-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0,0,0,.65);
    color: #fff;
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s;
    user-select: none;
    line-height: 1;
}

.crash-gallery__del-btn:hover {
    background: rgba(180,30,30,.85);
}

.crash-gallery__thumb--del:has(input:checked) img {
    opacity: .25;
    transform: scale(1);
}

.crash-gallery__thumb--del:has(input:checked) .crash-gallery__del-btn {
    background: #c0392b;
}

/* ── Lightbox ──────────────────────────────────────────────────────────────── */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.93);
    z-index: 9000;
    align-items: center;
    justify-content: center;
}

.lightbox.is-open {
    display: flex;
}

.lightbox__img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,.8);
}

.lightbox__close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: .25rem .5rem;
    opacity: .8;
    transition: opacity .15s;
}

.lightbox__close:hover { opacity: 1; }

.lightbox__prev,
.lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.1);
    border: none;
    color: #fff;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    padding: .5rem .9rem;
    border-radius: 4px;
    opacity: .7;
    transition: opacity .15s, background .15s;
}

.lightbox__prev:hover,
.lightbox__next:hover {
    opacity: 1;
    background: rgba(255,255,255,.2);
}

.lightbox__prev { left: 1rem; }
.lightbox__next { right: 1rem; }

/* ── Auth / Login Pages ────────────────────────────────────────────────────── */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--c-bg);
}

.login-container h1 {
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--c-yellow);
    margin-bottom: .25rem;
    text-align: center;
}
/* Decorative stripe under KURVENKÖNIG on login */
.login-container h1::after {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--c-red) 0%, var(--c-yellow) 100%);
    margin-top: .35rem;
    border-radius: 2px;
}

.login-container h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--c-muted);
    margin-bottom: 1.5rem;
    text-transform: none;
    letter-spacing: 0;
}

.login-container form,
.login-container > p {
    width: 100%;
    max-width: 380px;
}
.login-container form {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.login-container form > div {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.login-container form label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.login-container form input {
    padding: .55em .75em;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    color: var(--c-text);
    font-size: .95rem;
    width: 100%;
}
.login-container form input:focus {
    outline: none;
    border-color: var(--c-yellow);
    box-shadow: 0 0 0 2px var(--c-yellow-glow);
}
.login-container form button[type=submit] {
    margin-top: .25rem;
    padding: .65em 1.5em;
    background: var(--c-yellow);
    color: #000;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background .15s;
}
.login-container form button[type=submit]:hover {
    background: #FFE489;
}
.login-container p.error {
    max-width: 380px;
    margin-bottom: .5rem;
}

/* ── Colour dot (users table) ──────────────────────────────────────────────── */
.color-dot {
    display: inline-block;
    width: .85rem;
    height: .85rem;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: .3rem;
    border: 1px solid rgba(255,255,255,.2);
}

/* ── Utility classes ───────────────────────────────────────────────────────── */
.muted      { color: var(--c-muted); }
.text-center{ text-align: center; }
.font-bold  { font-weight: 700; }

/* ── Section headings (non-eval) ────────────────────────────────────────────── */
.container > section { margin-bottom: 2rem; }
.container > section > h2 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--c-yellow);
    margin-bottom: .75rem;
    padding-bottom: .3rem;
    border-bottom: 1px solid var(--c-border);
}

/* ══════════════════════════════════════════════════════════════════════════
   LIVE-ERFASSUNG
   Most live styles are in live.css (already loaded by live.php).
   These extend / override for the Carrera look.
   ══════════════════════════════════════════════════════════════════════════ */

/* Header: KURVENKÖNIG-style strip */
.live-header {
    background: var(--c-surface);
    border-bottom: 3px solid var(--c-yellow);
    padding: 1rem;
    text-align: center;
}
.live-header__label  {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--c-muted);
}
.live-header__name   { font-size: 1.5rem; font-weight: 900; color: var(--c-yellow); letter-spacing: .04em; }
.live-header__total  { font-size: .9rem; color: #ccc; }
.live-header__status {
    display: inline-block;
    margin-top: .25rem;
    padding: .1em .6em;
    border-radius: 3px;
    font-size: .7rem;
    font-weight: 700;
    background: var(--c-surface-3);
    color: var(--c-muted);
}
.live-header__status--live {
    background: var(--c-red);
    color: #fff;
    animation: blink 1.2s step-end infinite;
}
@keyframes blink { 50% { opacity: .5; } }

/* Driver cards */
.driver-card {
    margin: .75rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.driver-card__header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .75rem;
    background: var(--c-surface-2);
}
.driver-card__name  { flex: 1; font-weight: 700; font-size: 1rem; }
.driver-card__total {
    min-width: 2.2rem;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--c-yellow);
}
.driver-card__undo {
    background: var(--c-surface-3);
    color: var(--c-muted);
    font-size: .8rem;
    padding: .3em .6em;
    border-radius: var(--radius);
    border: 1px solid var(--c-border);
}
.driver-card__undo:hover:not(:disabled) {
    background: #3a3a3a;
    color: var(--c-text);
}

/* Curve grid */
.curve-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 6px;
    padding: .6rem;
}

/* Curve button */
.curve-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    min-height: 84px;
    background: var(--c-surface-2);
    border-radius: var(--radius);
    border: 2px solid transparent;
    color: var(--c-muted);
    font-size: .7rem;
    padding: .3rem;
    transition: background .1s, border-color .1s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.curve-btn:hover:not(:disabled),
.curve-btn:active:not(:disabled) {
    background: var(--c-surface-3);
    border-color: var(--c-yellow);
    color: var(--c-text);
}
.curve-btn:disabled { opacity: .35; }

/* Logo image inside curve button */
.curve-btn__logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 4px;
}

/* Fallback when logo is missing (handled by alt text + box) */
.curve-btn__logo-fallback {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-surface-3);
    border-radius: 4px;
    font-size: .6rem;
    color: var(--c-muted);
    text-align: center;
    border: 1px dashed var(--c-border);
}

.curve-btn__name {
    font-size: .65rem;
    text-align: center;
    word-break: break-word;
    hyphens: auto;
    color: var(--c-muted);
}
.curve-btn__count {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: .85rem;
    font-weight: 700;
    color: var(--c-yellow);
    line-height: 1;
}

/* Live notices */
.live-notice {
    margin: 1rem;
    padding: .75rem 1rem;
    background: #1a1200;
    border: 1px solid var(--c-yellow);
    border-radius: var(--radius);
    color: var(--c-yellow);
    text-align: center;
    font-size: .9rem;
}
.live-empty {
    margin: 2rem 1rem;
    color: var(--c-muted);
    text-align: center;
}

/* ══════════════════════════════════════════════════════════════════════════
   CURVE SET MANAGEMENT — logo thumbnail
   ══════════════════════════════════════════════════════════════════════════ */
.curve-logo-thumb {
    height: 40px;
    width: auto;
    border-radius: 4px;
    background: var(--c-surface-3);
    padding: 2px;
}

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE OVERRIDES
   ══════════════════════════════════════════════════════════════════════════ */

/* ── ≥ 480 px: slightly bigger curve grid ─────────── */
@media (min-width: 480px) {
    .curve-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
    .curve-btn { min-height: 90px; }
    .curve-btn__logo { width: 56px; height: 56px; }
}

/* ── Live-Wrap: Flex-Fit-Layout ──────────────────────
   Füllt die von body.page-live zugeteilte Resthöhe exakt aus (ersetzt das
   alte Grid-Layout des früheren "zwei Karten nebeneinander"-Designs -
   Flex-Kinder nehmen automatisch die volle Breite ein, kein
   grid-column-Workaround mehr nötig). Gilt auf allen Breiten, nicht mehr
   nur ab 640px, da Fit-to-Screen auch auf Mobile gelten soll. */
.live-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.live-header,
.live-notice,
.live-empty {
    flex: 0 0 auto;
}

/* ── ≥ 768 px: restore sticky header offset ────────── */
@media (min-width: 768px) {
    .site-nav__links a { font-size: .9rem; }
}

/* ── ≥ 1024 px: wider form inputs ─────────────────── */
@media (min-width: 1024px) {
    .form-group input:not([type=file]):not([type=color]),
    .form-group select,
    .form-group textarea {
        max-width: 560px;
    }
}

/* ═══ V1 Redesign — Utilities ═══════════════════════════════════════════════ */

/* Glass-Panel: dunkles, leicht durchscheinendes Card-Surface mit Tiefe */
.glass {
    background: var(--c-surface);
    background-image: var(--kk-gradient-panel);
    border: 1px solid var(--c-border);
    border-radius: var(--kk-radius);
    box-shadow: var(--kk-shadow-card);
}

/* Gold-Gradient-Hauptbutton (sparsam einsetzen!) */
.btn-gold {
    background: var(--kk-gradient-gold);
    color: #1a1300;
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    box-shadow: 0 6px 18px var(--kk-gold-glow);
}
.btn-gold:hover:not(:disabled) {
    filter: brightness(1.06);
    color: #1a1300;
}

/* ═══ V1 Redesign — Hero ════════════════════════════════════════════════════ */
.hero {
    position: relative;
    margin-bottom: 1.5rem;
    padding: clamp(1.5rem, 5vw, 3rem) clamp(1rem, 4vw, 2rem);
    border-radius: var(--kk-radius-xl);
    background-color: var(--c-bg-soft, #0c0c0c);
    background-image: var(--kk-gradient-hero), url(/assets/img/carbon.svg);
    background-repeat: no-repeat, repeat;
    background-size: auto, 38px 38px;
    border: 1px solid var(--c-border);
    overflow: hidden;
}
.hero__title {
    font-family: var(--kk-font-display);
    font-size: clamp(2rem, 8vw, 4rem);
    line-height: .95;
    letter-spacing: .03em;
    color: var(--c-text);
    margin: 0;
}
.hero__title .accent { color: var(--c-yellow); }
.hero__sub {
    margin-top: .5rem;
    color: var(--c-muted);
    font-family: var(--kk-font-body);
    text-transform: none;
    font-weight: 500;
}
.hero__status {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1rem;
    font-family: var(--kk-font-numeric);
    font-weight: 600;
}

/* ═══ V1 Redesign — Fahrer-Gamecard ═════════════════════════════════════════ */
.gamecard {
    --driver-color: var(--c-yellow);
    position: relative;
    text-align: center;
    padding: 1.75rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: var(--kk-radius-xl);
    background: var(--c-surface);
    background-image: var(--kk-gradient-panel);
    border: 1px solid var(--c-border);
    box-shadow: var(--kk-shadow-card),
                0 0 0 1px color-mix(in srgb, var(--driver-color) 30%, transparent),
                0 0 40px -8px var(--driver-color);
}
.gamecard__avatar {
    width: 110px;
    height: 110px;
    margin: 0 auto .75rem;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 3px solid var(--driver-color);
    box-shadow: 0 0 24px -4px var(--driver-color);
}
.gamecard__name {
    font-family: var(--kk-font-display);
    font-size: clamp(1.8rem, 7vw, 2.6rem);
    letter-spacing: .04em;
    color: var(--c-text);
    margin: 0;
}
.gamecard__stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin-top: 1rem;
    font-family: var(--kk-font-numeric);
}
.gamecard__stat { text-align: center; }
.gamecard__stat b {
    display: block;
    font-size: 1.5rem;
    color: var(--driver-color);
    font-weight: 700;
}
.gamecard__stat span {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--c-muted);
}

/* ═══ V1 Redesign — Podium (Top 3) ══════════════════════════════════════════ */
.podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: .5rem;
    padding: 1.5rem 1rem .5rem;
    max-width: 520px;
    margin: 0 auto;
}
.podium__step { text-align: center; }
.podium__step--1 { order: 2; }
.podium__step--2 { order: 1; }
.podium__step--3 { order: 3; }
.podium__name {
    font-family: var(--kk-font-display);
    font-size: clamp(1rem, 3.5vw, 1.4rem);
    letter-spacing: .03em;
    margin-bottom: .4rem;
    color: var(--c-text);
}
.podium__points {
    font-family: var(--kk-font-numeric);
    font-weight: 700;
    color: var(--c-muted);
    font-size: .85rem;
}
.podium__block {
    margin-top: .5rem;
    border-radius: 8px 8px 0 0;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-bottom: none;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: .5rem;
    font-family: var(--kk-font-display);
    font-size: 1.6rem;
}
.podium__step--1 .podium__block { height: 130px; border-top: 3px solid var(--c-gold); color: var(--c-gold); }
.podium__step--2 .podium__block { height: 95px;  border-top: 3px solid var(--c-silver); color: var(--c-silver); }
.podium__step--3 .podium__block { height: 70px;  border-top: 3px solid var(--c-bronze); color: var(--c-bronze); }

/* ═══ V1 Redesign — Mobile-Feinschliff ══════════════════════════════════════ */
@media (max-width: 480px) {
    .site-nav { flex-wrap: wrap; height: auto; padding: .5rem .75rem; }
    .site-nav__links { width: 100%; order: 3; }
    .btn { min-height: 44px; }            /* Tap-Target */
    .hero { padding: 1.25rem 1rem; }
}

/* ═══ V1 Redesign — Helm-Platzhalter in der Gamecard ════════════════════════ */
.gamecard__avatar--helmet {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0e0e0e;
    color: var(--driver-color);
    padding: 0;
    overflow: hidden;
}
.gamecard__avatar--helmet svg {
    width: 76%;
    height: 76%;
}

/* ── Player Card – Stats Bar ───────────────────────────────────────────────── */
.driver-stats-bar {
    display: flex;
    border-top: 1px solid var(--c-border);
}
.driver-stats-bar__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: .75rem .4rem;
    border-right: 1px solid var(--c-border);
    gap: .15rem;
}
.driver-stats-bar__item:last-child { border-right: none; }
.driver-stats-bar__value {
    font-family: var(--kk-font-numeric);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--c-yellow);
    line-height: 1;
}
.driver-stats-bar__label {
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--c-muted);
    text-align: center;
}

/* ── Player Card – Nächste Events ──────────────────────────────────────────── */
.upcoming-events {
    display: grid;
    gap: 1rem;
    padding: .75rem 1rem;
}
@media (min-width: 640px) {
    .upcoming-events { grid-template-columns: 1fr 1fr; }
}
.upcoming-events__heading {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--c-muted);
    margin-bottom: .5rem;
}
.upcoming-events__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    padding: .45rem .6rem;
    background: var(--c-surface-2);
    border-radius: var(--radius);
    border-left: 3px solid var(--c-border);
    margin-bottom: .3rem;
    font-size: .85rem;
}
.upcoming-events__item--live { border-left-color: var(--c-live); }
.upcoming-events__item--geplant { border-left-color: var(--c-geplant); }
.upcoming-events__empty { color: var(--c-muted); font-size: .85rem; }

/* ── Player Card – Kurven-DNA ──────────────────────────────────────────────── */
.curve-dna {
    display: grid;
    gap: 1.25rem;
    padding: .75rem 1rem;
}
@media (min-width: 640px) {
    .curve-dna { grid-template-columns: 1fr 1.6fr; }
}
.curve-dna__section-title {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .4rem;
}
.curve-dna__section-title--fav  { color: var(--c-green); }
.curve-dna__section-title--prob { color: var(--c-red); }
.curve-dna__left { display: flex; flex-direction: column; gap: 1rem; }
.curve-dna__podium {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.curve-dna__podium li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .85rem;
    padding: .3rem .5rem;
    background: var(--c-surface-2);
    border-radius: var(--radius);
}
.curve-dna__podium-count {
    font-family: var(--kk-font-numeric);
    font-weight: 700;
    color: var(--c-muted);
    font-size: .8rem;
}

/* ── Player Card – Kurven Heatmap ──────────────────────────────────────────── */
.curve-heatmap {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.curve-heatmap__row {
    display: grid;
    grid-template-columns: 90px 1fr 2.5rem;
    gap: .4rem;
    align-items: center;
    font-size: .78rem;
}
.curve-heatmap__name {
    color: var(--c-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.curve-heatmap__track {
    height: 9px;
    background: var(--c-surface-3);
    border-radius: 3px;
    overflow: hidden;
}
.curve-heatmap__bar {
    height: 100%;
    border-radius: 3px;
    transition: width .3s ease;
}
.curve-heatmap__count {
    font-family: var(--kk-font-numeric);
    color: var(--c-muted);
    font-size: .75rem;
    text-align: right;
}

/* ── Player Card – Placeholder ─────────────────────────────────────────────── */
.profile-placeholder {
    position: relative;
}
.profile-placeholder::after {
    content: '🔒 Coming Soon';
    position: absolute;
    inset: 0;
    background: rgba(7, 7, 7, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--c-muted);
    border-radius: var(--radius-lg);
    pointer-events: all;
    cursor: default;
}

/* ── Toggle Switch ──────────────────────────────────────────────────────────── */
.toggle-label {
    display: flex;
    align-items: center;
    gap: .75rem;
    cursor: pointer;
    font-size: .9rem;
    color: var(--c-text);
    user-select: none;
}
.toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 2.5rem;
    height: 1.375rem;
    background: var(--c-surface-3, #333);
    border-radius: 100px;
    border: 1px solid var(--c-border);
    transition: background .2s, border-color .2s;
    flex-shrink: 0;
}
.toggle-switch::after {
    content: '';
    position: absolute;
    left: .1875rem;
    top: .1875rem;
    width: .9375rem;
    height: .9375rem;
    border-radius: 50%;
    background: var(--c-muted);
    transition: transform .2s, background .2s;
}
.toggle-input:checked + .toggle-switch {
    background: var(--c-yellow);
    border-color: var(--c-yellow);
}
.toggle-input:checked + .toggle-switch::after {
    transform: translateX(1.125rem);
    background: #111;
}
.toggle-input:focus-visible + .toggle-switch {
    outline: 2px solid var(--c-yellow);
    outline-offset: 2px;
}

/* ── Checkbox-Label (legacy, für andere Stellen) ────────────────────────────── */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .9rem;
    cursor: pointer;
    color: var(--c-text);
}
.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--c-yellow);
    cursor: pointer;
}

/* ── Fahrer-Grid (öffentliche Übersicht) ────────────────────────────────────── */
.drivers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
    padding: 1rem 0;
}
.driver-card {
    --driver-color: var(--c-yellow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 1.25rem 1rem;
    background: var(--c-surface);
    border: 1px solid color-mix(in srgb, var(--driver-color) 25%, var(--c-border));
    border-radius: var(--kk-radius-xl, 1rem);
    box-shadow: 0 0 24px -8px var(--driver-color);
    text-decoration: none;
    color: var(--c-text);
    transition: transform .15s, box-shadow .15s;
}
.driver-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 36px -6px var(--driver-color);
}
.driver-card__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--driver-color);
    box-shadow: 0 0 16px -4px var(--driver-color);
}
.driver-card__helmet {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid var(--driver-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-surface-2);
    color: var(--driver-color);
}
.driver-card__helmet svg { width: 40px; height: 40px; }
.driver-card__name {
    font-family: var(--kk-font-display);
    font-size: 1.1rem;
    letter-spacing: .04em;
    text-align: center;
}
.driver-card__role {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--c-muted);
}

/* ── Stat Drilldown ─────────────────────────────────────────────────────────── */
.stat-trigger {
    all: unset;
    cursor: pointer;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}
.stat-trigger:hover { opacity: .8; }
.stat-detail-panel {
    background: var(--c-surface-2, #1a1a1a);
    border: 1px solid var(--c-border);
    border-radius: var(--radius, .5rem);
    padding: .75rem 1rem;
    margin-top: .5rem;
}
.stat-detail-panel__title {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--c-muted);
    margin: 0 0 .5rem;
}
.stat-detail-panel__link {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .5rem;
    border-radius: 4px;
    color: var(--c-text);
    text-decoration: none;
    font-size: .88rem;
}
.stat-detail-panel__link:hover { background: var(--c-surface-3, #222); }

/* ── Vergangene Rennen ──────────────────────────────────────────────────────── */
.past-events-list {
    list-style: none;
    padding: .25rem 0;
    margin: 0;
}
.past-events-list__link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem 1rem;
    border-radius: var(--radius, .5rem);
    text-decoration: none;
    color: var(--c-text);
    transition: background .15s;
}
.past-events-list__link:hover { background: var(--c-surface-2, #1a1a1a); }
.past-events-list__date {
    font-size: .8rem;
    color: var(--c-muted);
    flex-shrink: 0;
    min-width: 5rem;
}
.past-events-list__title { flex: 1; }
.past-events-list__arrow {
    color: var(--c-muted);
    font-size: .8rem;
    flex-shrink: 0;
}

/* ═══ Fahrercode (F1-Kürzel) ════════════════════════════════════════════════ */

/* Grosses Kürzel-Badge oben rechts in der Gamecard */
.gamecard__code {
    position: absolute;
    top: .9rem;
    right: 1.1rem;
    font-family: var(--kk-font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: .08em;
    line-height: 1;
    color: var(--driver-color);
    padding: .3rem .55rem;
    border: 2px solid var(--driver-color);
    border-radius: .5rem;
    background: color-mix(in srgb, var(--driver-color) 12%, transparent);
}

/* Kürzel-Badge auf der Fahrer-Übersichtskarte */
.driver-card { position: relative; }
.driver-card__code {
    position: absolute;
    top: .6rem;
    right: .7rem;
    font-family: var(--kk-font-numeric);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--driver-color);
    padding: .12rem .4rem;
    border: 1px solid var(--driver-color);
    border-radius: .35rem;
}

/* Kürzel im Live-Tabellenkopf */
.live-table__driver-code {
    display: inline-block;
    font-family: var(--kk-font-numeric);
    font-weight: 700;
    letter-spacing: .05em;
    color: var(--dc, var(--c-text));
    margin-right: .25rem;
}

/* Kleines Inline-Kürzel in Tabellen/Podien (monospace-Tag) */
.driver-code-tag {
    display: inline-block;
    font-family: var(--kk-font-numeric);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--c-muted);
    padding: .05rem .3rem;
    border: 1px solid var(--c-border);
    border-radius: .3rem;
    vertical-align: middle;
}

/* Colorpicker + Hex-Textfeld nebeneinander */
.color-field {
    display: flex;
    align-items: center;
    gap: .6rem;
}
.color-field input[type="color"] {
    flex-shrink: 0;
}
.color-field__hex {
    width: 9rem;
    font-family: var(--kk-font-numeric);
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* Fahrercode-Eingabefeld */
.driver-code-input {
    width: 7rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-family: var(--kk-font-numeric);
    font-weight: 700;
}

/* ═══ SmartRace-Import: Fortschritt & Mapping ═══════════════════════════════ */
.sr-progress {
    padding: .5rem 1rem 0;
}
.sr-progress__bar {
    height: 14px;
    border-radius: 8px;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    overflow: hidden;
}
.sr-progress__fill {
    height: 100%;
    width: 0;
    background: var(--c-green, #38c172);
    transition: width .2s ease;
}
.sr-progress__meta {
    margin-top: .4rem;
    font-family: var(--kk-font-numeric);
    font-weight: 700;
    letter-spacing: .04em;
}
.sr-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    border: 1px solid var(--c-border);
}
.sr-thumb--empty {
    background: var(--c-surface-2);
}

/* ═══ Admin-Hub (Übersichtskarten) ═════════════════════════════════════════ */
.admin-hub {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}
.admin-hub__card {
    position: relative;
    display: block;
    padding: 1.4rem 1.25rem;
    border-radius: var(--kk-radius-xl, 1rem);
    background: var(--c-surface);
    background-image: var(--kk-gradient-panel);
    border: 1px solid var(--c-border);
    text-decoration: none;
    color: var(--c-text);
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.admin-hub__card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--c-yellow) 50%, var(--c-border));
    box-shadow: var(--kk-shadow-card);
}
.admin-hub__title {
    font-family: var(--kk-font-display);
    letter-spacing: .03em;
    margin: 0 0 .4rem;
}
.admin-hub__desc {
    color: var(--c-muted);
    font-size: .85rem;
    margin: 0;
}
.admin-hub__arrow {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    color: var(--c-yellow);
    font-size: 1.2rem;
}

/* Kleiner Zurück-zu-Admin-Link im Seitenkopf */
.admin-back {
    display: inline-block;
    margin: 0 0 .5rem;
    font-size: .8rem;
    color: var(--c-muted);
    text-decoration: none;
}
.admin-back:hover { color: var(--c-text); }

/* ═══ SmartRace im Fahrerprofil ════════════════════════════════════════════ */
.sr-perf-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    padding: .75rem 1rem;
    font-family: var(--kk-font-numeric);
}
.sr-perf-grid__item { text-align: center; }
.sr-perf-grid__value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--driver-color, var(--c-yellow));
}
.sr-perf-grid__label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--c-muted);
}
.sr-besttimes {
    list-style: none;
    margin: 0;
    padding: .25rem 1rem .75rem;
}
.sr-besttimes li {
    display: flex;
    justify-content: space-between;
    padding: .3rem 0;
    border-bottom: 1px solid var(--c-border);
}
.sr-besttimes__time { font-family: var(--kk-font-numeric); font-weight: 700; }

.sr-garage {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .75rem;
    padding: .75rem 1rem;
}
.sr-garage__card {
    border: 1px solid var(--c-border);
    border-radius: .6rem;
    overflow: hidden;
    background: var(--c-surface-2);
}
.sr-garage__img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}
.sr-garage__img--empty { background: var(--c-surface); }
.sr-garage__body { padding: .45rem .6rem; }
.sr-garage__name { font-weight: 600; font-size: .82rem; line-height: 1.2; }
.sr-garage__mfr { color: var(--c-muted); font-size: .72rem; }

.garage-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    padding: .75rem 1rem 0;
}
.garage-filters .select {
    width: auto;
    min-width: 160px;
}
.garage-owner-badge, .garage-brand-badge {
    display: inline-block;
    font-size: .68rem;
    padding: .1rem .4rem;
    border-radius: .3rem;
    background: var(--c-surface);
    color: var(--c-muted);
    margin-top: .2rem;
}

/* Admin-Kontrollbox: gemappter SmartRace-Name */
.sr-admin-check {
    margin: 0 1rem 1rem;
    padding: .6rem .85rem;
    border: 1px dashed color-mix(in srgb, var(--c-yellow) 50%, var(--c-border));
    border-radius: .6rem;
    background: color-mix(in srgb, var(--c-yellow) 7%, transparent);
    font-size: .85rem;
}
.sr-admin-check b { font-family: var(--kk-font-numeric); }

/* ── Fahrer-Fahrzeugseite: Hero, Fahr-Stats, Merkmal-Kacheln ────────────── */
.vehicle-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
}
.vehicle-hero__img {
    width: 260px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    border: 1px solid var(--c-border);
    border-radius: .6rem;
}
.vehicle-hero__img--empty { background: var(--c-surface); }
.vehicle-hero__info {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.vehicle-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.stat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: .6rem;
}
.stat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    padding: .6rem .5rem;
    border: 1px solid var(--c-border);
    border-radius: .6rem;
    background: var(--c-surface-2);
}
.stat-tile__value {
    font-family: var(--kk-font-numeric);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--c-yellow);
    line-height: 1;
    text-align: center;
}
.stat-tile__value a { color: inherit; }
.stat-tile__label {
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--c-muted);
    text-align: center;
}

.feature-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .6rem;
    padding: .75rem 1rem 1rem;
}
.feature-tile {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .55rem .65rem;
    border: 1px solid var(--c-border);
    border-radius: .6rem;
    background: var(--c-surface-2);
}
.feature-tile__label {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--c-muted);
}
.feature-tile__value {
    font-size: .9rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.feature-tile--maint-ok {
    border-color: var(--c-green);
    background: color-mix(in srgb, var(--c-green) 8%, var(--c-surface-2));
}
.feature-tile--maint-warn {
    border-color: var(--c-orange);
    background: color-mix(in srgb, var(--c-orange) 10%, var(--c-surface-2));
}
.feature-tile--maint-due {
    border-color: var(--c-red);
    background: color-mix(in srgb, var(--c-red) 10%, var(--c-surface-2));
}
.stat-tile__sub {
    font-size: .62rem;
    color: var(--c-muted);
    text-align: center;
}
.feature-tile__hint {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--c-red);
}
.feature-tile__vis {
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--c-muted);
}

/* ═══ Admin Panel Layout ════════════════════════════════════════════════ */

.admin-layout {
    display: flex;
    flex-direction: column;
    max-width: var(--max-w);
    margin: 0 auto;
    padding-top: 1.25rem;
}

@media (min-width: 768px) {
    .admin-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 1.5rem;
    }
}

/* ── Sidebar (mobile: horizontale Tab-Leiste) ───────────────────────── */
.admin-sidebar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .25rem;
    padding: .5rem 1rem .5rem 0;
    border-bottom: 2px solid var(--c-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
}

@media (min-width: 768px) {
    .admin-sidebar {
        flex-direction: column;
        align-items: flex-start;
        gap: .1rem;
        padding: 0;
        border-bottom: none;
        border-right: 1px solid var(--c-border);
        width: 180px;
        flex-shrink: 0;
        position: sticky;
        top: calc(var(--nav-h) + 1.25rem);
        transition: width .2s;
        overflow: hidden;
    }
}

/* Toggle-Button (nur Desktop) */
.admin-sidebar__toggle {
    display: none;
}

@media (min-width: 768px) {
    .admin-sidebar__toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        align-self: flex-end;
        flex-shrink: 0;
        width: 22px;
        height: 22px;
        margin-right: -11px; /* halb rausragen */
        margin-bottom: .6rem;
        border-radius: 50%;
        background: var(--c-surface-2);
        border: 1px solid var(--c-border);
        color: var(--c-muted);
        font-size: .72rem;
        cursor: pointer;
        z-index: 1;
        transition: background .15s, color .15s, border-color .15s;
    }
    .admin-sidebar__toggle:hover {
        background: var(--c-surface-3);
        color: var(--c-yellow);
        border-color: var(--c-yellow);
    }
}

.admin-sidebar__nav {
    display: contents; /* mobile: Kinder fließen direkt in Flex-Row */
}

@media (min-width: 768px) {
    .admin-sidebar__nav {
        display: flex;
        flex-direction: column;
        gap: .1rem;
        width: 100%;
        padding-right: 1rem;
        transition: opacity .15s;
    }
}

.admin-sidebar__link {
    display: block;
    padding: .45em .75em;
    border-radius: var(--radius);
    font-size: .88rem;
    font-weight: 600;
    color: var(--c-muted);
    text-decoration: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.admin-sidebar__link:hover {
    background: var(--c-surface-2);
    color: var(--c-text);
    text-decoration: none;
}
.admin-sidebar__link--active {
    color: var(--c-yellow);
    background: var(--c-yellow-glow);
}

/* Collapsed (Desktop) */
@media (min-width: 768px) {
    .admin-layout--collapsed .admin-sidebar {
        width: 1.75rem;
    }
    .admin-layout--collapsed .admin-sidebar__nav {
        opacity: 0;
        pointer-events: none;
    }
}

/* ── Main ────────────────────────────────────────────────────────────── */
.admin-main {
    flex: 1;
    min-width: 0;
}

/* ── Select Utility (für bare <select> außerhalb .form-group) ────────── */
.select {
    display: block;
    width: 100%;
    padding: .5em .75em;
    padding-right: 2.2em;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    color: var(--c-text);
    font-size: .9rem;
    font: inherit;
    transition: border-color .15s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M6 8L0 0h12z' fill='%23a7a7a7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75em center;
    cursor: pointer;
}
.select:focus {
    outline: none;
    border-color: var(--c-yellow);
    box-shadow: 0 0 0 2px var(--c-yellow-glow);
}
.select--auto {
    width: auto;
    min-width: 160px;
}

/* ── SmartRace Import Row ─────────────────────────────────────────────── */
.sr-import-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem 1rem;
    border-bottom: 1px solid var(--c-border);
    font-size: .88rem;
}
.sr-import-row:last-child { border-bottom: none; }
.sr-import-row__name { flex: 1; font-weight: 600; }
.sr-import-row__num {
    font-family: var(--kk-font-numeric);
    font-size: .8rem;
    color: var(--c-muted);
    min-width: 2.5rem;
}
