/* ==========================================================================
   TE-Arcade — Design-Tokens nach TE_Filial_KPI/docs/corporate_design.md,
   8-Bit-Akzente nur als Display-Elemente (PROJEKTPLAN Kap. 6).
   Mobile-first: Basis-Styles gelten fuers Handy, min-width erweitert.
   ========================================================================== */

:root {
    /* Primaerpalette (1:1 aus dem Print-Styleguide) */
    --color-brand-yellow: #E6C846;
    --color-brand-yellow-soft: #FFE68C;
    --color-brand-red: #FF4664;
    --color-ink-900: #1E1E1E;
    --color-ink-700: #3C3C3C;
    --color-ink-500: #5A5A5A;
    --color-ink-300: #B4B4B4;
    --color-paper: #FAF9F6;
    --color-paper-tint: #F2EFE5;
    --color-border-soft: #E7E2D3;
    --color-surface-dark: #1E1E1E;
    --color-surface-dark-2: #262525;
    --color-state-positive: #7FAE3A;
    --color-state-positive-soft: #C9E0A2;
    --color-state-warn: #E6A446;

    --font-display: "Roboto Slab", serif;
    --font-body: "Montserrat", sans-serif;
    --font-pixel: "Press Start 2P", monospace;

    --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
    --space-5: 1.5rem; --space-6: 2rem; --space-7: 3rem;
    --radius-sm: 4px;   /* CI: kein Radius ueber 4px */

    --touch-target: 44px;  /* Mobile-first: Mindestgroesse aller Bedienelemente */
}

* { box-sizing: border-box; }

/* hidden-Attribut gewinnt IMMER — auch gegen display:flex auf Klassen
   (sonst sind per JS getoggelte Boxen wie Grund-Abfrage/Bestaetigung
   dauerhaft sichtbar). */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; max-width: 100%; }  /* nie horizontal scrollen (mobil) */

body {
    margin: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--color-surface-dark);
    color: var(--color-paper);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.55;
}

/* --- Hero-Streifen (CI-Signatur: schwarz + gelber Tab) ------------------- */
.hero {
    background: var(--color-surface-dark);
    border-bottom: 2px solid var(--color-brand-yellow);
    padding: var(--space-4) var(--space-4) var(--space-3);
    padding-top: max(var(--space-4), env(safe-area-inset-top));
}
.hero-inner { display: flex; align-items: center; gap: var(--space-3); }
.hero-title {
    font-family: var(--font-pixel);
    font-size: 1rem;
    color: var(--color-brand-yellow);
    letter-spacing: .04em;
    text-shadow: 2px 2px 0 var(--color-ink-700);
}
.hero-tab {
    margin-left: auto;
    width: 8px; height: 28px;
    background: var(--color-brand-yellow);
}
.hero-claim {
    margin-top: var(--space-2);
    font-size: .75rem;
    color: var(--color-ink-300);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 500;
}

/* --- Content -------------------------------------------------------------- */
.content {
    flex: 1;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: var(--space-5) var(--space-4);
}

.arcade-panel {
    background: var(--color-surface-dark-2);
    border: 1px solid var(--color-ink-700);
    border-radius: var(--radius-sm);
    padding: var(--space-5) var(--space-4);
}

.pixel-line {
    font-family: var(--font-pixel);
    font-size: .8rem;
    color: var(--color-brand-yellow);
    margin: 0 0 var(--space-4);
}
.pixel-small { font-family: var(--font-pixel); font-size: .55rem; }

.blink { animation: blink 1.2s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

.body-text { color: var(--color-paper); margin: 0 0 var(--space-5); }

.meta-line {
    margin-top: var(--space-5);
    font-size: .75rem;
    color: var(--color-ink-500);
}

/* --- Stat-Karten (KPI-Karte nach CI, dunkle Variante) --------------------- */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;   /* Handy: 2 Spalten */
    gap: var(--space-3);
}
.stat-card {
    background: var(--color-surface-dark);
    border: 1px solid var(--color-ink-700);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    min-height: var(--touch-target);
}
.stat-card.accent { border-left: 3px solid var(--color-brand-yellow); }
.stat-number {
    font-family: var(--font-display);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 1.4rem;
    color: var(--color-brand-yellow);
}
.stat-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--color-ink-300);
    margin-top: var(--space-1);
}

/* --- Formulare (mobile-first: grosse Touch-Ziele) --------------------------- */
.narrow { max-width: 420px; margin: 0 auto; }

.form { display: flex; flex-direction: column; gap: var(--space-4); }

.field { display: flex; flex-direction: column; gap: var(--space-1); }
.field-label {
    font-size: .7rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .08em;
    color: var(--color-ink-300);
}
.field input, .inline-form input {
    min-height: var(--touch-target);
    padding: var(--space-2) var(--space-3);
    background: var(--color-surface-dark);
    border: 1px solid var(--color-ink-700);
    border-radius: var(--radius-sm);
    color: var(--color-paper);
    font-family: var(--font-body);
    font-size: 1rem;
}
.field input:focus, .inline-form input:focus {
    outline: 2px solid var(--color-brand-yellow);
    outline-offset: -1px;
}

.btn {
    min-height: var(--touch-target);
    padding: 10px 18px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
}
.btn-primary { background: var(--color-brand-yellow); color: var(--color-ink-900); }
.btn-primary:hover { filter: brightness(.95); }
.btn-ghost {
    background: transparent; color: var(--color-paper);
    border-color: var(--color-ink-500);
}
.btn-ghost:hover { background: var(--color-surface-dark); }
.btn-sm { min-height: 38px; padding: 6px 12px; font-size: .75rem; }

