/* =====================================================================
   Games — Design-System "Midnight Arcade"
   Reines CSS, keine Frameworks, kein Build-Step (läuft 1:1 auf lima-city).
   Mobile-first: das Spiel wird überwiegend am Handy gespielt.

   Bewusst DUNKEL statt im hellen iOS-Look von Hub/Fitness-App: ein Spiel
   soll sich wie ein Spiel anfühlen, nicht wie ein Formular. Die Verwandt-
   schaft zur Familie bleibt über dieselbe Formensprache erhalten (weiche
   Radien, Systemschrift, großzügige Tap-Ziele) — nur eben in dunkel.

   Systemschriften statt Webfonts: die CSP (s. .htaccess) erlaubt nur
   eigene Quellen, externe Fonts wären blockiert.

   Farbwelt pro Spiel: --accent* wird von .theme-<name> überschrieben
   (s. Games.php: 'theme'). Alles darunter — Buttons, Ringe, Verläufe,
   Glow — zieht automatisch mit, ohne eigene Regeln je Spiel.
   ===================================================================== */

:root {
    /* --- Flächen ------------------------------------------------------ */
    --bg: #080A11;
    --bg-2: #0E111A;
    --surface: rgba(255, 255, 255, 0.045);
    --surface-2: rgba(255, 255, 255, 0.075);
    --surface-3: rgba(255, 255, 255, 0.11);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.18);

    /* --- Text --------------------------------------------------------- */
    --text: #F3F5F9;
    --text-2: #98A2B6;
    --text-3: #616B80;

    /* --- Akzent (Standard: Arcade-Violett→Cyan) ----------------------- */
    --accent: #8B5CFF;
    --accent-soft: rgba(139, 92, 255, 0.16);
    --accent-grad: linear-gradient(135deg, #8B5CFF 0%, #5B7CFA 55%, #22D3EE 100%);
    --accent-glow: rgba(139, 92, 255, 0.45);

    /* --- Status ------------------------------------------------------- */
    --green: #34D399;
    --green-soft: rgba(52, 211, 153, 0.14);
    --red: #FB7185;
    --red-soft: rgba(251, 113, 133, 0.14);
    --amber: #FBBF24;
    --amber-soft: rgba(251, 191, 36, 0.14);

    /* --- Maße --------------------------------------------------------- */
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 26px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --header-h: 58px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* History Guesser: Bernstein/Sepia — Archiv, altes Papier, Messing.
   Nur die Akzent-Token werden getauscht, der Rest des Systems bleibt. */
.theme-hg {
    --accent: #F0A83A;
    --accent-soft: rgba(240, 168, 58, 0.16);
    --accent-grad: linear-gradient(135deg, #FFD277 0%, #F0A83A 45%, #DC6437 100%);
    --accent-glow: rgba(240, 168, 58, 0.42);
}

* { box-sizing: border-box; }

/* Grundfarbe bewusst auf <html>, nicht auf <body>: hätte nur body eine
   Hintergrundfarbe, würde sie auf die Zeichenfläche "hochgereicht" und body
   selbst gälte als transparent — das Zusammenspiel mit dem Aurora-
   Pseudoelement (z-index:-1) hinge dann an genau dieser Feinheit. So liegt
   die Farbe eindeutig unten, die Aurora sauber darüber, der Inhalt darauf. */
html {
    -webkit-text-size-adjust: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    background: transparent;
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: contain;
}

/* Aurora-Hintergrund: weiche Farbwolken hinter allem. Fixed +
   pointer-events:none, damit sie beim Scrollen stehen bleiben und nie
   Klicks abfangen. Rein dekorativ. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(58vw 42vh at 12% -6%, rgba(139, 92, 255, 0.20), transparent 62%),
        radial-gradient(52vw 40vh at 92% 8%, rgba(34, 211, 238, 0.14), transparent 60%),
        radial-gradient(70vw 50vh at 50% 108%, rgba(91, 124, 250, 0.13), transparent 65%),
        var(--bg);
}
body.theme-hg::before {
    background:
        radial-gradient(58vw 42vh at 12% -6%, rgba(240, 168, 58, 0.18), transparent 62%),
        radial-gradient(52vw 40vh at 92% 8%, rgba(220, 100, 55, 0.14), transparent 60%),
        radial-gradient(70vw 50vh at 50% 108%, rgba(160, 90, 40, 0.16), transparent 65%),
        var(--bg);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, p { margin: 0; }

::selection { background: var(--accent-soft); color: var(--text); }

/* --- Typo-Bausteine ---------------------------------------------------- */
.gradient-text {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-3);
}

/* --- Buttons ----------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 0 22px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -0.01em;
    cursor: pointer;
    color: var(--text);
    background: var(--surface-2);
    transition: transform 0.14s ease, filter 0.18s ease, background 0.18s ease;
}
.btn:active { transform: scale(0.975); }
.btn-block { width: 100%; }

.btn-primary {
    background: var(--accent-grad);
    color: #0A0C12;
    font-weight: 750;
    box-shadow: 0 6px 22px -6px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.btn-primary:active { filter: brightness(1.06); }

.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:active { background: var(--surface-3); }

.btn-danger { background: var(--red-soft); color: var(--red); border: 1px solid rgba(251, 113, 133, 0.24); }

.btn-plain {
    background: none;
    color: var(--text-2);
    padding: 0 10px;
    min-height: 40px;
    font-size: 14px;
    font-weight: 600;
}
.btn-plain:active { color: var(--text); }

.btn-sm { min-height: 34px; padding: 0 16px; font-size: 13px; border-radius: 100px; }
.btn-icon { width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 12px; }
.btn:disabled { opacity: 0.42; cursor: default; }
.btn:disabled:active { transform: none; }

/* --- Formulare ---------------------------------------------------------- */
.field { margin-bottom: 18px; }
.field label,
.login-form label {
    display: block;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 8px;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="password"],
.field input[type="email"],
.field select,
.field textarea,
.login-form input,
.input {
    width: 100%;
    font-family: inherit;
    font-size: 16px; /* verhindert Auto-Zoom bei Fokus auf iOS Safari */
    font-weight: 500;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.field textarea { resize: vertical; min-height: 88px; line-height: 1.55; }
.field input::placeholder, .input::placeholder { color: var(--text-3); }

.field input:focus,
.field select:focus,
.field textarea:focus,
.login-form input:focus,
.input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-2);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

/* Datei-Auswahl (Bild-Upload im Admin-Bereich) */
.field input[type="file"] {
    width: 100%;
    font-size: 14px;
    color: var(--text-2);
    padding: 12px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
}
/* Bewusst ZWEI getrennte Regeln statt einer mit Komma: kennt ein Browser
   einen Selektor aus einer Komma-Liste nicht, verwirft er die GANZE Regel —
   Firefox kennt die -webkit-Variante nicht und hätte dann gar kein Styling
   für den Datei-Button bekommen. */
.field input[type="file"]::file-selector-button {
    font-family: inherit;
    font-size: 13px;
    font-weight: 650;
    margin-right: 12px;
    padding: 8px 14px;
    border: none;
    border-radius: 100px;
    background: var(--surface-3);
    color: var(--text);
    cursor: pointer;
}
.field input[type="file"]::-webkit-file-upload-button {
    font-family: inherit;
    font-size: 13px;
    font-weight: 650;
    margin-right: 12px;
    padding: 8px 14px;
    border: none;
    border-radius: 100px;
    background: var(--surface-3);
    color: var(--text);
    cursor: pointer;
}

.field-hint { font-size: 12.5px; line-height: 1.5; color: var(--text-3); margin-top: 7px; }

/* Auswahl-Pfeil für <select> (appearance:none entfernt den nativen) */
.field select {
    background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
    background-position: calc(100% - 20px) center, calc(100% - 14px) center;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 42px;
}
.field select option { background: var(--bg-2); color: var(--text); }

/* --- Meldungen ---------------------------------------------------------- */
.flash {
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    border: 1px solid transparent;
    text-align: left;
}
.flash-error { background: var(--red-soft); color: #FFC2CC; border-color: rgba(251, 113, 133, 0.28); }
.flash-success { background: var(--green-soft); color: #9DF0CE; border-color: rgba(52, 211, 153, 0.28); }
.flash-info { background: var(--accent-soft); color: var(--text); border-color: var(--border-strong); }

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(26px + var(--safe-bottom));
    transform: translate(-50%, 22px);
    max-width: calc(100vw - 36px);
    background: rgba(16, 19, 28, 0.94);
    border: 1px solid var(--border-strong);
    color: var(--text);
    padding: 13px 20px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease, transform 0.24s ease;
    z-index: 60;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 14px 40px -12px rgba(0, 0, 0, 0.8);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* --- Anmelde-Seiten (Login, Einladung, Passwort-Reset) ------------------ */
.login-body { display: flex; align-items: center; justify-content: center; padding: 24px 0; }
.login-wrap {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    padding: calc(var(--safe-top) + 20px) 22px calc(var(--safe-bottom) + 32px);
    text-align: center;
    animation: fade-up 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Logo-Badge mit weichem Schein darunter (s. helpers.php: games_logo()) */
.brand {
    position: relative;
    display: inline-flex;
    margin-bottom: 22px;
}
.brand::after {
    content: "";
    position: absolute;
    inset: 12% 12% -18%;
    background: var(--accent-glow);
    filter: blur(30px);
    opacity: 0.75;
    z-index: -1;
    border-radius: 50%;
}
.brand-logo { display: block; border-radius: 26px; }

.login-title { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.login-subtitle { font-size: 14.5px; line-height: 1.55; color: var(--text-2); margin: 10px 0 30px; }
.login-form { text-align: left; }
.login-form label { margin-top: 16px; }
.login-form .btn { margin-top: 26px; }

.login-invite-link {
    display: inline-block;
    margin-top: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-3);
    border-bottom: 1px solid transparent;
}
.login-invite-link:hover { color: var(--accent); border-bottom-color: var(--accent-soft); }

/* --- Kopfzeile ---------------------------------------------------------- */
.app-header,
.hg-overview-header {
    position: sticky;
    top: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: calc(var(--header-h) + var(--safe-top));
    padding: calc(var(--safe-top) + 10px) 16px 10px;
    background: rgba(8, 10, 17, 0.72);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border-bottom: 1px solid var(--border);
}
.app-header-title {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -0.02em;
}
.app-header-right { display: flex; align-items: center; gap: 4px; }
.app-header-user { font-size: 13px; color: var(--text-3); font-weight: 600; margin-right: 4px; }

.app-main {
    max-width: 560px;
    margin: 0 auto;
    padding: 22px 16px calc(32px + var(--safe-bottom));
}
.app-intro { font-size: 14px; color: var(--text-2); margin: 0 0 16px; }

/* Zahnrad für Admins — schwebt über dem Spielgeschehen, verdeckt nichts
   (s. Architektur-Plan Abschnitt 7). Fixed, weil die Spielseite bewusst
   keine Kopfzeile hat. */
.settings-fab {
    position: fixed;
    top: calc(var(--safe-top) + 12px);
    right: 14px;
    z-index: 40;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(16, 19, 28, 0.7);
    border: 1px solid var(--border);
    border-radius: 50%;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 6px 20px -8px rgba(0, 0, 0, 0.9);
}
.settings-fab:active { background: var(--surface-3); }

/* --- Karten ------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 30px 0 12px; }
.section-header:first-child { margin-top: 6px; }
.section-title { font-size: 19px; font-weight: 750; letter-spacing: -0.02em; }
.section-subtitle { font-size: 13px; color: var(--text-3); margin-top: 4px; line-height: 1.5; }

.select-on-click {
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.32);
    color: var(--accent);
    margin-bottom: 12px;
}

/* =====================================================================
   Spielauswahl — große, plakative Karten statt kleiner Kacheln
   ===================================================================== */
.game-grid { display: grid; gap: 16px; }

.game-card {
    position: relative;
    display: block;
    width: 100%;
    text-align: left;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--surface);
    overflow: hidden;
    isolation: isolate;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.18s ease;
    animation: fade-up 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.game-card:active { transform: scale(0.985); }
.game-card:hover { border-color: var(--border-strong); }

/* Farbwäsche: liegt hinter dem Inhalt, kommt aus dem Theme der Kachel */
.game-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--accent-grad);
    opacity: 0.16;
}
/* Lichtkegel oben rechts */
.game-card::after {
    content: "";
    position: absolute;
    top: -55%;
    right: -30%;
    width: 78%;
    height: 150%;
    z-index: -1;
    background: radial-gradient(closest-side, var(--accent-glow), transparent);
    opacity: 0.5;
    filter: blur(6px);
}

.game-card-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 31px;
    line-height: 1;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border-strong);
    margin-bottom: 16px;
    box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.9);
}
.game-card-tag {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 7px;
}
.game-card-name { font-size: 23px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 7px; }
.game-card-desc { font-size: 14px; line-height: 1.55; color: var(--text-2); }
.game-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 18px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text);
}
.game-card-cta span { transition: transform 0.18s ease; }
.game-card:hover .game-card-cta span { transform: translateX(4px); }

