/* ============================================================
   BrainBattle — Design-System
   Dunkel, kinoreif, eine Signalfarbe. Mobile first.
   ============================================================ */

:root {
    /* Grundton: tiefes Nachtblau, nie reines Schwarz/Grau */
    --bg-0: #070b14;
    --bg-1: #0b1222;
    --bg-2: #111b31;
    --panel: rgba(148, 170, 220, 0.06);
    --panel-strong: rgba(148, 170, 220, 0.11);
    --line: rgba(148, 170, 220, 0.14);
    --line-strong: rgba(148, 170, 220, 0.28);

    --text: #eaf0fb;
    --muted: #8fa1c2;

    /* Signalfarbe: Aktionen + Erfolg */
    --accent: #34f59b;
    --accent-deep: #17c876;
    --accent-ink: #04240f;
    --accent-soft: rgba(52, 245, 155, 0.12);
    --glow: 0 0 22px rgba(52, 245, 155, 0.32);

    /* Sekundärakzent: nur Fehler/Gefahr */
    --danger: #ff5470;
    --danger-soft: rgba(255, 84, 112, 0.14);
    --danger-glow: 0 0 22px rgba(255, 84, 112, 0.3);

    --font-display: 'Unbounded', 'Arial Black', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;

    --radius: 18px;
    --radius-sm: 12px;
    --speed: 220ms;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Basis ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    background: var(--bg-0);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; filter: brightness(1.1); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: rgba(52, 245, 155, 0.3); }