.flash {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    border-left: 3px solid;
}
.flash-ok { background: #26311c; border-color: var(--color-state-positive); color: var(--color-state-positive-soft); }
.flash-error { background: #3a2026; border-color: var(--color-brand-red); color: #ffd7de; }

.quiet-link { color: var(--color-ink-300); }
.quiet-link:hover { color: var(--color-brand-yellow); }

/* --- Admin: Crew-Karten ------------------------------------------------------ */
.crew-list { display: flex; flex-direction: column; gap: var(--space-3); }
.crew-card {
    background: var(--color-surface-dark);
    border: 1px solid var(--color-ink-700);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
}
.crew-card.inactive { opacity: .55; }
.crew-head { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.crew-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }

.pill {
    border-radius: 999px; padding: 3px 12px;
    font-size: .7rem; font-weight: 600; letter-spacing: .04em;
}
.pill-ok { background: var(--color-state-positive-soft); color: var(--color-ink-900); }
.pill-warn { background: var(--color-brand-yellow-soft); color: var(--color-ink-900); }
.pill-grey { background: var(--color-ink-700); color: var(--color-ink-300); }

.crew-meta {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2) var(--space-4);
    margin: var(--space-3) 0;
}
.crew-meta dt {
    font-size: .65rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .08em; color: var(--color-ink-500);
}
.crew-meta dd { margin: 0; font-variant-numeric: tabular-nums; }

.crew-actions { display: flex; flex-direction: column; gap: var(--space-2); }
.inline-form { display: flex; gap: var(--space-2); }
.inline-form input { flex: 1; min-width: 0; }

@media (min-width: 640px) {
    .crew-meta { grid-template-columns: repeat(4, 1fr); }
    .crew-actions { flex-direction: row; flex-wrap: wrap; }
}

/* --- Quest-Board & Einsatz-Doku --------------------------------------------- */
.cta-block { margin-top: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.btn-block { display: block; width: 100%; text-align: center; text-decoration: none; }
a.btn { text-decoration: none; line-height: calc(var(--touch-target) - 22px); }

.size-row { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-5); }
.size-row .btn { flex: 1; min-width: 72px; text-align: center; }

.proposal-list { display: flex; flex-direction: column; gap: var(--space-4); }
.proposal-card {
    background: var(--color-surface-dark);
    border: 1px solid var(--color-ink-700);
    border-left: 3px solid var(--color-brand-yellow);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
}
.proposal-head { display: flex; justify-content: space-between; align-items: center;
    margin-bottom: var(--space-3); color: var(--color-brand-yellow); }
.street-list { margin: 0 0 var(--space-4); padding-left: 1.2em; }
.street-list li { margin-bottom: 2px; }
.muted { color: var(--color-ink-500); font-size: .85em; }

/* Quest-Fortschritt */
.quest-progress { margin-bottom: var(--space-5); }
.quest-progress-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: var(--space-2);
    color: var(--color-brand-yellow);
}

/* ── Tinder-Deck: Strassen wegwischen ─────────────────────────────────────── */
.deck-wrap { margin-bottom: var(--space-5); }
.deck {
    position: relative;
    height: 340px;
    touch-action: pan-y;               /* horizontales Wischen gehoert uns */
}

/* Mini-Karte auf der Swipe-Karte: rein visuell, Gesten gehen an die Karte */
.card-map {
    height: 150px;
    border: 1px solid var(--color-ink-700);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-surface-dark-2);
    pointer-events: none;
}
.card-map-inner { height: 100%; width: 100%; }
.card-map .leaflet-control-attribution {
    background: rgba(30, 30, 30, .7) !important;
    color: var(--color-ink-500) !important;
    font-size: 8px;
}
.swipe-card {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; justify-content: center;
    gap: var(--space-2);
    padding: var(--space-5);
    background: var(--color-surface-dark);
    border: 2px solid var(--color-ink-700);
    border-radius: var(--radius-sm);
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
    transition: transform .25s ease, opacity .25s ease;
    will-change: transform;
}
.swipe-card.top { border-color: var(--color-brand-yellow);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.swipe-card.dragging { transition: none; cursor: grabbing; }
.swipe-card.fly { transition: transform .28s ease-in, opacity .28s ease-in; }
.swipe-street {
    font-family: var(--font-display); font-weight: 700;
    font-size: 1.35rem; line-height: 1.25;
    color: var(--color-paper);
}
.swipe-sub { color: var(--color-ink-300); font-size: .9rem; }
.swipe-hint { font-size: .7rem; color: var(--color-ink-500); margin-top: var(--space-2); }
.swipe-tag {
    position: absolute; top: var(--space-4);
    font-family: var(--font-pixel); font-size: .6rem;
    padding: var(--space-2) var(--space-3);
    border: 2px solid; border-radius: var(--radius-sm);
    opacity: 0; pointer-events: none;
}
.swipe-tag-yes { left: var(--space-4); color: var(--color-state-positive);
    border-color: var(--color-state-positive); transform: rotate(-8deg); }
.swipe-tag-no { right: var(--space-4); color: var(--color-brand-red);
    border-color: var(--color-brand-red); transform: rotate(8deg); }

.deck-empty {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    border: 2px dashed var(--color-ink-700); border-radius: var(--radius-sm);
}

.deck-actions {
    display: flex; justify-content: center; gap: var(--space-5);
    margin-top: var(--space-4);
}
.deck-btn {
    width: 60px; height: 60px; border-radius: 50%;
    font-size: 1.5rem; cursor: pointer;
    background: var(--color-surface-dark);
    border: 2px solid;
    -webkit-tap-highlight-color: transparent;
}
.deck-btn:active { transform: scale(.92); }
.deck-btn-yes { color: var(--color-state-positive); border-color: var(--color-state-positive); }
.deck-btn-no { color: var(--color-brand-red); border-color: var(--color-brand-red); }
.deck-btn-later { color: var(--color-ink-300); border-color: var(--color-ink-500);
    font-size: 1.2rem; width: 48px; height: 48px; align-self: center; }

.deck-undo {
    display: block; margin: var(--space-3) auto 0;
    background: none; border: 0; cursor: pointer;
    color: var(--color-ink-500); font-size: .8rem;
}
.deck-undo:hover { color: var(--color-brand-yellow); }

.deck-reason {
    margin-top: var(--space-4);
    padding: var(--space-4);
    background: var(--color-surface-dark);
    border: 1px solid var(--color-brand-red);
    border-radius: var(--radius-sm);
    display: flex; flex-direction: column; gap: var(--space-3);
}
.deck-reason input {
    flex: 1; min-width: 0; min-height: var(--touch-target);
    padding: var(--space-2) var(--space-3);
    background: var(--color-surface-dark-2);
    border: 1px solid var(--color-ink-700);
    border-radius: var(--radius-sm);
    color: var(--color-paper);
}

/* Bestaetigungs-Screen (kein aktives Time-Tracking: Sollzeit wird gebucht) */
.confirm-box {
    text-align: center;
    padding: var(--space-5) var(--space-4);
    border: 2px solid var(--color-brand-yellow);
    border-radius: var(--radius-sm);
    background: var(--color-surface-dark);
    display: flex; flex-direction: column; gap: var(--space-4);
}
.confirm-time { display: flex; flex-direction: column; gap: 2px; }
.confirm-time-value {
    font-family: var(--font-display); font-weight: 900;
    font-size: 2rem; color: var(--color-brand-yellow);
    font-variant-numeric: tabular-nums;
}
.confirm-time-label {
    font-size: .75rem; text-transform: uppercase; letter-spacing: .08em;
    color: var(--color-ink-300);
}
.adjust-box {
    display: flex; flex-direction: column; gap: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px dashed var(--color-ink-700);
    text-align: left;
}

.seg-list { display: flex; flex-direction: column; gap: var(--space-3); }
.seg-card {
    background: var(--color-surface-dark);
    border: 2px solid var(--color-ink-700);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color .15s, transform .15s;
}
.seg-card.done { border-color: var(--color-state-positive); }
.seg-card.done .seg-name { text-decoration: line-through; color: var(--color-ink-300); }
.seg-card.done .seg-cta { color: var(--color-state-positive); }
.seg-card.blocked { border-color: var(--color-brand-red); opacity: .75; }
.seg-card.pop { animation: seg-pop .35s ease-out; }
@keyframes seg-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.035); }
    100% { transform: scale(1); }
}
.seg-card.seg-static {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    opacity: .65;
}
.seg-main {
    display: flex; align-items: center; gap: var(--space-3);
    width: 100%;
    min-height: 64px;
    padding: var(--space-3) var(--space-4);
    background: none; border: 0; cursor: pointer;
    color: var(--color-paper);
    font-family: var(--font-body);
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}
.seg-check { font-size: 1.4rem; flex: 0 0 auto; }
.seg-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.seg-name { font-weight: 600; font-size: 1rem; }
.seg-sub { font-size: .78rem; color: var(--color-ink-300); }
.seg-cta {
    font-family: var(--font-pixel); font-size: .55rem;
    color: var(--color-brand-yellow);
    flex: 0 0 auto;
}
.seg-problem {
    display: block; width: 100%;
    padding: var(--space-2) var(--space-4) var(--space-3);
    background: none; border: 0; cursor: pointer;
    color: var(--color-ink-500);
    font-size: .75rem; text-align: right;
}
.seg-reason {
    display: flex; gap: var(--space-2);
    padding: 0 var(--space-4) var(--space-3);
}
.seg-reason input {
    flex: 1; min-width: 0;
    min-height: var(--touch-target);
    padding: var(--space-2) var(--space-3);
    background: var(--color-surface-dark-2);
    border: 1px solid var(--color-ink-700);
    border-radius: var(--radius-sm);
    color: var(--color-paper);
}