.game-card.is-soon { opacity: 0.5; cursor: default; }
.game-card.is-soon:active { transform: none; }

/* --- Listen -------------------------------------------------------------- */
.list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 17px;
    border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-row-main { flex: 1; min-width: 0; }
.list-row-title { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-row-subtitle { font-size: 13px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.list-row-actions { display: flex; gap: 8px; flex-shrink: 0; }
.list-empty { padding: 40px 20px; text-align: center; color: var(--text-3); font-size: 14px; line-height: 1.6; }

.badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
}
.badge-admin { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.badge-pending { background: var(--amber-soft); color: var(--amber); border-color: rgba(251, 191, 36, 0.26); }
.badge-success { background: var(--green-soft); color: var(--green); border-color: rgba(52, 211, 153, 0.26); }
.badge-progress { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }

/* =====================================================================
   History Guesser
   ===================================================================== */
.hg-page { min-height: 100vh; display: flex; flex-direction: column; }

/* Die Flex-Kette muss durchgehen: .hg-page → #hgRoot → .hg-panel. Ohne diese
   Regel ist #hgRoot ein gewöhnlicher Block, .hg-panel bekommt keine Resthöhe
   und das "margin-top:auto" am Absende-Button greift nicht — der Button säße
   dann direkt unter dem Eingabefeld statt unten in Daumenreichweite. */
#hgRoot { flex: 1; display: flex; flex-direction: column; }

/* --- Spiele-Übersicht ---------------------------------------------------- */
.hg-game-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 17px;
    transition: background 0.16s ease;
}
.hg-game-list-row + .hg-game-list-row { border-top: 1px solid var(--border); }
.hg-game-list-row:active { background: var(--surface-2); }
.hg-game-list-arrow { color: var(--text-3); font-size: 17px; }

/* --- Bild-Bühne ---------------------------------------------------------- */
.hg-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 56vh;
    background: #05070C;
    overflow: hidden;
    flex-shrink: 0;
}
.hg-stage img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    animation: stage-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
/* Weicher Verlauf oben und unten: hält die Chips lesbar und bindet das
   Bild in die Seite ein, statt es hart abzuschneiden. */