.icon { width: 1.15em; height: 1.15em; flex: 0 0 auto; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* Atmosphäre: weiche Farb-Orbs im Hintergrund */
.bg-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; background:
    radial-gradient(1100px 600px at 85% -10%, #101d3d 0%, transparent 60%),
    radial-gradient(900px 500px at -15% 30%, #0d1a2e 0%, transparent 55%),
    var(--bg-0); }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; }
.orb-a { width: 420px; height: 420px; background: rgba(52, 245, 155, 0.10); top: -140px; right: -120px; }
.orb-b { width: 380px; height: 380px; background: rgba(64, 96, 255, 0.12); bottom: -120px; left: -140px; }

/* ---------- Typografie ---------- */
.h-display {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.12;
    font-size: clamp(1.55rem, 5.5vw, 2.4rem);
    text-wrap: balance;
}

/* ---------- Layout ---------- */
.page {
    max-width: 700px;
    margin: 0 auto;
    padding: 16px 16px calc(96px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.topbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 16px;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    background: rgba(7, 11, 20, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.logo { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.logo-mark {
    width: 34px; height: 34px; border-radius: 10px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: var(--accent-ink);
    box-shadow: var(--glow);
}
.logo-mark .icon { width: 20px; height: 20px; }
.logo-word { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; color: var(--text); }
.logo-word em { font-style: normal; color: var(--accent); }

.topnav { display: none; }
.topbar-user { display: flex; }

/* Desktop: Navigation oben statt unten */
@media (min-width: 860px) {
    .page { padding-bottom: 48px; }
    .topnav { display: flex; gap: 4px; }
    .topnav a {
        display: flex; align-items: center; gap: 8px;
        padding: 9px 16px; border-radius: 999px;
        color: var(--muted); font-weight: 600; font-size: 0.92rem;
        transition: color var(--speed), background var(--speed);
    }
    .topnav a:hover { color: var(--text); background: var(--panel); }
    .topnav a.is-active { color: var(--accent); background: var(--accent-soft); }
    .bottomnav { display: none !important; }
}

/* Mobile: Daumen-Navigation unten */
.bottomnav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    display: flex; justify-content: space-around; align-items: stretch;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: rgba(9, 13, 24, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
}
.bottomnav a {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    min-width: 64px; min-height: 48px; justify-content: center;
    color: var(--muted); font-size: 0.68rem; font-weight: 600;
    border-radius: var(--radius-sm);
    transition: color var(--speed);
}
.bottomnav a .icon { width: 22px; height: 22px; }
.bottomnav a.is-active { color: var(--accent); }
.bottomnav .nav-play {
    color: var(--accent-ink);
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    border-radius: 16px;
    margin-top: -18px;
    padding: 10px 4px 6px;
    box-shadow: var(--glow);
}
.bottomnav .nav-play.is-active { color: var(--accent-ink); }

/* ---------- Karten & Panels ---------- */
.card {
    background: linear-gradient(180deg, var(--panel-strong), var(--panel));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.card-title {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-display); font-weight: 500;
    font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 14px;
}
.card-title .icon { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    min-height: 48px; padding: 12px 22px;
    border-radius: 14px;
    font-weight: 700; font-size: 1rem;
    border: 1px solid transparent;
    transition: transform var(--speed) var(--ease), box-shadow var(--speed), filter var(--speed), background var(--speed);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: var(--accent-ink);
    box-shadow: var(--glow);
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost {
    background: var(--panel);
    border-color: var(--line-strong);
    color: var(--text);
}
.btn-ghost:hover { background: var(--panel-strong); }
.btn-danger-ghost { background: var(--danger-soft); border-color: rgba(255, 84, 112, 0.35); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 0.9rem; }
.btn-lg { min-height: 58px; font-size: 1.08rem; border-radius: 16px; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field > span { font-weight: 600; font-size: 0.9rem; }
.field small { color: var(--muted); font-weight: 400; }
.field input, .field textarea, .field select {
    font: inherit; color: var(--text);
    background: rgba(7, 11, 20, 0.6);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 13px 14px;
    min-height: 48px;
    outline: none;
    transition: border-color var(--speed), box-shadow var(--speed);
    width: 100%;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.field-hint { font-size: 0.82rem; color: var(--muted); }
.stack-form .btn { margin-top: 4px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; background: rgba(7, 11, 20, 0.5); border: 1px solid var(--line); border-radius: 999px; padding: 5px; margin-bottom: 18px; }
.tab {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 42px; padding: 8px 10px; border-radius: 999px;
    font-weight: 700; font-size: 0.9rem; color: var(--muted);
    transition: color var(--speed), background var(--speed), box-shadow var(--speed);
    white-space: nowrap;
}
.tab.is-active { color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-deep)); box-shadow: var(--glow); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: rise 260ms var(--ease); }

/* ---------- Chips & Alerts ---------- */
.chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: 999px;
    background: var(--panel); border: 1px solid var(--line);
    font-size: 0.85rem; font-weight: 600;
}
.chip .icon { color: var(--accent); }

.alert {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    border-radius: var(--radius-sm); padding: 13px 15px;
    font-size: 0.92rem; border: 1px solid;
}
.alert p { margin: 0; }
.alert-danger  { background: var(--danger-soft); border-color: rgba(255, 84, 112, 0.4); color: #ffc2ce; }
.alert-success { background: var(--accent-soft); border-color: rgba(52, 245, 155, 0.4); color: #b9ffdd; }
.alert-info    { background: rgba(64, 96, 255, 0.12); border-color: rgba(110, 140, 255, 0.35); color: #c6d2ff; }
.alert-warn    { background: rgba(255, 84, 112, 0.1); border-color: rgba(255, 84, 112, 0.35); color: #ffd3da; }
.alert-warn .icon { color: var(--danger); }
.alert > div { flex: 1; min-width: 180px; }

/* ---------- Avatare ---------- */
.avatar {
    display: inline-grid; place-items: center;
    width: 38px; height: 38px; border-radius: 12px;
    font-weight: 800; font-size: 0.9rem; color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    flex: 0 0 auto;
}
.avatar-sm { width: 30px; height: 30px; font-size: 0.72rem; border-radius: 9px; }
.avatar-xl { width: 72px; height: 72px; font-size: 1.6rem; border-radius: 20px; }

/* ============================================================
   Landing
   ============================================================ */
.landing .page { max-width: 1060px; }
.hero { display: grid; gap: 28px; padding: 24px 0 8px; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.15fr 1fr; gap: 48px; padding: 48px 0 24px; } }

.hero-kicker {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--accent); font-weight: 700; font-size: 0.85rem;
    letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 14px;
}
.hero-title {
    font-family: var(--font-display); font-weight: 900;
    font-size: clamp(2.4rem, 8vw, 4.2rem); line-height: 1.04;
    background: linear-gradient(120deg, #fff 30%, var(--accent) 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.hero-sub { color: var(--muted); font-size: 1.08rem; max-width: 44ch; margin: 16px 0 20px; }
.hero-types { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.hero-guest .btn { gap: 10px; }

.auth-card { padding: 22px; }

.landing-how { display: grid; gap: 14px; padding-bottom: 24px; }
@media (min-width: 720px) { .landing-how { grid-template-columns: repeat(3, 1fr); } }
.how-step h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; margin: 10px 0 6px; }
.how-step p { color: var(--muted); font-size: 0.92rem; }
.how-num {
    display: inline-grid; place-items: center;
    width: 34px; height: 34px; border-radius: 10px;
    background: var(--accent-soft); color: var(--accent);
    font-family: var(--font-display); font-weight: 700;
}

/* ============================================================
   Seitenköpfe & Standard-Bausteine
   ============================================================ */
.page-head { padding: 8px 0 0; }
.page-kicker { color: var(--accent); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 6px; }
.page-sub { color: var(--muted); margin-top: 8px; }
.page-head .alert { margin-top: 12px; }

.empty-state { text-align: center; padding: 36px 22px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-state p { color: var(--muted); max-width: 42ch; }
.empty-icon {
    display: grid; place-items: center; width: 62px; height: 62px;
    border-radius: 20px; background: var(--accent-soft); color: var(--accent);
}
.empty-icon .icon { width: 30px; height: 30px; }

/* Fortschrittsbalken */
.bar { height: 12px; border-radius: 999px; background: rgba(7, 11, 20, 0.7); border: 1px solid var(--line); overflow: hidden; }
.bar-slim { height: 8px; }
.bar-fill {
    display: block; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-deep), var(--accent));
    box-shadow: 0 0 12px rgba(52, 245, 155, 0.4);
    transition: width 380ms var(--ease);
}
.bar-fill.bar-danger { background: linear-gradient(90deg, #c9304d, var(--danger)); box-shadow: 0 0 12px rgba(255, 84, 112, 0.4); }

/* Statistik-Kacheln */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-tile { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; line-height: 1; }
.stat-value small { font-size: 0.95rem; color: var(--muted); font-weight: 500; }
.stat-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.stat-label .icon { color: var(--accent); }
.stat-xp .stat-value { color: var(--accent); }

/* ============================================================
   Dashboard
   ============================================================ */
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 8px; }
.dash-greet { color: var(--muted); font-weight: 600; margin-bottom: 8px; }

.streak-orb {
    position: relative; flex: 0 0 auto;
    width: 92px; height: 92px; border-radius: 28px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
    background: linear-gradient(180deg, var(--panel-strong), var(--panel));
    border: 1px solid var(--line-strong);
    color: var(--muted);
}
.streak-orb .icon { width: 20px; height: 20px; margin-bottom: 2px; }
.streak-orb.is-hot { border-color: rgba(52, 245, 155, 0.5); box-shadow: var(--glow); color: var(--accent); }
.streak-orb.is-risk { border-color: rgba(255, 84, 112, 0.55); box-shadow: var(--danger-glow); color: var(--danger); animation: pulse-risk 1.6s ease-in-out infinite; }
.streak-num { font-family: var(--font-display); font-weight: 700; font-size: 1.55rem; line-height: 1; color: var(--text); }
.streak-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.level-card { padding: 16px 18px; }
.level-row { display: flex; align-items: center; gap: 14px; }
.level-badge {
    flex: 0 0 auto; display: grid; place-items: center;
    min-width: 56px; height: 56px; padding: 0 10px; border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: var(--accent-ink); font-family: var(--font-display); font-weight: 700;
    box-shadow: var(--glow);
}
.level-info { flex: 1; }
.level-nums { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; font-size: 0.88rem; }
.level-nums span { color: var(--muted); font-size: 0.8rem; }

.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; color: var(--text); transition: transform var(--speed) var(--ease), border-color var(--speed); }
.quick-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.quick-card .icon { width: 24px; height: 24px; color: var(--accent); margin-bottom: 6px; }
.quick-card strong { font-size: 0.98rem; }
.quick-card span { color: var(--muted); font-size: 0.8rem; }
.quick-primary { background: linear-gradient(135deg, rgba(52, 245, 155, 0.16), rgba(23, 200, 118, 0.07)); border-color: rgba(52, 245, 155, 0.35); }
.quick-review .icon { color: var(--danger); }

.subject-list { display: flex; flex-direction: column; gap: 12px; }
.subject-row { display: grid; grid-template-columns: minmax(90px, 130px) 1fr auto; align-items: center; gap: 10px; font-size: 0.9rem; }
.subject-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subject-pct { font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; min-width: 44px; text-align: right; }
.subject-count { grid-column: 2 / 4; color: var(--muted); font-size: 0.75rem; text-align: right; margin-top: -6px; }

.recent-list { display: flex; flex-direction: column; }
.recent-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 4px; color: var(--text);
    border-bottom: 1px solid var(--line);
    transition: background var(--speed);
    border-radius: 8px;
}
.recent-row:last-child { border-bottom: 0; }
.recent-row:hover { background: var(--panel); }
.recent-icon {
    flex: 0 0 auto; display: grid; place-items: center;
    width: 40px; height: 40px; border-radius: 12px;
    background: var(--accent-soft); color: var(--accent);
}
.recent-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.recent-main strong { font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-main small { color: var(--muted); font-size: 0.78rem; }
.recent-score { font-family: var(--font-display); font-weight: 700; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.recent-score small { color: var(--muted); font-size: 0.62rem; font-family: var(--font-body); font-weight: 600; }

/* Badges */
.badge-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.badge-strip::-webkit-scrollbar { display: none; }
.badge-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .badge-grid { grid-template-columns: repeat(4, 1fr); } }
.badge-medal {
    flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 14px 12px; border-radius: var(--radius-sm); text-align: center;
    background: var(--panel); border: 1px solid var(--line);
    min-width: 108px;
}
.badge-icon {
    display: grid; place-items: center; width: 46px; height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: var(--accent-ink);
    box-shadow: var(--glow);
}
.badge-name { font-weight: 700; font-size: 0.8rem; }
.badge-desc { color: var(--muted); font-size: 0.72rem; }
.badge-medal.is-locked { opacity: 0.45; filter: saturate(0.2); }

/* ============================================================
   Spiel erstellen
   ============================================================ */
.create-form { display: flex; flex-direction: column; gap: 16px; }

.template-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.template-item {
    display: flex; flex-direction: column; gap: 2px; text-align: left;
    padding: 12px 14px; border-radius: var(--radius-sm);
    background: rgba(7, 11, 20, 0.45); border: 1px solid var(--line);
    transition: border-color var(--speed), background var(--speed);
}
.template-item:hover { border-color: var(--line-strong); }
.template-item.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.template-subject { color: var(--accent); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.template-topic { font-weight: 700; font-size: 0.95rem; }
.template-desc { color: var(--muted); font-size: 0.8rem; }

.type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.type-card {
    display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left;
    padding: 14px; border-radius: var(--radius-sm);
    background: rgba(7, 11, 20, 0.45); border: 1px solid var(--line);
    transition: border-color var(--speed), background var(--speed), transform var(--speed) var(--ease);
}
.type-card:active { transform: scale(0.97); }
.type-icon {
    display: grid; place-items: center; width: 38px; height: 38px;
    border-radius: 11px; background: var(--panel-strong); color: var(--muted);
    margin-bottom: 6px; transition: background var(--speed), color var(--speed);
}
.type-name { font-weight: 800; font-size: 0.92rem; }
.type-desc { color: var(--muted); font-size: 0.76rem; }
.type-card.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.type-card.is-active .type-icon { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: var(--accent-ink); box-shadow: var(--glow); }

.create-options { display: flex; flex-direction: column; gap: 18px; }
.option-row .card-title { margin-bottom: 10px; }
.segmented { display: flex; gap: 6px; background: rgba(7, 11, 20, 0.5); border: 1px solid var(--line); border-radius: 999px; padding: 5px; }
.segmented button {
    flex: 1; min-height: 42px; border-radius: 999px;
    font-weight: 700; font-size: 0.92rem; color: var(--muted);
    transition: color var(--speed), background var(--speed), box-shadow var(--speed);
}
.segmented button.is-active { color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-deep)); box-shadow: var(--glow); }

.create-submit { display: flex; flex-direction: column; gap: 10px; }

/* Ladezustand der Generierung */
.gen-overlay {
    position: fixed; inset: 0; z-index: 100;
    display: grid; place-items: center;
    background: rgba(5, 8, 15, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.gen-overlay[hidden] { display: none; }
.gen-box { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 24px; max-width: 340px; }
.gen-spinner {
    display: grid; place-items: center;
    width: 76px; height: 76px; border-radius: 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: var(--accent-ink);
    box-shadow: var(--glow);
    animation: spinner-pulse 1.1s ease-in-out infinite;
}
.gen-spinner .icon { width: 36px; height: 36px; }
.gen-status { font-size: 1.15rem; }
.gen-sub { color: var(--muted); font-size: 0.9rem; min-height: 1.4em; }

/* ============================================================
   Spiel-Runtime
   ============================================================ */
.in-game .page { max-width: 640px; padding-bottom: 24px; }

.game-shell { display: flex; flex-direction: column; gap: 14px; min-height: calc(100dvh - 140px); }
.game-topline { display: flex; align-items: center; gap: 12px; }
.game-quit {
    display: grid; place-items: center; flex: 0 0 auto;
    width: 42px; height: 42px; border-radius: 12px;
    background: var(--panel); border: 1px solid var(--line); color: var(--muted);
}
.game-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.game-type-chip { display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.game-title-line { font-weight: 700; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-diff { flex: 0 0 auto; padding: 5px 11px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; border: 1px solid var(--line-strong); color: var(--muted); }
.game-diff.diff-schwer { color: var(--danger); border-color: rgba(255, 84, 112, 0.4); }
.game-diff.diff-leicht, .game-diff.diff-mittel { color: var(--accent); border-color: rgba(52, 245, 155, 0.35); }

.game-root { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.game-loading { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); }

/* Kopfzeile im Spiel: Fortschritt + Timer */
.round-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.round-count { font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; color: var(--muted); }
.review-chip { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; padding: 3px 10px; border-radius: 999px; background: var(--danger-soft); color: var(--danger); font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }

.timer-ring { position: relative; width: 52px; height: 52px; flex: 0 0 auto; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke-width: 4; }
.timer-ring .ring-bg { stroke: var(--line); }
.timer-ring .ring-fg { stroke: var(--accent); stroke-linecap: round; transition: stroke 200ms; }
.timer-ring.is-low .ring-fg { stroke: var(--danger); }
.timer-ring .timer-num {
    position: absolute; inset: 0; display: grid; place-items: center;
    font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
}
.timer-ring.is-low .timer-num { color: var(--danger); }

/* Frage & Antworten */
.q-card { background: linear-gradient(180deg, var(--panel-strong), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.q-text { font-size: 1.12rem; font-weight: 600; line-height: 1.5; }

.answer-grid { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.answer-btn {
    display: flex; align-items: center; gap: 12px; text-align: left;
    min-height: 56px; padding: 13px 16px;
    border-radius: 14px;
    background: linear-gradient(180deg, var(--panel-strong), var(--panel));
    border: 1px solid var(--line-strong);
    font-weight: 600; font-size: 0.98rem; line-height: 1.35;
    transition: border-color 160ms, background 160ms, transform 160ms var(--ease);
}
.answer-btn:active { transform: scale(0.98); }
.answer-key {
    flex: 0 0 auto; display: grid; place-items: center;
    width: 30px; height: 30px; border-radius: 9px;
    background: rgba(7, 11, 20, 0.6); border: 1px solid var(--line);
    font-family: var(--font-display); font-weight: 700; font-size: 0.78rem; color: var(--muted);
}
.answer-btn.is-correct {
    border-color: var(--accent); background: var(--accent-soft);
    box-shadow: var(--glow);
    animation: pop-success 320ms var(--ease);
}
.answer-btn.is-correct .answer-key { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.answer-btn.is-wrong {
    border-color: var(--danger); background: var(--danger-soft);
    animation: shake 340ms ease;
}
.answer-btn.is-wrong .answer-key { background: var(--danger); color: #fff; border-color: transparent; }
.answer-btn.is-dim { opacity: 0.4; }
.answer-btn[disabled] { cursor: default; }

.hint-row { display: flex; justify-content: flex-end; margin-top: 12px; }
.hint-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.85rem; font-weight: 700; padding: 8px 12px; border-radius: 999px; border: 1px dashed var(--line-strong); }
.hint-text { margin-top: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(64, 96, 255, 0.1); border: 1px solid rgba(110, 140, 255, 0.3); color: #c6d2ff; font-size: 0.9rem; animation: rise 240ms var(--ease); }

.explain-panel {
    border-radius: var(--radius-sm); padding: 14px 16px;
    border: 1px solid; font-size: 0.93rem;
    animation: rise 260ms var(--ease);
}
.explain-panel.is-good { background: var(--accent-soft); border-color: rgba(52, 245, 155, 0.4); }
.explain-panel.is-bad { background: var(--danger-soft); border-color: rgba(255, 84, 112, 0.4); }
.explain-verdict { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; margin-bottom: 6px; }
.explain-panel.is-good .explain-verdict { color: var(--accent); }
.explain-panel.is-bad .explain-verdict { color: var(--danger); }
.explain-points { float: right; font-family: var(--font-display); font-weight: 700; color: var(--accent); }

.game-footer { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }

/* Punkte-Pop */
.points-pop {
    position: fixed; left: 50%; top: 38%; z-index: 60;
    transform: translateX(-50%);
    font-family: var(--font-display); font-weight: 900; font-size: 2rem;
    color: var(--accent); text-shadow: 0 0 18px rgba(52, 245, 155, 0.6);
    pointer-events: none;
    animation: float-up 700ms var(--ease) forwards;
}

/* --- Quiz-Duell: Versus-Leiste --- */
.versus-bar {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
    background: linear-gradient(180deg, var(--panel-strong), var(--panel));
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px 16px;
}
.vs-side { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vs-side.vs-right { align-items: flex-end; text-align: right; }
.vs-name { font-size: 0.75rem; font-weight: 700; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.vs-score { font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; line-height: 1; }
.vs-badge { font-family: var(--font-display); font-weight: 900; font-size: 0.8rem; color: var(--danger); padding: 6px 10px; border: 1px solid rgba(255, 84, 112, 0.4); border-radius: 10px; background: var(--danger-soft); }
.vs-status { font-size: 0.7rem; color: var(--muted); min-height: 1em; }
.vs-side.is-flash .vs-score { animation: pop-success 320ms var(--ease); }

/* --- Boss-Fight --- */
.boss-arena { display: flex; flex-direction: column; gap: 12px; }
.hp-row { display: flex; flex-direction: column; gap: 6px; }
.hp-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.8rem; font-weight: 700; }
.hp-head .hp-num { font-family: var(--font-display); }
.hp-bar { height: 16px; border-radius: 999px; background: rgba(7, 11, 20, 0.7); border: 1px solid var(--line); overflow: hidden; }
.hp-fill { display: block; height: 100%; border-radius: 999px; transition: width 360ms var(--ease); }
.hp-boss .hp-fill { background: linear-gradient(90deg, #c9304d, var(--danger)); box-shadow: 0 0 14px rgba(255, 84, 112, 0.5); }
.hp-boss .hp-head { color: var(--danger); }
.hp-player .hp-fill { background: linear-gradient(90deg, var(--accent-deep), var(--accent)); box-shadow: 0 0 14px rgba(52, 245, 155, 0.45); }
.hp-player .hp-head { color: var(--accent); }

.boss-figure {
    position: relative; align-self: center;
    display: grid; place-items: center;
    width: 88px; height: 88px; border-radius: 26px;
    background: linear-gradient(135deg, rgba(255, 84, 112, 0.22), rgba(120, 30, 60, 0.25));
    border: 1px solid rgba(255, 84, 112, 0.45);
    color: var(--danger);
    box-shadow: var(--danger-glow);
}
.boss-figure .icon { width: 44px; height: 44px; }
.boss-figure.is-hit { animation: boss-hit 360ms ease; }
.boss-figure.is-attack { animation: boss-attack 380ms var(--ease); }
.game-shell.is-shaken { animation: shake 340ms ease; }

.combo-meter { display: flex; align-items: center; gap: 8px; justify-content: center; min-height: 26px; font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; color: var(--muted); }
.combo-meter.is-hot { color: var(--accent); text-shadow: 0 0 14px rgba(52, 245, 155, 0.5); }
.combo-meter .icon { width: 16px; height: 16px; }

.dmg-float {
    position: absolute; left: 50%; top: -8px; transform: translateX(-50%);
    font-family: var(--font-display); font-weight: 900; font-size: 1.3rem;
    pointer-events: none; animation: float-up 650ms var(--ease) forwards;
}
.dmg-float.dmg-out { color: var(--accent); text-shadow: 0 0 14px rgba(52, 245, 155, 0.6); }
.dmg-float.dmg-in { color: var(--danger); text-shadow: 0 0 14px rgba(255, 84, 112, 0.6); }

/* --- Story-Adventure --- */
.scene-card {
    background: linear-gradient(160deg, rgba(64, 96, 255, 0.1), var(--panel));
    border: 1px solid rgba(110, 140, 255, 0.25);
    border-radius: var(--radius); padding: 18px 20px;
    font-size: 0.98rem; line-height: 1.65; color: #dbe4ff;
    animation: rise 300ms var(--ease);
}
.scene-kicker { display: flex; align-items: center; gap: 7px; color: #8fa5ff; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 8px; }
.lives { display: flex; gap: 5px; }
.lives .icon { width: 20px; height: 20px; color: var(--danger); fill: var(--danger); }
.lives .icon.is-lost { color: var(--line-strong); fill: none; opacity: 0.5; }

/* --- Karten-Match --- */
.match-timer { display: flex; flex-direction: column; gap: 6px; }
.match-timer .hp-head { color: var(--muted); }
.match-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .match-grid { grid-template-columns: repeat(3, 1fr); } }
.match-card {
    min-height: 84px; padding: 12px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; text-align: center;
    font-size: 0.85rem; line-height: 1.35;
    background: linear-gradient(180deg, var(--panel-strong), var(--panel));
    border: 1px solid var(--line-strong);
    transition: border-color 160ms, background 160ms, transform 200ms var(--ease), opacity 300ms;
    transform-style: preserve-3d;
    animation: flip-in 360ms var(--ease) backwards;
}
.match-card.card-term { font-weight: 800; font-size: 0.92rem; }
.match-card.card-def { color: var(--muted); }
.match-card.is-selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); transform: scale(1.03); color: var(--text); }
.match-card.is-matched { border-color: var(--accent); background: var(--accent-soft); opacity: 0.35; pointer-events: none; transform: scale(0.96); }
.match-card.is-wrong { border-color: var(--danger); background: var(--danger-soft); animation: shake 340ms ease; }

/* ============================================================
   Auswertung
   ============================================================ */
.results-hero { text-align: center; padding: 20px 0 6px; }
.results-game { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-size: 0.82rem; font-weight: 700; margin-bottom: 10px; }
.results-title { font-size: clamp(1.7rem, 6.5vw, 2.6rem); }
.results-hero.is-win .results-title { background: linear-gradient(120deg, #fff 25%, var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.results-hero.is-loss .results-title { color: var(--text); }
.results-sub { color: var(--muted); margin-top: 8px; }
.results-score { display: flex; flex-direction: column; align-items: center; margin-top: 18px; }
.score-number {
    font-family: var(--font-display); font-weight: 900;
    font-size: clamp(3rem, 14vw, 4.6rem); line-height: 1;
    color: var(--accent); text-shadow: 0 0 34px rgba(52, 245, 155, 0.4);
}
.score-label { color: var(--muted); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 4px; }

.results-actions { display: flex; flex-direction: column; gap: 10px; }
.guest-cta { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; padding: 26px 20px; }
.guest-cta p { color: var(--muted); max-width: 46ch; }

#result-fx { display: flex; flex-direction: column; gap: 10px; }
.fx-banner {
    display: flex; align-items: center; gap: 12px;
    border-radius: var(--radius-sm); padding: 14px 16px;
    background: var(--accent-soft); border: 1px solid rgba(52, 245, 155, 0.45);
    animation: rise 320ms var(--ease);
    font-weight: 600;
}
.fx-banner .badge-icon { width: 40px; height: 40px; flex: 0 0 auto; }
.fx-banner strong { display: block; font-family: var(--font-display); font-size: 0.92rem; }
.fx-banner small { color: var(--muted); }

/* ============================================================
   Challenge
   ============================================================ */
.share-card { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.share-code {
    font-family: var(--font-display); font-weight: 900;
    font-size: clamp(2rem, 9vw, 2.9rem); letter-spacing: 0.22em;
    padding: 8px 10px 8px 20px;
    color: var(--accent); text-shadow: 0 0 26px rgba(52, 245, 155, 0.45);
}
.challenge-play { display: flex; flex-direction: column; gap: 8px; }

.code-input { text-transform: uppercase; letter-spacing: 0.3em; font-family: var(--font-display); font-weight: 700; text-align: center; font-size: 1.3rem !important; }

.leaderboard { list-style: none; display: flex; flex-direction: column; }
.lb-row {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 10px; border-radius: var(--radius-sm);
    border-bottom: 1px solid var(--line);
}
.lb-row:last-child { border-bottom: 0; }
.lb-rank { font-family: var(--font-display); font-weight: 700; min-width: 26px; text-align: center; color: var(--muted); }
.lb-row.rank-1 .lb-rank { color: var(--accent); text-shadow: 0 0 12px rgba(52, 245, 155, 0.6); }
.lb-row.is-top { background: var(--panel); }
.lb-row.is-me { border: 1px solid rgba(52, 245, 155, 0.4); background: var(--accent-soft); }
.lb-name { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-correct { color: var(--muted); font-size: 0.78rem; }
.lb-score { font-family: var(--font-display); font-weight: 700; }

.how-list { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 0.93rem; }
.how-list strong { color: var(--text); }

/* ============================================================
   Profil
   ============================================================ */
.profile-head { display: flex; align-items: center; gap: 16px; padding-top: 8px; }

/* ============================================================
   Toasts
   ============================================================ */
#toast-root {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(88px + env(safe-area-inset-bottom));
    z-index: 120; display: flex; flex-direction: column; gap: 8px;
    width: min(92vw, 400px); pointer-events: none;
}
@media (min-width: 860px) { #toast-root { bottom: 28px; } }
.toast {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: 14px;
    background: rgba(13, 20, 36, 0.95); border: 1px solid var(--line-strong);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    font-weight: 600; font-size: 0.92rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    animation: rise 280ms var(--ease);
}
.toast.is-danger { border-color: rgba(255, 84, 112, 0.5); color: #ffd3da; }
.toast.is-success { border-color: rgba(52, 245, 155, 0.5); color: #b9ffdd; }
.toast.is-leaving { opacity: 0; transition: opacity 250ms; }

/* ============================================================
   3D-Spiele: Bühne, HUD, Shooter, Penalty, Race
   ============================================================ */
.stage3d {
    position: relative;
    height: min(46vh, 380px);
    border-radius: var(--radius);
    border: 1px solid var(--line-strong);
    overflow: hidden;
    background: var(--bg-1);
    touch-action: manipulation;
}
.stage3d canvas { width: 100% !important; height: 100% !important; display: block; }
.stage-race { height: min(34vh, 280px); }

.stage-hud {
    position: absolute; top: 44px; left: 10px; right: 10px; z-index: 5;
    display: flex; justify-content: space-between; gap: 8px;
    pointer-events: none;
}
.hud-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px;
    background: rgba(7, 11, 20, 0.75); border: 1px solid var(--line-strong);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    font-family: var(--font-display); font-weight: 700; font-size: 0.82rem;
}
.hud-chip .icon { color: var(--accent); width: 15px; height: 15px; }
.hud-chip b { font-weight: 900; }
.hud-combo { color: var(--accent); }
.hud-combo:empty { display: none; }
.hud-me { border-color: rgba(52, 245, 155, 0.45); }
.hud-me .icon { color: var(--accent); }
.hud-ai { border-color: rgba(255, 84, 112, 0.45); }
.hud-ai .icon { color: var(--danger); }

.crosshair {
    position: absolute; left: 50%; top: 50%; z-index: 4;
    width: 26px; height: 26px; transform: translate(-50%, -50%);
    pointer-events: none; opacity: 0.6;
}
.crosshair::before, .crosshair::after {
    content: ''; position: absolute; background: var(--accent);
    box-shadow: 0 0 8px rgba(52, 245, 155, 0.7);
}
.crosshair::before { left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px;
    clip-path: polygon(0 0, 100% 0, 100% 32%, 0 32%, 0 68%, 100% 68%, 100% 100%, 0 100%); }
.crosshair::after { top: 50%; left: 0; right: 0; height: 2px; margin-top: -1px;
    clip-path: polygon(0 0, 32% 0, 32% 100%, 0 100%, 68% 0, 100% 0, 100% 100%, 68% 100%); }

.q-compact { padding: 14px 16px; }
.q-compact .q-text { font-size: 1rem; }

.shooter-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shooter-opt {
    display: flex; align-items: center; gap: 9px; text-align: left;
    min-height: 48px; padding: 9px 12px; border-radius: 12px;
    background: linear-gradient(180deg, var(--panel-strong), var(--panel));
    border: 1px solid var(--line-strong);
    font-weight: 600; font-size: 0.85rem; line-height: 1.3;
    transition: border-color 160ms, background 160ms;
}
.shooter-opt .answer-key { width: 26px; height: 26px; font-size: 0.7rem; }
.shooter-opt.is-correct { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--glow); }
.shooter-opt.is-correct .answer-key { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.shooter-opt.is-wrong { border-color: var(--danger); background: var(--danger-soft); animation: shake 340ms ease; }
.shooter-opt.is-dim { opacity: 0.4; }

/* Timer-Leiste: zählt oben über der Bühne runter */
.timer-bar {
    position: absolute; left: 0; right: 0; top: 0; z-index: 6;
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    background: linear-gradient(180deg, rgba(7, 11, 20, 0.85), transparent);
    pointer-events: none;
}
.timer-bar-num {
    font-family: var(--font-display); font-weight: 900; font-size: 1.1rem;
    min-width: 30px; text-align: center; color: var(--accent);
}
.timer-bar-track { flex: 1; height: 8px; border-radius: 999px; background: rgba(7, 11, 20, 0.7); border: 1px solid var(--line); overflow: hidden; }
.timer-bar-fill {
    display: block; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-deep), var(--accent));
    box-shadow: 0 0 10px rgba(52, 245, 155, 0.5);
}
.timer-bar.is-low .timer-bar-num { color: var(--danger); }
.timer-bar.is-low .timer-bar-fill { background: linear-gradient(90deg, #c9304d, var(--danger)); box-shadow: 0 0 10px rgba(255, 84, 112, 0.5); }

/* FPS-Shooter */
.stage-fps { height: min(56vh, 460px); touch-action: none; }
.stage-penalty { height: min(48vh, 400px); }

.minimap {
    position: absolute; top: 88px; right: 10px; z-index: 5;
    width: 96px; height: 96px;
    border-radius: 12px; border: 1px solid var(--line-strong);
    pointer-events: none;
}
@media (min-width: 640px) { .minimap { width: 120px; height: 120px; } }

.hit-flash {
    position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(255, 84, 112, 0.45) 100%);
}
.hit-flash.is-on { animation: hit-flash 380ms ease; }
@keyframes hit-flash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }

.muzzle {
    position: absolute; left: 50%; bottom: 0; z-index: 4;
    width: 120px; height: 90px; transform: translateX(-50%);
    background: radial-gradient(ellipse at 50% 100%, rgba(52, 245, 155, 0.55), transparent 65%);
    opacity: 0; pointer-events: none;
}
.muzzle.is-on { animation: muzzle 140ms ease; }
@keyframes muzzle { 0% { opacity: 0; } 40% { opacity: 1; } 100% { opacity: 0; } }

.fps-fire {
    position: absolute; right: 14px; bottom: 34px; z-index: 7;
    width: 68px; height: 68px; border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: var(--accent-ink);
    box-shadow: var(--glow);
    border: 3px solid rgba(255, 255, 255, 0.25);
}
.fps-fire .icon { width: 30px; height: 30px; }
.fps-fire:active { transform: scale(0.92); }

.fps-stick {
    position: absolute; z-index: 7; width: 88px; height: 88px;
    border-radius: 50%; border: 2px solid rgba(148, 170, 220, 0.4);
    background: rgba(7, 11, 20, 0.4); pointer-events: none;
}
.fps-stick-nub {
    position: absolute; left: 50%; top: 50%; margin: -18px 0 0 -18px;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(52, 245, 155, 0.5); border: 2px solid var(--accent);
}

.fps-hint {
    position: absolute; inset: 0; z-index: 8;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    background: rgba(5, 8, 15, 0.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    text-align: center; padding: 20px; cursor: pointer; pointer-events: none;
    font-weight: 700;
}
.fps-hint .icon { width: 34px; height: 34px; color: var(--accent); }
.fps-hint[hidden] { display: none; }

.legend-chip { cursor: default; }

/* Turbo-Race: Lenk-Buttons */
.race-controls { display: flex; gap: 10px; }
.race-btn {
    flex: 1; min-height: 52px; border-radius: 14px;
    background: var(--panel); border: 1px solid var(--line-strong);
    font-size: 1.5rem; font-weight: 900; color: var(--accent);
    transition: background 140ms, transform 140ms var(--ease);
}
.race-btn:active { transform: scale(0.95); background: var(--accent-soft); }

/* Gross-Einblendung TOOOR! / GEHALTEN! */
.shot-result {
    position: absolute; left: 50%; top: 40%; z-index: 7; transform: translate(-50%, -50%);
    font-family: var(--font-display); font-weight: 900;
    font-size: clamp(2.2rem, 10vw, 3.6rem); letter-spacing: 0.04em;
    animation: pop-success 380ms var(--ease);
    pointer-events: none;
}
.shot-result.is-goal { color: var(--accent); text-shadow: 0 0 34px rgba(52, 245, 155, 0.65); }
.shot-result.is-save { color: var(--danger); text-shadow: 0 0 34px rgba(255, 84, 112, 0.65); }

/* Turbo-Race */
.race-progress { display: flex; flex-direction: column; gap: 8px; }
.race-row { display: flex; align-items: center; gap: 10px; }
.race-tag {
    flex: 0 0 auto; min-width: 38px; text-align: center;
    font-family: var(--font-display); font-weight: 900; font-size: 0.72rem;
    padding: 4px 8px; border-radius: 8px;
}
.race-me { color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-deep)); }
.race-ai { color: #fff; background: linear-gradient(135deg, var(--danger), #c9304d); }
.race-row .bar { flex: 1; }

/* ============================================================
   Länder-Eroberung: Hex-Karte
   ============================================================ */
.conquest-hud { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.conquest-contest {
    font-family: var(--font-display); font-weight: 700; font-size: 0.78rem;
    color: var(--muted); text-align: center; flex: 1; min-width: 120px;
}
.conquest-wrap {
    perspective: 900px;
    border-radius: var(--radius);
    border: 1px solid var(--line-strong);
    background: radial-gradient(600px 300px at 50% 0%, rgba(64, 96, 255, 0.08), transparent 70%), var(--bg-1);
    padding: 10px;
    overflow: hidden;
}
.conquest-wrap svg {
    width: 100%; height: auto; max-height: 40vh; display: block; margin: 0 auto;
    transform: rotateX(18deg);
    transform-origin: 50% 60%;
    filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.45));
}
.country {
    fill: rgba(148, 170, 220, 0.1);
    stroke: rgba(200, 214, 240, 0.55); stroke-width: 2.5; stroke-linejoin: round;
    transition: fill 300ms, filter 300ms;
    transform-box: fill-box; transform-origin: center;
    cursor: default;
}
.country-me { fill: rgba(52, 245, 155, 0.5); filter: drop-shadow(0 0 8px rgba(52, 245, 155, 0.45)); }
.country-ai { fill: rgba(255, 84, 112, 0.48); filter: drop-shadow(0 0 8px rgba(255, 84, 112, 0.4)); }
.country.can-attack {
    cursor: pointer;
    animation: country-pulse 1.3s ease-in-out infinite;
    stroke: var(--accent); stroke-width: 3;
}
.country.can-attack:hover { fill: rgba(52, 245, 155, 0.28); }
.country.is-contested { animation: country-pulse 0.8s ease-in-out infinite; stroke: var(--accent); stroke-width: 3.5; }
.country.just-captured { animation: capture-pop 380ms var(--ease); }
.country-label {
    fill: var(--text); font-size: 13px; font-weight: 600; text-anchor: middle;
    font-family: var(--font-body); pointer-events: none; opacity: 0.9;
    paint-order: stroke; stroke: rgba(7, 11, 20, 0.7); stroke-width: 3px;
}
.capital { stroke-width: 2; }
.capital-me { fill: var(--accent); stroke: rgba(4, 36, 15, 0.6); }
.capital-ai { fill: var(--danger); stroke: rgba(50, 8, 16, 0.6); }

/* Blitzrunde */
.speed-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* "3D"-Tag auf den Spieltyp-Karten */
.type-card { position: relative; }
.type-tag3d {
    position: absolute; top: 10px; right: 10px;
    font-family: var(--font-display); font-weight: 900; font-size: 0.62rem;
    letter-spacing: 0.08em; padding: 3px 8px; border-radius: 999px;
    color: var(--accent-ink);
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    box-shadow: var(--glow);
}

@keyframes country-pulse {
    0%, 100% { stroke-opacity: 0.5; }
    50% { stroke-opacity: 1; }
}
@keyframes capture-pop {
    0% { transform: scale(1); }
    45% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ============================================================
   Animationen (alle unter 400 ms)
   ============================================================ */
@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pop-success {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.05); }
    100% { transform: scale(1); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-7px); }
    45% { transform: translateX(6px); }
    70% { transform: translateX(-4px); }
    88% { transform: translateX(2px); }
}
@keyframes float-up {
    0%   { opacity: 0; transform: translate(-50%, 12px) scale(0.85); }
    25%  { opacity: 1; transform: translate(-50%, 0) scale(1.05); }
    100% { opacity: 0; transform: translate(-50%, -46px) scale(1); }
}
.dmg-float { animation-name: dmg-up; }
@keyframes dmg-up {
    0%   { opacity: 0; transform: translate(-50%, 8px) scale(0.8); }
    25%  { opacity: 1; transform: translate(-50%, -4px) scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, -40px) scale(1); }
}
@keyframes boss-hit {
    0%   { transform: translateX(0); filter: brightness(1); }
    30%  { transform: translateX(-8px) rotate(-4deg); filter: brightness(1.8); }
    60%  { transform: translateX(6px) rotate(3deg); }
    100% { transform: translateX(0); filter: brightness(1); }
}
@keyframes boss-attack {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.18) translateY(6px); }
    100% { transform: scale(1); }
}
@keyframes flip-in {
    from { opacity: 0; transform: rotateY(85deg); }
    to   { opacity: 1; transform: rotateY(0); }
}
@keyframes spinner-pulse {
    0%, 100% { transform: scale(1); box-shadow: var(--glow); }
    50% { transform: scale(1.08); box-shadow: 0 0 34px rgba(52, 245, 155, 0.5); }
}
@keyframes pulse-risk {
    0%, 100% { box-shadow: var(--danger-glow); }
    50% { box-shadow: 0 0 34px rgba(255, 84, 112, 0.55); }
}

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