.seg-options { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.opt { flex: 1; min-width: 90px; }
.opt input { position: absolute; opacity: 0; }
.opt span {
    display: block; text-align: center;
    min-height: var(--touch-target); line-height: var(--touch-target);
    border: 1px solid var(--color-ink-500); border-radius: var(--radius-sm);
    font-size: .8rem; font-weight: 600; cursor: pointer;
}
.opt input:checked + span { border-color: var(--color-brand-yellow);
    background: var(--color-surface-dark-2); color: var(--color-brand-yellow); }
.opt-ok input:checked + span { border-color: var(--color-state-positive);
    color: var(--color-state-positive); }
.opt-no input:checked + span { border-color: var(--color-brand-red);
    color: var(--color-brand-red); }
.reason-input { margin-top: var(--space-2); width: 100%;
    min-height: var(--touch-target); padding: var(--space-2) var(--space-3);
    background: var(--color-surface-dark); border: 1px solid var(--color-ink-700);
    border-radius: var(--radius-sm); color: var(--color-paper); }

.give-back { margin-top: var(--space-6); }

/* Modal-Zustand: waehrend Problem/Mehr-Kaesten offen ist, sind die anderen
   Deck-Optionen NICHT verfuegbar — sichtbar ausgeblendet statt still gesperrt */
.deck-wrap.overlay-open .deck-actions,
.deck-wrap.overlay-open .deck-undo,
.deck-wrap.overlay-open .morebox-btn { display: none; }
.deck-wrap.overlay-open .deck { opacity: .5; pointer-events: none; filter: saturate(.5); }
.deck-reason {
    border: 2px solid var(--color-brand-yellow);
    background: var(--color-surface-dark-2);
}
.field-error {
    display: block; margin-top: var(--space-1);
    font-size: .78rem; color: var(--color-brand-red);
}

/* --- Score-Screen ------------------------------------------------------------ */
.score-panel { text-align: center; }
.score-big {
    font-family: var(--font-pixel);
    font-size: 2.6rem;
    color: var(--color-brand-yellow);
    text-shadow: 3px 3px 0 var(--color-ink-700);
    margin: var(--space-5) 0 var(--space-1);
}
.score-meta { justify-items: center; margin-top: var(--space-4); }
.score-panel .crew-meta { grid-template-columns: repeat(2, 1fr); }

/* --- Konto-Journal ------------------------------------------------------------ */
.konto-grid { grid-template-columns: repeat(2, 1fr); margin-bottom: var(--space-5); }
.ledger-list { list-style: none; margin: 0; padding: 0; }
.ledger-row {
    display: flex; gap: var(--space-3); align-items: baseline;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-ink-700);
    font-size: .9rem;
}
.ledger-date { color: var(--color-ink-500); font-variant-numeric: tabular-nums; }
.ledger-label { flex: 1; }
.ledger-delta { font-variant-numeric: tabular-nums; font-weight: 600; }
.ledger-delta.plus { color: var(--color-state-positive); }
.ledger-delta.minus { color: var(--color-ink-300); }