.hg-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(to bottom, rgba(5, 7, 12, 0.85) 0%, transparent 26%),
        linear-gradient(to top, var(--bg) 1%, rgba(8, 10, 17, 0.35) 14%, transparent 34%);
}

.hg-topbar {
    position: absolute;
    top: var(--safe-top);
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
}
/* Platz für das Zahnrad NUR freihalten, wenn es auch da ist (Admins). Für
   normale Spieler wären das sonst 64px verschenkte Breite — auf einem
   schmalen Handy genug, um die drei Chips (Runde / getippt / Timer) in eine
   zweite Zeile über das Bild zu drücken. Die Klasse setzt history-guesser.php. */
body.has-fab .hg-topbar { padding-right: 64px; }
.hg-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(8, 10, 17, 0.62);
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 7px 13px;
    border-radius: 999px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.hg-chip-round { color: var(--accent); }
.hg-chip-timer { font-variant-numeric: tabular-nums; min-width: 54px; justify-content: center; }
.hg-chip-timer.is-urgent {
    background: rgba(251, 113, 133, 0.9);
    border-color: transparent;
    color: #1A0409;
    animation: pulse 1s ease-in-out infinite;
}

/* --- Bedienfeld ---------------------------------------------------------- */
.hg-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 4px 22px calc(24px + var(--safe-bottom));
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
}
.hg-prompt { text-align: center; font-size: 14px; color: var(--text-2); margin-bottom: 4px; }
.hg-category {
    display: block;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}