/* --- Level, Streak, Badges ----------------------------------------------------- */
.level-block { margin-bottom: var(--space-5); }
.level-head { display: flex; align-items: baseline; justify-content: space-between; }
.level-name {
    font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
    color: var(--color-brand-yellow);
}
.streak { font-weight: 600; font-variant-numeric: tabular-nums; }
.level-bar {
    height: 12px; margin-top: var(--space-2);
    background: var(--color-surface-dark);
    border: 1px solid var(--color-ink-700);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.level-fill {
    height: 100%;
    background: repeating-linear-gradient(90deg,
        var(--color-brand-yellow) 0 8px, var(--color-brand-yellow-soft) 8px 10px);
}
.level-meta { margin-top: var(--space-1); font-size: .75rem; }

/* Boss-Sektion auf der Basis-Seite (Arena-Partial) */
.boss-section { margin-top: var(--space-6); text-align: center; }
.boss-section .battle-log,
.boss-section .battle-dialog { text-align: left; }

/* Kopfzeile der Basis mit Avatar-Chip */
.hero-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-3);
}
.hero-row .pixel-line { margin-bottom: 0; }
.avatar-chip {
    display: block;
    width: 56px; height: 56px;
    border: 2px solid var(--color-brand-yellow);
    border-radius: var(--radius-sm);
    background: var(--color-surface-dark);
    overflow: hidden;
    text-decoration: none;
}
.avatar-chip img { width: 100%; height: 100%; image-rendering: pixelated; }
.avatar-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; height: 100%;
    font-size: 1.1rem; color: var(--color-ink-300);
}
.avatar-empty small { font-size: .5rem; text-transform: uppercase; }

/* Avatar-Auswahl: grosses Einzelbild-Karussell */
.avatar-panel { text-align: center; }
.avatar-stage {
    display: flex; align-items: center; justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-4);
    background:
        radial-gradient(ellipse at 50% 30%, rgba(230, 200, 70, .12), transparent 60%),
        linear-gradient(180deg, #26221a, var(--color-surface-dark));
    border: 1px solid var(--color-ink-700);
    border-radius: var(--radius-sm);
    padding: var(--space-5) var(--space-2);
}
.avatar-view {
    display: flex; flex-direction: column; align-items: center;
    min-width: 0; flex: 1;
    touch-action: pan-y;
}
#avatar-img {
    width: min(62vw, 240px); height: min(62vw, 240px);
    image-rendering: pixelated;
    filter: drop-shadow(0 16px 12px rgba(0, 0, 0, .55));
    user-select: none; -webkit-user-drag: none;
}
#avatar-img.slide-left { animation: slide-in-l .3s ease-out; }
#avatar-img.slide-right { animation: slide-in-r .3s ease-out; }
@keyframes slide-in-l { from { transform: translateX(36px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide-in-r { from { transform: translateX(-36px); opacity: 0; } to { transform: none; opacity: 1; } }
.avatar-platform { width: 170px; margin-top: -18px; }
.avatar-name-big {
    margin-top: var(--space-3);
    font-size: .75rem;
    color: var(--color-brand-yellow);
}
.avatar-count { margin-top: var(--space-1); font-size: .75rem; }

.carousel-arrow {
    flex: 0 0 auto;
    width: 54px; height: 54px;
    border-radius: 50%;
    border: 2px solid var(--color-brand-yellow);
    background: var(--color-surface-dark);
    color: var(--color-brand-yellow);
    font-size: 1.8rem; line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    animation: arrow-pulse 1.6s ease-in-out infinite;
}
.carousel-arrow:last-of-type { animation-delay: .8s; }
.carousel-arrow:active { transform: scale(.9); }
@keyframes arrow-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(230, 200, 70, 0); }
    50% { box-shadow: 0 0 14px rgba(230, 200, 70, .5); }
}
.avatar-confirm { margin-top: var(--space-4); }

/* Kaempfer:innen im Team-Cluster (Pokemon-Seite unten links) */
.fighter { position: relative; }
.fighter img {
    width: 96px; height: 96px;
    image-rendering: pixelated;
    filter: drop-shadow(0 8px 7px rgba(0, 0, 0, .55));
    animation: boss-bob 2.6s ease-in-out infinite;
}
.fighter.me img {
    width: 112px; height: 112px;
    animation-delay: .4s;
}
.fighter.me::after {
    content: "DU";
    position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
    font-family: var(--font-pixel); font-size: .5rem;
    color: var(--color-brand-yellow);
    text-shadow: 0 0 8px rgba(230, 200, 70, .6);
}
.fighter-placeholder {
    width: 64px; height: 64px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--color-surface-dark);
    border: 1px solid var(--color-ink-500);
    color: var(--color-ink-300);
    font-family: var(--font-display); font-weight: 700;
    font-size: 1.3rem;
}
@media (min-width: 640px) {
    .fighter img { width: 116px; height: 116px; }
    .fighter.me img { width: 134px; height: 134px; }
    .team-cluster .fighter { margin-left: -38px; }
}

.badge-block { margin-top: var(--space-5); }
.badge-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: var(--space-3);
}
.badge-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);   /* Handy: 4 Spalten */
    gap: var(--space-2);
}
.badge-tile {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: var(--space-3) var(--space-1);
    background: var(--color-surface-dark);
    border: 1px solid var(--color-ink-700);
    border-radius: var(--radius-sm);
    text-align: center;
}
.badge-icon { font-size: 1.4rem; line-height: 1; }
.badge-name {
    font-size: .55rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em;
    color: var(--color-ink-300);
    line-height: 1.25;
}
/* Grau bis erreicht, Farbe + Gold-Rahmen wenn verdient */
.badge-tile.locked { opacity: .45; }
.badge-tile.locked .badge-icon { filter: grayscale(1); }
.badge-tile.earned {
    border-color: var(--color-brand-yellow);
    box-shadow: 0 0 8px rgba(230, 200, 70, .25);
}
.badge-tile.earned .badge-name { color: var(--color-paper); }
.badge-tile.active {
    border-color: var(--color-brand-yellow);
    outline: 2px solid var(--color-brand-yellow);
}
.badge-caption {
    margin-top: var(--space-3);
    padding: var(--space-3);
    background: var(--color-surface-dark);
    border: 1px solid var(--color-ink-700);
    border-left: 3px solid var(--color-brand-yellow);
    border-radius: var(--radius-sm);
    font-size: .85rem; line-height: 1.5;
    color: var(--color-ink-300);
}
.badge-caption b { color: var(--color-paper); }
.badge-new { color: var(--color-state-positive); }

@media (min-width: 640px) { .badge-grid { grid-template-columns: repeat(5, 1fr); } }

/* Mehr-Briefkaesten-Meldung auf der Swipe-Karte */
.maps-btn {
    display: inline-block;
    margin-top: var(--space-2);
    padding: 6px 12px;
    background: var(--color-surface-dark-2);
    border: 1px solid var(--color-ink-500);
    border-radius: var(--radius-sm);
    color: var(--color-paper);
    font-size: .8rem; font-weight: 600;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.maps-btn:active { background: var(--color-surface-dark); }
.morebox-btn {
    margin-top: var(--space-2);
    background: none; border: 0; cursor: pointer;
    color: var(--color-ink-500);
    font-size: .72rem;
    text-decoration: underline dotted;
}
.morebox-box { border-color: var(--color-brand-yellow); }

/* --- Highscore = Spielautomat ------------------------------------------------- */
.cabinet {
    position: relative;
    border: 3px solid var(--color-brand-yellow);
    box-shadow: 0 0 0 3px var(--color-ink-900), 0 0 24px rgba(230, 200, 70, .25);
    text-align: center;
    overflow: hidden;
}
/* CRT-Scanlines ueber dem ganzen Automaten */
.cabinet::after {
    content: "";
    position: absolute; inset: 0;
    background: repeating-linear-gradient(
        to bottom, transparent 0 2px, rgba(0, 0, 0, .18) 2px 4px);
    pointer-events: none;
}

/* Marquee-Lauflicht (Gluehbirnenreihe) */
.marquee {
    display: flex; justify-content: space-between;
    padding: 0 var(--space-2);
    margin: calc(var(--space-2) * -1) 0 var(--space-3);
}
.marquee:last-child { margin: var(--space-4) 0 calc(var(--space-2) * -1); }
.bulb {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--color-brand-yellow);
    animation: chase 1.2s steps(1) infinite;
}
.bulb:nth-child(3n+1) { animation-delay: 0s; }
.bulb:nth-child(3n+2) { animation-delay: .4s; }
.bulb:nth-child(3n)   { animation-delay: .8s; }
@keyframes chase {
    0%, 32%  { opacity: 1; box-shadow: 0 0 8px var(--color-brand-yellow); }
    33%, 100% { opacity: .18; box-shadow: none; }
}

.cabinet-title {
    font-size: 1rem;
    text-shadow: 2px 2px 0 var(--color-ink-700), 0 0 14px rgba(230, 200, 70, .6);
    animation: flicker 4s infinite;
}
@keyframes flicker {
    0%, 100% { opacity: 1; } 92% { opacity: 1; }
    93% { opacity: .55; } 94% { opacity: 1; } 96% { opacity: .75; } 97% { opacity: 1; }
}

.hi-score { margin: 0 0 var(--space-4); font-family: var(--font-pixel); }
.hi-score-label { font-size: .6rem; color: var(--color-brand-red); margin-right: var(--space-2); }
.hi-score-value { font-size: .9rem; color: var(--color-paper); letter-spacing: .1em; }

.cabinet-tabs { justify-content: center; }

.score-list { list-style: none; margin: 0; padding: 0; }
.score-row {
    display: flex; align-items: baseline; gap: var(--space-2);
    padding: var(--space-3) var(--space-2);
    border-bottom: 1px dashed var(--color-ink-700);
    font-family: var(--font-pixel);
    font-size: .62rem;
    text-align: left;
}
.score-row.me { background: rgba(230, 200, 70, .08); outline: 1px solid var(--color-ink-700); }
.score-row.champion .score-name,
.score-row.champion .score-points { animation: champ 1.4s ease-in-out infinite; }
@keyframes champ {
    0%, 100% { text-shadow: 0 0 2px rgba(230, 200, 70, .4); }
    50% { text-shadow: 0 0 12px rgba(230, 200, 70, .95); }
}
.score-rank { min-width: 3em; }
.rank-1 { color: var(--color-brand-yellow); }
.rank-2 { color: var(--color-paper); }
.rank-3 { color: var(--color-state-warn); }
.rank-n { color: var(--color-ink-500); }
.score-name {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--color-paper);
}
.score-boxes { color: var(--color-ink-500); font-size: .55rem; }
.score-points { color: var(--color-brand-yellow); letter-spacing: .06em; }

.empty-board { color: var(--color-ink-300); line-height: 2; margin: var(--space-6) 0; }
.insert-coin { margin-top: var(--space-5); font-size: .65rem; }

/* --- Admin ------------------------------------------------------------------------ */
.admin-nav { margin-bottom: var(--space-5); }

/* Kompakte Crew-Zeilen: eine Zeile pro Account, Details klappen auf */
.crew-row {
    background: var(--color-surface-dark);
    border: 1px solid var(--color-ink-700);
    border-radius: var(--radius-sm);
}
.crew-row.inactive { opacity: .55; }
.crew-row summary {
    display: flex; align-items: center; gap: var(--space-3);
    min-height: var(--touch-target);
    padding: var(--space-2) var(--space-4);
    cursor: pointer;
    list-style: none;
}
.crew-row summary::-webkit-details-marker { display: none; }
.crew-row summary::before {
    content: "▸";
    color: var(--color-ink-500);
    flex: 0 0 auto;
}
.crew-row[open] summary::before { content: "▾"; color: var(--color-brand-yellow); }
.crew-row summary .crew-name { flex: 1; min-width: 0; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
.crew-summary-meta { display: flex; align-items: center; gap: var(--space-3); }
.tab-num { font-variant-numeric: tabular-nums; font-size: .85rem; }
.crew-detail {
    padding: var(--space-3) var(--space-4) var(--space-4);
    border-top: 1px solid var(--color-ink-700);
}
.section-head {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--color-brand-yellow);
    margin: var(--space-6) 0 var(--space-3);
    border-bottom: 1px solid var(--color-ink-700);
    padding-bottom: var(--space-2);
}
select.reason-input { min-height: var(--touch-target); }