/* Die große Jahreszahl — das visuelle Zentrum der Eingabe */
.hg-year-display {
    text-align: center;
    font-size: clamp(52px, 17vw, 68px);
    font-weight: 850;
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    margin: 6px 0 20px;
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 6px 26px var(--accent-glow));
}

/* Zeitstrahl-Slider. --pct wird von history-guesser.js gesetzt, damit die
   zurückgelegte Strecke gefüllt aussieht (rein mit CSS nicht möglich). */
.hg-slider {
    width: 100%;
    height: 42px;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
}
/* Kein Rahmen auf der Schiene: sonst hinge die korrekte Zentrierung des
   Griffs (margin-top unten) daran, ob box-sizing für dieses Pseudoelement
   greift — die Rechnung ginge je nach Browser um 1–2px daneben. Ohne Rahmen
   ist die Schiene exakt 8px hoch und die Zentrierung eindeutig: (8-30)/2. */
.hg-slider::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent) 0 var(--pct, 50%), rgba(255, 255, 255, 0.13) var(--pct, 50%) 100%);
}
.hg-slider::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent) 0 var(--pct, 50%), rgba(255, 255, 255, 0.13) var(--pct, 50%) 100%);
}
.hg-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 30px;
    height: 30px;
    margin-top: -11px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--accent);
    box-shadow: 0 3px 14px -2px var(--accent-glow), 0 1px 4px rgba(0, 0, 0, 0.5);
}
.hg-slider::-moz-range-thumb {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--accent);
    box-shadow: 0 3px 14px -2px var(--accent-glow), 0 1px 4px rgba(0, 0, 0, 0.5);
}
.hg-slider:focus { outline: none; }
.hg-slider:focus::-webkit-slider-thumb { box-shadow: 0 0 0 6px var(--accent-soft); }