/* Admin: Boss-Planer */
.boss-plan-list { display: flex; flex-direction: column; gap: var(--space-3); }
.boss-plan-card {
    background: var(--color-surface-dark);
    border: 1px solid var(--color-ink-700);
    border-radius: var(--radius-sm);
}
.boss-plan-card > summary {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-3); flex-wrap: wrap;
    min-height: var(--touch-target);
    padding: var(--space-3) var(--space-4);
    cursor: pointer; list-style: none;
}
.boss-plan-card > summary::-webkit-details-marker { display: none; }
.bp-month { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.bp-summary { display: flex; align-items: center; gap: var(--space-2); font-size: .8rem; }
.bp-form {
    display: flex; flex-direction: column; gap: var(--space-4);
    padding: 0 var(--space-4) var(--space-4);
    border-top: 1px solid var(--color-ink-700);
}
.field-hint { display: block; margin-top: var(--space-1);
    font-size: .75rem; color: var(--color-ink-500); }
.field-hint code {
    background: var(--color-surface-dark-2); padding: 1px 5px;
    border-radius: 3px; font-size: .9em;
}

/* Figurenauswahl als Sprite-Karten */
.char-picker {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-2);
    margin-top: var(--space-2);
}
.char-option input { position: absolute; opacity: 0; }
.char-card {
    display: flex; align-items: center; gap: var(--space-2);
    padding: var(--space-2);
    background: var(--color-surface-dark-2);
    border: 2px solid var(--color-ink-700);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.char-card img { width: 44px; height: 44px; image-rendering: pixelated; flex: 0 0 auto; }
.char-name { font-size: .8rem; font-weight: 600; }
.char-option input:checked + .char-card {
    border-color: var(--color-brand-yellow);
    background: var(--color-surface-dark);
    box-shadow: 0 0 8px rgba(230, 200, 70, .3);
}
.bp-advanced {
    border: 1px dashed var(--color-ink-700);
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
}
.bp-advanced > summary {
    cursor: pointer; font-size: .8rem; font-weight: 600;
    color: var(--color-ink-300);
    min-height: var(--touch-target); display: flex; align-items: center;
}
.bp-advanced textarea { width: 100%; }
.bp-actions { display: flex; flex-direction: column; gap: var(--space-2); }
@media (min-width: 640px) { .char-picker { grid-template-columns: repeat(4, 1fr); } }

/* --- Teamkarte (Fog-of-War) ------------------------------------------------------ */
.map-panel { padding-bottom: var(--space-4); }
#map {
    height: min(62dvh, 560px);
    border: 1px solid var(--color-ink-700);
    border-radius: var(--radius-sm);
    background: var(--color-surface-dark);
}
/* Dunkler Arcade-Look: Standard-OSM-Tiles invertiert + entsaettigt */
.fog-tiles {
    filter: grayscale(1) invert(1) brightness(.82) contrast(1.15);
}
.map-progress { margin-bottom: var(--space-2); }
.map-controls { margin: var(--space-3) 0; }
.map-legend {
    margin: var(--space-3) 0 0;
    font-size: .75rem;
    color: var(--color-ink-300);
}
.dot {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
    vertical-align: baseline;
}
.dot-fresh { background: #E6C846; }
.dot-old { background: #E6C846; opacity: .35; }
.dot-reserved { background: #E6A446; }
.leaflet-container { font-family: var(--font-body); }
.leaflet-control-attribution {
    background: rgba(30, 30, 30, .8) !important;
    color: var(--color-ink-300) !important;
}
.leaflet-control-attribution a { color: var(--color-ink-300) !important; }

/* --- Monats-Boss: immersive Battle-Arena v2 ------------------------------------ */
.battle-panel { text-align: center; padding: var(--space-3); }

.battle-arena {
    position: relative;
    text-align: center;
    background:
        radial-gradient(ellipse at 50% 18%, rgba(230, 200, 70, .10), transparent 58%),
        radial-gradient(ellipse at 50% 105%, rgba(230, 200, 70, .10), transparent 55%),
        linear-gradient(180deg, #26221a 0%, #1a1712 55%, var(--color-surface-dark) 100%);
    border: 1px solid var(--color-ink-700);
    border-radius: var(--radius-sm);
    padding: var(--space-5) var(--space-4) var(--space-4);
    overflow: hidden;
}
/* Encounter-Blitz */
.battle-flash {
    position: absolute; inset: 0;
    background: var(--color-paper);
    animation: battle-flash .7s steps(2) forwards;
    pointer-events: none;
    z-index: 5;
}
@keyframes battle-flash {
    0%, 30% { opacity: .9; } 31%, 55% { opacity: 0; }
    56%, 75% { opacity: .6; } 76%, 100% { opacity: 0; }
}

/* Schwebende Papierschnipsel (Story-Partikel) */
.paper-field { position: absolute; inset: 0; pointer-events: none; }
.paper {
    position: absolute;
    width: 7px; height: 9px;
    background: var(--color-paper);
    opacity: .14;
    animation: paper-drift linear infinite;
}
.paper:nth-child(1) { left: 8%;  animation-duration: 11s; animation-delay: 0s; }
.paper:nth-child(2) { left: 20%; animation-duration: 14s; animation-delay: -4s; width: 5px; }
.paper:nth-child(3) { left: 31%; animation-duration: 10s; animation-delay: -7s; }
.paper:nth-child(4) { left: 44%; animation-duration: 16s; animation-delay: -2s; width: 9px; }
.paper:nth-child(5) { left: 55%; animation-duration: 12s; animation-delay: -9s; }
.paper:nth-child(6) { left: 66%; animation-duration: 15s; animation-delay: -5s; width: 5px; }
.paper:nth-child(7) { left: 77%; animation-duration: 11s; animation-delay: -1s; }
.paper:nth-child(8) { left: 88%; animation-duration: 13s; animation-delay: -8s; }
.paper:nth-child(9) { left: 95%; animation-duration: 17s; animation-delay: -3s; width: 4px; }
@keyframes paper-drift {
    from { transform: translateY(-30px) rotate(0deg); }
    to   { transform: translateY(460px) rotate(320deg); }
}

/* Entrance-Stagger */
.arena-head, .enemy-side, .team-side, .arena-cta, .arena-victory {
    position: relative; z-index: 1;
    opacity: 0;
    animation: rise-in .55s cubic-bezier(.2, .8, .3, 1) forwards;
}
.arena-head  { animation-delay: .15s; }
.enemy-side  { animation-delay: .3s; }
.team-side   { animation-delay: .5s; }
.arena-cta, .arena-victory { animation-delay: .65s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Kopfbereich */
.arena-eyebrow {
    display: block;
    font-family: var(--font-pixel);
    font-size: .5rem;
    color: var(--color-ink-300);
    letter-spacing: .12em;
}
.arena-title {
    margin: var(--space-2) 0 0;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(1.7rem, 8vw, 2.6rem);
    line-height: 1.05;
    color: var(--color-paper);
    text-shadow: 0 3px 0 rgba(0, 0, 0, .45), 0 0 26px rgba(230, 200, 70, .28);
}
.arena-title::after {
    content: "";
    display: block;
    width: 56px; height: 4px;
    margin: var(--space-2) auto 0;
    background: var(--color-brand-yellow);
}
.arena-mission {
    display: block;
    margin-top: var(--space-2);
    font-size: .72rem; font-weight: 600;
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--color-ink-300);
}

/* Pokemon-Gegenueberstellung: Info-Plates volle Breite, Buehnen dazwischen */
.enemy-side { margin-top: var(--space-3); }
.team-side { margin-top: var(--space-3); }
.side-plate {
    width: 100%;
    background: rgba(30, 30, 30, .9);
    border: 1px solid var(--color-ink-700);
    border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-4);
}
.enemy-plate2 { border-left: 3px solid var(--color-brand-red); }
.team-plate2 { border-left: 3px solid var(--color-brand-yellow); margin-top: var(--space-2); }
.plate-head { display: flex; justify-content: space-between; align-items: baseline; }
.plate-name {
    font-family: var(--font-pixel); font-size: .62rem;
    color: var(--color-paper);
    letter-spacing: .04em;
}
.plate-stats {
    display: flex; gap: var(--space-4); flex-wrap: wrap;
    margin-top: var(--space-2);
    font-size: .82rem; font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--color-paper);
}
.hp-row2 { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3); }
.hp-row2 .hp-track { flex: 1 1 auto; min-width: 0; }  /* Bar fuellt die Zeile — sonst 0 Breite = "leer" */
.hp-row2.pre-dialog { opacity: 0; }   /* waehrend des Dialogs verdeckt (JS blendet ein) */
.hp-num2 {
    font-family: var(--font-display); font-variant-numeric: tabular-nums;
    font-size: .85rem; color: var(--color-ink-300);
}
.hp-num2 b { color: var(--color-paper); font-size: 1.15rem; }

/* Buehnen (volle Breite; Boss rechts, Team links wie im Pokemon-Kampf) */
.enemy-stage {
    position: relative;
    display: flex; flex-direction: column; align-items: flex-end;
    justify-content: flex-end;
    min-height: 190px;
    margin-top: calc(var(--space-2) * -1);
    padding-right: var(--space-2);
}
.team-stage {
    position: relative;
    display: flex; flex-direction: column; align-items: flex-start;
    justify-content: flex-end;
    padding-left: var(--space-2);
}
.team-platform { width: 210px; }

/* Sprechblase: erscheint je Sprecher am Boss (rechts) ODER am Team (links) */
.speech-bubble {
    position: absolute; top: 0;
    max-width: 84%;
    background: var(--color-paper);
    color: var(--color-ink-900);
    border-radius: 12px;
    padding: var(--space-3) var(--space-4);
    font-size: .9rem; line-height: 1.5;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .5);
    cursor: pointer;
    z-index: 6;
}
.speech-bubble.from-boss { right: 0; }
.speech-bubble.from-team { left: 0; top: -6px; }
.speech-bubble::after {   /* Zipfel nach unten zum jeweiligen Sprite */
    content: "";
    position: absolute; bottom: -9px;
    border: 10px solid transparent;
    border-top-color: var(--color-paper);
    border-bottom: 0;
}
.speech-bubble.from-boss::after { right: 34px; }
.speech-bubble.from-team::after { left: 34px; }
.speech-speaker {
    display: block;
    font-family: var(--font-pixel); font-size: .5rem;
    margin-bottom: 4px;
}
.from-boss .speech-speaker { color: var(--color-brand-red); }
.from-team .speech-speaker { color: var(--color-state-positive); }
.speech-text { display: block; min-height: 1.4em; padding-right: var(--space-3); }
.speech-bubble .dialog-next {
    position: absolute; right: 10px; bottom: 4px;
    color: var(--color-ink-500);
    animation: blink 1s steps(2, start) infinite;
}
.team-cluster {
    position: relative; z-index: 1;
    display: flex; align-items: flex-end;
}
.team-cluster .fighter { margin-left: -30px; }
.team-cluster .fighter:first-child { margin-left: 0; }
.fighter-more {
    margin-left: -14px;
    align-self: center;
    z-index: 10;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--color-surface-dark);
    border: 1px solid var(--color-brand-yellow);
    color: var(--color-brand-yellow);
    font-size: .72rem; font-weight: 700;
}
.team-empty .fighter-placeholder { opacity: .5; }
.battle-sprite {
    width: 176px; height: 176px;
    image-rendering: pixelated;
    position: relative; z-index: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    filter: drop-shadow(0 16px 12px rgba(0, 0, 0, .55));
    animation: boss-slide .7s ease-out 1, boss-bob 2.6s ease-in-out infinite .8s;
}
@keyframes boss-slide { from { transform: translateX(70%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes boss-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.battle-sprite.hit { animation: boss-hit .45s ease-out 1; }
@keyframes boss-hit {
    0%, 100% { transform: translateX(0); filter: drop-shadow(0 16px 12px rgba(0,0,0,.55)); }
    20% { transform: translateX(-9px); filter: drop-shadow(0 16px 12px rgba(0,0,0,.55)) brightness(1.8); }
    45% { transform: translateX(7px); }
    70% { transform: translateX(-4px); }
}
.burst {
    position: absolute;
    top: 40%; left: 50%;
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
    animation: burst-fly .75s ease-out forwards;
}
@keyframes burst-fly {
    from { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}
.stage-platform {
    width: 210px; height: 36px;
    margin-top: -22px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center,
        rgba(230, 200, 70, .30), rgba(230, 200, 70, .07) 60%, transparent 75%);
    animation: platform-pulse 2.6s ease-in-out infinite .8s;
}
@keyframes platform-pulse { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.94); } }
.battle-arena.defeated .battle-sprite {
    filter: grayscale(1) brightness(.7);
    transform: rotate(90deg) translateY(30px);
    animation: none;
    cursor: default;
}

/* HP-Balken (sitzt im Gegner-Infokasten) */
.hp-label {
    font-family: var(--font-pixel); font-size: .5rem;
    color: var(--color-brand-red);
    letter-spacing: .1em;
}
.hp-track {
    position: relative;
    height: 20px;
    background: rgba(0, 0, 0, .45);
    border: 1px solid var(--color-ink-700);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
/* Meilenstein-Ticks bei 25/50/75 % */
.hp-ticks {
    position: absolute; inset: 0; z-index: 2;
    background:
        linear-gradient(90deg, transparent calc(25% - 1px), rgba(0,0,0,.5) 25%, transparent calc(25% + 1px)),
        linear-gradient(90deg, transparent calc(50% - 1px), rgba(0,0,0,.5) 50%, transparent calc(50% + 1px)),
        linear-gradient(90deg, transparent calc(75% - 1px), rgba(0,0,0,.5) 75%, transparent calc(75% + 1px));
    pointer-events: none;
}
.hp-fill {
    position: relative;
    height: 100%; width: 100%;
    background: linear-gradient(180deg, #92bd48, var(--color-state-positive));
    transition: width 1.6s cubic-bezier(.2, .8, .3, 1);
    overflow: hidden;
}
.hp-fill.hp-mid { background: linear-gradient(180deg, var(--color-brand-yellow), var(--color-state-warn)); }
.hp-fill.hp-low {
    background: linear-gradient(180deg, #ff7a90, var(--color-brand-red));
    animation: hp-blink .7s steps(1) infinite;
}
@keyframes hp-blink { 50% { opacity: .5; } }
/* Glanz-Sweep ueber den Balken */
.hp-shine {
    position: absolute; top: 0; bottom: 0; width: 46px;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
    animation: shine 2.8s ease-in-out infinite 1.8s;
}
@keyframes shine { from { left: -60px; } 60%, 100% { left: 110%; } }
.hp-pct {
    position: absolute; right: 8px; top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    font-family: var(--font-pixel); font-size: .5rem;
    color: var(--color-paper);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
}

/* CTA + Sieg */
.arena-cta { margin-top: var(--space-4); }
.arena-victory { margin-top: var(--space-4); color: var(--color-state-positive); }

/* Kampflog: Feed mit Avataren */
.battle-log { margin-top: var(--space-4); text-align: left; }
.log-line {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-2) var(--space-2);
    border-bottom: 1px solid var(--color-ink-700);
    font-size: .85rem;
    opacity: 0;
    animation: rise-in .45s ease-out forwards;
}
.log-avatar {
    flex: 0 0 30px; height: 30px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--color-surface-dark-2);
    border: 1px solid var(--color-brand-yellow);
    color: var(--color-brand-yellow);
    font-family: var(--font-display); font-weight: 700;
}
.log-body { flex: 1; min-width: 0; }
.log-move { font-family: var(--font-pixel); font-size: .5rem; color: var(--color-brand-yellow); }
.log-dmg {
    font-weight: 700; font-variant-numeric: tabular-nums;
    color: var(--color-brand-red);
    background: rgba(255, 70, 100, .12);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: .78rem;
}

/* Dialog */
.battle-dialog {
    margin-top: var(--space-4);
    text-align: left;
    background: var(--color-surface-dark);
    border: 1px solid var(--color-ink-700);
    border-left: 3px solid var(--color-brand-yellow);
    border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-4);
    min-height: 92px;
    position: relative;
    cursor: pointer;
}
.dialog-speaker {
    display: inline-block;
    font-family: var(--font-pixel); font-size: .5rem;
    color: var(--color-ink-900);
    background: var(--color-brand-yellow);
    border-radius: 999px;
    padding: 4px 10px;
    margin-bottom: var(--space-2);
}
.dialog-text { font-size: .95rem; line-height: 1.6; min-height: 3.2em; }
.dialog-next {
    position: absolute; right: 12px; bottom: 8px;
    color: var(--color-brand-yellow);
    animation: blink 1s steps(2, start) infinite;
}
.dialog-replay { background: none; border: 0; cursor: pointer; font-size: inherit; }

@media (min-width: 640px) {
    .battle-sprite { width: 216px; height: 216px; }
    .enemy-stage { min-height: 246px; }
}

/* --- Bottom-Navigation (nur Mitarbeiter) -------------------------------------- */
body.has-nav .content { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    display: flex;
    background: var(--color-surface-dark-2);
    border-top: 2px solid var(--color-brand-yellow);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 10;
}
.nav-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: var(--space-2) 0 var(--space-3);
    min-height: var(--touch-target);
    text-decoration: none;
    color: var(--color-ink-300);
    font-size: .65rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em;
}
.nav-item .nav-icon { font-size: 1.15rem; line-height: 1; }
.nav-item.active { color: var(--color-brand-yellow); }

.hero-title { text-decoration: none; }

/* --- Footer ---------------------------------------------------------------- */
.footer {
    padding: var(--space-4);
    padding-bottom: max(var(--space-4), env(safe-area-inset-bottom));
    text-align: center;
    color: var(--color-ink-500);
    border-top: 1px solid var(--color-ink-700);
}

/* --- Desktop-Erweiterung (mobile-first: erst ab 640px) --------------------- */
@media (min-width: 640px) {
    .hero-title { font-size: 1.4rem; }
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
    .stat-number { font-size: 1.8rem; }
}