.hg-scale {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 650;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
    margin: -2px 2px 16px;
}

.hg-year-input {
    display: block;
    width: 150px;
    margin: 0 auto 18px;
    text-align: center;
    font-family: inherit;
    font-size: 19px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    appearance: none;
    -webkit-appearance: none;
}
.hg-year-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
/* Spinner ausblenden — die Zahl wird per Slider oder Tastatur gesetzt */
.hg-year-input::-webkit-outer-spin-button,
.hg-year-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.hg-year-input { -moz-appearance: textfield; }

.hg-submit { margin-top: auto; }

/* --- Warten -------------------------------------------------------------- */
.hg-waiting { text-align: center; padding: 30px 20px; color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
.hg-waiting-spinner {
    width: 30px;
    height: 30px;
    margin: 0 auto 16px;
    border: 3px solid var(--surface-3);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.hg-waiting strong { color: var(--accent); font-size: 17px; }

/* --- Auflösung ------------------------------------------------------------ */
.hg-reveal { animation: fade-up 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.hg-reveal-label { text-align: center; margin-bottom: 2px; }
.hg-reveal-year {
    font-size: clamp(48px, 15vw, 62px);
    font-weight: 850;
    line-height: 1.05;
    letter-spacing: -0.04em;
    text-align: center;
    font-variant-numeric: tabular-nums;
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 6px 26px var(--accent-glow));
    animation: reveal-pop 0.55s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.hg-reveal-title { font-size: 17px; font-weight: 750; text-align: center; margin: 10px 0 8px; letter-spacing: -0.02em; }
.hg-reveal-desc { font-size: 14px; line-height: 1.65; color: var(--text-2); text-align: center; }
.hg-reveal-source { font-size: 11px; color: var(--text-3); text-align: center; margin-top: 10px; }
.hg-reveal-source a { color: var(--text-2); border-bottom: 1px solid var(--border-strong); }

/* Eigenes Ergebnis: drei Werte nebeneinander */
.hg-my-result {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0 18px;
}
.hg-my-result-item {
    flex: 1;
    max-width: 120px;
    text-align: center;
    padding: 13px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.hg-my-result-value { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.hg-my-result-value.is-hit { color: var(--green); }
.hg-my-result-label { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-top: 5px; }
.hg-no-guess { text-align: center; color: var(--text-3); font-size: 14px; margin: 20px 0 18px; }

.hg-guess-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.hg-guess-row:last-child { border-bottom: none; }
.hg-guess-row-name { font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg-guess-row-meta { color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.hg-guess-row-points {
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    min-width: 46px;
    text-align: right;
}
.hg-guess-row.is-me { background: linear-gradient(90deg, var(--accent-soft), transparent); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 10px; }

.hg-next-hint { text-align: center; color: var(--text-3); font-size: 13px; margin-top: 18px; }

/* --- Lobby ---------------------------------------------------------------- */
.hg-lobby-list { margin: 20px 0 4px; text-align: left; }
.hg-lobby-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.hg-lobby-row:last-child { border-bottom: none; }
.hg-lobby-name { font-weight: 600; font-size: 15px; }

.hg-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    color: #0A0C12;
    background: var(--accent-grad);
    box-shadow: 0 4px 14px -4px var(--accent-glow);
}

/* --- Endauswertung / Rangliste --------------------------------------------- */
.hg-leaderboard-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.hg-leaderboard-row:last-child { border-bottom: none; }
.hg-leaderboard-rank {
    width: 26px;
    flex-shrink: 0;
    text-align: center;
    font-weight: 800;
    font-size: 15px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}
.hg-leaderboard-row.is-winner .hg-leaderboard-rank { color: var(--amber); }
.hg-leaderboard-row.is-winner .hg-avatar {
    background: linear-gradient(135deg, #FFE082, #F0A83A 55%, #D97706);
    box-shadow: 0 4px 18px -4px rgba(251, 191, 36, 0.6);
}
.hg-leaderboard-name { flex: 1; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg-leaderboard-score { margin-left: auto; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

.hg-trophy { font-size: 46px; line-height: 1; filter: drop-shadow(0 8px 22px rgba(251, 191, 36, 0.45)); }

/* --- Animationen ----------------------------------------------------------- */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}
@keyframes stage-in {
    from { opacity: 0; transform: scale(1.045); }
    to { opacity: 1; transform: none; }
}
@keyframes reveal-pop {
    0% { opacity: 0; transform: scale(0.72); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.07); }
}

/* Gestaffelter Auftritt der Auswahl-Karten */
.game-card:nth-child(1) { animation-delay: 0.04s; }
.game-card:nth-child(2) { animation-delay: 0.1s; }
.game-card:nth-child(3) { animation-delay: 0.16s; }
.game-card:nth-child(4) { animation-delay: 0.22s; }

/* Wer Bewegung reduziert haben möchte, bekommt sie nicht. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* --- Etwas mehr Luft auf großen Schirmen ------------------------------------ */
@media (min-width: 640px) {
    .game-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

    /* Bühne auf dieselbe Breite wie das Bedienfeld darunter bringen. Ohne das
       liefe das Bild randlos über den ganzen Schirm, während Slider und Button
       darunter bei 560px enden — das sah aus wie zwei verschiedene Seiten. */
    .hg-stage {
        max-width: 560px;
        margin: 0 auto;
        border-radius: var(--radius-xl);
        max-height: 52vh;
    }
    .hg-stage::after { border-radius: var(--radius-xl); }
    .hg-topbar { padding-left: 18px; padding-right: 18px; }
    body.has-fab .hg-topbar { padding-right: 18px; }
}
