  :root {
    --cell: 72px;   /* Fallback; #boardWrap überschreibt ihn passend zum Platz */
    /* Surfaces — DARK MODE ONLY. Der Light Mode ist deaktiviert; diese
       Werte sind die dunklen Kerzenlicht-Töne und werden NICHT mehr
       umgeschaltet. body.dark-mode bleibt defintiv für Kompatibilität,
       wird aber durch den Deaktivierungs-Code immer gesetzt. */
    --surface:            #12100c;
    --surface-rgb:        18,16,12;   /* für Schleier über dem Spielhintergrund */
    --surface-panel:      #1c1813;
    --surface-panel-rgb:  28,24,19;
    --surface-subtle:     color-mix(in srgb, var(--surface-panel) 92%, transparent);
    /* Structure (borders / frames) */
    --border:             #3a3128;
    --border-strong:      #0b0906;
    --border-strong-rgb:  11,9,6;
    /* Text */
    --text:               #ece3d2;
    --text-muted:         #a89b83;

    /* ── GOLD-RAMPE ──
       Metall braucht mehr als zwei Stufen: eine Schattenkante, die Fläche und
       eine Glanzkante. Vorher gab es nur --accent und --accent-strong, und
       genau deshalb waren über die Datei verteilt sechs weitere Gold-Literale
       entstanden (#d9b968, #f6e2a0, #e0bd66, #f6e2a8, #f2dfae, #7a6030) — die
       haben alle diese fehlende Rampe von Hand nachgebaut. Sie zeigen jetzt
       hierher. Die Werte stammen aus den Referenzen im Mood-Board (gemessener
       Leit-Farbton 35–45°); --gold-3 ist die unveränderte Markenfarbe.

       NICHT hierher gemappt, obwohl warm und goldnah: #c8a96e (.mb-l) ist die
       helle Brettkachel und gehört zur Spielfeld-Semantik, nicht zur Chrome;
       #a09060 (.win-sword) ist Messing an einer Stahlklinge. Beides sind
       eigene Farben, keine improvisierten Rampenstufen. */
    --gold-1:             #6b4718;   /* gravierte Vertiefung, Schattenkante */
    --gold-2:             #86611e;   /* Textgold hell — siehe --accent-strong */
    --gold-3:             #c9a84c;   /* Fläche · die Markenfarbe             */
    --gold-4:             #d9b968;   /* obere Fase                           */
    --gold-5:             #e8d69a;   /* Glanzkante, Spitze im Textverlauf    */
    --gold-sheen:         linear-gradient(180deg,
                            var(--gold-5) 0%, var(--gold-3) 55%, var(--gold-2) 100%);

    /* Accent (brand gold) */
    --accent:             var(--gold-3);
    --accent-rgb:         201,168,76;
    /* War #8f6a22. Als Textfarbe (u.a. #tooltip h4, .btn-sm:hover, .card-cost)
       erreichte das auf --surface-panel nur 4,47:1 und auf --surface 4,05:1 —
       WCAG AA verlangt 4,5:1. --gold-2 kommt auf 5,08:1 bzw. 4,61:1 und sieht
       praktisch gleich aus. */
    --accent-strong:      var(--gold-2);
    --accent-strong-rgb:  134,97,30;

    /* ── TINTE AUF GOLD ──
       Schriftfarbe auf goldenen Flächen (.btn-primary, .btn-sm.active).
       Diese kippt ABSICHTLICH NICHT in body.dark-mode und ist deshalb der
       einzige Token hier, der unten nicht neu deklariert wird: die Fläche
       darunter ist --accent, und die bleibt in beiden Themes dieselbe
       Goldfarbe. Vorher stand dort --text, das mitkippte — im Dunkelmodus
       also Creme auf Gold, 1,79:1. Dunkle Tinte auf --gold-3 ergibt 6,62:1.
       Gehört damit zur selben Sorte wie die Gameplay-Farben oben: an das
       Objekt gebunden, nicht an das Thema. */
    --on-accent:          #33230f;

    /* ── AUSWAHL ──
       Eigene Farbe für "ausgewählt/aktiv", getrennt von --success. Vorher trug
       Grün beide Bedeutungen (.card.selected-card las --success), was auf dem
       Brett "gut" und "angeklickt" vermischt. In sämtlichen Referenzen ist
       Auswahl cyan-teal und Grün ausschließlich positiv-wertend. */
    --select:             #1a8f96;
    --select-rgb:         26,143,150;
    --select-glow:        0 0 0 2px rgba(var(--select-rgb),.9),
                          0 0 18px rgba(var(--select-rgb),.45);

    /* ── ERHEBUNG ──
       Kontaktschatten PLUS Rim-Light von oben links. Der harte `0 Npx 0`-
       Versatz, der das vorher überall allein getragen hat, liest ohne Weichzeichnung
       als Aufkleber; erst der weiche Schatten mit hellem Oberkantenglanz macht
       daraus einen Gegenstand mit Dicke. Lichtwinkel 135°, passend zum gemalten
       Licht der Hintergründe.

        WICHTIG — der Versatz bleibt bei drückbaren Bedienelementen erhalten und
        wird NICHT durch --elev-* ersetzt: dort ist er keine Schattenimitation,
        sondern die sichtbare Seitenfläche des Knopfes, und :active fährt sie
        zusammen mit translateY() ein. Das ist eine echte Druck-Rückmeldung, die
        ein Weichschatten nicht leisten kann. Ersetzt wird er nur bei ruhenden
        Flächen (Karten, Panele, Modals); Knöpfe bekommen zusätzlich --rim-light.

        ACHTUNG beim Ändern: --elev-* enthält ein verschachteltes var() und
        unterliegt damit derselben Scope-Falle wie --glass-* (siehe dort). Die
        drei Stufen sind in body.dark-mode NEU deklariert, nicht geerbt — eine
        Änderung hier muss dort mitgezogen werden, sonst driften die Themes. */
    --rim-light:          inset 0 1px 0 rgba(255,255,255,.35);
    --elev-1:             0 2px 4px rgba(var(--border-strong-rgb),.35);
    --elev-2:             0 8px 18px rgba(var(--border-strong-rgb),.30), var(--rim-light);
    --elev-3:             0 24px 60px rgba(var(--border-strong-rgb),.45),
                          0 0 40px rgba(var(--accent-rgb),.22), var(--rim-light);

    /* ── BEWEGUNG ──
       Drei Dauern und zwei Kurven statt 36 verstreuter Zahlen. --ease-overshoot
       gab es faktisch schon zweimal im File (.34,1.56,.64,1 am Kartenhover und
       .34,1.3,.64,1 am Siegesbanner) — sie hatte nur keinen Namen. */
    --dur-micro:          120ms;
    --dur-normal:         260ms;
    --dur-macro:          700ms;
    --ease-out:           cubic-bezier(.22,.61,.36,1);
    --ease-overshoot:     cubic-bezier(.34,1.3,.64,1);

    /* ── FORM ──
       Vier Stufen. Gewachsen waren es dreizehn (2,3,4,5,6,8,9,10,12,14,16,20,30). */
    --r-sm:               3px;
    --r-md:               6px;
    --r-lg:               10px;
    --r-pill:             999px;

    /* Status */
    --success:            #4a8f4a;
    --success-rgb:        74,143,74;
    --danger:             #b23a2c;
    --danger-rgb:         178,58,44;
    /* Modal/overlay backdrop scrim */
    --overlay-scrim:      rgba(51,35,15,.62);
    /* Win-screen hero gradient + grid-line texture */
    --hero-bg-start:      #f7e8bd;
    --hero-bg-end:        #e7cd85;
    --grid-line:          rgba(74,53,36,.03);

    /* Glass — menu-hero surfaces over the background photo. These are
       just --surface-panel/--accent at reduced alpha so a frosted card
       reads as "the current theme's panel, translucent" — they DO flip
       with body.dark-mode because they're built from tokens that do,
       not from their own fixed palette. Text on the glass just reads
       --text/--text-muted/--accent-strong directly (see .mode-title
       etc. below) — no separate glass-text alias needed.
       GOTCHA: a custom property's nested var() resolves at the scope
       where THAT property is declared, not per element that inherits
       it. So --glass-bg must be re-declared (same formula) inside
       body.dark-mode below, or it stays locked to :root's light
       --surface-panel-rgb forever — it will NOT auto-update just
       because --surface-panel-rgb changed on body.dark-mode. */
    --glass-bg:           rgba(var(--surface-panel-rgb),.6);
    --glass-bg-hover:     rgba(var(--surface-panel-rgb),.75);
    --glass-border:       rgba(var(--accent-rgb),.4);
    --glass-border-hover: rgba(var(--accent-rgb),.85);
  }

  /* Dark mode: warmes Kerzenlicht-Dunkel, Gold auf Holz.
     Toggled via body.dark-mode — see js/ui.js toggleDarkMode().

     War vorher dunkelblau-violett (#0c0c18 / #13131f / #1a1a2e, Farbton ~240°).
     Umgestellt nach dem Abgleich mit dem Mood-Board: dort misst KEINE einzige
     Referenz kalt. Gwent liegt bei #231c17, Hearthstone bei #221912, TFT bei
     #251e22, Songs of Conquest bei #2e1f25 — alles Farbton 15–40°, also warm.
     Der Grund ist nicht Geschmack: Gold (40°) und Violett (240°) sind fast
     Komplementärfarben, die Kante flimmert und das Gold wirkt aufgesetzt. Auf
     warmem Braun liegt dieselbe Farbe analog und liest als Metall auf Holz —
     daher kommt der wertige Eindruck der Vorbilder.
     Herleitung: 02_Design_UI/Token_Abgleich_DesignDNA.md, Abschnitt 2. */
  body.dark-mode {
    --surface:            #12100c;
    --surface-rgb:        18,16,12;
    --surface-panel:      #1c1813;
    --surface-panel-rgb:  28,24,19;
    /* Abgeleitet aus --surface-panel, kippt automatisch mit dem Theme */
    --surface-subtle:     color-mix(in srgb, var(--surface-panel) 92%, transparent);
    --border:             #3a3128;
    --border-strong:      #0b0906;
    --border-strong-rgb:  11,9,6;
    /* Neutralgrau (#dddddd/#999999) kippt auf warmem Grund optisch ins
       Grünliche. Beide Werte leicht ins Warme gezogen — Kontrast steigt dabei
       sogar (14,92:1 statt 14,30:1 auf der Grundfläche). */
    --text:               #ece3d2;
    --text-muted:         #a89b83;
    --accent:             var(--gold-3);
    --accent-rgb:         201,168,76;
    /* Im Dunkeln die hellere Rampenstufe: --gold-2 wäre hier zu dunkel.
       --gold-4 auf --surface-panel ergibt 9,32:1. */
    --accent-strong:      var(--gold-4);
    --accent-strong-rgb:  217,185,104;
    --select:             #4fd6dd;
    --select-rgb:         79,214,221;
    /* Reines Weiß als Oberkantenglanz wirkt auf warmem Dunkel kreidig —
       hier ein schwacher Goldschimmer statt dessen. */
    --rim-light:          inset 0 1px 0 rgba(232,214,154,.14);
    /* Neu deklariert, nicht bloß geerbt — exakt dieselbe Falle wie bei
       --glass-* weiter unten: --elev-* und --select-glow stehen in :root und
       lösen ihr verschachteltes var() DORT auf. Ohne diese Wiederholung
       behielten die Schatten die hellbraune --border-strong-rgb des Hell-
       Themes (74,53,36) und wären auf dunklem Grund praktisch unsichtbar,
       und der Auswahl-Glow bliebe auf dem dunklen Petrol des Hell-Themes. */
    --elev-1:             0 2px 4px rgba(var(--border-strong-rgb),.55);
    --elev-2:             0 8px 18px rgba(var(--border-strong-rgb),.6), var(--rim-light);
    --elev-3:             0 24px 60px rgba(var(--border-strong-rgb),.8),
                          0 0 40px rgba(var(--accent-rgb),.22), var(--rim-light);
    --select-glow:        0 0 0 2px rgba(var(--select-rgb),.9),
                          0 0 18px rgba(var(--select-rgb),.45);
    --success:            #8fc47a;
    --success-rgb:        143,196,122;
    --danger:             #e07a6a;
    --danger-rgb:         224,122,106;
    /* Re-declared (not just inherited) because a custom property's nested
       var() resolves at ITS OWN declaration scope, not per element that
       inherits it — without this, --glass-bg would stay locked to :root's
       light --surface-panel-rgb forever. See the comment where --glass-bg
       is first declared. */
    --glass-bg:           rgba(var(--surface-panel-rgb),.6);
    --glass-bg-hover:     rgba(var(--surface-panel-rgb),.75);
    --glass-border:       rgba(var(--accent-rgb),.4);
    --glass-border-hover: rgba(var(--accent-rgb),.85);
    --overlay-scrim:      rgba(8,6,4,.86);
    --hero-bg-start:      #241a12;
    --hero-bg-end:        #080605;
    --grid-line:          rgba(232,214,154,.012);
  }
  body { background: var(--surface); color: var(--text); font-family: 'Inter', 'Segoe UI', sans-serif; min-height: 100vh; transition: background .25s ease, color .25s ease; }

  /* ── THEME TOGGLE BUTTON ── */
  .theme-toggle-btn {
    position: fixed; top: 12px; left: 14px; z-index: 85;
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--surface-panel); border: 2px solid var(--accent-strong);
    box-shadow: 0 3px 0 var(--border), var(--rim-light);
    font-size: 1.05rem; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform .15s;
  }
  .theme-toggle-btn:hover { transform: scale(1.08); }
  .theme-toggle-btn:active { transform: scale(.95); }

  /* ── SCREENS ── */
  .screen { display: none; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
  .screen.active { display: flex; animation: screenFadeIn .22s ease both; }
  @keyframes screenFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
  /* Alpha kam vorher als Hex-Suffix (#c9a84c55/cc). Ein var() lässt sich nicht
     so ergänzen, deshalb hier über --accent-rgb: 55 hex = .33, cc hex = .8. */
  @keyframes airdropPulse { from { box-shadow: 0 0 4px rgba(var(--accent-rgb),.33); } to { box-shadow: 0 0 14px rgba(var(--accent-rgb),.8); } }

  /* ── MENU: hero background image, title lives IN the image (not rendered
     here), content anchored to the bottom third so it never covers the
     title/dice area in the image's middle. The card/text colors below use
     the --glass-* tokens (see :root) and read var(--text) etc. directly,
     so the whole hero properly recolors with the light/dark toggle — only
     the ::before darkening scrim stays a constant dark gradient, since its
     job is purely to keep the image's own title legible and has nothing to
     do with theme (a "light" scrim would wash out a dark photo, not
     brighten it). ── */
  #menu.menu-hero {
    background-image: url('assets/ui/menu/menu-background.jpg');
    background-size: cover; background-position: center; background-repeat: no-repeat;
    position: relative; overflow: hidden;
    justify-content: flex-start; align-items: flex-start;
    overflow-y: auto; padding: 100px 100px 48px;
  }
  #menu.menu-hero::before {
    content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
    background: linear-gradient(to top, rgba(10,8,4,.85) 0%, rgba(10,8,4,.55) 34%, rgba(10,8,4,.12) 60%, transparent 76%);
  }
  .menu-content {
    position: relative; z-index: 1; display: flex; flex-direction: column; align-items: stretch; gap: 20px; width: 100%;
    background: var(--glass-bg); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    border-radius: 28px; padding: 24px 20px 20px; max-width: 880px;
  }
  .menu-section { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
  .menu-section-title {
    font-family: 'Cinzel', serif; font-size: .75rem; letter-spacing: 2.5px; text-transform: uppercase;
    color: var(--accent-strong); text-shadow: 0 2px 6px rgba(0,0,0,.75);
    margin-bottom: 4px;
  }
  .section-intro {
    font-size: .75rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 4px;
  }
  .menu-footer {
    position: relative; z-index: 1; width: 100%; max-width: 900px;
    display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap;
    margin-top: 24px; padding-top: 12px;
    border-top: 1px solid var(--glass-border);
  }
  .menu-footer-link {
    background: none; border: none; padding: 0; cursor: pointer;
    font-family: 'Inter', sans-serif; font-size: .7rem; letter-spacing: .3px;
    color: var(--text-muted); text-decoration: none; text-shadow: 0 1px 4px rgba(0,0,0,.7);
    transition: color .15s;
  }
  .menu-footer-link:hover { color: var(--accent-strong); }

  /* ── MENU: CARDREALMS redesign ──
     Single-column, vertically stacked, mobile-first. Background uses
     menu-background.jpg with dark overlay for text readability. */

  .menu-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
    width: 100%;
    max-width: 520px;
    margin: 0;
    padding: 0;
  }
  

  /* ── Section A: Header ── */
  .menu-header { text-align: center; margin-bottom: 4px; }
  .menu-logo {
    font-family: 'Cinzel', 'Georgia', serif;
    font-size: 2.6rem; font-weight: 700; letter-spacing: 4px;
    color: var(--accent-strong); margin: 0; line-height: 1.05;
    text-shadow: 0 0 18px rgba(var(--accent-strong-rgb),.35);
  }
  .menu-logo-gem { color: var(--accent-strong); margin: 0 4px; display: inline-block; }
  .menu-subtitle {
    font-family: 'Cinzel', 'Georgia', serif;
    font-size: .75rem; letter-spacing: 6px; text-transform: uppercase;
    color: var(--text); margin-top: 6px;
  }

  /* ── Section B: Tagline / Rogue-like badge ── */
  .menu-badge {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 7px 22px; border-radius: 999px; cursor: pointer;
    background: rgba(var(--accent-rgb), .14); border: 1px solid rgba(var(--accent-strong-rgb), .5);
    color: var(--accent-strong); font-family: 'Cinzel', 'Georgia', serif;
    font-size: .8rem; font-weight: 700; letter-spacing: 3px;
    transition: background .2s, box-shadow .2s;
  }
  .menu-badge:hover { background: rgba(var(--accent-rgb), .26); box-shadow: 0 0 16px rgba(var(--accent-strong-rgb), .3); }
  .menu-tagline { font-size: .92rem; font-style: italic; color: var(--text); margin: 0; }

  /* ── Section headings ── */
  .menu-heading {
    font-family: 'Cinzel', 'Georgia', serif;
    font-size: 1.15rem; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
    color: var(--accent-strong); margin: 0;
  }
  .menu-desc { font-size: .9rem; color: var(--text-muted); line-height: 1.5; margin: 0; }

  /* ── MENU CARDS: framed sections with the shared fantasy frame + per-mode illustration ──
     The frame background (frame-menu-v2.png, 1408×544 ≈ 2.59:1) defines the card's
     shape: no border, aspect-ratio matches the frame so the artwork fills it edge-to-edge.
     Cards are clickable (data-action on the card itself) and align to the left. */
  .menu-card {
    position: relative; border-radius: 16px; overflow: hidden;
    display: flex; align-items: center; gap: 16px;
    aspect-ratio: 1408 / 544;
    background-size: 100% 100%; background-repeat: no-repeat; background-position: center;
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
    transition: transform .15s, box-shadow .15s, border-color .15s;
    padding: 0 60px 0 0;
    cursor: pointer;
    border: 2px solid transparent;
  }
  .menu-card:hover,
  .menu-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(0,0,0,.5);
    border-color: var(--accent-strong);
    outline: none;
  }
  .menu-card-body { align-items: flex-start; }
  .menu-card .menu-badge { align-self: flex-start; }
  /* Per-mode illustration on the LEFT side, overlapping the frame. */
  .menu-illustration {
    flex-shrink: 0; width: 42%; height: 100%; object-fit: contain;
    position: relative; z-index: 2; padding: 8px 0;
  }
  /* Content sits on the RIGHT side of the frame, above it. */
  .menu-card-body {
    position: relative; z-index: 3; flex: 1; min-width: 0;
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
    padding: 18px 20px 18px 4px; text-align: left;
  }
  .menu-card .menu-badge { margin: 0; }
  .menu-card .menu-tagline { font-size: .85rem; margin: 0; text-align: left; }
  .menu-card .menu-desc { font-size: .82rem; margin: 0; text-align: left; }
  /* Action buttons stay left-aligned (width:auto from the block above). */

  /* ── Duelle options ── */
  .duel-options { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; width: 100%; }
  .duel-btn {
    flex: 1 1 140px; max-width: 160px;
    background: var(--surface-panel); border: 2px solid var(--border); border-radius: 10px;
    color: var(--text); font-size: .8rem; letter-spacing: 1px; font-weight: 600;
    padding: 10px 12px; cursor: pointer; text-transform: uppercase;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    transition: border-color .2s, transform .15s, box-shadow .2s;
  }
  .duel-btn-img {
    width: 100%; height: 54px; object-fit: cover; border-radius: 6px;
    border: 1px solid rgba(var(--accent-strong-rgb), .35);
  }
  .duel-btn:hover { border-color: var(--accent-strong); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.4); }
  @media (max-width: 620px) {
    .menu-illustration { width: 36%; }
    .menu-card-body { padding: 14px 14px 14px 2px; }
  }
  @media (max-width: 620px) {
    .duel-options { flex-direction: column; align-items: stretch; }
    .duel-btn { max-width: none; }
  }

  /* ── Action buttons (Tutorial / Regelwerk / Analog / Feedback) ── */
  .menu-action {
    width: 100%;
    background: rgba(var(--accent-rgb), .12); border: 1px solid rgba(var(--accent-strong-rgb), .45); border-radius: 10px;
    color: var(--accent-strong); font-family: 'Cinzel', 'Georgia', serif;
    font-size: .78rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
    padding: 13px 18px; cursor: pointer;
    transition: background .2s, box-shadow .2s, transform .15s;
  }
  .menu-action:hover { background: rgba(var(--accent-rgb), .24); box-shadow: 0 0 18px rgba(var(--accent-strong-rgb), .25); transform: translateY(-1px); }

  /* ── Divider line between sections ── */
  .menu-divider { height: 1px; width: 100%; max-width: 420px; margin: 0 auto; background: var(--border); }

  /* ── Section H: Player profile card ── */
  .profile-card {
    background: var(--surface-panel); border: 2px solid var(--border); border-radius: 14px;
    padding: 22px 24px; display: flex; flex-direction: column; gap: 14px;
    box-shadow: 0 12px 34px rgba(0,0,0,.45);
  }
  .profile-name { color: var(--text); font-family: 'Cinzel', 'Georgia', serif; font-size: 1.15rem; font-weight: 700; letter-spacing: 1px; }
  .profile-stats-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .profile-level { color: var(--text); font-size: .85rem; }
  .profile-xp { display: flex; flex-direction: column; gap: 6px; }
  .xp-label { color: var(--text-muted); font-size: .72rem; letter-spacing: .5px; }
  .xp-bar { height: 8px; border-radius: 999px; border: 1px solid var(--border); background: transparent; overflow: hidden; }
  .xp-bar-fill { height: 100%; width: 0%; border-radius: 999px; background: var(--gold-sheen); transition: width .35s ease; }

  /* ── MODE CARDS (hero menu — frosted glass panels over the background photo, recolor with the theme) ── */
  .mode-grid { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; max-width: 720px; }
  .mode-card {
    flex: 1 1 140px; max-width: 170px; padding: 22px 14px; border-radius: 14px; cursor: pointer;
    border: 1px solid var(--glass-border); background: var(--glass-bg);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 8px 20px rgba(0,0,0,.35);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    transition: transform .15s, border-color .15s, box-shadow .15s, background .15s;
    text-align: center;
  }
  .mode-card:hover { transform: translateY(-4px); border-color: var(--glass-border-hover); background: var(--glass-bg-hover); box-shadow: 0 12px 28px rgba(0,0,0,.45); }
  .mode-card:focus-visible,
  .color-opt:focus-visible,
  .board-opt:focus-visible,
  .theme-opt:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
  .mode-icon { font-size: 2.1rem; }
  .mode-title { font-family: 'Cinzel', serif; font-size: .95rem; font-weight: 600; color: var(--text); letter-spacing: 2px; }
  .mode-desc { font-size: .7rem; color: var(--text-muted); line-height: 1.4; }

  /* Regelwerk — smaller, quieter, single horizontal card in its own section */
  .mode-card--wide {
    flex: none; max-width: none; width: auto; flex-direction: row; align-items: center;
    gap: 12px; padding: 12px 22px; border-radius: 30px;
  }
  .mode-card--wide .mode-icon { font-size: 1.3rem; }
  .mode-card--wide .mode-title { font-size: .82rem; }
  .mode-card--wide .mode-desc { font-size: .68rem; }

  /* ── FEATURED MODE CARDS (full-width with background image) ──
     Each card stacks THREE independent layers:
       1. .card-frame      — reusable generic fantasy frame (shared asset).
       2. .card-illustration — per-item emblem on the LEFT, overlapping the frame,
          rendered ABOVE the frame. Can extend ~10-20% outside the frame boundary.
       3. .mode-card-content  — live text on the RIGHT side of the frame.
     The card itself stays a clickable button via data-action; decorative layers
     have pointer-events:none so clicks pass straight through to the card. */
  .mode-card--featured {
    flex: none; width: 100%; max-width: none; min-height: 220px;
    padding: 0; border-radius: 16px; overflow: hidden;
    position: relative; display: flex; flex-direction: column;
    cursor: pointer;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 8px 20px rgba(0,0,0,.35);
    transition: transform .15s, border-color .15s, box-shadow .15s, background .15s;
  }
  .mode-card--featured:hover { transform: translateY(-8px); border-color: var(--glass-border-hover); background: var(--glass-bg-hover); box-shadow: 0 12px 28px rgba(0,0,0,.45); }
  .mode-card--featured:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
  /* FRAME: the shared generic fantasy frame. Covers the whole card. */
  .mode-card--featured .card-frame,
  .mode-card--duelle .card-frame {
    position: absolute; inset: 0;
    background-image: url('../02_Design_UI/02_Taste_Library/Menus/frame-menu-v2.png');
    background-size: cover; background-position: center; background-repeat: no-repeat;
    z-index: 1; pointer-events: none;
  }
  /* ILLUSTRATION: per-item emblem, LEFT side, above the frame, overlaps it. */
  .mode-card--featured .card-illustration,
  .mode-card--duelle .card-illustration {
    position: absolute;
    left: -8%; top: 50%; transform: translateY(-50%);
    width: 42%; height: 84%;
    background-size: contain; background-position: center; background-repeat: no-repeat;
    z-index: 2; pointer-events: none;
  }
  .mode-card--featured .mode-card-content {
    position: relative; z-index: 3; display: flex; flex-direction: column;
    align-items: flex-start; justify-content: center; padding: 28px 24px;
    text-align: left; color: var(--text);
    background: linear-gradient(to top, rgba(10,8,4,.85) 0%, rgba(10,8,4,.45) 40%, rgba(10,8,4,.15) 70%, transparent 90%);
  }
  .mode-card--featured .mode-title {
    font-family: 'Cinzel', serif; font-size: 1.3rem; font-weight: 700;
    letter-spacing: 3px; text-transform: uppercase; color: var(--text);
    text-shadow: 0 2px 8px rgba(0,0,0,.8); margin-bottom: 10px;
  }
  .mode-card--featured .mode-desc {
    font-size: .8rem; line-height: 1.6; color: rgba(255,250,240,.9);
    text-shadow: 0 1px 4px rgba(0,0,0,.7); max-width: 520px;
  }
  .mode-card--featured:hover .mode-card-image { filter: brightness(0.7); transform: scale(1.02); transition: filter .3s, transform .3s; }
  .mode-card--featured:hover .mode-card-content { background: linear-gradient(to top, rgba(10,8,4,.9) 0%, rgba(10,8,4,.55) 40%, rgba(10,8,4,.2) 70%, transparent 90%); }

  /* ── DUELLE GRID (2x2 small cards with images) ── */
  .duelle-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; width: 100%;
  }
  .mode-card--duelle {
    flex: none; min-height: 160px; padding: 0; border-radius: 12px; overflow: hidden;
    position: relative; display: flex; flex-direction: column;
  }
  /* FRAME for duelle cards is handled by the shared .card-frame rule above.
     ILLUSTRATION for duelle cards is handled by the shared .card-illustration rule above,
     but slightly smaller to fit the compact grid. */
  .mode-card--duelle .card-illustration {
    left: -6%; width: 38%; height: 80%;
  }
  .mode-card--duelle .mode-card-content {
    position: relative; z-index: 3; display: flex; flex-direction: column;
    align-items: flex-start; justify-content: center; padding: 18px 14px;
    text-align: left; color: var(--text);
    background: linear-gradient(to top, rgba(10,8,4,.85) 0%, rgba(10,8,4,.4) 50%, rgba(10,8,4,.1) 80%, transparent 95%);
  }
  .mode-card--duelle .mode-title {
    font-family: 'Cinzel', serif; font-size: .9rem; font-weight: 600;
    letter-spacing: 2px; text-transform: uppercase; color: var(--text);
    text-shadow: 0 2px 6px rgba(0,0,0,.8); margin-bottom: 6px;
  }
  .mode-card--duelle .mode-desc {
    font-size: .65rem; line-height: 1.4; color: rgba(255,250,240,.85);
    text-shadow: 0 1px 3px rgba(0,0,0,.7);
  }
  .mode-card--duelle:hover .card-frame,
  .mode-card--duelle:hover .card-illustration { transform: scale(1.02); transition: transform .3s; }
  .mode-card--duelle:hover .mode-card-content { background: linear-gradient(to top, rgba(10,8,4,.9) 0%, rgba(10,8,4,.5) 50%, rgba(10,8,4,.15) 80%, transparent 95%); }

  @media (max-width: 620px) {
    .duelle-grid { grid-template-columns: 1fr; }
    .mode-card--featured { min-height: 180px; }
    .mode-card--featured .mode-title { font-size: 1.1rem; }
    .mode-card--featured .mode-desc { font-size: .75rem; }
    .mode-card--duelle { min-height: 140px; }
  }

  /* ── RULES / OFFLINE SCREENS ── */
  .rules-modal {
    background: var(--surface-panel); border: 3px solid var(--border); border-radius: 16px;
    padding: 28px 32px; max-width: 520px; width: 100%; box-shadow: var(--elev-3);
  }
  .rules-section { margin-bottom: 14px; }
  .rules-section-title { font-size: .7rem; text-transform: uppercase; letter-spacing: 2px; color: var(--accent-strong); margin-bottom: 5px; font-weight: 600; }
  .rules-section p { font-size: .82rem; color: var(--text-muted); line-height: 1.6; }
  .offline-group { background: var(--surface-panel); border: 2px solid var(--border); border-radius: 10px; padding: 10px 14px; }
  .offline-group-title { font-size: .68rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--accent-strong); margin-bottom: 8px; font-weight: 600; }
  .offline-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: .82rem; color: var(--text); }
  .card-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 36px; border-radius: 4px; font-weight: 700;
    font-size: .85rem; background: var(--surface-panel); color: var(--text);
    border: 1px solid var(--border); flex-shrink: 0; font-family: 'Cinzel', serif;
  }
  .card-badge--red { color: var(--danger); }

  /* ── BILDSCHIRM-KLEINTEILE ──
     Diese Klassen ersetzen die style="…"-Attribute, die in index.html die
     Farben von Hand gesetzt hatten. Es waren 47 Literale, und zwar aus der
     ALTEN kalten Palette: #13131f, #2a2a3a, #1a1a2e, #0f0f1e, dazu die
     Grauwerte #aaa, #666, #555, #444, #888, #ccc, #333. Sie kippten nicht
     mit body.dark-mode, weil sie gar nicht am Token-System hingen. Im
     Hellmodus hieß das: dunkelblaue Kästen auf dem Pergament-Modal und
     Mittelgrau auf hellem Grund, also unter der Lesbarkeitsgrenze.
     Genau der Fall, den der Dateikopf beschreibt, wenn er sagt, dass in
     der Chrome-Schicht kein Hex-Wert stehen soll. */

  /* Modal-Überschrift. Trug #c9a84c, also --accent. Als TEXT ist das auf
     --surface-panel nur 4,47:1; --accent-strong sieht gleich aus und
     erreicht 5,08:1. */
  .modal-title {
    font-family: 'Cinzel', serif;
    color: var(--accent-strong);
    margin-bottom: 18px;
  }
  .modal-title--tight { margin-bottom: 6px; }

  /* Kleines Kapitälchen-Etikett über einer Gruppe. */
  .eyebrow-label {
    font-size: .72rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 10px;
  }
  .eyebrow-label--sm { font-size: .7rem; letter-spacing: 1.5px; margin-bottom: 10px; }

  /* Die vier Materialkacheln im Offline-Bildschirm.
     ACHTUNG: die SVG-Zeichnungen darin haben ihre Füllfarben fest im Markup
     und sind für einen dunklen Grund gezeichnet (cremefarbene Karten und
     Würfel, dunkle Spielsteine). Auf --surface-subtle im Hellmodus tragen sie
     nur noch über ihre Konturen. Die Bildunterschrift nennt jeweils den
     Gegenstand, das Bild ist Dekoration, deshalb bleibt es hier bei der
     Kachel-Chrome. Wer die Zeichnungen selbst an das Token-System hängen
     will, muss sie neu zeichnen — das ist eine eigene Aufgabe. */
  .material-card {
    background: var(--surface-panel);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 12px 6px 10px;
    text-align: center;
  }
  .material-name {
    font-size: 9px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text);
    margin-top: 6px;
  }
  .material-note { font-size: 8px; color: var(--text-muted); margin-top: 2px; }

  /* Hinweiskasten (Airdrop-Erklärung). */
  .note-box {
    background: var(--surface-panel);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 12px;
    font-size: .82rem;
    color: var(--text);
  }
  .note-box strong { color: var(--accent-strong); }

  /* Eingerückter Einstellungsblock im Online-Modal. */
  .settings-box {
    margin-bottom: 18px;
    padding: 12px;
    background: var(--surface-panel);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
  }

  /* Lauftext in Modals. War #aaa, im Hellmodus 1,9:1 auf dem Pergament. */
  .modal-text { color: var(--text-muted); }
  .modal-text--sm { font-size: .8rem; color: var(--text-muted); }
  .modal-hint { font-size: .75rem; color: var(--text-muted); }

  /* Trennlinie zwischen Raum-erstellen und Raum-beitreten. */
  .modal-rule { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

  /* Die große Zahl der König-Leben im Einstellungsdialog. */
  .hp-number {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    color: var(--accent-strong);
    line-height: 1;
  }
  .hp-caption { font-size: .65rem; color: var(--text-muted); margin-top: 2px; }

  /* Figurenliste im Regelwerk-Bildschirm. */
  .figure-list { font-size: .8rem; line-height: 1.8; color: var(--text); }

  /* ── ONLINE MODAL ── */
  #onlineModal { background: var(--surface-panel); border: 3px solid var(--border); border-radius: 16px; padding: 32px; max-width: 720px; width: 100%; box-shadow: var(--elev-3); }
  #onlineModal h2 { margin-bottom: 20px; color: var(--accent-strong); font-family: 'Cinzel', serif; }
  .input-row { display: flex; gap: 8px; margin-bottom: 12px; }
  input[type=text] { flex: 1; padding: 10px 14px; background: var(--surface-subtle); border: 2px solid var(--border); border-radius: 8px; color: var(--text); font-size: 1rem; }
  input[type=text]:focus { outline: none; border-color: var(--accent-strong); }
  /* PeerJS-Raumcodes sind lange IDs (~36 Zeichen), keine 5-Zeichen-Codes:
     deshalb klein, monospace und umbruchfähig statt 1.4rem mit Sperrschrift. */
  #roomCode {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .8rem; font-weight: 600; letter-spacing: .3px; line-height: 1.4;
    color: var(--accent-strong); background: var(--surface-subtle);
    padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
    text-align: left; word-break: break-all;
  }
  #statusMsg { margin-top: 12px; color: var(--text-muted); font-size: .9rem; min-height: 20px; }

  /* ═══════════════════════════════════════════════════
     GAME LAYOUT — nach 02_Design_UI/iteration1_Kartenspiel_Screen_Wireframe
     Drei Spalten über die volle Höhe:
       links   Ereignisse · Log · Kartendeck · eigene Identität
       mitte   Gegnerhand · Brett · eigene Hand
       rechts  Gegner-Identität · Würfel · Nächste Phase · Detailansicht
     ═══════════════════════════════════════════════════ */
  #game.active {
    display: grid;
    /* Seitenspalten folgen der Fensterbreite statt fester 300 px: auf schmalen
       Displays (16:10, 1366×768) bleiben sie handlich, auf Ultrawide/4K wachsen
       sie proportional mit, damit die Mitte nicht ungenutzt breit wird. Die
       Mindestbreite garantiert, dass Panels atmen können, das Maximum verhindert
       riesige leere Kartenrahmen auf sehr breiten Schirmen. */
    grid-template-columns: clamp(250px, 19vw, 360px) minmax(0, 1fr) clamp(250px, 19vw, 360px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    position: relative;   /* Bezugsrahmen für die angedockte Figuren-Vorschau */
    align-items: stretch;
    gap: 8px; padding: 8px;
    height: 100vh; max-height: 100vh; overflow: hidden;
    background: var(--surface);
  }
  /* Alle Rasterplätze EXPLIZIT vergeben. Mit automatischer Verteilung belegte das
     Tutorial-HUD — ein direktes Kind von #game, das nur im Tutorial sichtbar wird —
     die erste Spalte und schob alle drei Bereiche eine Position weiter: die
     Seitenspalte lag in der Mitte, das Brett rechts und abgeschnitten.
     Ist das HUD ausgeblendet, bleibt Zeile 1 leer und fällt auf Höhe 0 zusammen. */
  #tutorialHUD { grid-column: 1 / -1; grid-row: 1; }
  #runHUD      { grid-column: 1 / -1; grid-row: 1; }
  #leftPanel   { grid-column: 1; grid-row: 2 / 4; }
  #centerCol   { grid-column: 2; grid-row: 2; }
  #rightPanel  { grid-column: 3; grid-row: 2 / 4; }
/* Die eigene Hand bekommt eine eigene Zeile unter dem Brett, damit sie ihm
     nicht mehr die Mittelspalte wegnimmt. Sie liegt dabei in Spalte 2, an
     den unteren Rand ausgerichtet. Die Figuren-Vorschau ist inzwischen in
     die rechte Spalte gewandert (s. #rightPanel). Die linke Spalte reicht
     ueber beide Zeilen, die Hand liegt damit rechts neben der eigenen
     Lebensanzeige. */
  #myHandRow   { grid-column: 2; grid-row: 3; min-height: 0; align-self: end; }
  /* Die Figuren-Vorschau wohnt jetzt in der rechten Spalte (siehe #rightPanel)
     statt als eigene Rasterzelle unter ihr: dort füllt sie die Karten-
     Detailansicht und drückt keine Panele mehr zusammen. */
  #leftPanel, #rightPanel {
    display: flex; flex-direction: column; gap: 6px;
    min-height: 0; overflow-y: auto; overflow-x: hidden;
  }
  /* Panele in den Seitenspalten schrumpfen nicht. Ohne das verteilt Flexbox
     den Platzmangel auf die Kinder — und traf dabei ausgerechnet die
     Gegnerhand, die als einzige `min-height: 0` mitbringt und deshalb bis auf
     18 px zusammenfiel, während die Nachbarn ihre Größe hielten. Läuft der
     Inhalt über, soll die Spalte scrollen, nicht einzelne Panele einknicken. */
  #leftPanel > *, #rightPanel > * { flex: none; }
  /* Die eigene Identität sitzt laut Wireframe unten in der linken Spalte. */
  #myIdentity { margin-top: auto; }
  #btnLeaveGame { width: 100%; }

  /* Seitenspalten reduzieren: kompaktere Abstände und kleinere Typografie,
     damit das Brett und die Hand dominieren. */
  .panel { padding: 8px 10px; }
  .panel h3 { font-size: .62rem; letter-spacing: 1.2px; margin-bottom: 5px; }
  #log { font-size: .65rem; height: 68px; line-height: 1.45; }
  .identity-row { font-size: .68rem; }
  .event-grid { gap: 4px; }
  .event-card { padding: 5px 5px 6px; }
  .event-card-title { font-size: .52rem; }
  #airdropStatus { font-size: .62rem; }
  .deck-stack { height: 90px; margin: 4px 0 8px; }
  .deck-stack span { width: 66px; height: 90px; margin-left: -33px; }
  .deck-stack span:nth-child(1) { transform: translate(-7px, 3px) rotate(-4deg); }
  .deck-stack span:nth-child(2) { transform: translate(3px, 1px) rotate(2deg); }
  .deck-count { font-size: .62rem; }

  /* ── MITTELSPALTE: Brett oben, eigene Hand unten ──
     Die Hand bekommt mehr Raum und klare Hierarchie: das Brett ist der
     Hauptdarsteller, die Hand ist der strategische Kommandopunkt darunter.
     Beide zusammen füllen die Mittelspalte. */
  #centerCol {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px; min-height: 0; min-width: 0;
  }
  #boardArea {
    display: grid;
    place-items: center;
    min-height: 0; min-width: 0;
    /* Platz für die Hand reservieren — auf kleinen Schirmen greift die
       Container-Query unten und passt --cell weiter an. */
  }
  #myHandRow {
    min-height: 168px;
    max-height: min(220px, 24vh);
    /* Eigene Hand als "Command Point": Karten am unteren Rand ausrichten statt
       oben, damit die Hand wie aus dem Brett heraus wächst. */
    justify-content: flex-end;
    /* Kein Panel-Kleid mehr: Die Hand soll wie Teil des Bretts wirken, nicht
       wie eine eigene Karte. Deshalb keine Fläche, keine Kante, kein Schatten. */
    background: none; border: none; box-shadow: none;
  }

  .hand-row {
    background: var(--surface-panel); border: 2px solid var(--border);
    border-radius: 10px; padding: 8px 12px 10px;
    display: flex; flex-direction: column; gap: 6px; min-height: 0;
    box-shadow: var(--elev-2);
  }
  .hand-row-label {
    font-size: .65rem; letter-spacing: 1.6px; text-transform: uppercase;
    color: var(--text-muted); font-weight: 600;
  }
  #oppHandRow #tsOppHand { display: flex; align-items: flex-end; min-height: 46px; }

  /* Die eigene Hand bekommt mehr Höhe und bessere Kartensichtbarkeit.
     Horizontales Scrollen statt Wrap, damit die Karten nicht gestapelt
     und unleserlich werden. */
  #myHandRow {
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: thin;
  }
  #cardRow {
    display: flex; gap: 10px; align-items: flex-end;
    padding: 4px 2px 6px;
    min-height: 148px;
    overflow-x: auto; overflow-y: visible;
    scrollbar-width: thin;
  }
  #myHand {
    display: flex; gap: 10px; align-items: flex-end;
    padding: 4px 2px 6px;
    min-height: 148px;
    overflow-x: auto; overflow-y: visible;
    scrollbar-width: thin;
  }
  #myHand .card {
    flex-shrink: 0;
    transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s, border-color .15s;
  }

  /* ── IDENTITÄT ──
     Callout 1 des Wireframes: der Aktiv-Glow wandert zu dem Spieler, der am Zug ist. */
  .identity { transition: box-shadow .25s, border-color .25s; }
  .identity.is-active {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 1px var(--accent-strong), 0 0 18px rgba(201,168,76,.28);
  }
  .identity-row {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 6px; font-size: .72rem; margin-top: 2px;
  }
  .identity-row > span:last-child { color: var(--text-muted); font-size: .62rem; }
  .identity-hearts { display: flex; gap: 2px; margin-top: 3px; min-height: 14px; }

  /* ── EREIGNIS-KARTEN / RUNDENSTATUS ── */
  .event-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .event-card {
    border: 1px dashed var(--border); border-radius: 8px;
    padding: 6px 6px 7px; text-align: center; min-width: 0;
  }
  .event-card-title {
    font-size: .56rem; letter-spacing: .8px; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 4px;
  }
  #airdropStatus { font-size: .68rem; margin-bottom: 5px; color: var(--text-muted); }
  #airdropStatus b { color: var(--text); }
  /* Zustände des Airdrop-Hinweises. Standen vorher als feste Hex-Werte im
     JavaScript und ignorierten damit den Hell-/Dunkelmodus — im Hellmodus
     verschwand die Zahl praktisch. */
  .airdrop-live { color: var(--accent-strong); font-weight: 700; letter-spacing: .5px; }
  .airdrop-soon { color: var(--danger); font-weight: 600; }
  .hand-empty   { font-size: .65rem; color: var(--text-muted); font-style: italic; }
  .upgrade-hint { font-size: .8rem; color: var(--text-muted); margin-bottom: 8px; }
  #airdropPips   { display: flex; justify-content: center; gap: 4px; }
  /* ── MITTELFELD ALS 2×2-ABBILD ──
     Die vier Felder liegen so, wie sie auf dem Brett liegen: oben D5/E5,
     darunter D4/E4. Ein belegtes Feld trägt die Farbe seines Besitzers. */
  .center-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 3px; width: 52px; margin: 2px auto 0;
  }
  .center-cell {
    aspect-ratio: 1; border-radius: 3px;
    border: 1px solid var(--border);
    background: rgba(var(--border-strong-rgb), .10);
    transition: background .25s, box-shadow .25s, border-color .25s;
  }
  .center-cell.is-held {
    background: var(--held);
    border-color: var(--held);
    box-shadow: 0 0 7px color-mix(in srgb, var(--held) 60%, transparent);
  }
  /* Statuszeile unter den beiden Ereigniskarten. Leer nimmt sie keinen Platz,
     damit das Panel nicht springt, sobald der Bonus greift. */
  .event-note { font-size: .62rem; color: var(--text-muted); text-align: center; }
  .event-note:not(:empty) { margin-top: 7px; }
  .event-note.is-max { font-weight: 600; }
  .event-round {
    margin-top: 7px; padding-top: 6px; border-top: 1px solid var(--border);
    font-size: .6rem; letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted); text-align: center;
  }

  /* ── KARTENDECK ── */
  #deckPanel { text-align: center; }
  .deck-stack { position: relative; height: 116px; margin: 6px 0 10px; }
  .deck-stack span {
    position: absolute; left: 50%; top: 0; width: 82px; height: 112px;
    margin-left: -41px; border-radius: 8px;
    background: transparent;
    border: 1px solid var(--accent-strong);
  }
  .deck-stack span:nth-child(1) { transform: translate(-9px, 4px) rotate(-5deg); opacity: .55; }
  .deck-stack span:nth-child(2) { transform: translate(4px, 2px) rotate(3deg);  opacity: .8; }
  .deck-count { font-size: .68rem; color: var(--text-muted); }
  .deck-count b { color: var(--text); }

  /* ── NÄCHSTE PHASE ── */
  #phasePanel { display: flex; flex-direction: column; gap: 6px; }
  #phasePanel .btn-sm { width: 100%; }
  #stepsLeft { text-align: center; font-size: .72rem; color: var(--text-muted); margin-top: 4px; }
  #activeBonuses { display: flex; gap: 6px; flex-wrap: wrap; }

  /* ── LOG (TERTIÄR) ──
     Randinformation: kein Panel-Ornament, keine Textur, kein Shadow.
     Dezenter Border reicht — der Blick soll nicht hierher wandern. */
  #logPanel {
    flex: 0 0 auto;
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
    padding: 6px 8px;
  }
  #logPanel .panel {}
  #log .entry:first-child { color: var(--text); font-weight: 600; }
  #log .entry:nth-child(n+4) { opacity: .55; }
  #log .entry:nth-child(n+8) { opacity: .35; }

  /* ── TASTATUR-HINWEISE (TERTIÄR) ──
     Technische Hilfsinfo: keine Fläche, kein Rahmen, nur dezenter Text. */
  .ks-hints {
    font-size: .55rem; color: var(--text-muted); text-align: center;
    line-height: 2.1; display: flex; flex-wrap: wrap; gap: 4px 6px;
    justify-content: center; align-items: center;
    padding: 0; background: none; border-radius: 0;
  }
  .ks-hints kbd {
    font-family: inherit; font-size: .52rem; padding: 1px 5px;
    border: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
    border-radius: 4px;
    background: transparent; color: var(--text-muted);
    box-shadow: none;
  }

  /* (Alte .ks-hints Regeln entfernt — die minimierte Version steht oben.) */

  /* ── VERDECKTE GEGNERKARTEN ── */
  .facedown-card {
    width: 34px; height: 46px; border-radius: 5px; flex-shrink: 0;
    background: repeating-linear-gradient(135deg, var(--gold-4) 0 6px, var(--gold-3) 6px 12px);
    border: 1px solid var(--accent-strong); position: relative; overflow: hidden;
    margin-left: -10px; box-shadow: -2px 0 6px rgba(var(--border-strong-rgb),.3);
    transition: transform .15s;
  }
  .facedown-card:first-child { margin-left: 0; }
  .facedown-card::before {
    content: ''; position: absolute; inset: 3px;
    border: 1px solid rgba(var(--border-strong-rgb),.4); border-radius: 3px;
  }
  .facedown-card::after {
    content: '⚔'; position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; opacity: .35; color: var(--border-strong);
  }
  .facedown-card:hover { transform: translateY(-4px); }

  #tsMyName, #tsOppName { font-weight: 600; }
  /* Nur noch Typografie — Fläche und Form kommen von .ribbon-banner.
     Die frühere `background`-Kurzschreibweise hier gewann per ID-Spezifität
     gegen die Klasse und löschte damit die Pergament-Textur wieder weg. */
  #turnIndicator { font-size: .74rem; }

  #boardWrap { position: relative; display: flex; flex-direction: column; }
  .board-row { display: flex; }

  /* ═══════════════════════════════════════════════════
     AMBIENT-BLEED — Styleguide §7
     „Der Board-Rahmen darf an den Kanten in eine gemalte Szene übergehen statt
     hart abzuschneiden." Vorher endete das Brett an einer 2px-Linie und einem
     harten Schlagschatten — es lag auf der Fläche, statt in ihr zu stehen.

     Zwei Ebenen, beide rein aus vorhandenen Mitteln, ohne neues Artwork:

     ::before  Ein Holzrahmen, der nach außen ausfranst. Die Maske blendet ihn
               zum Rand hin aus, sodass es keine Abbruchkante gibt — genau das
               meint „Bleed". Liegt hinter dem Brett.
     ::after   Warmes Fackellicht von schräg oben, wie es die Portraits auch
               haben (§9: Chiaroscuro, Rim-Light von oben links). Liegt über dem
               Brett, aber ohne Mausereignisse abzufangen.
     ═══════════════════════════════════════════════════ */
  #boardWrap::before {
    content: ''; position: absolute; inset: -34px; z-index: -1;
    background-color: var(--surface-panel);
    background-size: auto;
    background-repeat: repeat;
    background-blend-mode: multiply;
    border-radius: 14px;
    opacity: .55;
    -webkit-mask-image: radial-gradient(closest-side, #000 62%, rgba(0,0,0,.35) 84%, transparent 100%);
            mask-image: radial-gradient(closest-side, #000 62%, rgba(0,0,0,.35) 84%, transparent 100%);
  }
  #boardWrap::after {
    content: ''; position: absolute; inset: -34px; z-index: 3;
    pointer-events: none; border-radius: 14px;
    background:
      radial-gradient(60% 45% at 18% -6%, rgba(255, 214, 150, .20), transparent 70%),
      radial-gradient(55% 40% at 88% -4%, rgba(255, 196, 130, .13), transparent 70%),
      radial-gradient(closest-side, transparent 58%, rgba(20, 14, 8, .30) 100%);
  }
  /* Im Dunkelmodus trägt das Fackellicht mehr — dort ist der Kontrast zur
     Umgebung größer und der Übergang sonst wieder eine sichtbare Kante. */
  body.dark-mode #boardWrap::before { opacity: .75; }
  body.dark-mode #boardWrap::after {
    background:
      radial-gradient(60% 45% at 18% -6%, rgba(255, 206, 140, .26), transparent 70%),
      radial-gradient(55% 40% at 88% -4%, rgba(255, 186, 120, .17), transparent 70%),
      radial-gradient(closest-side, transparent 54%, rgba(6, 4, 2, .48) 100%);
  }
  #boardFrame { padding: 4px; background: var(--border-strong); border: 1px solid #2e2020; border-radius: 6px; }
  /* Koordinaten skalieren mit der Zellgroesse mit (--cell), statt eigene feste
     72px zu fuehren — sonst laufen Beschriftung und Brett auseinander. */
  #coordRow  { display: flex; margin-bottom: 2px; }
  #coordRow span { font-size: 9px; color: var(--accent-strong); width: var(--cell); text-align: center; font-family: 'Cinzel', serif; letter-spacing: 1px; }
  #coordRow .coord-corner { width: 16px; flex-shrink: 0; }
  #coordLeft { display: flex; flex-direction: column; width: 16px; flex-shrink: 0; }
  #coordLeft span { font-size: 9px; color: var(--accent-strong); height: var(--cell); display: flex; align-items: center; justify-content: center; font-family: 'Cinzel', serif; }
  /* Der Rahmen ist jetzt Messing statt einer harten dunklen Linie — er bildet
     den Übergang vom Brett in den ausfransenden Holzrahmen darum. */
  #board {
    /* Spaltenzahl aus derselben Quelle wie die Engine: setBoardSize() in
       js/helpers.js schreibt --board-size. Der Roguelike-Modus spielt Akt I auf
       5x5, das Hauptspiel bleibt bei 8x8. */
    display: grid; grid-template-columns: repeat(var(--board-cols, 8), 1fr); user-select: none;
    border: 3px solid var(--accent-strong);
    box-shadow:
      0 0 0 1px rgba(var(--border-strong-rgb), .8),
      inset 0 0 22px rgba(var(--border-strong-rgb), .45),
      0 10px 44px rgba(var(--border-strong-rgb), .4);
  }

  /* ── CELLS ── */
  /* Zellgroesse folgt dem kleineren der beiden Freiraeume. 8 Zellen brauchen
     8x --cell; die Obergrenze haelt das Brett auf grossen Schirmen handlich. */
  #boardWrap { --cell: clamp(30px, min(7.4vh, 5.1vw), 78px); }

  /* Die vh-Formel darüber kennt nur das Fenster, nicht den Platz, der nach
     Kopfzeile und Handkarten übrig bleibt — wachsen die Handkarten, läuft das
     Brett unten aus seiner Grid-Zelle heraus und wird überdeckt. Mit
     Container-Einheiten misst die Zelle den tatsächlich freien Bereich, das
     Brett passt sich also von selbst an, wenn sich die Zeilenhöhen später
     wieder ändern. Die vh-Fassung bleibt als Rückfall für Browser ohne
     Container-Queries stehen. */
  @supports (container-type: size) {
    #boardArea { container-type: size; }
    /* Obergrenze skaliert mit dem Platz: auf 4K und Ultrawide wächst die Zelle
       mit, statt bei 108 px festzuhängen — das Brett nutzt die frei werdende
       Mitte voll aus. 12.6 entspricht ~8 Zellen + Rahmen + Freiraum, die cqw-
       Seite bremst auf sehr breiten Schirmen (Ultrawide), cqh auf hohen.
       Die Untergrenze bleibt 30 px, damit sehr kleine Fenster weiter spielbar
       sind. */
    #boardWrap { --cell: clamp(30px, min(12.6cqh, 12.6cqw), 168px); }
  }
  .cell { width: var(--cell); height: var(--cell); position: relative; cursor: pointer; transition: filter .12s; border: 1px solid rgba(0,0,0,.15); }
  .cell:hover { filter: brightness(1.18); }
  /* terrain backgrounds — Wesnoth-inspired (untouched: board art, not chrome) */
  .t-castle    { background: #38352f; }
  .t-court     { background: #4c4840; }
  .t-village   { background: #3a5c22; }
  .t-forest    { background: #1a3010; }
  .t-grass     { background: #3a5c28; }
  .t-grass2    { background: #446830; }
  .t-path      { background: #7a6845; }
  .t-mountain  { background: #5a5650; }
  .t-mtn-edge  { background: #44403a; }
  .t-water     { background: #1a2e48; }

  .cell.selected { outline: 3px solid #7fc97f !important; outline-offset: -3px; filter: brightness(1.25); }
  /* Zugziel/Angriffsziel: Tint-Ring + Motiv (Fußabdrücke bzw. gekreuzte
     Klingen) als Inline-SVG. Nur dieser eine Regelort — die Brett-Designs
     unten ergänzen lediglich einen box-shadow, das ::after bleibt stehen. */
  .cell.valid-move::after { content:''; position:absolute; inset:0; background:rgba(100,220,100,.20) url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><g fill='%23ccffce' opacity='.85'><ellipse cx='11' cy='12' rx='3.2' ry='4.8' transform='rotate(-15 11 12)'/><ellipse cx='21' cy='19' rx='3.2' ry='4.8' transform='rotate(-15 21 19)'/><circle cx='9.2' cy='5.4' r='1.2'/><circle cx='19.2' cy='12.4' r='1.2'/></g></svg>") center/58% no-repeat; border-radius:50%; margin:16%; pointer-events:none; border: 2px solid rgba(100,220,100,.5); z-index:3; }
  .cell.valid-attack::after { content:''; position:absolute; inset:0; background:rgba(220,80,60,.30) url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23ffd9cf' stroke-width='2.2' stroke-linecap='round'><path d='M8 8 L24 24 M24 8 L8 24'/><path d='M21 27 L27 21 M5 21 L11 27' stroke-width='1.8'/></svg>") center/56% no-repeat; border-radius:50%; margin:10%; pointer-events:none; border: 2px solid rgba(220,80,60,.6); z-index:3; }
  .cell.soldat-zone { filter: sepia(.4) hue-rotate(-10deg) brightness(1.15) !important; }
  .cell.soldat-zone::after { content:'⚠'; position:absolute; bottom:2px; right:3px; font-size:8px; opacity:.5; pointer-events:none; z-index:3; }
  .cell.turm-block { filter: brightness(.85) hue-rotate(220deg) saturate(.6) !important; }
  .cell.soldat-zone-friendly { filter: sepia(.2) brightness(1.05) !important; }
  /* Spawnfelder nach Anzeigefarbe (render.js: spawnClsW/spawnClsB). Vorher
     hießen sie spawn-white/-black und der Ring war grün bzw. rot — grün gehört
     hier keiner Seite. Jetzt trägt jeder Ring seine Teamfarbe. */
  .cell.spawn-blue { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c2) 55%, transparent); }
  .cell.spawn-red  { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c1) 55%, transparent); }
  .cell.center { box-shadow: inset 0 0 0 2px rgba(var(--accent-rgb),.5); }
  .cell.airdrop-field { box-shadow: inset 0 0 0 3px rgba(255,215,0,.9); }
  @keyframes airdropBounce { 0%,100%{transform:translateY(0) scale(1)} 50%{transform:translateY(-4px) scale(1.1)} }
  .cell.airdrop-field::after { content:'📦'; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); font-size:26px; z-index:4; pointer-events:none; animation:airdropBounce 1.2s ease-in-out infinite; }
  .piece.frozen-piece { filter: hue-rotate(180deg) brightness(1.15) saturate(.45); }
  /* Eisschicht über dem Chip: halbtransparenter Eisverlauf + Frostsaum am
     Rand (Frostkristalle als heller Inset-Schimmer). Ersetzt das 🧊-Emoji. */
  .piece.frozen-piece .picon { position: relative; }
  .piece.frozen-piece .picon::before {
    content:''; position:absolute; inset:-2px; border-radius:50%;
    background: linear-gradient(135deg, rgba(190,230,255,.55), rgba(110,175,225,.22) 45%, rgba(205,240,255,.5));
    box-shadow: inset 0 0 7px rgba(225,248,255,.95), inset 0 0 0 2px rgba(190,230,255,.4);
    z-index:3; pointer-events:none;
  }

  /* ── TERRAIN DECOR ── */
  .terrain { position:absolute; inset:0; pointer-events:none; z-index:0; overflow:hidden; }

  /* ── KÖNIGS AURA ── */
  @keyframes auraPulse { 0%,100%{opacity:.35} 50%{opacity:.6} }
  /* Klassen nach Anzeigefarbe (render.js). Vorher aura-white/-black, wobei
     aura-white fest auf --c1 (rot) zeigte — bei gedrehter playerColors-Zuordnung
     leuchtete die Aura also in der Gegenfarbe. Jetzt stimmt es per Konstruktion:
     --c1 ist rot, --c2 blau. */
  .cell.aura-blue::before, .cell.aura-red::before {
    content:''; position:absolute; inset:0; pointer-events:none; z-index:1;
    animation: auraPulse 2.4s ease-in-out infinite;
  }
  .cell.aura-red::before {
    background: radial-gradient(ellipse at 50% 50%, var(--c1) 0%, transparent 75%);
    opacity:.4;
  }
  .cell.aura-blue::before {
    background: radial-gradient(ellipse at 50% 50%, var(--c2) 0%, transparent 75%);
    opacity:.4;
  }
  /* stagger animation offsets so cells pulse at slightly different times */
  .cell.aura-blue:nth-child(2n)::before, .cell.aura-red:nth-child(2n)::before { animation-delay: .4s; }
  .cell.aura-blue:nth-child(3n)::before, .cell.aura-red:nth-child(3n)::before { animation-delay: .8s; }
  .cell.aura-blue:nth-child(5n)::before, .cell.aura-red:nth-child(5n)::before { animation-delay: 1.2s; }

  /* ── PIECES (untouched: figure art comes in the next pass) ── */
  .piece { position: absolute; inset: calc(var(--cell) * .07); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: transform .15s, box-shadow .15s; z-index: 2; box-shadow: 0 3px 8px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.15); border: 2px solid rgba(var(--accent-rgb),.4); }
  .piece:hover { transform: scale(1.1) translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.7), 0 0 0 2px rgba(var(--accent-rgb),.6); }
  .piece.white { background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c1) 50%, #fff 50%), color-mix(in srgb, var(--c1) 85%, #000 15%)); color: #fff; }
  .piece.black { background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c2) 50%, #fff 50%), color-mix(in srgb, var(--c2) 85%, #000 15%)); color: #fff; }
  .piece .picon { font-size: clamp(11px, calc(var(--cell) * .30), 26px); line-height: 1; display:flex; align-items:center; justify-content:center; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
  .piece .picon svg { display:block; }
  /* Kenney PNG sprites: convert to white so they appear on the colored piece background */
  .piece-sprite { width: clamp(13px, calc(var(--cell) * .36), 30px); height: clamp(13px, calc(var(--cell) * .36), 30px); display:block; object-fit:contain; filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
  /* Custom chip-icon design packs (assets/designs/<pack>/chips/...) — full-color
     art, unlike .piece-sprite above, so no brightness/invert tint. */
  .piece-chip-img { width: clamp(13px, calc(var(--cell) * .36), 30px); height: clamp(13px, calc(var(--cell) * .36), 30px); display:block; object-fit:contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }

  /* ── CHIP-GRAFIK STATT SCHEIBE ──
     Liegt für eine Figur eine Chip-Datei
     (assets/designs/<pack>/chips/<red|blue>/<type>.png), ersetzt sie die
     gezeichnete Spielscheibe vollständig: kein Farbverlauf, kein Rand, kein
     Schlagschatten mehr darunter — die Grafik bringt ihren eigenen Rahmen mit
     und stand sonst als kleines Bild in einem zweiten, größeren Kreis.
     `contain` statt `cover`, damit ein runder Chip nicht an den Ecken
     beschnitten wird. Fehlt die Datei, nimmt _chipFallback() has-chip weg und
     alles darunter gilt wieder. */
  .piece.has-chip { background: none !important; border: none; box-shadow: none; }
  /* Der Turm ist die einzige Figur, an die etwas anschließt: die vier
     Sperrzonen-Mauern enden am Kachelrand. Mit dem üblichen 7-%-Abstand bliebe
     dazwischen ein Streifen Brett stehen und das Mauerkreuz wäre unterbrochen.
     Nur beim Turm füllt der Chip deshalb die ganze Kachel — sein Steinkranz
     stößt dann direkt an das Mauerwerk. */
  .piece.piece-turm.has-chip { inset: 0; }
  /* box-shadow:none oben nimmt sonst auch den Hover-Ring mit — er steht weiter
     oben im File und verliert damit. Der Angriffs-Marker ist ein `outline`
     und bleibt davon unberührt. */
  .piece.has-chip:hover { box-shadow: 0 0 0 2px rgba(var(--accent-rgb),.6); }
  .piece.has-chip .picon { width: 100%; height: 100%; filter: none; }
  .piece.has-chip .piece-chip-img {
    width: 100%; height: 100%; object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.55));
  }
  /* Der Punkt aufgerüsteter Figuren liegt jetzt auf dem Bild statt darunter. */
  .piece.has-chip .php {
    position: absolute; bottom: 0; right: 0; z-index: 2;
    text-shadow: 0 1px 3px rgba(0,0,0,.9);
  }
  .piece .php { font-size: clamp(7px, calc(var(--cell) * .125), 11px); color: #ff6b6b; font-weight: bold; line-height: 1; }
  .piece .php.green { color: #7fc97f; }
  /* Unterstützung: zwei gekreuzte Speere (Inline-SVG) statt ⚑-Emoji —
     liest sich als „da steht noch einer", auch auf kleinen Chips. */
  .piece.has-support::before {
    content:''; position:absolute; top:-6px; right:-6px;
    width:clamp(12px, calc(var(--cell) * .30), 22px); height:clamp(12px, calc(var(--cell) * .30), 22px);
    background:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8c040' stroke-width='2' stroke-linecap='round'><path d='M5 21 L17 9 M19 21 L7 9'/><g fill='%23e8c040' stroke='none'><path d='M17 9 l3.5 -3.5 -0.5 5 z'/><path d='M7 9 L3.5 5.5 L4 10.5 z'/></g></svg>") center/contain no-repeat;
    filter:drop-shadow(0 1px 3px rgba(0,0,0,.8));
  }
  /* Während der Wanderung (render.js/_wandereFiguren) zwei Dinge abschalten:
     - transition: die Figur hat sonst `transition: transform .15s` und würde
       jeden von GSAP gesetzten Frame noch einmal weich nachziehen — das Ergebnis
       ruckelt und läuft der Animation hinterher.
     - z-index anheben: die wandernde Figur liegt sonst unter den Zellen, die im
       DOM nach ihr kommen, und verschwindet auf halbem Weg dahinter. */
  #board.flip-laeuft .piece { z-index: 20; transition: none; }
  /* Geister: freistehende Kopien gefallener oder zurückgestufter Figuren.
     render.js/_figurGeist hängt sie an <body> mit position:fixed — nicht ans
     Brett, das bei jedem Rendern geleert wird. Sie tragen die Figurenklassen
     weiter (Scheibe, Chip, Rand) und brauchen nur noch die Ebene und Ruhe. */
  .piece-geist { pointer-events: none; z-index: 200; transition: none; cursor: default; }
  .piece-geist.geist-tod   { filter: grayscale(.5) brightness(.8); }
  .piece-geist.geist-bruch { filter: brightness(1.35); }
  /* Handkarten während der Bewegung: wie beim Brett die eigene transition aus,
     sonst zieht der Browser jeden GSAP-Frame noch einmal weich nach. */
  #cardRow.karten-laufen .card { transition: none; }
  @keyframes pieceSpawn { from { transform: scale(0) rotate(-180deg); opacity:0; } to { transform: scale(1) rotate(0); opacity:1; } }
  .piece.just-spawned { animation: pieceSpawn .4s cubic-bezier(.34,1.56,.64,1) forwards; }
  @keyframes pieceLand { 0%{transform:scale(1.25) translateY(-3px);} 60%{transform:scale(.95);} 100%{transform:scale(1);} }
  .piece.just-moved { animation: pieceLand .25s ease forwards; }

  /* ── PANELS ── */
  .panel { background: transparent; border: 2px solid var(--border); border-radius: 10px; padding: 8px 10px; }
  .panel h3 { font-size: .62rem; color: var(--accent-strong); text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 5px; font-family: 'Cinzel', serif; }
  .panel .value { font-size: 1.15rem; font-weight: 600; color: var(--accent-strong); }
  .panel:has(.value) { border-color: var(--accent-strong); }

  /* ── TURN INDICATOR ── */
  /* ═══════════════════════════════════════════════════
     PERGAMENT-BANNER — Styleguide §7
     Die zentrale Statusanzeige ist laut Styleguide ein Banner mit Ribbon-Enden
     in Cinzel, kein Pillen-Chip. Die Schwalbenschwanz-Kerben entstehen per
     clip-path statt über zusätzliches Markup — ein Element, keine Wrapper.
     Weil clip-path auch Ränder abschneidet, trägt der Banner keinen Border,
     sondern einen drop-shadow als Kante; das wirkt ohnehin mehr nach Stoff.
     ═══════════════════════════════════════════════════ */
  .ribbon-banner {
    --ribbon-notch: 13px;
    position: relative;
    padding: 8px calc(var(--ribbon-notch) + 12px);
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: .82rem; font-weight: 600; letter-spacing: .8px;
    /* Der Banner liegt auf einem Panel aus demselben Pergament — ohne eigenen
       Ton verschwindet er darin. Die Verlaufsschicht darüber macht ihn zu einem
       Stück Material, das auf dem Panel liegt, statt Teil davon zu sein. */
    background-color: var(--surface-panel);
    background-image:
      linear-gradient(rgba(var(--border-strong-rgb), .10), rgba(var(--border-strong-rgb), .18)),
      url('assets/ui/textures/parchment_512.png');
    background-size: auto, auto;
    background-repeat: repeat, repeat;
    background-blend-mode: normal, multiply;
    clip-path: polygon(
      0 0, 100% 0,
      calc(100% - var(--ribbon-notch)) 50%, 100% 100%,
      0 100%, var(--ribbon-notch) 50%
    );
    filter: drop-shadow(0 2px 3px rgba(var(--border-strong-rgb), .38));
  }
  body.dark-mode .ribbon-banner {
    background-image:
      linear-gradient(rgba(255,255,255,.07), rgba(255,255,255,.02));
    background-size: auto, auto;
    background-repeat: repeat, repeat;
    background-blend-mode: normal, soft-light;
  }

  /* Der Turn-Indikator ist der prominenteste Banner — er bekommt zusätzlich
     die Spielerfarbe, die renderUI() als --turn-color hereinreicht. */
  #turnIndicator {
    color: var(--turn-color, var(--text));
    box-shadow: inset 0 0 0 999px rgba(0,0,0,0);   /* Platzhalter, s. u. */
  }
  #turnIndicator::before {
    content: ''; position: absolute; inset: 0;
    background: var(--turn-color, transparent);
    opacity: .13; pointer-events: none;
  }
  #turnIndicator > * { position: relative; }

  /* ── PHASE BADGE ── */
  #phaseBar span { color: var(--accent-strong); }

  /* ── DICE ── */
  .dice-display { text-align: center; }
  /* ═══════════════════════════════════════════════════
     MESSING-MEDAILLONS — Styleguide §7
     „Zähler und Badges als Medaillon-Chips mit Gold-Rand statt einfacher
     Kreise/Pillen." Ein gemeinsamer Bausatz für alle Zähler: Würfelergebnis,
     Airdrop-Pips und Tutorial-Fortschritt sahen vorher aus wie drei
     verschiedene Systeme.
     ═══════════════════════════════════════════════════ */
  .medallion {
    border-radius: 50%;
    background-color: var(--surface-panel);
    background-size: auto;
    background-repeat: repeat;
    background-blend-mode: soft-light;
    border: 2px solid var(--accent-strong);
    box-shadow:
      inset 0 1px 2px rgba(255,255,255,.35),      /* Lichtkante oben */
      inset 0 -2px 4px rgba(var(--border-strong-rgb),.4),  /* Schattenkante unten */
      0 1px 3px rgba(var(--border-strong-rgb),.45);
  }

  .die {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; margin: 1px;
    color: var(--text); font-size: 1.3rem; font-weight: bold;
    font-family: 'Cinzel', serif;
    border-radius: 50%;
    background-color: var(--surface-panel);
    background-size: auto;
    background-repeat: repeat;
    background-blend-mode: soft-light;
    border: 2px solid var(--accent-strong);
    box-shadow:
      inset 0 1px 2px rgba(255,255,255,.35),
      inset 0 -2px 4px rgba(var(--border-strong-rgb),.4),
      0 1px 3px rgba(var(--border-strong-rgb),.45);
  }

  /* ── BEWEGUNGSWÜRFEL PROMINENT ──────────────────────────────
     Der Bewegungswürfel ist der zentrale Zahlenwert des rechten Panels und soll
     mehr Präsenz haben als die kleinen .die-Chips. Bewusst nur für #moveDie —
     die Kampfwürfel (.combatSide .die, 72 px) bleiben unberührt.

     Wichtig: Hier stehen NUR Größe und Font. Farbe, Rahmen, Schatten und die
     gezeichneten Würfelseiten erbt #moveDie von .die bzw. den Medallion-/Face-
     Regeln weiter unten. Würde man hier box-shadow oder border setzen, käme
     es mit der „gemalten Seite ist der Würfel"-Regel in Konflikt. */
  #moveDie {
    width: 92px; height: 92px;
    font-size: 2.6rem;
    margin: 4px auto;
  }

  /* Airdrop-Fortschritt: gefüllte Pips sind Messing, leere bleiben zurückhaltend */
  .airdrop-pip {
    width: 12px; height: 12px; display: inline-block; border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--surface);
    transition: background .35s, box-shadow .35s, border-color .35s;
  }
  /* Gefüllt heißt „erreicht" — der Pip muss deshalb HELLER leuchten als ein
     leerer. Mit multiply war es umgekehrt: die gefüllten wurden zu dunklen
     Punkten und die leeren wirkten aktiver. */
  .airdrop-pip.is-filled {
    border-color: var(--accent-strong);
    background-color: var(--accent-strong);
    background-size: auto;
    background-repeat: repeat;
    background-blend-mode: soft-light;
    box-shadow: inset 0 1px 1px rgba(255,255,255,.55), 0 0 7px rgba(var(--accent-strong-rgb),.55);
  }
  .airdrop-pip.is-pulse { animation: airdropPulse .9s infinite alternate; }

  /* ── CARDS ── */
  /* 132 x 198 = exakt 2:3 — dasselbe Verhältnis, in dem die Rahmengrafiken
     erzeugt werden. Vorher waren es 132 x 190; der Rahmen wurde dadurch um
     gut 4 % in die Höhe gezogen, was Ornamente und Fensterkanten leicht
     verschoben hat. */
  /* Statt die Karten in einer starren Reihe zu zwängen: flexible Hand am
     unteren Rand, die horizontal scrollt und genug Höhe für Lesbarkeit hat. */
  #cardRow { display: flex; gap: 10px; min-height: 208px; align-items: flex-end; justify-content: center; overflow-x: auto; padding-bottom: 2px; }
  /* Karten auf Ultrawide und 4K nicht kleiner lassen als nötig — die Hand füllt
     die Mitte dann besser aus. 132×198 bleibt Basis; die Produktregel nutzt die
     kleinere der beiden Achsen des Zellraums. */
  @media (min-width: 2000px) {
    #cardRow { min-height: 250px; }
    #myHand  { min-height: 250px; }
    #myHandRow {
      min-height: 218px;
      max-height: 300px;
    }
  }
  @media (min-width: 3200px) {
    #cardRow { min-height: 290px; }
    #myHand  { min-height: 290px; }
    #myHandRow {
      min-height: 258px;
      max-height: 340px;
    }
  }

  /* Verbindung zum Brett: ursprünglich ein goldener Oberrand auf der Hand.
     Entfernt — die eigene Hand hat kein Panel-Kleid mehr (s. #myHandRow), der
     Goldbalken als Teil dieses Randes ist damit hinfällig. */
  .card {
    --card-color: #8a7458;
    width: 140px; height: 210px;
    border-radius: 10px;
    border: 2px solid var(--border);
    border-top: 4px solid var(--card-color);
    background: var(--surface-panel);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer;
    transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s, border-color .15s;
    position: relative; padding-top: 6px; flex-shrink: 0;
    box-shadow: var(--elev-1);
  }
  .card:hover {
    transform: translateY(-14px) rotate(-1deg);
    border-color: var(--card-color);
    box-shadow: 0 16px 28px rgba(var(--border-strong-rgb),.4), 0 0 0 1px color-mix(in srgb, var(--card-color) 45%, transparent);
  }
  .card.selected-card {
    border-top-color: var(--success);
    transform: translateY(-16px);
    box-shadow: 0 18px 32px rgba(var(--border-strong-rgb),.45), 0 0 0 2px var(--success), 0 0 24px rgba(var(--success-rgb),.45);
  }
  .card.läufer-saved { border-top-color: var(--success); box-shadow: 0 0 10px rgba(var(--success-rgb),.3); }
  .card.phase-locked {
    opacity: .55; cursor: not-allowed;
    filter: grayscale(.35);
  }
  /* Gesperrte Karte: das Bild bleibt erkennbar — statt einer Vollflächen-
     Überdeckung nur ein kleines Schloss-Badge oben rechts (siehe Karten-
     Rückseite/Unit-Card: Ausgrauen ja, Verbergen nein). */
  .card.phase-locked::after {
    content:'🔒'; position:absolute; top:6px; right:6px; z-index:5;
    font-size:.9rem; line-height:1;
    background:rgba(10,10,22,.75); border-radius:50%;
    padding:3px 4px; pointer-events:none;
  }
  .card-rank { position:absolute; top:8px; left:12px; z-index:4; font-family:'Cinzel',serif; font-size:20px; font-weight:700; line-height:1; }
  .card .cicon { font-size: 56px; line-height: 1; }
  .card .clabel {
    color: var(--text); font-size: 12.5px; margin-top: 10px; text-align: center;
    line-height: 1.3; letter-spacing: .2px; max-width: 122px; font-weight: 500;
  }
  /* Effektzeile: die mechanische Kurzfassung unter dem Namen. */
  .card .ceffect { color: var(--text-muted); font-size: 9.5px; margin-top: 3px; text-align: center; line-height: 1.2; opacity: .85; max-width: 122px; }
  /* Kosten oben rechts, spiegelbildlich zum Wert. */
  .card-cost { position: absolute; top: 8px; right: 12px; z-index: 4; font-family: 'Cinzel', serif; font-size: 16px; font-weight: 700; line-height: 1; color: var(--accent-strong); }

  /* ── LOG ── */
  #log { font-size: .7rem; color: var(--text-muted); height: 92px; overflow-y: auto; line-height: 1.5; }
  #log .entry { padding: 2px 0; border-bottom: 1px solid var(--border); }
  #log .entry.atk { color: var(--danger); }
  #log .entry.sys { color: var(--success); }

  /* ── TOOLTIP ── */
  #tooltip { position: fixed; z-index: 999; background: var(--surface-panel); color: var(--text); border: 2px solid var(--accent-strong); border-radius: 10px; padding: 10px 14px; max-width: 220px; font-size: .8rem; line-height: 1.5; pointer-events: none; opacity: 0; transition: opacity .15s; box-shadow: 0 8px 24px rgba(var(--border-strong-rgb),.35); }
  #tooltip.show { opacity: 1; }
  #tooltip h4 { color: var(--accent-strong); margin-bottom: 4px; font-size: .85rem; font-family: 'Cinzel', serif; }
  #tooltip p { color: var(--text-muted); margin: 2px 0; }

  /* ── BUTTONS ──
     Base .btn / .btn-primary / .btn-secondary: these classes are used all
     over index.html (menu, online modal, king-HP picker, win screen,
     roguelike screens) but had NO matching definitions anywhere in this
     file — every one of those buttons was rendering with bare browser
     defaults. This is the single reusable button system for anything
     outside the compact in-game side panels (which keep .btn-sm below). */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 20px; font-size: .92rem; font-weight: 600; letter-spacing: .3px;
    border-radius: var(--r-md, 10px); border: 2px solid var(--border);
    background: var(--surface-panel); color: var(--text);
    cursor: pointer; font-family: 'Cinzel', serif;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background-color .15s ease, color .15s ease;
  }
  .btn:hover { transform: translateY(-1px); border-color: var(--accent-strong); box-shadow: var(--elev-1); }
  .btn:active { transform: translateY(0); }
  .btn:disabled { opacity: .4; cursor: default; transform: none; box-shadow: none; }
  .btn:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

  .btn-primary {
    background: var(--gold-sheen); color: var(--on-accent); border-color: var(--accent-strong);
    box-shadow: 0 4px 0 var(--accent-strong), var(--rim-light);
  }
  .btn-primary:hover {
    box-shadow: 0 4px 0 var(--accent-strong), 0 4px 20px rgba(var(--accent-strong-rgb),.35);
    border-color: var(--accent-strong);
  }
  .btn-primary:active { box-shadow: 0 2px 0 var(--accent-strong); transform: translateY(2px); }
  .btn-primary:disabled { box-shadow: none; }

  .btn-secondary {
    background: var(--surface-panel); color: var(--text-muted); border: 2px solid var(--border);
  }
  .btn-secondary:hover { border-color: var(--accent-strong); color: var(--accent-strong); background: var(--surface-subtle); }

  /* .online-tab: segmentierte Tab-Leiste im Online-Modal. Der aktive Tab trägt
     die goldene Akzentfarbe (wie .btn-primary), inaktive bleiben sekundär. */
  .online-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
  .online-tab { flex: 1; }
  .online-tab.active {
    background: var(--gold-sheen); color: var(--on-accent); border-color: var(--accent-strong);
    box-shadow: 0 2px 0 var(--accent-strong);
  }
  .online-tab-panel { text-align: left; }

  /* .btn-sm: the compact button family used inside the in-game side panels
     (Undo/Endphase/Würfeln/Spiel verlassen) — smaller and denser than .btn,
     but drawn from the same gold/parchment language so nothing looks like
     it belongs to a different app. */
  .btn-sm { padding: 8px 14px; font-size: .78rem; font-weight: 600; border-radius: var(--r-sm, 6px); border: 2px solid var(--border); background: var(--surface-panel); color: var(--text-muted); cursor: pointer; transition: all .15s ease; letter-spacing: .3px; font-family: 'Cinzel', serif; }
  .btn-sm:hover { border-color: var(--accent-strong); color: var(--accent-strong); transform: translateY(-1px); }
  .btn-sm:active { transform: translateY(0); }
  .btn-sm.active { background: var(--accent); border-color: var(--accent-strong); color: var(--on-accent); }
  .btn-sm:disabled { opacity: .35; cursor: default; transform: none; }
  .btn-sm.btn-leave:hover { border-color: var(--danger); color: var(--danger); }

  /* Würfeln-Button: der wichtigste Klick der Bewegungsphase bekommt dauerhaft
     den vollen Gold-Look statt nur, wenn JS die .primary-action Klasse setzt —
     "hervorgehoben", wie im Auftrag gefordert, nicht nur situativ golden.
     Gleiche Formsprache wie #btnRoll im Kampf-Overlay (Gold-Sheen + Stufen-
     Schatten), damit ein Würfel-Button im ganzen Spiel gleich aussieht. */
  #btnRollMove {
    background: var(--gold-sheen); color: var(--on-accent); border-color: var(--accent-strong);
    font-weight: 700; box-shadow: 0 3px 0 var(--accent-strong), var(--rim-light);
  }
  #btnRollMove:hover {
    color: var(--on-accent); border-color: var(--accent-strong);
    box-shadow: 0 3px 0 var(--accent-strong), 0 4px 18px rgba(var(--accent-strong-rgb),.35);
  }
  #btnRollMove:disabled { box-shadow: none; }


  /* ── ACTIVE BONUS CHIPS ── */
  .bonus-chip { display:inline-flex; align-items:center; gap:4px; padding:3px 9px; border-radius:20px; font-size:.78rem; font-weight:500; box-shadow: 0 1px 2px rgba(var(--border-strong-rgb),.3); }
  .bonus-chip.atk { background:rgba(var(--danger-rgb),.12); border:1px solid rgba(var(--danger-rgb),.4); color:var(--danger); }
  .bonus-chip.def { background:rgba(var(--success-rgb),.12); border:1px solid rgba(var(--success-rgb),.35); color:var(--success); }

  /* ── KAMPF-PANEL (rechte Spalte) ──
     Früher war #combatOverlay ein bildschirmfüllender Modal-Dialog mit Schleier.
     Jetzt ist es ein schmales Panel dort, wo in der Angriffsphase ohnehin nichts
     passiert. Bewusst karg gehalten: zwei Chips mit ihren Namen und Würfeln,
     darunter das Ergebnis. Alles, was doppelt war (Fraktion im Klartext, „VS",
     „kämpft gegen", Rollen-Zeile), ist raus — in 240 px Breite war das Papier. */
  #combatOverlay { display: none; }
  #combatOverlay.show { display: block; }
  /* Solange gekämpft wird, weicht der Bewegungswürfel dem Kampf-Panel. */
  #rightPanel:has(#combatOverlay.show) #dicePanel { display: none; }

  /* #rightPanel #combatBox: höhere Spezifität als die gemalten Rahmen aus dem
     UI-ART-PACK (.ui-has-chrome-combat #combatBox bringt 40px border-image mit —
     in einer 240px-Spalte wäre das kein Rahmen mehr, sondern die halbe Fläche). */
  #rightPanel #combatBox {
    background: transparent; border: none; border-image: none;
    padding: 0; min-width: 0; text-align: left; box-shadow: none; border-radius: 0;
  }
  #combatBox .combat-title {
    font-family: 'Cinzel', serif; color: var(--accent-strong);
    font-size: .66rem; letter-spacing: 1.4px; text-transform: uppercase;
    opacity: .85; margin-bottom: 8px;
  }
  /* Zwei Kämpfer nebeneinander, ein Klingenzeichen dazwischen. */
  .combatDice {
    display: flex; justify-content: center; align-items: flex-start;
    gap: 6px; margin: 0 0 6px;
  }
  .combatSide {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    min-width: 0; flex: 1 1 0;
  }
  .combatSide .slabel {
    font-size: .6rem; color: var(--text-muted); letter-spacing: .3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  }
  .combatSide .die {
    width: 38px; height: 38px; font-size: 1.25rem; line-height: 38px;
    border-radius: 8px; border: 2px solid var(--accent-strong);
    background: var(--surface-panel); color: var(--text);
    font-family: 'Cinzel', serif; font-weight: 600;
    transition: background .2s, color .2s;
    box-shadow: 0 2px 0 var(--accent-strong), var(--rim-light);
  }
  .combatSide .die.rolling { animation: dieRoll .08s infinite; }
  @keyframes dieRoll { 0%{transform:rotate(-6deg) scale(1.04);} 50%{transform:rotate(6deg) scale(.97);} 100%{transform:rotate(-6deg) scale(1.04);} }
  @keyframes dieLand { 0%{transform:scale(1.25) rotate(8deg);} 60%{transform:scale(.93) rotate(-2deg);} 100%{transform:scale(1) rotate(0);} }
  .combatSide .die.landed { animation: dieLand .3s cubic-bezier(.34,1.56,.64,1) forwards; }
  /* Ergebnis: knapp, ohne feste Mindesthöhe — ein leerer Block vor dem Wurf war
     einer der Gründe, warum das Panel überladen wirkte. */
  .combatResult { font-size: .78rem; line-height: 1.45; margin: 2px 0 0; }
  .combatResult:empty { display: none; }
  .combatResult .combat-hint { color: var(--text-muted); font-size: .72rem; font-style: italic; }
  .combatResult .combat-winner { display: block; font-size: .84rem; margin-top: 2px; }
  .combatResult .combat-detail { color: var(--text-muted); font-size: .74rem; }

  #btnRoll {
    margin-top: 8px; padding: 8px 14px; width: 100%;
    font-size: .78rem; border-radius: 8px;
    background: var(--accent); border: none; color: var(--on-accent);
    font-weight: 600; cursor: pointer; font-family: 'Cinzel', serif; letter-spacing: 1px;
    transition: transform .1s, box-shadow .1s;
    box-shadow: 0 3px 0 var(--accent-strong), var(--rim-light);
  }
  #btnRoll:hover { transform: scale(1.02); box-shadow: 0 3px 0 var(--accent-strong), 0 4px 20px rgba(var(--accent-strong-rgb),.3); }
  #btnRoll:disabled { opacity: .35; cursor: default; transform: none; }

  /* Die beiden Kämpfer einander gegenüber. Die Grafik ist der BRETT-Chip, den
     combat.js über getPieceChipHTML() einsetzt — für den Dialog braucht es
     deshalb kein eigenes Asset. --side-color setzt combat.js je Seite. */
  .combat-portrait {
    width: 38px; height: 38px; border-radius: 50%; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-panel);
    border: 2px solid var(--side-color, var(--accent-strong));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--side-color, var(--accent-strong)) 22%, transparent);
  }
  .combat-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
  /* Fallback-Pfad: ohne Chip-Datei liefert getPieceChipHTML ein SVG-Icon. */
  .combat-portrait svg { width: 58%; height: 58%; color: var(--side-color, var(--text)); }
  .combat-vs-mark {
    display: flex; align-items: center; justify-content: center;
    padding-top: 22px; flex: 0 0 auto;
    font-size: .8rem; color: var(--accent-strong); opacity: .6;
  }

  /* Ergebnis-Einfärbung des Kampf-Panels (combat.js setzt die Klasse aus Sicht
     des Zuschauers). Im Panel gibt es keinen dicken Rahmen mehr — die Aussage
     trägt hier ein farbiger Ring um den Inhalt. */
  #combatBox.combat-win {
    outline: 2px solid var(--success);
    outline-offset: 4px;
    border-radius: 8px;
    box-shadow: 0 0 18px color-mix(in srgb, var(--success) 35%, transparent);
  }
  #combatBox.combat-lose {
    outline: 2px solid var(--danger);
    outline-offset: 4px;
    border-radius: 8px;
    box-shadow: 0 0 18px color-mix(in srgb, var(--danger) 32%, transparent);
  }

  /* ── TUTORIAL OVERLAYS ── */
  .tutorial-overlay { display: none; position: fixed; inset: 0; background: var(--overlay-scrim); z-index: 120; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
  .tutorial-overlay.show { display: flex; }
  .tutorial-box { background: var(--surface-panel); color: var(--text); border: 3px solid var(--accent-strong); border-radius: 16px; padding: 28px 34px; text-align: center; max-width: 480px; max-height: 88vh; overflow-y: auto; box-shadow: var(--elev-3); }
  .tutorial-title { font-family: 'Cinzel', serif; color: var(--accent-strong); font-size: 1.25rem; letter-spacing: 1px; margin-bottom: 12px; }
  .tutorial-text { font-size: .9rem; color: var(--text); line-height: 1.6; }

  /* ── TUTORIAL: new-cards / new-figure reveal (inside the narration box) ── */
  .tut-card-diff-label { font-family: 'Cinzel', serif; font-size: .68rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent-strong); margin: 18px 0 8px; text-align: left; }
  .tut-card-diff-label--removed { color: var(--text-muted); }
  .tut-card-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-start; }
  .tut-card-chip {
    width: 92px; border-radius: 10px; border: 2px solid var(--border); border-top: 3px solid var(--accent-strong);
    background: var(--surface-panel); padding: 10px 6px; text-align: center;
    position: relative; box-shadow: var(--elev-1);
  }
  .tut-card-chip--new { animation: tutCardDeal .4s cubic-bezier(.34,1.56,.64,1) both; border-top-color: var(--success); box-shadow: var(--elev-1), 0 0 10px rgba(var(--success-rgb),.25); }
  .tut-card-new-badge { position: absolute; top: -7px; right: -6px; background: var(--success); color: #fff; font-size: .52rem; font-weight: 700; letter-spacing: .5px; padding: 2px 5px; border-radius: 5px; }
  .tut-card-chip--removed { border-top-color: var(--border); opacity: .55; filter: grayscale(.6); box-shadow: none; }
  .tut-card-icon { font-size: 26px; line-height: 1; }
  .tut-card-label { font-size: .68rem; color: var(--text); margin-top: 4px; font-weight: 500; }
  .tut-card-desc { font-size: .6rem; color: var(--text-muted); margin-top: 4px; line-height: 1.35; }
  @keyframes tutCardDeal { from { opacity: 0; transform: translateY(16px) scale(.8) rotate(-4deg); } to { opacity: 1; transform: none; } }

  .tut-figure-card { display: flex; align-items: center; gap: 14px; text-align: left; margin-top: 8px; padding: 10px; background: rgba(var(--accent-rgb),.14); border: 1px solid var(--accent-strong); border-radius: 10px; }
  .tut-figure-icon { flex-shrink: 0; width: 40px; height: 40px; color: var(--accent-strong); }
  .tut-figure-icon svg { width: 100%; height: 100%; }
  .tut-figure-name { font-family: 'Cinzel', serif; color: var(--accent-strong); font-size: .95rem; margin-bottom: 3px; }
  .tut-figure-desc { font-size: .74rem; color: var(--text-muted); line-height: 1.5; }

  /* ── TUTORIAL HUD: persistent goal + progress bar on the game screen ── */
  #tutorialHUD {
    display: none; align-items: center; gap: 14px; flex-shrink: 0;
    padding: 7px 14px; background: rgba(var(--accent-rgb),.12);
    border: 2px solid var(--accent-strong); border-radius: 10px;
    justify-content: space-between;
  }
  #tutorialHUD.show { display: flex; }
  #tutorialHUDGoal { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
  .thud-icon { flex-shrink: 0; }
  #tutorialHUDGoalText { font-size: .78rem; color: var(--text); line-height: 1.3; }
  #tutorialHUDProgress { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
  #tutorialHUDLevelLabel { font-family: 'Cinzel', serif; font-size: .7rem; letter-spacing: .5px; color: var(--accent-strong); white-space: nowrap; }
  #tutorialHUDDots { display: flex; gap: 4px; }
  .thud-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); border: 1px solid transparent; }
  .thud-dot.done {
    background-color: var(--accent-strong);
    background-size: auto;
    background-repeat: repeat;
    background-blend-mode: soft-light;
    border-color: var(--accent-strong);
    box-shadow: inset 0 1px 1px rgba(255,255,255,.35);
  }
  .thud-dot.current { background: var(--accent-strong); box-shadow: 0 0 0 3px rgba(var(--accent-strong-rgb),.3); animation: thudPulse 1.4s ease-in-out infinite; }
  @keyframes thudPulse { 0%,100% { box-shadow: 0 0 0 3px rgba(var(--accent-strong-rgb),.3); } 50% { box-shadow: 0 0 0 5px rgba(var(--accent-strong-rgb),.15); } }

  /* ── PLAYER COLORS ──
     Bleiben bewusst außerhalb des Theme-Blocks: sie kodieren Spielzustand,
     nicht Thema (siehe Dateikopf). Vertieft nach dem Mood-Board-Abgleich —
     #c0392b/#2471a3 stammten aus der Flat-UI-Webpalette und lagen neben den
     erdigeren Fraktionsfarben der Vorbilder (gemessen: Gwent-Karmin #a5342b,
     Rüstungsblau der eigenen Königin #2d67b7). Weiße Figurenbeschriftung
     gewinnt dadurch Kontrast: 8,40:1 statt 6,99:1 auf dem dunklen Verlaufsstop.
     ACHTUNG: nur die Startwerte. Die Farbwahl im Menü überschreibt sie zur
     Laufzeit aus COLOR_HEX in js/constants.js — beide müssen gleich bleiben. */
  body { --c1: #a5342b; --c2: #2a6396; }
  /* Swimming: subtle slow glow — no body flash, just a quiet board aura */
  #boardWrap.swimming-white { --board-swim: var(--c1); animation: boardSwimGlow 3.5s ease-in-out infinite; }
  #boardWrap.swimming-black { --board-swim: var(--c2); animation: boardSwimGlow 3.5s ease-in-out infinite; }
  @keyframes boardSwimGlow {
    0%,100% { box-shadow: 0 0 0 1px transparent; }
    50%     { box-shadow: 0 0 24px 4px color-mix(in srgb, var(--board-swim) 30%, transparent); }
  }
  /* ── DICE SHAKE ── */
  @keyframes diceShake {
    0%,100% { transform: rotate(0deg) scale(1); }
    18%     { transform: rotate(-22deg) scale(1.25); }
    38%     { transform: rotate(16deg) scale(1.18); }
    58%     { transform: rotate(-10deg) scale(1.1); }
    78%     { transform: rotate(6deg) scale(1.05); }
  }
  .dice-shake { display: inline-block; animation: diceShake 0.42s cubic-bezier(.36,.07,.19,.97) both; }

  /* ── CARD FLY ── */
  .card-fly {
    position: fixed; z-index: 9999; pointer-events: none;
    border-radius: 8px; box-shadow: 0 8px 32px rgba(var(--border-strong-rgb),.4);
    transition: transform 0.32s cubic-bezier(.18,.89,.32,1.28), opacity 0.32s ease;
  }

  /* ── UNIT INFO CARD ── */
  .unit-card {
    padding: 0; min-height: 160px;
  }
  /* Kein Karten-Rahmen/kein Karten-Kleid mehr auf #unitCard: beim Hover-Tilt
     (Scale + Rotation) würde die Kartenkante sichtbar über der Fläche stehen.
     Border, Radius und Box-Schatten ruhen jetzt auf den Flächen selbst. */
  /* 3D-Flip (Originkit Flip-Gallery-Technik): #unitCard ist der Perspektiv-
     Container, #unitCardFlip der drehende Würfel in preserve-3d, Front/Back
     zwei absolut darüber liegende Flächen mit backface-visibility:hidden. */
  #unitCard {
    position: relative; inset: auto; width: auto;
    flex: 1 1 auto; align-self: stretch;
    min-height: 0;
    /* Originkit Flip-Gallery nutzt perspective: 900px am Container. Der Tilt
       hebt die Karte leicht an und skaliert sie minimal — overflow: visible,
       damit nichts an der Kartenkante abgeschnitten wird. Kein border/box-shadow
       mehr hier, damit der Hover-Tilt keine Kartenkante über die Fläche legt. */
    perspective: 900px;
    overflow: visible;
    cursor: pointer; user-select: none;
  }
  /* Tilt-Wrapper: das Element, das die perf-JS-Transformierung (rotateX/
     rotateY + scale3d) direkt ansteuert. preserve-3d, damit der Flip-Würfel
     darin die Tiefe behält. */
  .unit-card-tilt {
    position: relative; width: 100%; height: 100%;
    transform-style: preserve-3d;
    transition: transform .2s ease-out;
    will-change: transform;
  }
  .unit-card-flip {
    position: relative; width: 100%; height: 100%;
    transform-style: preserve-3d;
    transition: transform .8s cubic-bezier(.22, 1, .36, 1);
  }
  .unit-card-flip.is-flipped { transform: rotateY(180deg); }
  .unit-card-face {
    position: absolute; inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
  }
  .unit-card-front { display: flex; align-items: stretch; border-radius: 12px; }
  .unit-card-back {
    transform: rotateY(180deg);
    display: flex; flex-direction: column;
    overflow-y: auto; overflow-x: hidden;
    /* Die Text-Info braucht ihre eigene Fläche: #unitCard hat keinen
       Hintergrund/Rahmen mehr (kein Konflikt mit dem Hover-Tilt), daher liegen
       Fläche und Radius hier auf der Rückseite. */
    background: var(--surface-panel);
    border: 2px solid var(--border);
    border-radius: 12px;
  }
  .unit-card-back .unit-card-content {
    width: 100%; height: 100%; display: flex; flex-direction: column;
    padding: 0;
  }
  .unit-portrait {
    width: 100%; height: 100%; min-height: 96px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(180deg, #2b2015 0%, #16110a 100%);
    position: relative; overflow: hidden;
  }
  .unit-card-front .unit-portrait { height: 100%; }
  .unit-portrait.has-portrait-art { height: 100%; }
  .unit-portrait svg { filter: drop-shadow(0 0 8px currentColor); }
  .unit-portrait-glow {
    position: absolute; inset: 0; opacity: 0.12;
    background: radial-gradient(ellipse at 50% 60%, var(--unit-color, #888) 0%, transparent 70%);
  }
  .unit-portrait-img {
    width: 100%; height: 100%; object-fit: contain; object-position: center 50%;
    display: block;
  }
  .unit-name {
    font-family: 'Cinzel', serif; font-size: .9rem; font-weight: 600;
    color: var(--accent-strong); letter-spacing: 1.5px; text-align: center;
    padding: 8px 10px 2px;
  }
  .unit-owner { font-size: .68rem; color: var(--text-muted); text-align: center; padding-bottom: 6px; letter-spacing: .5px; }
  .unit-stats {
    display: flex; gap: 6px; justify-content: center; padding: 0 10px 8px;
    font-size: .7rem; color: var(--text-muted);
  }
  .unit-stat-chip {
    background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 4px;
    padding: 2px 7px; display: flex; align-items: center; gap: 3px;
  }
  .unit-desc {
    font-size: .72rem; color: var(--text-muted); line-height: 1.5;
    padding: 0 12px 10px; text-align: left; border-top: 1px solid var(--border); padding-top: 8px;
  }
  .unit-tags { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 10px 10px; }
  .unit-tag {
    font-size: .62rem; text-transform: uppercase; letter-spacing: 1px;
    background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 3px;
    padding: 2px 6px; color: var(--text-muted);
  }
  /* ── Unit-Card: Bewegungs-/Angriffs-Diagramm (Rückseite) ──
     Farbsprache wie 01_Regelwerk/Movement_Visualisierung.html: Grün = nur
     Bewegung, Rot = Bewegung & Angriff, Lila Schraffur = Taunt, Gelb
     Schraffur = Blocked, Blau = die Figur selbst. */
  .unit-movement {
    padding: 0 12px 12px; border-top: 1px solid var(--border);
    display: flex; flex-direction: column; align-items: center; gap: 6px;
  }
  .unit-movement:empty { display: none; }
  .um-legend {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
    padding-top: 7px; font-size: .58rem; color: var(--text-muted); letter-spacing: .3px;
  }
  .um-legend-item { display: flex; align-items: center; gap: 4px; }
  .um-legend-item i {
    width: 10px; height: 10px; border-radius: 2px; display: inline-block;
    border: 1px solid rgba(255,255,255,.15);
  }
  .um-board {
    display: grid; gap: 2px; width: 100%; max-width: 168px;
  }
  .um-cell { aspect-ratio: 1; border-radius: 3px; position: relative; }
  .um-empty  { background: var(--surface-subtle); border: 1px solid var(--border); }
  .um-move   { background: #2e7d2e; }
  .um-both   { background: #8b2020; }
  .um-piece  { background: #2a5aaa; border: 1px solid #6699ff; }
  .um-taunt {
    background: var(--surface-subtle);
    background-image: repeating-linear-gradient(45deg, #a78bfa 0px, #a78bfa 2px, transparent 2px, transparent 6px);
    border: 1px solid #7c3aed;
  }
  .um-blocked {
    background: var(--surface-subtle);
    background-image: repeating-linear-gradient(45deg, #f59e0b 0px, #f59e0b 2px, transparent 2px, transparent 6px),
                      repeating-linear-gradient(-45deg, #f59e0b 0px, #f59e0b 2px, transparent 2px, transparent 6px);
    border: 1px solid #d97706;
  }
  .um-move::after { content:''; position:absolute; bottom:2px; right:2px; width:3px; height:3px; border-radius:50%; background: rgba(100,255,100,.55); }
  .um-both::after { content:''; position:absolute; bottom:2px; right:2px; width:3px; height:3px; border-radius:50%; background: rgba(255,100,100,.55); }

  /* ── TURN-CHANGE SMOKE TRANSITION ──
     Weicher, neutraler Nebel statt des harten Vollbild-Farbblitzes. */
  #turnFog { position:fixed; inset:0; z-index:1000; pointer-events:none; overflow:hidden; opacity:0; visibility:hidden; }
  #turnFog.active { visibility:visible; animation: fogTransition 1s ease-in-out forwards; }

  .fog-cloud { position:absolute; width:70%; height:70%; border-radius:50%; background: rgba(150,150,150,.4); filter: blur(70px); opacity:0; }
  .fog-cloud-1 { top:-20%; left:-20%; }
  .fog-cloud-2 { top:20%; left:30%; }
  .fog-cloud-3 { bottom:-20%; right:-20%; }
  #turnFog.active .fog-cloud-1 { animation: fogCloud1 1s ease-in-out forwards; }
  #turnFog.active .fog-cloud-2 { animation: fogCloud2 1s ease-in-out forwards; }
  #turnFog.active .fog-cloud-3 { animation: fogCloud3 1s ease-in-out forwards; }

  @keyframes fogTransition { 0%{opacity:0} 35%{opacity:1} 65%{opacity:1} 100%{opacity:0} }
  @keyframes fogCloud1 { 0%{transform:translate(-20%,-10%) scale(.7); opacity:0} 35%{transform:translate(10%,10%) scale(1.2); opacity:.7} 100%{transform:translate(40%,20%) scale(1.5); opacity:0} }
  @keyframes fogCloud2 { 0%{transform:translate(20%,0) scale(.8); opacity:0} 40%{transform:translate(-10%,0) scale(1.3); opacity:.6} 100%{transform:translate(-30%,0) scale(1.6); opacity:0} }
  @keyframes fogCloud3 { 0%{transform:translate(20%,20%) scale(.7); opacity:0} 35%{transform:translate(-10%,-10%) scale(1.2); opacity:.65} 100%{transform:translate(-40%,-20%) scale(1.5); opacity:0} }

  /* „X ist dran“ als dezenter Banner über dem Nebel statt Vollbild-Fläche. */
  #turnFlash {
    position:fixed; left:50%; top:50%; transform:translate(-50%,-50%);
    z-index:1001; pointer-events:none; opacity:0;
    font-family:'Cinzel',serif; font-size:1.35rem; letter-spacing:.5px;
    color: var(--accent-strong); text-shadow: 0 2px 14px rgba(0,0,0,.85);
    padding: 12px 26px; border-radius: 999px;
    background: rgba(var(--surface-panel-rgb), .72);
    border: 1px solid rgba(var(--accent-strong-rgb), .45);
    white-space: nowrap;
  }
  #turnFlash.flash { animation: turnFlashText 1.2s ease forwards; }
  @keyframes turnFlashText { 0%{opacity:0} 25%{opacity:1} 70%{opacity:1} 100%{opacity:0} }

  /* ── WIN SCREEN (Gwent style) ── */
  #winScreen {
    background: radial-gradient(ellipse at 50% 45%, var(--hero-bg-start) 0%, var(--hero-bg-end) 65%);
    position: relative; overflow: hidden; gap: 0;
  }
  #winScreen::before {
    content: ''; position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 40px, var(--grid-line) 40px, var(--grid-line) 41px),
                repeating-linear-gradient(90deg, transparent, transparent 40px, var(--grid-line) 40px, var(--grid-line) 41px);
  }
  .win-container {
    position: relative; z-index: 2;
    display: flex; flex-direction: column; align-items: center; gap: 0;
    animation: winEntrance .65s cubic-bezier(.34,1.3,.64,1) both;
  }
  @keyframes winEntrance {
    from { transform: scale(.55) translateY(-40px); opacity: 0; }
    to   { transform: scale(1) translateY(0);        opacity: 1; }
  }
  /* Crown + swords row */
  .win-crown-wrap {
    display: flex; align-items: center; justify-content: center;
    gap: 0; position: relative; z-index: 2; margin-bottom: -6px;
  }
  .win-crown { display: flex; align-items: flex-end; }
  .win-sword {
    width: 160px; height: 6px; position: relative; flex-shrink: 0;
    background: linear-gradient(90deg, transparent 0%, #8a8070 20%, #ccc8b8 50%, #8a8070 80%, transparent 100%);
    border-radius: 3px;
  }
  .win-sword::before {
    content: ''; position: absolute; top: 50%; transform: translateY(-50%);
    width: 22px; height: 16px;
    background: linear-gradient(90deg, #a09060, var(--gold-3));
    border-radius: 2px;
  }
  .win-sword-l { transform: rotate(25deg) translateX(20px); }
  .win-sword-l::before { right: -4px; }
  .win-sword-r { transform: rotate(-25deg) translateX(-20px); }
  .win-sword-r::before { left: -4px; }
  /* Banner */
  .win-banner {
    display: flex; align-items: stretch; min-width: 460px;
    border-top: 4px solid var(--accent-strong); border-bottom: 4px solid var(--accent-strong);
    box-shadow: 0 0 60px rgba(var(--accent-strong-rgb),.25), 0 0 0 1px rgba(var(--accent-strong-rgb),.15);
    position: relative;
  }
  .victory-banner {
    background: linear-gradient(180deg, var(--gold-5) 0%, var(--gold-4) 60%, var(--gold-5) 100%);
  }
  .victory-banner .win-result-text { color: var(--text); text-shadow: 0 0 30px rgba(255,255,255,.6), 0 2px 0 rgba(255,255,255,.4); }
  .defeat-banner {
    background: linear-gradient(180deg, #3a1208 0%, #1e0804 60%, #3a1208 100%);
    border-color: #7a4020;
    box-shadow: 0 0 60px rgba(180,60,20,.2);
  }
  .win-banner-inner {
    padding: 20px 60px; display: flex; align-items: center; justify-content: center; flex: 1;
  }
  .win-result-text {
    font-family: 'Cinzel', serif; font-size: 3.8rem; font-weight: 700;
    color: #ffffff; letter-spacing: 14px; text-transform: uppercase;
    text-shadow: 0 0 40px rgba(var(--accent-rgb),.7), 0 2px 0 rgba(0,0,0,.9), 0 4px 16px rgba(0,0,0,.8);
  }
  .win-banner-tassel {
    width: 48px; background: rgba(var(--border-strong-rgb),.15);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  }
  .win-banner-tassel::before {
    content: ''; width: 4px; height: 80%; border-radius: 2px;
    background: linear-gradient(180deg, var(--gold-3), var(--gold-1), var(--gold-3));
  }
  .win-winner {
    font-family: 'Cinzel', serif; font-size: 1.1rem; font-weight: 600;
    letter-spacing: 3px; margin-top: 18px; text-shadow: 0 2px 8px rgba(var(--border-strong-rgb),.3);
  }
  .win-sub { font-size: .8rem; color: var(--text-muted); letter-spacing: 2px; margin-top: 6px; text-transform: uppercase; }
  .win-btn { margin-top: 28px; letter-spacing: 3px; font-family: 'Cinzel', serif; font-size: .9rem; }
  /* Particles */
  .win-particles { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
  .win-particle {
    position: absolute; pointer-events: none;
    animation: winFloat linear infinite;
    opacity: 0;
  }
  @keyframes winFloat {
    0%   { transform: translateY(0) scale(.8); opacity: 0; }
    20%  { opacity: .7; }
    80%  { opacity: .4; }
    100% { transform: translateY(-120px) scale(1.2); opacity: 0; }
  }

  /* ── COLOR PICKER ── */
  /* Cosmic BG (Originkit): der WebGL-Nebel liegt hinter dem Picker. Die
     Screen-Flaeche selbst ist der Nachthimmel — das Canvas malt nur das Licht
     des Nebels darueber (Alpha traegt die Helligkeit, siehe cosmicbg.js). */
  #colorScreen {
    position: relative;
    background:
      radial-gradient(ellipse at 50% 45%, #1a1030 0%, #0a0714 60%, #050309 100%);
    overflow: hidden;
  }
  .cosmic-bg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    display: block;
    z-index: 0;
    pointer-events: none;
  }
  /* prefers-reduced-motion: kein Loop im JS — hier zusaetzlich der ruhende
     Nacht-Himmel ohne Bewegungs-Anteil (der statische Frame bleibt sichtbar). */
  @media (prefers-reduced-motion: reduce) {
    .cosmic-bg { opacity: .85; }
  }
  #colorPicker { position: relative; z-index: 1; background:rgba(var(--surface-panel-rgb), .82); color: var(--text); border:3px solid var(--border); border-radius:16px; padding:28px 36px; max-width:500px; width:100%; text-align:center; box-shadow: var(--elev-3); }
  /* Durchscheinender Picker: der Cosmic-BG-Nebel soll hinter der Karte
     sichtbar bleiben (gleiche Glas-Ebene wie das Hauptmenue). */
  body.dark-mode #colorPicker { background: rgba(var(--surface-panel-rgb), .72); }
  #colorPicker h2 { margin-bottom:20px; color:var(--accent-strong); font-family:'Cinzel',serif; }
  .picker-section { margin-bottom:22px; padding-bottom:20px; border-bottom:1px solid var(--border); }
  .picker-section:last-of-type { border-bottom:none; margin-bottom:0; padding-bottom:0; }
  .picker-label { font-family:'Cinzel',serif; font-size:.68rem; color:var(--accent-strong); text-transform:uppercase; letter-spacing:1.5px; margin-bottom:12px; }
  .color-opts { display:flex; gap:12px; justify-content:center; }
  .color-opt { width:80px; height:80px; border-radius:12px; border:2px solid transparent; cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; font-size:.75rem; font-weight:500; transition:transform .15s, border-color .15s; }
  .color-opt:hover { transform:scale(1.06); }
  .color-opt.picked { border-color:var(--accent-strong); transform:scale(1.06); }
  .color-opt.red  { background:linear-gradient(135deg,#6b0000,#c0392b); color:#fff; }
  .color-opt.blue { background:linear-gradient(135deg,#0a2840,#2471a3); color:#fff; }
  /* Board style preview */
  .board-opts { display:flex; gap:14px; justify-content:center; flex-wrap:wrap; }
  .board-opt { border:2px solid var(--border); border-radius:12px; cursor:pointer; overflow:hidden; transition:border-color .15s, transform .15s; display:flex; flex-direction:column; align-items:center; }
  .board-opt:hover { transform:scale(1.04); border-color:var(--accent-strong); }
  .board-opt.picked { border-color:var(--accent-strong); }
  .board-opt-label { font-size:.68rem; color:var(--text-muted); font-family:'Cinzel',serif; padding:5px 0; }
  .board-opt.picked .board-opt-label { color:var(--accent-strong); }

  /* Vorschau-Thumbnail der gemalten Spielfelderboards in der Brett-Auswahl. */
  .board-opt-thumb { width:86px; height:60px; object-fit:cover; display:block; border-radius:8px 8px 0 0; }

  /* Fraktion in den 1vs1-Einstellungen (ersetzt die alte Farbwahl Rot/Blau).
     Eigene Klasse statt `.faction-opt`, weil die dortige Klasse von run.js'
     updateHeroSelection() gesteuert wird — die beiden Wahlen würden sich kämpfen. */
  .duel-faction-opts { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; }
  .duel-faction-opt {
    width:150px; padding:14px 12px; border-radius:12px; cursor:pointer;
    border:2px solid var(--border); background: var(--surface-subtle);
    text-align:center; transition:border-color .15s, transform .15s, box-shadow .15s;
    display:flex; flex-direction:column; align-items:center; gap:6px;
  }
  .duel-faction-opt:hover { transform:translateY(-2px); border-color:var(--accent-strong); }
  .duel-faction-opt.picked {
    border-color:var(--accent-strong);
    box-shadow:0 0 0 1px var(--accent-strong);
  }
  .duel-faction-portrait {
    width:72px; height:72px; object-fit:cover; border-radius:50%;
    border:2px solid var(--border);
  }
  .duel-faction-opt.picked .duel-faction-portrait { border-color:var(--accent-strong); }
  .duel-faction-name { font-family:'Cinzel',serif; font-size:.9rem; font-weight:600; color:var(--text); }
  .duel-faction-desc { font-size:.68rem; color:var(--text-muted); }

  /* ── THEME PICKER ── */
  .theme-opts { display:flex; gap:12px; justify-content:center; }
  .theme-opt { border:2px solid var(--border); border-radius:12px; cursor:pointer; padding:12px 14px; text-align:center; min-width:108px; transition:border-color .15s, transform .15s; background: var(--surface-subtle); display:flex; flex-direction:column; align-items:center; gap:5px; }
  .theme-opt:hover { transform:scale(1.04); border-color:var(--accent-strong); }
  .theme-opt.picked { border-color:var(--accent-strong); }
  .theme-opt-label { font-family:'Cinzel',serif; font-size:.7rem; color:var(--text-muted); letter-spacing:1px; }
  .theme-opt.picked .theme-opt-label { color:var(--accent-strong); }
  .theme-opt-sub { font-size:.6rem; color:var(--text-muted); }
  .theme-preview-icons { display:flex; gap:4px; align-items:center; justify-content:center; padding:4px 0; }
  .mini-board { display:grid; grid-template-columns:repeat(4,1fr); width:88px; height:88px; }
  .mb-l { background:#c8a96e; }
  .mb-d { background:#6b3f1a; }
  /* Vorschaukachel für das Marmor-Brett im Menü — dieselbe Textur wie im Spiel,
     nur auf 4×4 Felder skaliert statt 8×8. */
  .mini-board.mb-marmor {
    background-image:
      url('assets/ui/textures/board_tile_marble_slate_512.png'),
      repeating-conic-gradient(from 0deg,
        #262019 0% 25%, #1c1712 25% 50%);
    background-size: auto, auto;
    background-repeat: repeat, repeat;
  }

  /* ── BRETT-DESIGN „MARMOR" ──
     Eine einzige Kachel trägt 2×2 Felder samt Gold-Inlay in der Fuge, deshalb
     liegt die Textur auf dem Brett statt auf den einzelnen Zellen: so bleiben
     die Fugen über das ganze Feld durchgehend, statt an jeder Zellgrenze neu
     anzusetzen. Die Zellen selbst werden transparent. */
  #board.board-marmor {
    background-image:
      url('assets/ui/textures/board_tile_marble_slate_512.png'),
      /* Fallback, falls die Marmor-Textur fehlt: ein dunkles 2×2-Schachraster
         in derselben Kachelgröße. Eine background-image-Ebene, deren URL nicht
         lädt, fällt auf die nächste Ebene zurück — das Brett bleibt so auch
         ohne Textur lesbar statt schlicht leer. */
      repeating-conic-gradient(from 0deg,
        #262019 0% 25%, #1c1712 25% 50%);
    background-size: calc(var(--cell) * 2), calc(var(--cell) * 2);
    background-repeat: repeat, repeat;
  }
  #board.board-marmor .cell { background: none; border-color: transparent; }
  /* Die Hervorhebungen müssen auf Marmor kräftiger sein als auf dem flachen
     Holzbrett — die Textur bringt eigene Helligkeitsunterschiede mit. */
  #board.board-marmor .cell.valid-move  { box-shadow: inset 0 0 0 3px rgba(126,200,120,.85); }
  #board.board-marmor .cell.valid-attack { box-shadow: inset 0 0 0 3px rgba(220,70,70,.9); }
  .mb-castle  { background:#38352f; }
  .mb-forest  { background:#1a3010; }
  .mb-grass   { background:#3a5c28; }
  .mb-mtn     { background:#5a5650; }
  .mb-path    { background:#7a6845; }
  .mb-water   { background:#1a2e48; }
  .mb-court   { background:#4c4840; }

  /* ── ALWAYS-ON ZONES ── */
  .cell.turm-block { background: var(--turm-color, rgba(100,80,200,.2)) !important; }
  .cell.turm-block::after { content:'🚫'; position:absolute; bottom:1px; left:2px; font-size:8px; opacity:.45; pointer-events:none; z-index:1; }
  .cell.soldat-zone-friendly { background: rgba(255,140,0,.12) !important; }


  /* ── KING HP DISPLAY ── */
  .king-hp-card { background:var(--surface-panel); border:2px solid var(--border); border-radius:12px; padding:14px 16px; position:relative; overflow:hidden; }
  .king-hp-card .khp-name { font-family:'Cinzel',serif; font-size:.68rem; letter-spacing:1.5px; text-transform:uppercase; opacity:.7; margin-bottom:6px; }
  .king-hp-card .khp-hearts { display:flex; gap:4px; flex-wrap:wrap; margin-bottom:6px; }
  .khp-heart { font-size:1.3rem; line-height:1; transition:transform .2s, opacity .3s; }
  .khp-heart.lost { opacity:.15; transform:scale(.8); }
  .king-hp-card .khp-bar { height:6px; background: var(--border); border-radius:3px; overflow:hidden; margin-top:4px; }
  .khp-bar-fill { height:100%; border-radius:3px; transition:width .4s; }
  .king-hp-card.swimming { animation: kingSwimGlow 3.5s ease-in-out infinite; }
  @keyframes kingSwimGlow {
    0%,100% { border-color: var(--border); }
    50%     { border-color: color-mix(in srgb, var(--king-swim-color, #888) 60%, var(--border)); box-shadow: 0 0 10px 1px color-mix(in srgb, var(--king-swim-color, #888) 20%, transparent); }
  }
  .king-hp-card .khp-swim { display:none; font-size:.7rem; color:var(--accent-strong); margin-top:4px; letter-spacing:.5px; }
  .king-hp-card.swimming .khp-swim { display:block; }

  /* ── ONLINE WAITING ── */
  #waitingOverlay { display:none; position:fixed; top:12px; left:50%; transform:translateX(-50%); z-index:90; pointer-events:none; }
  #waitingOverlay.show { display:block; }
  #waitingBox { background:var(--surface-panel); border:2px solid var(--accent-strong); border-radius:30px; padding:8px 20px; display:flex; align-items:center; gap:10px; white-space:nowrap; backdrop-filter:blur(6px); box-shadow:0 4px 20px rgba(var(--border-strong-rgb),.3); }
  #waitingBox h3 { font-family:'Cinzel',serif; color:var(--accent-strong); font-size:.85rem; margin:0; letter-spacing:.5px; }
  #waitingBox p { color:var(--text-muted); font-size:.75rem; margin:0; display:none; }
  @keyframes waitDot { 0%,100%{opacity:.2} 50%{opacity:1} }
  .wait-dots span { animation:waitDot 1.2s infinite; font-size:1.5rem; color:var(--accent-strong); }
  .wait-dots span:nth-child(2){animation-delay:.2s} .wait-dots span:nth-child(3){animation-delay:.4s}
  #onlineBadge { position:fixed; top:10px; right:14px; background:var(--surface-panel); border:2px solid var(--accent-strong); border-radius:20px; padding:4px 12px; font-size:.72rem; color:var(--accent-strong); font-family:'Cinzel',serif; z-index:80; display:none; }
  #srvSeriesBadge { position:fixed; top:40px; right:14px; background:var(--surface-panel); border:1px solid var(--border); border-radius:20px; padding:3px 12px; font-size:.7rem; color:var(--text); font-family:'Cinzel',serif; z-index:79; display:none; white-space:nowrap; }

  /* ── VERBINDUNGSGÜTE (js/network/session.js) ──
     Der Punkt trägt die Aussage, die Millisekunden sind die Begründung. Klein,
     weil die Leitung im Spiel nie die Hauptinformation ist. */
  .net-quality { display:inline-flex; align-items:center; gap:5px; margin-left:8px; padding-left:8px; border-left:1px solid var(--border); font-size:.66rem; color:var(--text-muted); letter-spacing:0; }
  .net-quality[hidden] { display:none; }
  .net-quality::before { content:''; width:7px; height:7px; border-radius:50%; background:var(--text-muted); flex:0 0 auto; }
  .net-quality--good::before { background:#4caf7d; box-shadow:0 0 6px rgba(76,175,125,.8); }
  .net-quality--fair::before { background:#d9a13b; box-shadow:0 0 6px rgba(217,161,59,.8); }
  .net-quality--poor::before { background:#c0392b; box-shadow:0 0 6px rgba(192,57,43,.8); }

  /* ── WIEDERVERBINDUNG ──
     Blockierendes Overlay, aber ohne Bildschirmwechsel: das Brett bleibt sichtbar,
     damit niemand denkt, die Partie sei verloren. */
  #reconnectOverlay { display:none; position:fixed; inset:0; z-index:95; background:rgba(0,0,0,.45); backdrop-filter:blur(3px); align-items:center; justify-content:center; }
  #reconnectOverlay.show { display:flex; }
  #reconnectBox { background:var(--surface-panel); border:2px solid var(--accent-strong); border-radius:14px; padding:22px 26px; max-width:min(420px,92vw); text-align:center; box-shadow:0 10px 40px rgba(0,0,0,.45); }
  #reconnectBox h3 { font-family:'Cinzel',serif; color:var(--accent-strong); font-size:1rem; letter-spacing:1px; margin:0 0 6px; }
  #reconnectBox p { color:var(--text-muted); font-size:.8rem; margin:0 0 16px; line-height:1.45; }
  .reconnect-dots { display:flex; gap:5px; justify-content:center; margin-bottom:10px; }
  .reconnect-dots span { animation:waitDot 1.2s infinite; color:var(--accent-strong); font-size:1rem; }
  .reconnect-dots span:nth-child(2){ animation-delay:.2s } .reconnect-dots span:nth-child(3){ animation-delay:.4s }
  .reconnect-actions { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
  .reconnect-actions .btn { font-size:.8rem; padding:8px 16px; }
  /* Revanche steht unter „Neues Spiel" — der Abstand kommt aus .win-btn, hier nur
     etwas enger, damit die beiden Knöpfe als Paar lesbar bleiben. */
  .win-btn--rematch { margin-top:12px; }

  /* ── GAME STATUS BAR ── */
  #gameBar { display:none; width:100%; max-width:900px; background:var(--surface-panel); border:2px solid var(--border); border-radius:10px; padding:8px 16px; align-items:center; gap:12px; flex-wrap:wrap; justify-content:space-between; }
  #gameBar.show { display:flex; }
  .gb-player { display:flex; align-items:center; gap:8px; font-weight:600; font-size:.95rem; padding:4px 12px; border-radius:20px; }
  .gb-phase { font-family:'Cinzel',serif; font-size:.8rem; letter-spacing:1px; color:var(--text-muted); padding:4px 12px; border:1px solid var(--border); border-radius:20px; }
  .gb-phase.attack { color:var(--danger); border-color:rgba(var(--danger-rgb),.35); background:rgba(var(--danger-rgb),.08); }
  .gb-steps { display:flex; align-items:center; gap:6px; font-size:.85rem; color:var(--text-muted); }
  .gb-steps .steps-val { font-family:'Cinzel',serif; font-size:1.4rem; font-weight:700; color:var(--accent-strong); min-width:28px; text-align:center; }
  .gb-steps .steps-val.zero { color:var(--text-muted); }
  .gb-turn { font-size:.72rem; color:var(--text-muted); font-family:'Cinzel',serif; letter-spacing:.5px; }
  .gb-piececount { font-size:.72rem; color:var(--text-muted); padding:3px 8px; border-radius:10px; background: var(--surface-subtle); }
  /* Primary action buttons — gold + subtle pulse */
  #btnEndPhase.primary-action,
  #btnRollMove.primary-action {
    background: var(--accent) !important; color: var(--on-accent) !important;
    border-color: var(--accent-strong) !important; font-weight: 600;
    animation: primaryGlow 2.6s ease-in-out infinite;
  }
  @keyframes primaryGlow {
    0%, 100% { box-shadow: 0 2px 12px rgba(var(--accent-strong-rgb),.3); }
    50% { box-shadow: 0 4px 22px rgba(var(--accent-strong-rgb),.55), 0 0 0 2px rgba(var(--accent-strong-rgb),.18); }
  }

  /* ── RESPONSIVE ── */
  /* Schmale Fenster: die drei Spalten stapeln sich, das Brett bleibt oben.
     Die Zellgroesse regelt --cell selbst, deshalb keine festen Pixelwerte mehr. */
  /* ZWEI Breakpoints statt einem: schmale Fenster unter 1200 px stapeln die
     Seitenspalten knapper und lassen die Mitte atmen; unter 900 px geht alles
     einspaltig (wie vorher). So bleibt das Drei-Spalten-Brett auf 1366×768
     und 1440×900 nutzbar, statt abrupt zu kollabieren. */
  @media (max-width: 1200px) {
    /* Spalten schmaler als auf großen Displays, damit die Mitte genug Platz
       für das Brett behält — bei 1366×768 steht der Mitte damit ~700 px statt
       ~580 px zur Verfügung. */
    #game.active {
      grid-template-columns: clamp(220px, 17vw, 280px) minmax(0, 1fr) clamp(220px, 17vw, 280px);
    }
    /* Etwas kompaktere Seitenspalten-Panel-Typografie auf schmalen Displays. */
    .panel { padding: 7px 9px; }
    #myHandRow {
      min-height: 150px;
      max-height: min(190px, 22vh);
    }
    #cardRow { min-height: 178px; }
    #myHand  { min-height: 178px; }
  }

  @media (max-width: 900px) {
    /* Ein Landscape-Spieltisch passt im Hochformat nicht auf einen Schirm.
       Statt alles zusammenzuquetschen: eine Spalte, natürlicher Fluss, Seite
       scrollt. Die feste 100vh-Höhe muss dafür weg — sonst bekommt die
       1fr-Zeile mit dem Brett null Höhe und der Inhalt läuft sichtbar über. */
    #game.active {
      grid-template-columns: minmax(0, 1fr);
      grid-template-rows: none;
      height: auto; max-height: none; min-height: 100vh;
      overflow: visible;
    }
    #centerCol { grid-template-rows: auto; }
    /* Explizite Platzierung aufheben — im Hochformat stapelt sich alles.
       #myHandRow muss hier mit aufgeführt sein, sonst bliebe es auf der
       Desktop-Zuweisung (Spalte 2/4, Zeile 3) sitzen und liefe aus dem
       einspaltigen Raster heraus. */
    #tutorialHUD, #leftPanel, #centerCol, #rightPanel, #myHandRow { grid-column: 1; grid-row: auto; }
    #tutorialHUD { order: 0; }
    #centerCol  { order: 1; }
    #myHandRow  { order: 2; }
    #rightPanel { order: 3; }
    #leftPanel  { order: 4; }
    /* Im Hochformat gehört die Vorschau (inzwischen ein Kind der rechten
       Spalte) in den normalen Fluss: sie darf beliebig hoch werden und muss
       nicht mehr in eine Rasterzelle passen — die Seite scrollt ohnehin. */
    #unitCard {
      position: static; width: 100%; max-height: none; min-height: 320px;
      overflow: hidden; box-shadow: none;
      height: auto; flex: 1 1 320px;
    }
    /* Im Hochformat hat #unitCard keine 1fr-Höhe mehr (height:auto), der
       Tilt-Wrapper (height:100%) bekäme also keine Höhe — deshalb auch hier
       eine feste Höhe, damit Flip und Tilt gleich groß bleiben. */
    #unitCard .unit-card-tilt,
    #unitCard .unit-card-flip { height: 320px; }
    #leftPanel, #rightPanel {
      flex-direction: row; flex-wrap: wrap; align-items: flex-start; overflow: visible;
    }
    #leftPanel > *, #rightPanel > * { flex: 1 1 220px; }
    #myIdentity { margin-top: 0; }
    #boardWrap  { --cell: clamp(30px, min(9vw, 44px), 74px); }
    /* Größen-Containment hier wieder aufheben. Im Desktop-Raster bekommt
       #boardArea seine Höhe aus der 1fr-Zeile, das Containment schneidet nur
       die Rückkopplung ab. Im Hochformat stehen die Zeilen aber auf `auto` —
       dort müsste die Höhe aus dem Inhalt kommen, und genau die blendet
       `container-type: size` aus. Das Brett fiele sonst auf Höhe 0 zusammen.
       Die vw-Formel darüber braucht ohnehin keine Container-Einheiten. */
    #boardArea  { container-type: normal; }
  }

  /* Sprungziel für die Unterstützung — bewusst anders als ein normaler Zug:
     ein Klick hierhin bewegt die ausgewählte Figur, statt den Knappen
     auszuwählen. Ohne sichtbaren Unterschied wäre das eine böse Überraschung. */
  .cell.valid-support::after {
    content: '⚑'; position: absolute; inset: 0; z-index: 3;
    display: flex; align-items: center; justify-content: center;
    font-size: calc(var(--cell) * .34); color: var(--accent-strong);
    text-shadow: 0 1px 3px rgba(0,0,0,.7); pointer-events: none;
  }
  .cell.valid-support {
    box-shadow: inset 0 0 0 3px var(--accent-strong);
  }

  /* ═══════════════════════════════════════════════════
     SPIELHINTERGRUND — optional, per Datei zuschaltbar
     ═══════════════════════════════════════════════════
     Ablegen unter assets/ui/backgrounds/game-background-marble.jpg — mehr ist nicht zu
     tun, das Bild erscheint beim nächsten Laden. Fehlt die Datei, bleibt alles
     wie bisher: es gibt keinen Platzhalter und nichts verschiebt sich, weil das
     Bild auf einer eigenen Ebene HINTER dem Layout liegt und nichts umfließt.
     (Die Konsole meldet dann einen 404 für die fehlende Datei — harmlos, aber
     erklärt, falls jemand ihn sieht.)

     Anderer Dateiname oder abschalten: nur --game-bg unten ändern bzw. auf
     `none` setzen.

     Die Panele werden dabei leicht durchscheinend (--glass-bg), damit der
     Hintergrund spürbar ist, ohne dass Text darüber schlechter lesbar wird.
     Das ist dieselbe Glas-Ebene, die schon das Hauptmenü nutzt. */
  :root { --game-bg: url('assets/ui/backgrounds/game-background-marble.jpg'); }
  /* Tageszeit der Partie (Prompt 18). ui.js/applyMatchBackground() setzt die
     Klasse auf <html> — sie MUSS dort sitzen und nicht auf <body>, weil
     --game-bg an :root hängt und initGameBackground() die Variable von
     documentElement liest. Fehlt eine der drei Dateien, bleibt has-game-bg aus
     und die Panele bleiben deckend; bis dahin ändert sich also nichts. */
  html.bg-morning { --game-bg: url('assets/ui/backgrounds/game-background-morning.jpg'); }
  html.bg-dusk    { --game-bg: url('assets/ui/backgrounds/game-background-dusk.jpg'); }
  /* Die Nacht ist das vorhandene Bild: der Eichentisch ist ohnehin nur von einer
     Kerze beleuchtet. Kein eigenes File, keine Kopie — es fehlen also nur die
     zwei Umlichtungen Morgen und Dämmerung (Prompt 18). */
  html.bg-night   { --game-bg: url('assets/ui/backgrounds/game-background-marble.jpg'); }

  #game.active { position: relative; }
  #game.active::before {
    content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
    background-image: var(--game-bg);
    background-size: cover; background-position: center;
    background-repeat: no-repeat;
  }
  /* Kein Abdunklungs-Schleier über dem Spielhintergrund mehr: das Bild bleibt
     ungetrübt sichtbar. Die Lesbarkeit trägt allein die durchscheinenden
     Panele. */

  /* Bei Spielhintergrund-Bild: Flächen leicht durchscheinend (deckend genug
     für Lesbarkeit). Kein backdrop-filter hier — erzeugt einen neuen
     Stacking-Kontext und kann Click-Events auf den Figuren blockieren. */
  body.has-game-bg .panel,
  body.has-game-bg .hand-row,
  body.has-game-bg .unit-card,
  body.has-game-bg #tutorialHUD {
    background-color: rgba(var(--surface-panel-rgb), .75);
  }

  /* ── ONLINE-MENÜ: Spielhintergrund pro Brett ──
     Dasselbe --game-bg wie im Spiel: Wählt man im Online-Menü ein Brett,
     aktualisiert pickBoard() → applyBoardBackground() die Variable. Hier zeichnet
     sie den passenden Hintergrund hinter dem Modal; ein Schleier hält den Text
     lesbar. Das Modal wird leicht durchscheinend, damit das Bild durchscheint. */
  #onlineScreen { position: relative; }
  #onlineScreen::before {
    content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
    background-image: var(--game-bg);
    background-size: cover; background-position: center; background-repeat: no-repeat;
  }
  #onlineScreen::after {
    content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(10,8,4,.18) 0%, rgba(10,8,4,.66) 100%);
  }
  #onlineModal {
    background: rgba(var(--surface-panel-rgb), .82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  /* ═══════════════════════════════════════════════════
     MATERIAL-EBENE — Styleguide §4 und §7
     Die vier Texturen aus 02_Design_UI/textures lagen bisher ungenutzt herum,
     obwohl der Styleguide ihnen bereits Flächen zugewiesen hatte. Sie liegen
     hier ÜBER der Token-Farbe, nicht statt ihr: `background-color` bleibt
     var(--surface-panel), die Textur mischt sich nur ein. Damit funktioniert
     der Hell-/Dunkelmodus unverändert weiter und die Tokens bleiben die
     Farbquelle — es kommt nur Materialität dazu.

     Bewusst zurückhaltend dosiert. Ziel ist gemaltes Holz und Pergament, das
     man bemerkt, wenn man hinsieht — kein Textur-Teppich, der den Text
     schlechter lesbar macht.
     ═══════════════════════════════════════════════════ */
  .panel, .hand-row, .unit-card, #tutorialHUD {
    background-size: auto;
    background-repeat: repeat;
  }
  /* Dunkelmodus bekommt Holz statt Pergament. soft-light statt multiply, weil
     multiply auf dunklem Grund nur matschig wird — soft-light legt die Maserung
     als Helligkeitsspiel darüber und lässt die Fläche dunkel. */
  body.dark-mode .panel,
  body.dark-mode .hand-row,
  body.dark-mode .unit-card,
  body.dark-mode #tutorialHUD {
    background-size: auto;
    background-repeat: repeat;
    background-blend-mode: soft-light;
  }

  /* ═══════════════════════════════════════════════════
     BARRIEREFREIHEIT
     ═══════════════════════════════════════════════════ */

  /* Der Tastaturfokus auf dem Brett muss über jedem Feldmuster und über jeder
     Zug-Hervorhebung erkennbar bleiben — deshalb doppelter Ring in Gold und
     Dunkel statt eines einzelnen Outlines, das auf hellem Marmor verschwände. */
  #board .cell:focus { outline: none; }
  #board .cell:focus-visible {
    outline: none;
    box-shadow:
      inset 0 0 0 3px var(--accent-strong),
      inset 0 0 0 5px rgba(var(--border-strong-rgb), .85);
    z-index: 5;
  }

  /* Nur für Screenreader — sichtbar für niemanden, vorgelesen für alle,
     die darauf angewiesen sind. */
  .visually-hidden {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    clip: rect(0 0 0 0); clip-path: inset(50%);
    overflow: hidden; white-space: nowrap;
  }

  /* ── BEWEGUNG REDUZIEREN ──
     Zwölf Animationen liefen dauerhaft: pulsende Auren, wanderndes Fackellicht,
     schlagende Punkte, der Airdrop-Kasten. Für Menschen mit vestibulären
     Beschwerden ist das keine Zier, sondern ein Grund, das Spiel zu schließen.
     Einmalige Übergänge (Würfelwurf, Kartenflug) bleiben — sie tragen
     Information und dauern Millisekunden. Abgeschaltet wird, was ohne Ende
     weiterläuft. */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: .01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: .01ms !important;
      scroll-behavior: auto !important;
    }
    /* Was nur durch Bewegung erkennbar war, braucht einen ruhenden Ersatz. */
    .cell.airdrop-field::after { animation: none; transform: translate(-50%, -50%) scale(1.1); }
    .airdrop-pip.is-pulse      { box-shadow: 0 0 0 3px rgba(var(--accent-strong-rgb), .45); }
    .thud-dot.current          { box-shadow: 0 0 0 3px rgba(var(--accent-strong-rgb), .5); }
    #btnEndPhase.primary-action, #btnRollMove.primary-action {
      box-shadow: 0 0 0 2px var(--accent-strong), 0 2px 12px rgba(var(--accent-strong-rgb), .4);
    }
    .piece.attackable { outline-width: 3px; }
  }

  /* Zug beenden, obwohl noch Schritte übrig sind: gedämpfte Warnfarbe statt
     eines Dialogs. Wer bewusst beenden will, klickt einfach weiter. */
  #btnEndPhase.will-waste {
    border-color: var(--danger);
    color: var(--danger);
    font-size: .68rem;
  }

  /* ── SELECTED INFO EMPTY STATE ── */
  .info-empty { color: var(--text-muted); font-size: .8rem; font-style: italic; }
  .combat-hint { color: var(--text-muted); font-size: .82rem; font-style: italic; }
  /* Hinweis statt „Weiter"-Knopf: Das Ergebnis bleibt stehen, bis der nächste
     Kampf beginnt, die Phase endet oder das Brett angeklickt wird. */
  .combat-continue { display: block; margin-top: 6px; color: var(--text-muted); font-size: .68rem; font-style: italic; line-height: 1.35; }
  /* Kampf-Overlay: standen alle als feste Hex-Werte im JavaScript. */
  .combat-winner { font-size: 1.1rem; }
  .combat-detail { color: var(--text-muted); font-size: .85rem; }
  .combat-bonus-chip {
    display: inline-block; margin: 2px 3px 0 0; padding: 1px 6px;
    border-radius: 5px; font-size: .68rem; line-height: 1.35;
    background: rgba(var(--accent-strong-rgb), .14);
    border: 1px solid rgba(var(--accent-strong-rgb), .35);
    color: var(--accent-strong); font-weight: 600;
  }
  .tooltip-warn  { color: var(--danger); margin-top: 4px; }

  /* Attackable piece highlight — pulsing red ring with stronger visibility */
  .piece.attackable {
    outline: 2.5px solid rgba(220,60,60,.95);
    outline-offset: 2px;
    animation: attackPulse 1.1s ease-in-out infinite;
    filter: brightness(1.1);
  }
  @keyframes attackPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(220,60,60,.25), 0 0 10px rgba(220,60,60,.35); }
    50%       { box-shadow: 0 0 0 5px rgba(220,60,60,.15), 0 0 20px rgba(220,60,60,.55); }
  }

  /* Cancel attack button */
  /* Abbrechen ist der Nebenweg: eine leise Textzeile, kein zweiter Knopf, der
     mit „Würfeln" um Aufmerksamkeit streitet. */
  #btnCancelAttack {
    display: none; margin-top: 5px; width: 100%; padding: 3px 0;
    background: transparent; color: var(--text-muted); border: none;
    font-size: .7rem; cursor: pointer; transition: color .15s;
  }
  #btnCancelAttack:hover { color: var(--danger); }

  /* ── DARK MODE EXCEPTIONS ──
     Every other component in this file recolors purely by reading the
     --tokens redefined in body.dark-mode above — no per-component override
     needed. These two are the ONLY exceptions, and they're exceptions on
     purpose: each is genuinely different ARTWORK per theme (a different
     gradient pattern / different hue entirely), not a plain recolor that
     a token swap could express. If you find yourself adding a third
     `body.dark-mode .foo {}` block below, that's a signal to add a token
     to the palette instead — see the big comment at the top of the file. */
  body.dark-mode .facedown-card {
    background: repeating-linear-gradient(45deg, transparent, transparent 3px, rgba(100,80,160,.06) 3px, rgba(100,80,160,.06) 6px), linear-gradient(145deg, #1e1832 0%, #0d0c18 100%);
    border-color: #3a3060;
  }
  body.dark-mode .facedown-card::before { border-color: #2a2444; }
  body.dark-mode .facedown-card::after { color: var(--accent); opacity: .1; }
  body.dark-mode .victory-banner {
    background: linear-gradient(180deg, #1e3a6a 0%, #0f2040 60%, #1e3a6a 100%);
  }
  body.dark-mode .victory-banner .win-result-text {
    color: #ffffff; text-shadow: 0 0 40px rgba(var(--accent-rgb),.7), 0 2px 0 rgba(0,0,0,.9), 0 4px 16px rgba(0,0,0,.8);
  }

  /* ═══════════════════════════════════════════════════
     UI ART PACK OVERLAYS — painted board & chrome art
     ═══════════════════════════════════════════════════
     Every rule here is gated on an `ui-has-*` class that js/uiassets.js
     puts on <html> only after it has confirmed the file actually loads.
     Nothing below applies on a fresh checkout; drop a PNG into
     assets/ui/painted/ and its rule switches on by itself. Removing the
     file switches it back off. See assets/ui/README.md for the file list.

     Where an overlay replaces a built-in indicator (the filter tints and
     the 🚫/⚠ emoji markers on blocked and taunted tiles), the same gated
     block also switches that indicator OFF — otherwise the board would
     signal the same state twice. */

  /* ── Painted board ────────────────────────────────
     One image under all 64 cells. The cells go transparent so the painting
     shows through — same trick as #board.board-marmor, but a whole board
     instead of a repeating 2x2 tile. Highlights need to be stronger on a
     painted ground, for the same reason they are on marble. */
  /* Gatter ist die Klasse `.board-vollbild`, die renderBoard() nur setzt, wenn es
     ein gemaltes Brett für die AKTUELLE Kantenlänge gibt — `board-full` für 8×8,
     `board-full-5` für 5×5 und so weiter (js/uiassets.js). Welches Bild es ist,
     steht in --board-vollbild-bild, ebenfalls von renderBoard() gesetzt.

     Vorher hing die Regel allein an `html.ui-has-board-full`. Damit wurde das
     8×8-Gemälde per `background-size: 100% 100%` über JEDES Brett gezogen — auf
     dem 5×5 des Roguelike lagen die gemalten Felder dann nicht mehr auf den
     echten. */
  #board.board-vollbild {
    background-image: var(--board-vollbild-bild);
    background-size: 100% 100%;
  }
  #board.board-vollbild .cell { background: none; border-color: transparent; }
  #board.board-vollbild .cell.valid-move   { box-shadow: inset 0 0 0 3px rgba(126,200,120,.85); }
  #board.board-vollbild .cell.valid-attack { box-shadow: inset 0 0 0 3px rgba(220,70,70,.9); }

  /* ── Board tile overlays ──────────────────────────
     All three sit on .cell::before (unused elsewhere) at z-index 2:
     above the terrain and its decorations, below the piece (z-index 5+).
     The art has a transparent centre by design ("Kachel-Vertrag"), so the
     tile underneath stays visible and the piece reads on top of it. */
  .cell.center::before,
  .cell.turm-block::before,
  .cell.soldat-zone::before,
  .cell.soldat-zone-friendly::before {
    content: none;                 /* replaced per-state in the blocks below */
    position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background-size: 100% 100%; background-repeat: no-repeat;
  }

  /* Mittelfeld — one tile, rotated per position so the four quarter
     rosettes meet at the crossing point. --center-rot is set in render.js. */
  .ui-has-tile-center-idle .cell.center::before {
    content: ''; background-image: var(--ui-tile-center-idle);
    transform: rotate(var(--center-rot, 0deg));
  }
  .ui-has-tile-center-active .cell.center.center-active::before {
    content: ''; background-image: var(--ui-tile-center-active);
  }
  .ui-has-tile-center-full .cell.center.center-full::before {
    content: ''; background-image: var(--ui-tile-center-full);
  }
  /* The painted frame carries the emphasis — drop the built-in inset ring. */
  .ui-has-tile-center-idle .cell.center { box-shadow: none; }

  /* Turm-Sperrzone — filed by display color of the blocking Turm's owner. */
  /* Beide Overlays sind seit der zweiten Fassung gerichtet: das Motiv sitzt an
     der Oberkante und zeigt zur verursachenden Figur — beim Turm das
     Mauerstück, beim Soldaten der Zughaken. render.js liefert die Drehung. */
  .ui-has-tile-block-red .cell.turm-block.block-red::before {
    content: ''; background-image: var(--ui-tile-block-red);
    transform: rotate(var(--block-rot, 0deg));
  }
  .ui-has-tile-block-blue .cell.turm-block.block-blue::before {
    content: ''; background-image: var(--ui-tile-block-blue);
    transform: rotate(var(--block-rot, 0deg));
  }
  .ui-has-tile-block-red .cell.turm-block.block-red,
  .ui-has-tile-block-blue .cell.turm-block.block-blue {
    filter: none !important; background: transparent !important;
  }
  .ui-has-tile-block-red .cell.turm-block.block-red::after,
  .ui-has-tile-block-blue .cell.turm-block.block-blue::after { content: none; }

  /* Soldat-Taunt — filed by display color of the taunting Soldat. */
  /* Gilt für beide Zonen — die gegnerische wie die eigene. Unterschieden
     werden sie über die Farbe des Soldaten und die Deckkraft weiter unten. */
  .ui-has-tile-taunt-red .cell.taunt-red::before {
    content: ''; background-image: var(--ui-tile-taunt-red);
    transform: rotate(var(--taunt-rot, 0deg));
  }
  .ui-has-tile-taunt-blue .cell.taunt-blue::before {
    content: ''; background-image: var(--ui-tile-taunt-blue);
    transform: rotate(var(--taunt-rot, 0deg));
  }
  /* Die eigene Zone ist Information, keine Warnung: dieselbe Grafik, aber
     zurückgenommen, damit die gegnerische Zone im Blick zuerst auffällt. */
  .ui-has-tile-taunt-red .cell.soldat-zone-friendly.taunt-red::before,
  .ui-has-tile-taunt-blue .cell.soldat-zone-friendly.taunt-blue::before { opacity: .55; }
  /* Wo die Grafik greift, weichen der alte Farbfilter und das ⚠-Zeichen. */
  .ui-has-tile-taunt-red .cell.taunt-red,
  .ui-has-tile-taunt-blue .cell.taunt-blue { filter: none !important; background: none !important; }
  .ui-has-tile-taunt-red .cell.taunt-red::after,
  .ui-has-tile-taunt-blue .cell.taunt-blue::after { content: none; }

  /* ── Königs-Aura · Spawnfeld · Airdrop (Serie 3, Prompt 14–16) ──
     Aura und Spawnfeld sind nach ANZEIGEfarbe abgelegt (render.js), das
     Airdrop-Feld ist neutral und hat nur eine Fassung.

     Die Aura nutzt ihr vorhandenes ::before, bleibt aber auf z-index 1: sie ist
     Boden. Wo ein Feld gleichzeitig Sperrzone oder Mittelfeld ist, soll die
     stärkere Aussage obenauf liegen. Der pulsierende Farbschleier weicht der
     Grafik — ein Puls auf gemaltem Stein sähe nach Fehler aus. */
  .ui-has-tile-aura-blue .cell.aura-blue::before,
  .ui-has-tile-aura-red  .cell.aura-red::before {
    background-size: 100% 100%; background-repeat: no-repeat;
    opacity: 1; animation: none;
  }
  .ui-has-tile-aura-blue .cell.aura-blue::before { background-image: var(--ui-tile-aura-blue); }
  .ui-has-tile-aura-red  .cell.aura-red::before  { background-image: var(--ui-tile-aura-red); }

  /* Spawnfeld hatte bisher nur den Inset-Ring und braucht daher ein eigenes
     ::before. Der Ring weicht der Grafik; das Terrain-Dorf darunter bleibt. */
  .ui-has-tile-spawn-blue .cell.spawn-blue::before,
  .ui-has-tile-spawn-red  .cell.spawn-red::before {
    content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background-size: 100% 100%; background-repeat: no-repeat;
  }
  .ui-has-tile-spawn-blue .cell.spawn-blue::before { background-image: var(--ui-tile-spawn-blue); }
  .ui-has-tile-spawn-red  .cell.spawn-red::before  { background-image: var(--ui-tile-spawn-red); }

  /* Marsch-Ziel — das Ziel-Emblem (march-goal.png) hat nur eine neutrale Fassung.
     Wie Spawn ein eigenes ::before mit z-index über dem Brett, damit die Figur
     beim Betreten des Ziels weiterhin über dem Emblem steht. */
  .ui-has-tile-march-goal .cell.march-goal::before {
    content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background-size: 100% 100%; background-repeat: no-repeat;
    background-image: var(--ui-tile-march-goal);
  }
  .ui-has-tile-spawn-blue .cell.spawn-blue,
  .ui-has-tile-spawn-red  .cell.spawn-red { box-shadow: none; }

  /* Airdrop: die gemalte Kiste ersetzt das 📦 auf ::after, samt Hüpfen. Diese
     Kachel darf ihre Mitte nutzen — game.js legt sie nur auf freie Felder und
     löscht sie beim Betreten, sie liegt also nie unter einer Figur. Der goldene
     Inset-Ring bleibt bewusst stehen: er ist der Bonus-Farbcode und trägt die
     Lesbarkeit bei kleiner Zelle. Wirkt er neben der Goldkante der Grafik
     doppelt, ist er eine Zeile weiter unten abzuschalten. */
  .ui-has-tile-airdrop .cell.airdrop-field::after {
    content: ''; top: 0; left: 0; right: 0; bottom: 0;
    transform: none; animation: none;
    background-image: var(--ui-tile-airdrop);
    background-size: 100% 100%; background-repeat: no-repeat;
  }
  /* Abwurf: die Kiste fällt herein, statt einfach dazuliegen. Nur beim ersten
     Rendern des Feldes — render.js setzt .airdrop-neu genau dann (die Zelle wird
     bei jedem Rendern neu erzeugt, sonst fiele sie endlos).
     Als CSS-Keyframe und nicht als Tween: die Animation hängt an keinem Ablauf,
     und die Reduced-Motion-Query oben greift hier von selbst. */
  @keyframes airdropAbwurf {
    0%   { transform: translateY(-150%) scale(.65); opacity: 0; }
    65%  { transform: translateY(0) scale(1.08); opacity: 1; }
    82%  { transform: translateY(0) scale(.96); }
    100% { transform: translateY(0) scale(1); opacity: 1; }
  }
  .ui-has-tile-airdrop .cell.airdrop-field.airdrop-neu::after {
    animation: airdropAbwurf .55s cubic-bezier(.3, 1.15, .6, 1) both;
  }

  /* Thronfeld (Prompt 19) — eigenes ::before wie beim Spawnfeld. Der König steht
     permanent darauf: die Kachel wirkt ausschließlich über ihr Randband, die
     Mitte ist im Spiel immer von seinem Chip verdeckt. */
  .ui-has-tile-throne-blue .cell.throne-blue::before,
  .ui-has-tile-throne-red  .cell.throne-red::before {
    content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background-size: 100% 100%; background-repeat: no-repeat;
  }
  .ui-has-tile-throne-blue .cell.throne-blue::before { background-image: var(--ui-tile-throne-blue); }
  .ui-has-tile-throne-red  .cell.throne-red::before  { background-image: var(--ui-tile-throne-red); }

  /* ── Würfelaugen (Prompt 17) ──────────────────────
     Gilt für den Bewegungswürfel (#moveDie) und die beiden Kampfwürfel — beide
     tragen .die, helpers.js/setDieFace() setzt die Face-Klasse.

     Die Zahl bleibt im DOM: sie ist der Fallback ohne Grafik und das, was ein
     Screenreader vorliest. Hier wird sie nur optisch unsichtbar. Werte über 6
     (Kampf-Boni, Lauf-Karten mit +8) bekommen von setDieFace keine Face-Klasse
     und zeigen deshalb weiter die Zahl — dafür gibt es keine Würfelseite.

     Panel-Hintergrund, Rahmen und Schatten der gezeichneten Würfel weichen: die
     gemalte Seite IST der Würfel und braucht keinen Kasten drumherum. */
  .ui-has-die-1 .die.die-face-1, .ui-has-die-2 .die.die-face-2,
  .ui-has-die-3 .die.die-face-3, .ui-has-die-4 .die.die-face-4,
  .ui-has-die-5 .die.die-face-5, .ui-has-die-6 .die.die-face-6 {
    color: transparent;
    background-color: transparent; border-color: transparent; box-shadow: none;
    /* Die gemalte Seite (die-*.png) ist quadratisch und hat ihre Ecken im Bild
       selbst. Der runde .die-Chip (border-radius:50%) würde sie beschnitten.
       Deshalb hier auf 0, damit die Grafik unbeschnitten dargestellt wird. */
    border-radius: 0;
    background-repeat: no-repeat; background-position: center;
    background-size: contain;
  }
  .ui-has-die-1 .die.die-face-1 { background-image: var(--ui-die-1); }
  .ui-has-die-2 .die.die-face-2 { background-image: var(--ui-die-2); }
  .ui-has-die-3 .die.die-face-3 { background-image: var(--ui-die-3); }
  .ui-has-die-4 .die.die-face-4 { background-image: var(--ui-die-4); }
  .ui-has-die-5 .die.die-face-5 { background-image: var(--ui-die-5); }
  .ui-has-die-6 .die.die-face-6 { background-image: var(--ui-die-6); }

  /* ── Draw pile ────────────────────────────────────
     The built-in .deck-stack is three stacked <span>s. When deck art
     exists it becomes a single image instead; the spans are hidden. */
  .deck-stack.deck-full, .deck-stack.deck-half,
  .deck-stack.deck-last, .deck-stack.deck-shuffle {
    background-size: contain; background-repeat: no-repeat; background-position: center;
  }
  .ui-has-deck-full    .deck-stack.deck-full    { background-image: var(--ui-deck-full); }
  .ui-has-deck-half    .deck-stack.deck-half    { background-image: var(--ui-deck-half); }
  .ui-has-deck-last    .deck-stack.deck-last    { background-image: var(--ui-deck-last); }
  .ui-has-deck-shuffle .deck-stack.deck-shuffle { background-image: var(--ui-deck-shuffle); }
  .ui-has-deck-full    .deck-stack.deck-full span,
  .ui-has-deck-half    .deck-stack.deck-half span,
  .ui-has-deck-last    .deck-stack.deck-last span,
  .ui-has-deck-shuffle .deck-stack.deck-shuffle span { display: none; }

  /* ── Chrome ───────────────────────────────────────
     border-image keeps the carved frame crisp at any panel size — the
     four corners stay unscaled, only the edges stretch. The 34%/34px
     slice assumes the ornament sits in the outer third of the source
     image; adjust the slice if your panel art uses a wider border. */
  .ui-has-chrome-panel .panel {
    border-image: var(--ui-chrome-panel) 34% / 34px / 0 stretch;
    border-width: 34px; border-style: solid;
  }
  /* html… — needs to outrank `body.dark-mode .ribbon-banner`, which paints
     its own gradient background and would otherwise win on specificity. */
  html.ui-has-chrome-banner .ribbon-banner {
    background-image: var(--ui-chrome-banner);
    background-size: 100% 100%; background-repeat: no-repeat;
    background-color: transparent; border: none;
  }
  .ui-has-chrome-combat #combatBox {
    border-image: var(--ui-chrome-combat) 30% / 40px / 0 stretch;
    border-width: 40px; border-style: solid;
    background-color: transparent; border-radius: 0; box-shadow: none;
  }
  /* Outcome variants: combat.js does not set these classes yet — add
     .combat-win / .combat-lose on #combatBox when the result is known and
     these take over. Until then only the neutral frame above is used. */
  .ui-has-chrome-combat-win #combatBox.combat-win {
    border-image: var(--ui-chrome-combat-win) 30% / 40px / 0 stretch;
  }
  .ui-has-chrome-combat-lose #combatBox.combat-lose {
    border-image: var(--ui-chrome-combat-lose) 30% / 40px / 0 stretch;
  }

  /* ── Cards ────────────────────────────────────────
     The frame gets its OWN element (.card-frame, always rendered, hidden
     until art exists) rather than ::after — because .card.phase-locked::after
     is already the ✕ lock badge on upgrade cards, and a frame rule there
     would outrank it and swallow that signal. Lauf-Karten art sits behind
     the text on ::before (unused), dimmed so rank and label stay readable. */
  .card-frame { display: none; }
  .ui-has-card-frame-red  .card.cardframe-red  > .card-frame,
  .ui-has-card-frame-blue .card.cardframe-blue > .card-frame,
  .ui-has-card-frame-move   .card.cardframe-typ-move   > .card-frame,
  .ui-has-card-frame-effect .card.cardframe-typ-effect > .card-frame,
  .ui-has-card-frame-hero   .card.cardframe-typ-hero   > .card-frame {
    display: block; position: absolute; inset: 0; z-index: 3; pointer-events: none;
    background-size: 100% 100%; background-repeat: no-repeat;
  }
  .ui-has-card-frame-red  .card.cardframe-red  > .card-frame { background-image: var(--ui-card-frame-red); }
  .ui-has-card-frame-blue .card.cardframe-blue > .card-frame { background-image: var(--ui-card-frame-blue); }
  .ui-has-card-frame-move   .card.cardframe-typ-move   > .card-frame { background-image: var(--ui-card-frame-move); }
  .ui-has-card-frame-effect .card.cardframe-typ-effect > .card-frame { background-image: var(--ui-card-frame-effect); }
  .ui-has-card-frame-hero   .card.cardframe-typ-hero   > .card-frame { background-image: var(--ui-card-frame-hero); }

  /* Gwent-Layout: das Bild trägt die Karte, nicht mehr ein Emoji in der
     Mitte. Es füllt die Karte randlos; der Name sitzt unten auf einem
     dunklen Verlauf, damit er auf jedem Motiv lesbar bleibt. Greift nur
     bei .has-art (render.js setzt das, wenn die Datei geladen hat) — ohne
     Grafik bleibt die Karte beim Emoji-Layout. */
  .card[class*="cardart-"]::before {
    content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background-size: cover; background-position: center 35%;
    opacity: .55; border-radius: inherit;
  }
  /* Figuren sind freigestellt und sollen nicht angeschnitten werden — anders
     als die Lauf-Landschaften, die als Vollbild wirken. Deshalb `contain`
     statt `cover`, unten ausgerichtet, damit die Figur im Fenster steht statt
     zu schweben. Wirken die Figuren zu klein oder zu hoch: das sind die zwei
     Werte, an denen man dreht. */
  .card[class*="cardart-unit-"]::before {
    background-size: contain; background-position: center bottom;
  }
  /* Rückfall auf ein Figuren-Portrait: das ist ein vollflächiges Bild, kein
     freigestelltes Motiv — es soll das Fenster füllen statt darin zu stehen.
     Deshalb wieder `cover`, und der Bildausschnitt liegt oben, wo bei einem
     Portrait das Gesicht sitzt. Kommt später eine freigestellte Figur nach
     cards/units/, greift automatisch wieder die Regel darüber. */
  .card.art-portrait::before {
    background-image: var(--card-art-fb);
    background-size: cover; background-position: center 18%;
  }
  .card.has-art { justify-content: flex-end; padding-top: 0; overflow: hidden; }
  .card.has-art::before { opacity: 1; }
  .card.has-art .cicon { display: none; }
  .card.has-art .clabel {
    position: relative; z-index: 2; width: 100%; max-width: none; margin: 0;
    padding: 20px 6px 8px; color: #f3ead6; font-family: 'Cinzel', serif;
    font-size: 12.5px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.9);
    background: linear-gradient(to top, rgba(12,12,24,.92) 45%, rgba(12,12,24,0));
  }
  .card.has-art .card-rank { color: var(--gold-5) !important; text-shadow: 0 1px 4px rgba(0,0,0,.95); }

  /* Mit Rahmen-Grafik gelten dessen Aussparungen. Die vier Werte hier sind
     die EINZIGE Stelle, an der die Rahmengeometrie steht — sie entsprechen
     exakt den Prozentangaben im Generierungs-Prompt
     (02_Design_UI/Gemini_Prompts_Spiel_Assets.md, „Prompt 2 v2"). Kommt ein
     Rahmen mit anderem Zuschnitt, hier nachziehen, nirgends sonst.

     Werte für den dünnen Rahmen: Fenster 7–93 % breit, 6–76 % hoch,
     Namensband 76–90 %. Der alte, dicke Rahmen hatte 23–77 % / 12–71 % —
     davon blieb nur gut ein Viertel der Karte für das Motiv übrig. */
  /* Aus card-frame-blue.png gemessen (785 × 1078): Kunstfenster 22–78 % breit
     und 9–53 % hoch, darunter ein helles Pergamentband bei 54–61 % und eine
     dunkle Bronzetafel bei 70–89 %.

     Der NAME sitzt auf dem Pergamentband — eine Zeile, dunkle Schrift auf
     hellem Grund. Der EFFEKT sitzt auf der Bronzetafel, die dreimal so hoch
     ist: die Texte nennen Regeln wie Differenzschaden oder Sperrzone und
     brauchen zwei Zeilen. Deshalb helle Schrift auf dunklem Grund.

     Gilt für beide Teamfarben. Der rote Rahmen muss nach derselben Vorlage
     erzeugt werden — bis dahin sitzt sein Text daneben. */
  .card.has-frame {
    --fw-top: 9%;        /* Oberkante Kunstfenster */
    --fw-side: 22%;      /* Seitenränder Kunstfenster */
    --fw-bottom: 47%;    /* Abstand von unten = 100 % − 53 % */
    --fw-name: 39%;      /* Name auf dem Pergamentband (54–61 %) */
    --fw-name-side: 8%;  /* schmale Ränder: das Band ist nur 7 % hoch, der
                            längste Name („Proviant und Karren") muss auf eine
                            Zeile passen, sonst ragt er oben heraus */
    --fw-name-color: #3b2a16;
    --fw-name-shadow: none;
    --fw-eff: 14%;       /* Effekt auf der Bronzetafel (70–89 %) */
    --fw-eff-side: 17%;
    --fw-eff-color: var(--gold-5);
    --fw-eff-shadow: 0 1px 3px rgba(0,0,0,.85);
  }
  .card.has-frame.has-art::before {
    inset: var(--fw-top) var(--fw-side) var(--fw-bottom) var(--fw-side);
    border-radius: 0;
  }
  .card.has-frame .clabel {
    position: absolute; z-index: 4;
    left: var(--fw-name-side); right: var(--fw-name-side); bottom: var(--fw-name);
    width: auto; max-width: none; margin: 0; padding: 0;
    color: var(--fw-name-color); font-family: 'Cinzel', serif;
    font-size: 9px; line-height: 1.1; font-weight: 600;
    text-shadow: var(--fw-name-shadow); background: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .card.has-frame .ceffect {
    position: absolute; z-index: 4;
    left: var(--fw-eff-side); right: var(--fw-eff-side); bottom: var(--fw-eff);
    width: auto; max-width: none; margin: 0;
    color: var(--fw-eff-color); font-size: 8.5px; line-height: 1.2; opacity: 1;
    text-shadow: var(--fw-eff-shadow);
  }
  /* Wert und Kosten sitzen in den Abzeichen der Rahmengrafik — dort ist es
     dunkel, die Typfarbe aus dem Inline-Style wäre unlesbar. */
  .card.has-frame .card-rank,
  .card.has-frame .card-cost {
    top: 8.5%; font-size: 15px;
    color: var(--gold-5) !important; text-shadow: 0 1px 3px rgba(0,0,0,.9);
  }
  .card.has-frame .card-rank { left: 11%; }
  .card.has-frame .card-cost { right: 11%; }
  /* Ohne Bild bleibt das Emoji, rutscht aber ins Fenster des Rahmens. */
  .card.has-frame:not(.has-art) .cicon {
    position: absolute; z-index: 2;
    top: var(--fw-top); left: var(--fw-side);
    right: var(--fw-side); bottom: var(--fw-bottom);
    display: flex; align-items: center; justify-content: center; font-size: 44px;
  }

  /* ── Typ-Rahmen (Serie 3) ──────────────────────────────────────────
     Ein Rahmen je Kartenart statt je Teamfarbe. Alle Werte hier sind aus
     den freigestellten PNGs AUSGEZÄHLT, nicht geschätzt: Kunstfenster über
     die Magenta-Fläche, die beiden Textflächen über ihre Zeilenprofile.
     Kommt ein Rahmen mit anderem Zuschnitt, hier nachziehen — sonst nirgends.

     Zwei Unterschiede zum alten Rahmen, die mehr als eine Verschiebung sind:

     1. Die untere Tafel ist HELL (gemessen #E2D5B3), beim alten Rahmen war
        sie dunkle Bronze. Der Effekttext muss deshalb dunkel werden:
        #3b2a16 ergibt 9.4:1, das geerbte #f2dfae käme auf 1.1:1.
     2. Das Kunstfenster reicht bis 78 % und damit UNTER das Pergamentband.
        Das Band ist im PNG opak und verdeckt die Mitte; sichtbar bleibt ein
        schmaler Streifen darunter, der zum Fenster gehört. Soll dort statt
        Bild der Kartengrund stehen, --fw-bottom auf 37 % setzen. */
  .card.has-typframe {
    --fw-top: 5.5%;       /* Fenster 5.3–5.6 % je Datei */
    --fw-side: 10%;       /* Fenster 10.1–89.9 % */
    --fw-bottom: 21.6%;   /* Fenster bis 78.4 %, inkl. Streifen unter dem Band */
    --fw-name: 28%;       /* Pergamentband 63.0–76.1 %, Mitte 69.6 % */
    --fw-name-side: 10%;
    --fw-eff-top: 82.1%;  /* Beschreibungstafel 82.1–95.5 % */
    --fw-eff-bottom: 4.5%;
    --fw-eff-side: 14%;
    --fw-name-color: #3b2a16;
    --fw-name-shadow: none;
    --fw-eff-color: #3b2a16;
    --fw-eff-shadow: none;
  }
  /* Der Hero-Rahmen ist höher zugeschnitten (Ratio 0.674 statt 0.728), weil
     das Wappenschild über die Oberkante ragt. Dadurch sitzt jedes Band
     prozentual tiefer — eigene Werte statt der gemeinsamen oben. */
  .card.cardframe-typ-hero {
    --fw-top: 13.1%;
    --fw-bottom: 20.5%;
    --fw-name: 26.4%;     /* Band 65.1–77.2 %, Mitte 71.2 % */
    --fw-eff-top: 82.9%;
    --fw-eff-bottom: 4.7%;
  }
  /* Der Effekttext ist je Karte ein- oder zweizeilig. Ein fester bottom-Wert
     wäre für genau eine der beiden Längen richtig — deshalb als Box über die
     Tafel gelegt und darin zentriert. Der Name bleibt bottom-positioniert:
     er ist immer einzeilig, und als Flex-Container würde sein
     text-overflow: ellipsis nicht mehr greifen. */
  .card.has-typframe .ceffect {
    top: var(--fw-eff-top); bottom: var(--fw-eff-bottom);
    display: flex; align-items: center; justify-content: center;
    text-align: center;
  }
  /* Wert in der Raute oben links (nur Lauf-Karten tragen eine Zahl), Kosten
     im Wappenschild oben mittig (nur Upgrade-Karten, also nur Hero-Rahmen).
     Als zentrierte Box über dem Slot statt links/oben angeschlagen, sonst
     klebt die Zahl am Slot-Rand. Beide Slots sind mittelgold — dunkle
     Schrift ergibt 3.7:1 (Raute) bzw. 3.3:1 (Schild), das geerbte helle
     Gold käme auf 2.9:1 bzw. 3.2:1. */
  .card.has-typframe .card-rank,
  .card.has-typframe .card-cost {
    display: flex; align-items: center; justify-content: center;
    color: #3b2a16 !important; text-shadow: none;
  }
  .card.cardframe-typ-move .card-rank {
    top: 0; left: 0; right: auto; width: 23%; height: 15%; font-size: 13px;
  }
  .card.cardframe-typ-hero .card-cost {
    top: 0; left: 38%; right: auto; width: 24%; height: 16%;
  }
  /* Der gemalte Rahmen IST die Kartenkante — die eigene Kontur doppelte sie.
     Der 4-px-Streifen oben trug die Kartenart als Farbe, also genau die
     Information, die der Typ-Rahmen jetzt selbst zeigt; die 2-px-Kontur
     schob den Rahmen nach innen und schnitt Raute, Wappen und Bogen oben an.

     Transparent wird nur die FARBE, nicht die Breite — box-sizing ist
     border-box, das Layout bleibt damit unverändert. Und weil die Regel im
     Ruhezustand greift, setzen :hover und .selected-card ihre eigene
     border-color weiterhin durch: die Auswahl bleibt sichtbar. */
  .card.has-typframe:not(:hover):not(.selected-card) { border-color: transparent; }
  .ui-has-card-move-1 .card.cardart-move-1::before { background-image: var(--ui-card-move-1); }
  .ui-has-card-move-2 .card.cardart-move-2::before { background-image: var(--ui-card-move-2); }
  .ui-has-card-move-3 .card.cardart-move-3::before { background-image: var(--ui-card-move-3); }
  .ui-has-card-move-4 .card.cardart-move-4::before { background-image: var(--ui-card-move-4); }
  .ui-has-card-move-5 .card.cardart-move-5::before { background-image: var(--ui-card-move-5); }
  .ui-has-card-move-6 .card.cardart-move-6::before { background-image: var(--ui-card-move-6); }
  .ui-has-card-move-7 .card.cardart-move-7::before { background-image: var(--ui-card-move-7); }
  .ui-has-card-move-8 .card.cardart-move-8::before { background-image: var(--ui-card-move-8); }
  .ui-has-card-unit-dame   .card.cardart-unit-dame::before   { background-image: var(--ui-card-unit-dame); }
  .ui-has-card-unit-pferd  .card.cardart-unit-pferd::before  { background-image: var(--ui-card-unit-pferd); }
  .ui-has-card-unit-läufer .card.cardart-unit-läufer::before { background-image: var(--ui-card-unit-läufer); }
  .ui-has-card-unit-turm   .card.cardart-unit-turm::before   { background-image: var(--ui-card-unit-turm); }
  .ui-has-card-unit-soldat .card.cardart-unit-soldat::before { background-image: var(--ui-card-unit-soldat); }
  /* Team-Fassung einer Effektkarte: Pfad kommt inline aus renderCards(), weil
     5 Karten × 2 Farben sonst fünfzehn fast gleiche Regeln bräuchten. */
  .card.art-inline::before { background-image: var(--card-art); }
  .ui-has-card-effect-angriff .card.cardart-effect-angriff::before { background-image: var(--ui-card-effect-angriff); }
  .ui-has-card-effect-defense .card.cardart-effect-defense::before { background-image: var(--ui-card-effect-defense); }
  .ui-has-card-effect-spawn   .card.cardart-effect-spawn::before   { background-image: var(--ui-card-effect-spawn); }
  .ui-has-card-effect-eis     .card.cardart-effect-eis::before     { background-image: var(--ui-card-effect-eis); }
  .ui-has-card-effect-horn    .card.cardart-effect-horn::before    { background-image: var(--ui-card-effect-horn); }
  /* No art file → no ::before painted at all (background-image stays unset). */

  .ui-has-card-back .facedown-card {
    background-image: var(--ui-card-back) !important;
    background-size: cover; background-position: center;
  }

  /* ═══════════════════════════════════════════════════
     ROGUELIKE — Karte, Belohnung, Rast (js/run.js)
     ═══════════════════════════════════════════════════ */

  /* ── Leiste im Encounter ── */
  #runHUD {
    display: none; flex-direction: column; gap: 6px; flex-shrink: 0;
    padding: 7px 14px; background: rgba(var(--accent-rgb), .12);
    border: 2px solid var(--accent-strong); border-radius: 10px;
  }
  #runHUD.show { display: flex; }
  #runHUDGoal { display: flex; align-items: flex-start; gap: 8px; }
  #runHUDZiel { font-size: .78rem; color: var(--text); line-height: 1.3; }
  #runHUDProgress { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  #runHUDReihe, #runHUDBudget {
    font-family: 'Cinzel', serif; font-size: .7rem; letter-spacing: .5px;
    color: var(--accent-strong); white-space: nowrap;
  }
  #runHUDWarn {
    font-size: .74rem; font-weight: 600; color: #fff;
    background: #b03030; border-radius: 6px; padding: 5px 9px;
  }
  .run-life { font-size: .95rem; }
  .run-life--lost { opacity: .22; filter: grayscale(1); }

  /* Der Held: goldener Ring plus Krönchen. Er muss auf einen Blick von einem
     gewöhnlichen Knappen zu unterscheiden sein — sein Tod beendet den Run. */
  .piece.held-piece {
    box-shadow: 0 0 0 3px #d9a538, 0 0 12px 2px rgba(217,165,56,.7);
    z-index: 15;
  }
  .piece.held-piece::after {
    content: '♛'; position: absolute; top: -9px; left: 50%;
    transform: translateX(-50%); font-size: .7rem; color: #d9a538;
    text-shadow: 0 1px 2px rgba(0,0,0,.8); pointer-events: none;
  }

  /* ── Bildschirme ── */
  .run-screen {
    max-width: 760px; margin: 0 auto; padding: 26px 20px 40px;
    width: 100%; overflow-y: auto; max-height: 100vh;
  }
  .run-screen--narrow { max-width: 460px; text-align: center; }
  .run-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px; margin-bottom: 6px;
  }
  .run-head-right { text-align: right; }
  .run-head-titel {
    font-family: 'Cinzel', serif; font-size: 1.35rem; color: var(--accent-strong);
    letter-spacing: .5px;
  }
  .run-head-sub { font-size: .76rem; color: var(--text-muted); margin-top: 3px; }
  .run-hint { font-size: .8rem; color: var(--text-muted); line-height: 1.45; }

  /* ── Die verzweigte Karte ── */
  .run-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
  .run-row-num {
    width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Cinzel', serif; font-size: .72rem;
    border: 2px solid var(--border); color: var(--text-muted);
  }
  .run-row--now .run-row-num { border-color: var(--accent-strong); color: var(--accent-strong); }
  .run-row--done .run-row-num { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
  .run-row-nodes { display: flex; gap: 12px; flex: 1; min-width: 0; }
  .run-row--todo { opacity: .4; }
  .run-row--done { opacity: .55; }

  .run-node {
    flex: 1; min-width: 0; padding: 11px 12px; border-radius: 12px;
    border: 2px solid var(--border); background: rgba(var(--border-strong-rgb), .1);
    transition: transform .14s, border-color .14s;
  }
  .run-node--open { cursor: pointer; border-color: var(--accent-strong); }
  .run-node--open:hover, .run-node--open:focus-visible {
    transform: translateY(-2px); outline: none;
    box-shadow: 0 6px 18px rgba(var(--border-strong-rgb), .4);
  }
  .run-node-icon { font-size: 1.5rem; line-height: 1; }
  .run-node-titel {
    font-family: 'Cinzel', serif; font-size: .84rem; color: var(--text);
    margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .run-node-typ { font-size: .68rem; color: var(--text-muted); margin-top: 2px; }
  .run-node-stufe {
    font-size: .66rem; margin-top: 6px; text-transform: uppercase;
    letter-spacing: .6px; font-weight: 700;
  }
  .run-node--rast { max-width: 240px; }

  /* Belohnungsstufen — ungleich, und das soll man sehen (Designtipp 7) */
  .r-haeufig .run-node-stufe, .run-reward-stufe.r-haeufig { color: #8a8a8a; }
  .r-gut     .run-node-stufe, .run-reward-stufe.r-gut     { color: #4e9ad6; }
  .r-selten  .run-node-stufe, .run-reward-stufe.r-selten  { color: #d9a538; }
  .r-selten.run-node--open { border-color: #d9a538; }
  .run-reward-stufe { font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }

  /* ── Pfadwahl nach dem Wagen (Wald ODER Stadt) ──
     Zwei große Entscheidungskarten, die sich wie die Belohnungskarten anfühlen,
     aber eine RICHTUNG wählen statt eine Karte. Deshalb größer, mit eigenem
     Titel und einer Zeile, die den Umfang nennt. */
  #runPfadWahlSzenen {
    display: flex; gap: 16px; margin-top: 20px; flex-wrap: wrap;
    justify-content: center;
  }
  .run-pfad-opt {
    flex: 1 1 240px; max-width: 320px;
    padding: 24px 20px; border-radius: 16px; cursor: pointer;
    border: 2px solid var(--accent-strong);
    background: rgba(var(--accent-rgb), .10);
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    transition: transform .14s, box-shadow .14s, border-color .14s, background .14s;
  }
  .run-pfad-opt:hover, .run-pfad-opt:focus-visible {
    transform: translateY(-4px); outline: none;
    border-color: var(--accent-strong);
    background: rgba(var(--accent-rgb), .18);
    box-shadow: 0 8px 22px rgba(var(--border-strong-rgb), .45);
  }
  .run-pfad-titel {
    font-family: 'Cinzel', serif; font-size: 1.15rem; font-weight: 700;
    color: var(--accent-strong); letter-spacing: 1px;
  }
  .run-pfad-kurz {
    font-size: .78rem; color: var(--text-muted); line-height: 1.5;
  }
  .run-pfad-levels {
    font-size: .66rem; text-transform: uppercase; letter-spacing: .8px;
    color: var(--text); font-weight: 600;
    background: rgba(var(--border-strong-rgb), .12);
    border: 1px solid var(--border); border-radius: 20px;
    padding: 4px 12px; margin-top: 4px;
  }
  /* Gesperrter Pfad (Stadt noch nicht gebaut): gleiche Karte, aber kalt und
     ohne Klick-Feedback — man sieht, dass es ihn gibt, aber nicht wählbar ist. */
  .run-pfad-opt--gesperrt {
    cursor: not-allowed;
    border-color: var(--border);
    background: rgba(var(--border-strong-rgb), .08);
    opacity: .55;
  }
  .run-pfad-opt--gesperrt:hover, .run-pfad-opt--gesperrt:focus-visible {
    transform: none; box-shadow: none;
    border-color: var(--border);
    background: rgba(var(--border-strong-rgb), .08);
  }
  .run-pfad-opt--gesperrt .run-pfad-titel { color: var(--text-muted); }
  .run-pfad-opt--gesperrt .run-pfad-levels {
    color: var(--text-muted);
    border-color: var(--border);
    background: transparent;
  }

  /* ── Belohnungs- und Rastkarten ── */
  .run-reward-row {
    display: flex; gap: 14px; margin-top: 18px; flex-wrap: wrap;
    justify-content: center;
  }
  .run-reward-card {
    width: 168px; padding: 16px 13px; border-radius: 14px; cursor: pointer;
    border: 2px solid var(--accent-strong); background: rgba(var(--accent-rgb), .1);
    text-align: center; transition: transform .14s, box-shadow .14s;
  }
  .run-reward-card:hover, .run-reward-card:focus-visible {
    transform: translateY(-4px); outline: none;
    box-shadow: 0 8px 22px rgba(var(--border-strong-rgb), .45);
  }
  .run-reward-card--off { opacity: .3; pointer-events: none; }
  .run-reward-icon { font-size: 2rem; line-height: 1; }
  .run-reward-label {
    font-family: 'Cinzel', serif; font-size: .9rem; color: var(--text); margin-top: 8px;
  }
  .run-reward-desc { font-size: .7rem; color: var(--text-muted); margin-top: 6px; line-height: 1.35; }

  .run-rast-dienste { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
  .run-rast-dienste .btn { flex: 1; min-width: 150px; }

  .run-brief-meta {
    display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 12px;
    font-size: .7rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .6px;
  }

  @media (max-width: 620px) {
    .run-row-nodes { flex-direction: column; }
    .run-reward-card { width: 100%; max-width: 260px; }
  }

  /* ═══════════════════════════════════════════════════
     HERO SELECTION — Stufe 2
     ═══════════════════════════════════════════════════ */
  .hero-select-container {
    max-width: 820px; width: 100%; margin: 0 auto;
    padding: 28px 24px 40px;
    background: var(--surface-panel); border: 3px solid var(--border); border-radius: 18px;
    box-shadow: var(--elev-3);
  }
  .hero-section { margin-bottom: 22px; }
  .hero-section-title {
    font-family: 'Cinzel', serif; font-size: .72rem; font-weight: 600;
    letter-spacing: 2.5px; text-transform: uppercase;
    color: var(--accent-strong); margin-bottom: 10px;
  }
  .faction-opts { display: flex; gap: 12px; flex-wrap: wrap; }
  .faction-opt {
    flex: 1 1 200px; padding: 18px 16px; border-radius: 14px; cursor: pointer;
    border: 2px solid var(--border); background: var(--surface-subtle);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    text-align: center; transition: transform .15s, border-color .15s, box-shadow .15s;
  }
  .faction-opt:hover { transform: translateY(-2px); border-color: var(--accent-strong); }
  .faction-opt:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
  .faction-opt.picked {
    border-color: var(--accent-strong); background: rgba(var(--accent-rgb), .10);
    box-shadow: 0 0 0 1px var(--accent-strong), 0 6px 18px rgba(var(--border-strong-rgb), .3);
  }
  .faction-icon { font-size: 2.4rem; line-height: 1; }
  .faction-name { font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 600; color: var(--text); }
  .faction-desc { font-size: .72rem; color: var(--text-muted); }

  .hero-opts { display: flex; gap: 12px; flex-wrap: wrap; }
  .hero-opt {
    flex: 1 1 220px; padding: 16px 14px; border-radius: 12px; cursor: pointer;
    border: 2px solid var(--border); background: var(--surface-subtle);
    display: flex; flex-direction: column; gap: 6px;
    transition: transform .14s, border-color .14s, box-shadow .14s;
  }
  .hero-opt:hover { transform: translateY(-2px); border-color: var(--accent-strong); }
  .hero-opt:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
  .hero-opt.picked {
    border-color: var(--accent-strong); background: rgba(var(--accent-rgb), .10);
    box-shadow: 0 0 0 1px var(--accent-strong), 0 6px 18px rgba(var(--border-strong-rgb), .3);
  }
  .hero-icon { font-size: 1.8rem; line-height: 1; }
  .hero-name { font-family: 'Cinzel', serif; font-size: .92rem; font-weight: 600; color: var(--text); }
  .hero-beschreibung { font-size: .78rem; color: var(--text-muted); line-height: 1.35; }
  .hero-faehigkeit {
    font-size: .72rem; color: var(--text); line-height: 1.4;
    background: rgba(var(--border-strong-rgb), .08); border-radius: 6px; padding: 6px 8px;
    border: 1px solid var(--border);
  }
  .hero-faehigkeit strong { color: var(--accent-strong); }

  .hero-cards-preview {
    display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  }
  .hero-card-preview {
    width: 88px; padding: 10px 8px; border-radius: 10px; cursor: default;
    border: 2px solid var(--border); background: var(--surface-panel);
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    text-align: center; box-shadow: var(--elev-1);
  }
  .hero-card-icon { font-size: 1.6rem; line-height: 1; }
  .hero-card-label { font-size: .68rem; color: var(--text-muted); line-height: 1.25; }

  /* ── Feste Hindernisse (Encounter-Einrichtung) ──────────────────
     Tische, Fässer, Trümmer. Sie gehören keiner Seite und sind kein Ziel —
     deshalb bewusst stumpf und ohne Fraktionsfarbe: eine dunkle, massive Fläche
     mit Holzkante, die sich vom Boden abhebt, ohne wie eine Figur zu wirken. */
  .cell.hindernis {
    cursor: default;
    background-image:
      linear-gradient(160deg, rgba(255,255,255,.10) 0%, transparent 45%),
      repeating-linear-gradient(90deg,
        rgba(0,0,0,.42) 0 2px, transparent 2px calc(var(--cell) * 0.22)),
      linear-gradient(#4a3722, #35271a) !important;
    box-shadow:
      inset 0 2px 0 rgba(255,255,255,.13),
      inset 0 -3px 6px rgba(0,0,0,.6),
      0 2px 5px rgba(0,0,0,.45);
    border-color: #241a10 !important;
  }
  .cell.hindernis::after {
    content: ''; position: absolute; inset: 14%;
    border: 1px solid rgba(0,0,0,.35); border-radius: 2px;
    pointer-events: none;
  }
  /* Ein Hindernis nimmt keine Hervorhebung an — es ist nie ein Ziel. */
  .cell.hindernis.valid-move, .cell.hindernis.valid-attack { box-shadow: none; }
  .cell.hindernis:hover { filter: none; }

  /* ── Begleiter (benannte Figur, die nicht der Held ist) ──────────
     Schwächerer Ring als der Held: erkennbar als „gehört dir und hat einen
     Namen", aber ohne den Helden zu überstrahlen — sein Tod beendet den Run,
     der des Begleiters nicht. */
  .piece.begleiter-piece {
    box-shadow: 0 0 0 2px #7ea8c4, 0 0 9px 1px rgba(126,168,196,.55);
  }
  .piece.begleiter-piece::after {
    content: '✦'; position: absolute; top: -8px; left: 50%;
    transform: translateX(-50%); font-size: .6rem; color: #9ec8e0;
    text-shadow: 0 1px 2px rgba(0,0,0,.8); pointer-events: none;
  }

  /* ── Feste Belohnung (Prolog): Übergabe statt Auswahl ── */
  .run-reward-card--fest { cursor: default; }
  .run-reward-card--fest:hover { transform: none; box-shadow: none; }
  /* Was man verpasst hat, wird gezeigt statt verschwiegen — sonst lernt niemand,
     dass es ein Bonusziel gab. */
  .run-reward-card--verpasst {
    cursor: default; opacity: .5;
    border-color: var(--border); border-style: dashed;
    background: transparent;
  }
  .run-reward-card--verpasst:hover { transform: none; box-shadow: none; }
  .run-reward-weiter { flex-basis: 100%; display: flex; justify-content: center; margin-top: 6px; }
  .run-reward-weiter .btn { min-width: 220px; }

  /* Gemalte Hindernis-Kachel, sobald assets/ui/<pack>/tiles/hindernis.png da ist.
     Ersetzt die gezeichnete Fassung vollständig — deshalb `background-image` mit
     !important gegen die Gradienten der CSS-Variante, und der Innenrahmen aus
     ::after entfällt. */
  html.ui-has-tile-hindernis .cell.hindernis {
    background-image: var(--ui-tile-hindernis) !important;
    background-size: 100% 100%;
    box-shadow: none;
  }
  html.ui-has-tile-hindernis .cell.hindernis::after { content: none; }

  /* ═══════════════════════════════════════════════════
     BRETTDESIGN: HOLZBODEN — größenunabhängig
     ═══════════════════════════════════════════════════
     Das erste Design, das ausdrücklich für kleine Bretter gedacht ist (3×3 bis
     5×5). Deshalb `art: 'prozedural'` in BOARD_STYLES: es entsteht vollständig
     aus CSS und einer wiederholten Textur — es gibt keine Kantenlänge, für die es
     „gemalt" wäre, und damit auch keine, bei der es verzerrt.

     Kein Hell-Dunkel-Raster: auf drei mal drei Feldern liest sich ein Schachmuster
     nicht als Brett, sondern als Fehler. Die Felder trennt eine Fuge, keine Farbe. */
  #board.board-holz {
    background-image:
      /* Dielenfugen — laufen über das ganze Brett, nicht pro Feld */
      repeating-linear-gradient(180deg,
        rgba(0,0,0,.30) 0 1px,
        rgba(255,255,255,.03) 1px 3px,
        transparent 3px calc(var(--cell) * 0.5));
    background-size: auto, calc(var(--cell) * 2.5);
    background-repeat: repeat, repeat;
    border-color: #6b4a2a;
    box-shadow:
      0 0 0 1px rgba(0,0,0,.5),
      inset 0 0 26px rgba(0,0,0,.55),
      0 10px 40px rgba(0,0,0,.45);
  }
  /* Die Zellen tragen keine eigene Fläche — der Boden liegt unter allen. */
  #board.board-holz .cell { background: none; border-color: rgba(0,0,0,.22); }
  /* Auf Holz brauchen die Hervorhebungen mehr Kraft als auf flachem Grund,
     gleiche Begründung wie bei Marmor. */
  #board.board-holz .cell.valid-move   { box-shadow: inset 0 0 0 3px rgba(150,220,140,.9); }
  #board.board-holz .cell.valid-attack { box-shadow: inset 0 0 0 3px rgba(230,80,80,.95); }
  #board.board-holz .cell.sel          { box-shadow: inset 0 0 0 3px rgba(217,165,56,.95); }

  /* ── Gegenstand auf einem Feld (Roguelike) ──────────
     Die Haselnuss liegt da und wartet. Sanft pulsierend, damit sie auffällt, aber
     ohne die Hervorhebungen für Zug und Angriff zu übertönen. */
  .cell.gegenstand .gegenstand-icon {
    position: absolute; inset: 0; display: flex;
    align-items: center; justify-content: center;
    font-size: calc(var(--cell) * 0.45); pointer-events: none; z-index: 3;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.6));
    animation: gegenstandWiegen 2.4s ease-in-out infinite;
  }
  @keyframes gegenstandWiegen {
    0%,100% { transform: translateY(0)    scale(1);    }
    50%     { transform: translateY(-8%)  scale(1.06); }
  }

  /* ── Träger: wer den Gegenstand hat ─────────────────
     Muss auf einen Blick erkennbar sein: der Eisvogel greift den Träger an, und
     eine Figur, die scheinbar willkürlich zum Ziel wird, ist ein Rätsel. */
  .piece.traeger-piece { box-shadow: 0 0 0 2px #d9a538, 0 0 10px 2px rgba(217,165,56,.6); }
  .traeger-icon {
    position: absolute; right: -4px; bottom: -4px;
    font-size: .62rem; line-height: 1; pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.8));
  }

  /* ═══════════════════════════════════════════════════
     ARC-AUSWAHL — der Würfel als Level-Selector
     ═══════════════════════════════════════════════════
     Umsetzung von js/arcselect.js. Gestaltung nach
     02_Design_UI/00_Design_System/Art_Direction/Design_DNA_Potenzial.json:
     dunkle gemalte Bühne, Gold als EINZIGE Leitfarbe, Cyan nur als Zustand,
     Kante statt Füllfläche, Kontaktschatten plus Rim-Light von oben links.

     --arc-von/--arc-bis/--arc-licht setzt arcVorschauZeigen() pro Seite. Der
     Hintergrund wechselt damit sichtbar, auch bevor ein Bild existiert. */
  #arcSelectScreen {
    --arc-von: #3a2415; --arc-bis: #0d0906; --arc-licht: var(--gold-3);
    display: none; position: fixed; inset: 0; overflow: hidden;
    background:
      var(--arc-bild, none) center/cover no-repeat,
      radial-gradient(120% 90% at 30% 15%, var(--arc-von) 0%, var(--arc-bis) 70%);
    transition: background-color 420ms cubic-bezier(.22,.61,.36,1);
  }
  #arcSelectScreen.active { display: block; }

  /* Vignette: Tiefenhinweis aus der DNA („Vignette am Bildrand"). Liegt über dem
     Hintergrund, unter dem Inhalt — deshalb ein eigenes Element und kein
     box-shadow, der die Kanten des Würfels mitfärben würde. */
  .arc-vignette {
    position: absolute; inset: 0; pointer-events: none;
    background:
      radial-gradient(75% 60% at 50% 45%, transparent 40%, rgba(0,0,0,.55) 100%),
      linear-gradient(180deg, rgba(0,0,0,.35) 0%, transparent 22%, transparent 78%, rgba(0,0,0,.5) 100%);
  }

  .arc-layout {
    position: relative; height: 100%;
    display: grid; grid-template-columns: minmax(0,1.15fr) minmax(340px,.85fr);
    align-items: center; gap: clamp(12px, 4vw, 64px);
    padding: clamp(16px, 4vh, 48px) clamp(20px, 5vw, 72px);
  }

  /* ── Bühne und Würfel ── */
  .arc-stage-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }

  .arc-stage {
    --cube: clamp(170px, min(34vh, 26vw), 320px);
    --cube-half: calc(var(--cube) / 2);
    width: var(--cube); height: var(--cube);
    position: relative;
    perspective: 1100px;               /* flach genug, dass die Seiten lesbar bleiben */
    cursor: grab; touch-action: none;   /* sonst scrollt das Ziehen die Seite */
    outline: none;
    /* Die 3D-Projektion ragt über die Kastengrenze hinaus — der Würfel steht
       schräg, seine hinteren Ecken liegen weiter außen als seine Breite. Ohne
       diesen Freiraum schneidet er in Hinweistext und Navigation. */
    margin: clamp(14px, 3.5vh, 40px) 0 clamp(26px, 6vh, 60px);
  }
  .arc-stage.zieht { cursor: grabbing; }
  .arc-stage:focus-visible { outline: 2px solid var(--select); outline-offset: 14px; border-radius: 8px; }

  .arc-cube {
    position: absolute; inset: 0;
    transform-style: preserve-3d;
    will-change: transform;
  }

  /* Kontaktschatten auf dem Boden — der Würfel liegt auf etwas, er schwebt nicht.
     Bewusst ein eigenes, flach gedrehtes Element: ein box-shadow am Würfel würde
     mitrotieren und den Eindruck sofort zerstören. */
  .arc-cube-shadow {
    position: absolute; left: 50%; bottom: -14%;
    width: 118%; height: 30%;
    transform: translateX(-50%);
    background: radial-gradient(50% 50%, rgba(0,0,0,.62) 0%, transparent 72%);
    filter: blur(3px); pointer-events: none;
  }

  /* Kernebenen: füllen die Ecklöcher zwischen den abgerundeten Flächen, damit dort
     dunkles Material statt Hintergrund steht. Drei Ebenen genügen — jede Sichtlinie
     durch eine Ecke trifft mindestens eine davon. */
  .arc-core {
    position: absolute; inset: 4%;
    background: #241804;
    border-radius: 3%;
    pointer-events: none;
  }

  .arc-face {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6%;
    border-radius: calc(var(--cube) * 0.075);
    /* Elfenbein-Material, absichtlich fast RICHTUNGSLOS: der gerichtete Glanz kommt
       aus arcLichtSetzen(). Ein ins Bild gemalter Glanz würde beim Drehen
       mitwandern — und genau daran erkennt man sechs Karten statt eines Würfels. */
    background:
      radial-gradient(135% 135% at 50% 44%, #fdf7e8 0%, #f2e7ca 58%, #e2d2ac 100%);
    border: 2px solid;
    /* Kantenglanz aus --kante (0…1): seitlich stehende Flächen bekommen eine
       hellere Kante. „Kante statt Füllfläche“, aus der Design-DNA. */
    border-color: color-mix(in srgb, var(--gold-2), #fff6d8 calc(var(--kante, 0) * 78%));
    box-shadow:
      inset 0 0 0 1px rgba(255,255,255,.20),
      0 0 0 1px rgba(0,0,0,.45);
    backface-visibility: hidden;
    overflow: hidden;               /* das Licht-Overlay darf die Rundung nicht überragen */
  }

  /* Eine Fläche mit gemaltem Arc-Hintergrund: das Bild liegt UNTER dem
     Material-Verlauf? Nein — es ERSETZT ihn, damit das Bild sichtbar wird.
     Augen und Titel bleiben darüber, das Licht-Overlay (::after) sowieso.
     `background-size: cover` skaliert das Bild auf die Fläche; `--arc-bild`
     wird von arcWuerfelBildProbieren() gesetzt, wenn die Datei existiert. */
  .arc-face--mit-bild {
    background:
      linear-gradient(rgba(20,12,4,.28), rgba(20,12,4,.28)),
      var(--arc-bild, none) center / cover no-repeat;
  }
  .arc-face--mit-bild .pip:not(.pip--leer) {
    box-shadow: inset 0 0 6px rgba(0,0,0,.65), 0 0 0 2px rgba(0,0,0,.35), 0 1px 0 rgba(255,255,255,.3);
    background: radial-gradient(circle at 34% 30%, #e8c870 0%, #8a6420 70%);
  }
  .arc-face--mit-bild .arc-face-titel {
    color: #f5e8c8;
    text-shadow: 0 1px 3px rgba(0,0,0,.85), 0 0 12px rgba(0,0,0,.6);
  }

  /* Das gerichtete Licht. Zwei Farbflächen über dem Material, deren Deckkraft
     arcLichtSetzen() pro Bild aus der Flächennormale rechnet. Bewusst kein
     `filter: brightness()` — ein Filter macht das Element zur eigenen Zeichenebene
     und flacht preserve-3d ab. */
  .arc-face::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    border-radius: inherit;
    background:
      linear-gradient(rgba(255,246,225,var(--glanz, 0)), rgba(255,246,225,var(--glanz, 0))),
      linear-gradient(rgba(6,3,0,var(--schatten, 0)), rgba(6,3,0,var(--schatten, 0)));
    transition: background var(--licht-tempo, 0ms) linear;
  }

  /* Gesperrte Seiten sind kalt, aber aus DEMSELBEN Material.
     Vorher waren sie fast schwarz — und weil fünf von sechs Seiten gesperrt sind,
     las sich der Würfel dann als eine elfenbeinfarbene Karte auf einem schwarzen
     Kasten statt als ein Körper. Gesperrt heißt jetzt: entsättigtes Bein statt
     Elfenbein, Grau statt Gold, Schloss statt Name. Der Würfel bleibt ein Würfel. */
  .arc-face--gesperrt {
    background: radial-gradient(135% 135% at 50% 44%, #d9d3c5 0%, #c2bbaa 58%, #a49d8c 100%);
    border-color: color-mix(in srgb, #8a8171, #d8d2c4 calc(var(--kante, 0) * 70%));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 0 0 1px rgba(0,0,0,.45);
  }

  .arc-face-pips {
    display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
    width: 62%; height: 62%; gap: 6%;
  }
  .pip {
    border-radius: 50%; align-self: center; justify-self: center;
    width: 78%; aspect-ratio: 1;
    background: radial-gradient(circle at 34% 30%, #6b4718 0%, #33230f 70%);
    box-shadow: inset 0 1px 1px rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.35);
  }
  .pip--leer { background: none; box-shadow: none; }
  /* :not(.pip--leer) ist Pflicht, nicht Kosmetik: `.arc-face--gesperrt .pip` hat
     höhere Spezifität als `.pip--leer` und färbte sonst ALLE NEUN Rasterfelder —
     jede gesperrte Seite zeigte eine Sechs mit neun Augen. */
  .arc-face--gesperrt .pip:not(.pip--leer) {
    background: radial-gradient(circle at 34% 30%, #6e6656 0%, #464034 70%);
    box-shadow: inset 0 1px 1px rgba(0,0,0,.4);
  }

  .arc-face-titel {
    font-family: 'Cinzel', serif;
    font-size: clamp(.6rem, calc(var(--cube) * 0.062), .95rem);
    letter-spacing: .06em; color: var(--gold-1);
    text-align: center; padding: 0 8%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
  }
  .arc-face--gesperrt .arc-face-titel { color: #6b6353; opacity: .8; }

  .arc-stage-hint {
    font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
    color: rgba(255,250,240,.42);
  }

  /* ── Seitennavigation ── */
  .arc-seiten-nav { display: flex; align-items: center; gap: 16px; }
  .arc-nav-btn {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(0,0,0,.35); border: 2px solid var(--gold-2);
    color: var(--gold-4); font-size: 1.3rem; line-height: 1; cursor: pointer;
    transition: transform 120ms, border-color 120ms, color 120ms;
  }
  .arc-nav-btn:hover { color: var(--gold-5); border-color: var(--gold-4); transform: scale(1.08); }
  .arc-augen-label {
    font-family: 'Cinzel', serif; font-size: 1.5rem; color: var(--arc-licht);
    min-width: 1.4em; text-align: center;
    text-shadow: 0 0 18px color-mix(in srgb, var(--arc-licht) 55%, transparent);
  }

  /* ── Vorschau-Panel ──
     Pergament als Lesezone (DNA: „Pergament die Lesezone"), auf die dunkle Bühne
     gelegt wie ein Blatt auf einen Tisch. */
  .arc-info { min-width: 0; }
  .arc-info-inner {
    background: linear-gradient(180deg, rgba(251,243,224,.97) 0%, rgba(231,211,163,.94) 100%);
    border: 2px solid var(--gold-2);
    border-radius: 10px;
    padding: clamp(18px, 3vh, 30px) clamp(18px, 2.4vw, 32px);
    box-shadow: 0 24px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.55);
    max-height: 84vh; overflow-y: auto;
  }
  .arc-overline {
    font-size: .6875rem; font-weight: 700; letter-spacing: .16em;
    text-transform: uppercase; color: var(--gold-2);
  }
  .arc-stage-wrap .arc-overline { color: rgba(255,250,240,.55); }
  .arc-titel {
    font-family: 'Cinzel', serif; font-size: clamp(1.2rem, 2.2vw, 1.75rem);
    line-height: 1.15; letter-spacing: .02em;
    color: var(--gold-1); margin: 8px 0 4px;
  }
  .arc-held { font-size: .9rem; color: var(--text-muted); margin-bottom: 16px; }

  /* Trenner nach DNA: kein 1px-Strich, sondern eine geprägte Leiste. */
  .arc-meta {
    display: flex; gap: 28px; flex-wrap: wrap;
    padding: 14px 0; margin-bottom: 14px;
    border-top: 2px solid var(--gold-3); border-bottom: 2px solid var(--gold-3);
    box-shadow: inset 0 1px 0 rgba(107,71,24,.35), inset 0 -1px 0 rgba(107,71,24,.35);
  }
  .arc-meta-label {
    font-size: .625rem; font-weight: 700; letter-spacing: .14em;
    text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px;
  }
  .arc-meta-wert { font-family: 'Cinzel', serif; font-size: 1.05rem; color: var(--gold-1); }

  /* Schwierigkeit als Würfelaugen — dieselbe Sprache wie das ganze Spiel. */
  .arc-schwer { display: flex; gap: 6px; }
  .arc-schwer-pip {
    width: 11px; height: 11px; border-radius: 50%;
    border: 1.5px solid var(--gold-2); background: transparent;
  }
  .arc-schwer-pip.voll {
    background: radial-gradient(circle at 34% 30%, #6b4718 0%, #33230f 70%);
    border-color: var(--gold-1);
  }

  .arc-kurz { font-size: .9rem; line-height: 1.55; color: var(--text); margin-bottom: 14px; }
  .arc-stimmung {
    font-size: .78rem; font-style: italic; color: var(--text-muted);
    padding-left: 12px; border-left: 3px solid var(--gold-3); margin-bottom: 22px;
  }

  .arc-start { width: 100%; }
  .arc-start:disabled {
    background: #7a6f5e; color: rgba(255,255,255,.6);
    box-shadow: none; cursor: not-allowed;
  }
  .arc-zurueck { width: 100%; margin-top: 8px; }

  @media (max-width: 900px) {
    .arc-layout {
      grid-template-columns: minmax(0,1fr);
      align-content: start; gap: 20px; overflow-y: auto;
    }
    .arc-stage { --cube: clamp(120px, 30vw, 170px); }
    .arc-info-inner { max-height: none; }
  }

  /* ── BRETTDESIGN: STEINBODEN — größenunabhängig ── */
  #board.board-stein {
    background-image:
      repeating-linear-gradient(180deg,
        rgba(0,0,0,.35) 0 1px,
        rgba(255,255,255,.02) 1px 2px,
        transparent 2px calc(var(--cell) * 0.5)),
      url('assets/ui/textures/board/board_tile_stone_256.png');
    background-size: auto, calc(var(--cell) * 2);
    background-repeat: repeat, repeat;
    border-color: #3a3530;
    box-shadow:
      0 0 0 1px rgba(0,0,0,.5),
      inset 0 0 22px rgba(0,0,0,.45),
      0 10px 40px rgba(0,0,0,.4);
  }
  #board.board-stein .cell { background: none; border-color: rgba(0,0,0,.18); }
  #board.board-stein .cell.valid-move   { box-shadow: inset 0 0 0 3px rgba(140,200,180,.85); }
  #board.board-stein .cell.valid-attack { box-shadow: inset 0 0 0 3px rgba(220,70,70,.85); }

  /* ── BRETTDESIGN: OUTDOOR/GRAS — größenunabhängig ── */
  #board.board-aussen {
    background-image:
      repeating-linear-gradient(180deg,
        transparent 0 calc(var(--cell) * 0.5 - 1px),
        rgba(0,0,0,.18) calc(var(--cell) * 0.5) calc(var(--cell) * 0.5 + 1px),
        transparent calc(var(--cell) * 0.5 + 1px) calc(var(--cell) * 0.5)),
      url('assets/ui/textures/board/board_tile_grass_256.png');
    background-size: auto, calc(var(--cell) * 2);
    background-repeat: repeat, repeat;
    border-color: #4a5c38;
    box-shadow:
      0 0 0 1px rgba(0,0,0,.4),
      inset 0 0 20px rgba(0,0,0,.35),
      0 10px 40px rgba(0,0,0,.38);
  }
  #board.board-aussen .cell { background: none; border-color: rgba(0,0,0,.12); }
  #board.board-aussen .cell.valid-move   { box-shadow: inset 0 0 0 3px rgba(180,220,120,.8); }
  #board.board-aussen .cell.valid-attack { box-shadow: inset 0 0 0 3px rgba(220,80,60,.82); }

  /* ── ROGUELIKE HINTERGRUND ── */
  html.bg-roguelike { --game-bg: url('assets/ui/roguelike/background rougelike-story1.png'); }

  /* ═══════════════════════════════════════════════════
     ROGUELIKE — PERGAMENTKARTE
     ═══════════════════════════════════════════════════ */
  #runMapScreen {
    position: relative; justify-content: flex-start;
    /* War-Table: dunkles Holz, auf dem die Karte liegt (GS v1 §4).
       Fehlt das Bild, bleibt der dunkle Standard-Hintergrund. */
    background:
      radial-gradient(110% 90% at 50% 30%, transparent 55%, rgba(0,0,0,.42) 100%),
      url('assets/ui/roguelike/war-table.jpg') center / cover no-repeat,
      #0c0c18;
  }

  .run-map-container {
    width: 100%; max-width: 980px; margin: 0 auto;
    display: flex; flex-direction: column; min-height: 100vh; padding: 20px 20px 46px;
  }

  .run-map-hud {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
    flex-wrap: wrap; margin-bottom: 16px;
  }
  .run-map-hud-left { min-width: 200px; }
  .run-map-hud-center { display: flex; align-items: center; }
  .run-map-hud-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .run-map-leben { display: flex; gap: 4px; align-items: center; }
  .run-map-omen {
    font-family: 'Cinzel', serif; font-size: .78rem; letter-spacing: .5px;
    color: var(--danger); border: 1px solid var(--danger);
    padding: 4px 10px; border-radius: var(--r-pill);
    background: rgba(var(--danger-rgb), .08);
  }

  /* Das Pergament */
  .run-map-parchment {
    position: relative; flex: 1; min-height: 540px; width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background:
      radial-gradient(120% 90% at 50% 8%, rgba(201,168,76,.10), transparent 55%),
      url('assets/ui/roguelike/map-parchment.png') center / cover no-repeat,
      linear-gradient(160deg, #18140e 0%, #12100b 55%, #0d0b07 100%);
    box-shadow: var(--elev-3), inset 0 0 60px rgba(0,0,0,.28);
    overflow: hidden;
    /* Eigener Stapel-Kontext: mix-blend-mode der Geografie darf nur
       mit dem Pergament verschmelzen, nicht mit dem War-Table dahinter. */
    isolation: isolate;
  }
  .run-map-parchment::before {
    content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2;
    background:
      radial-gradient(85% 65% at 50% 50%, transparent 70%, rgba(0,0,0,.3) 100%);
  }
  #runMapSvg { position: relative; z-index: 3; width: 100%; height: 100%; display: block; }

  /* Kartenillustration (Geografie): liegt zwischen Pergament und SVG-
     Inhalt — wie eine aufgezeichnete Landkarte unter den Siegeln.
     Ebenen-Reihenfolge explizit: Pergament(0) < Geografie(1) < Vignette(2) < SVG(3). */
  .run-map-geo {
    position: absolute; inset: 0; z-index: 1;
    width: 100%; height: 100%; object-fit: cover;
    opacity: .5; mix-blend-mode: multiply;
    filter: sepia(.25) brightness(1.15) contrast(1.0);
    pointer-events: none;
  }

  /* Generierte Wachs-Siegel auf den Knoten */
  .run-node-siegel {
    pointer-events: none;
    filter: drop-shadow(0 .4px .6px rgba(20,12,4,.55));
  }

  .run-map-region {
    font-family: 'Cinzel', serif; font-size: 2.6px; fill: #4a3a24;
    letter-spacing: .4px; opacity: .75; text-transform: uppercase;
  }

  /* Pfade */
  .run-edge {
    stroke: #6a5a3a; stroke-width: .6; stroke-linecap: round;
    stroke-dasharray: 1.4 1.1; opacity: .35; fill: none;
  }
  .run-edge--done { opacity: .18; }
  .run-edge--active {
    opacity: .85; stroke: var(--gold-3); stroke-width: .9;
    stroke-dasharray: none; filter: drop-shadow(0 0 1px rgba(201,168,76,.6));
  }
  .run-edge--open { opacity: .5; stroke: #8a744a; }
  .run-edge--locked { opacity: .12; }

  /* Nebel über zukünftigen Knoten — weicher radialer Verlauf statt harter Fläche */
  .run-fog {
    fill: url(#runFogGrad); filter: blur(2px); pointer-events: none;
    animation: fogBreathe 7s ease-in-out infinite;
  }
  @keyframes fogBreathe { 0%,100% { opacity:.8 } 50% { opacity:1 } }

  /* Knoten als Siegel */
  /* Kein Hover-Transform: translateY() auf dem <g> inmitten der blur-gefilterten
     Nebel-Ellipsen verursacht Raster-Flicker (Re-Render des gefilterten SVG).
     Interaktion bleibt über `cursor:pointer` + Klick erhalten (GS v1 §10). */
  .run-node-svg { }
  .run-node-svg--open, .run-node-svg--now { cursor: pointer; }
  .run-node-circle {
    stroke-width: .7; vector-effect: non-scaling-stroke;
  }
  .run-node-icon-svg { font-size: 2.6px; pointer-events: none; }
  .run-node-boss-icon { font-size: 3.2px; pointer-events: none; }
  .run-node-titel-svg {
    font-size: 1.5px; fill: #3a2c1a; pointer-events: none;
    font-family: 'Cinzel', serif; letter-spacing: .2px;
  }

  /* Stufen-Farben der Siegel */
  .r-haeufig .run-node-circle { fill: #3a3428; stroke: #6a6250; }
  .r-gut     .run-node-circle { fill: #1d3140; stroke: #4e9ad6; }
  .r-selten  .run-node-circle { fill: #3a2d10; stroke: #d9a538; }
  .r-rast    .run-node-circle { fill: #2a2010; stroke: #c9a84c; }
  .r-boss    .run-node-circle { fill: #2a1210; stroke: #b23a2c; }

  /* Zustände */
  .run-node-svg--done .run-node-circle { opacity: .4; }
  .run-node-svg--now .run-node-circle {
    animation: sealPulse 2.4s ease-in-out infinite;
    filter: drop-shadow(0 0 1.4px rgba(201,168,76,.7));
  }
  @keyframes sealPulse {
    0%,100% { stroke-width: .7; }
    50% { stroke-width: 1.4; }
  }
  .run-node-svg--locked { opacity: .3; }

  /* ═══════════════════════════════════════════════════
     ENCOUNTER-DETAILPANEL
     ═══════════════════════════════════════════════════ */
  .run-detail-panel {
    position: fixed; right: 18px; top: 50%; transform: translateY(-50%) translateX(30px);
    width: min(340px, 88vw); z-index: 30;
    background: var(--surface-panel); border: 2px solid var(--accent-strong);
    border-radius: var(--r-lg); padding: 20px 18px;
    box-shadow: var(--elev-3);
    opacity: 0; pointer-events: none;
    transition: opacity var(--dur-normal) var(--ease-out), transform var(--dur-normal) var(--ease-overshoot);
  }
  .run-detail-panel.show { opacity: 1; pointer-events: auto; transform: translateY(-50%) translateX(0); }
  .run-detail-titel { font-family: 'Cinzel', serif; font-size: 1.2rem; color: var(--accent-strong); margin: 0 0 6px; }
  .run-detail-meta { font-size: .78rem; color: var(--text-muted); margin-bottom: 12px; }
  .run-detail-hinweis {
    font-family: 'Georgia', serif; font-style: italic; font-size: .88rem;
    color: var(--text); line-height: 1.5; margin: 0 0 12px;
    padding: 10px 12px; border-left: 3px solid var(--accent);
    background: rgba(var(--accent-rgb), .06); border-radius: 6px;
  }
  .run-detail-sachlich { font-size: .74rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 16px; }
  .run-detail-sachlich span { display: block; }
  .run-detail-btns { display: flex; gap: 10px; }
  .run-detail-btns .btn { flex: 1; }

  /* ═══════════════════════════════════════════════════
     DECK-OVERLAY (physikalisches Kartenspiel)
     ═══════════════════════════════════════════════════ */
  .run-deck-overlay {
    position: fixed; inset: 0; z-index: 40;
    background: rgba(255, 255, 255, 0.72);
    display: flex; align-items: center; justify-content: center; padding: 20px;
    opacity: 0; pointer-events: none;
    transition: opacity var(--dur-normal) var(--ease-out);
  }
  .run-deck-overlay.show { opacity: 1; pointer-events: auto; }

  .run-deck-panel {
    width: min(920px, 96vw); max-height: 90vh; overflow-y: auto;
    background: linear-gradient(170deg, #1c1813 0%, #15110c 100%);
    border: 2px solid var(--border); border-radius: var(--r-lg);
    box-shadow: var(--elev-3), inset 0 1px 0 rgba(255,255,255,.04);
    padding: 22px;
    transform: translateY(14px) rotate(-.4deg); transform-origin: 50% 0;
    transition: transform var(--dur-normal) var(--ease-overshoot);
  }
  .run-deck-overlay.show .run-deck-panel { transform: translateY(0) rotate(0deg); }

  .run-deck-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
  .run-deck-head h3 { font-family: 'Cinzel', serif; color: var(--accent-strong); font-size: 1.15rem; margin: 0; }
  .run-deck-count { font-size: .82rem; color: var(--text-muted); }
  .run-deck-head .btn-sm { margin-left: auto; }

  .run-deck-gruppe { margin-bottom: 18px; }
  .run-deck-phase {
    font-family: 'Cinzel', serif; font-size: .78rem; letter-spacing: 1px;
    color: var(--text-muted); text-transform: uppercase; margin-bottom: 10px;
    padding-bottom: 6px; border-bottom: 1px solid var(--border);
  }
  .run-deck-gitter { display: flex; flex-wrap: wrap; gap: 14px; }
  .run-deck-card { position: relative; }
  .run-deck-solo {
    position: absolute; top: -6px; right: -6px; z-index: 2;
    font-size: .56rem; letter-spacing: .5px; text-transform: uppercase;
    background: var(--accent); color: var(--on-accent);
    padding: 1px 6px; border-radius: var(--r-pill); font-weight: 700;
  }
  .run-deck-figur {
    position: absolute; bottom: 4px; right: 4px; z-index: 2;
    width: 26px; height: 26px; object-fit: contain; pointer-events: none;
  }
  /* Deaktivierte (geparkte) Karten — bleiben erhalten, spielen nicht mit. */
  .run-deck-card--geparkt .card { opacity: .45; filter: grayscale(.7); }
  .run-deck-card--geparkt .card:hover { transform: none; }
  .run-deck-gruppe--parken .run-deck-phase { opacity: .75; }
  .run-deck-park {
    position: absolute; top: 4px; right: 4px; z-index: 6;
    width: 24px; height: 24px; border-radius: 50%;
    border: 1px solid var(--border); background: rgba(10,10,18,.72);
    color: var(--text-muted); font-size: .72rem; line-height: 1;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: border-color .15s, color .15s, background .15s;
  }
  .run-deck-park:hover { border-color: var(--accent-strong); color: var(--accent-strong); background: rgba(10,10,18,.9); }

/* ═══ Atmosphäre: Beleuchtung folgt dem Zug ═══════════════════════
   #game trägt turn-blue/turn-red (render.js, Anzeigefarbe des Spielers
   in Zugform). Die Gegnerseite (Identität + Hand) sinkt leicht ins
   Dunkel, über dem Brett liegt ein schwacher Farbschleier in Zugfarbe.
   Rein CSS, Übergang beim Wechsel — keine Grafik. */
#myIdentity, #oppIdentity, #oppHandRow { transition: filter .6s ease, box-shadow .6s ease; }
#game.turn-blue #oppIdentity,
#game.turn-red  #oppIdentity { filter: brightness(.72) saturate(.85); }
#game.turn-blue #oppHandRow,
#game.turn-red  #oppHandRow { filter: brightness(.72); }
#game.turn-blue #myIdentity { box-shadow: 0 0 18px rgba(70,130,200,.20); }
#game.turn-red  #myIdentity { box-shadow: 0 0 18px rgba(200,70,70,.20); }

#boardArea { position: relative; }
#boardArea::after {
  content:''; position:absolute; inset:0; pointer-events:none; z-index:0;
  border-radius:12px; opacity:0;
  transition: opacity .6s ease, box-shadow .6s ease;
}
#game.turn-blue #boardArea::after { opacity:1; box-shadow: inset 0 0 60px rgba(42,99,150,.22); }
#game.turn-red  #boardArea::after { opacity:1; box-shadow: inset 0 0 60px rgba(160,40,40,.22); }

/* ═══ Beinhaus-Streifen: gefallene Figuren ═══════════════════════
   Geschlagene Figuren wandern nicht ins Nichts, sondern in den Streifen
   unter dem Kartendeck im LeftPanel — gruppiert nach Anzeigefarbe, mit
   demselben Chip wie auf dem Brett. Gefüllt von renderGraveyard() (render.js). */
#graveyardStrip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 8px; padding: 8px 12px;
  background: rgba(10,10,22,.55);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  min-height: 38px;
}
#graveyardStrip.gy-empty { opacity: .35; }
.gy-label {
  font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  color: #8a8aa8; white-space: nowrap;
}
.gy-group { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.gy-chip { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.gy-chip .piece-chip-img { width: 100%; height: 100%; object-fit: contain; filter: grayscale(.35) brightness(.85); }

/* ── Hand-Zeilen: Label ausgeblendet („Handkarten — …") ──
   Die Zugehörigkeit ist über die Position (unter Brett bzw. bei der
   Gegner-Identität) und die Karten selbst eindeutig — der Text ist
   redundanter Platz. */
.hand-row-label { display: none; }

/* ═══ Zugwechsel: ortsfestes Signal am Brett ═════════════════════
   flashTurn() (ui.js) blitzt bereits Vollbild in Spielerfarbe; zusätzlich
   pulst hier das Brett (#boardArea::after, dieselbe Ebene wie der
   Zugfarben-Schleier) und das eigene Identitätspanel. Klasse turn-change
   sitzt für 1,2 s auf #game (ui.js). */
@keyframes turnChangePulse {
  0%   { opacity: 0; }
  25%  { opacity: 1; }
  100% { opacity: 0; }
}
/* Kein `forwards`: nach dem Puls greift wieder das Stylesheet (turn-blue/red
   setzt opacity:1) — mit forwards bliebe der Schleier dauerhaft bei 0. */
#game.turn-change #boardArea::after { animation: turnChangePulse 1.2s ease; }
#game.turn-change #myIdentity { animation: turnChangePulse 1.2s ease; }
@media (prefers-reduced-motion: reduce) {
  #game.turn-change #boardArea::after,
  #game.turn-change #myIdentity { animation: none; }
}

/* ═══ Hover-Zugvorschau ══════════════════════════════════════════
   Fährt man über eine eigene, nicht ausgewählte Figur, deuten gestrichelte
   Ringe die möglichen Züge/Angriffe an — bewusst schwächer als die
   valid-move/valid-attack-Marker der echten Auswahl. Gesetzt von
   showHoverPreview() (render.js). */
.cell.preview-move::after,
.cell.preview-attack::after {
  content:''; position:absolute; inset:0; margin:20%; border-radius:50%;
  pointer-events:none; z-index:3;
}
.cell.preview-move::after {
  border: 2px dashed rgba(120,225,120,.55);
  background: rgba(100,220,100,.10);
}
.cell.preview-attack::after {
  border: 2px dashed rgba(230,90,70,.55);
  background: rgba(220,80,60,.12);
}

/* == Golden Screen v1: Run Map ==================================== */

  /* Spieler-Token (GS v1) */
  .run-player-token { fill: var(--accent-strong); stroke: #f4e8c8; stroke-width: .3; filter: drop-shadow(0 0 1.5px rgba(201,168,76,.8)); }
  .run-player-label { font-size: 1.4px; fill: #3a2c1a; pointer-events: none; font-family: 'Cinzel', serif; letter-spacing: .3px; font-weight: 700; }
  .run-roster { position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: linear-gradient(180deg, rgba(20,15,9,.55), rgba(12,9,5,.8)); border: 1px solid rgba(201,168,76,.25); border-radius: 10px; backdrop-filter: blur(2px); }
  .run-roster-label { font-family: 'Cinzel', serif; font-size: .62rem; text-transform: uppercase; letter-spacing: 1.6px; color: var(--gold-3); opacity: .8; flex-shrink: 0; }
  .run-roster-medaillons { display: flex; gap: 8px; flex-wrap: wrap; }
  .run-medallion { width: 58px; height: 58px; border-radius: 50%; padding: 0; border: 2px solid #6a5a3a; background: radial-gradient(circle at 35% 30%, #3a3226, #1a140c 75%); cursor: pointer; position: relative; transition: transform var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out); }
  .run-medallion img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; filter: sepia(.25) brightness(.92); }
  .run-medallion--held { border-color: var(--accent-strong); }
  .run-medallion:hover, .run-medallion:focus-visible { transform: translateY(-3px); border-color: var(--accent-strong); box-shadow: 0 4px 14px rgba(0,0,0,.55), 0 0 0 1px rgba(201,168,76,.4); outline: none; }
  .run-medallion:hover img { filter: sepia(.1) brightness(1.05); }
  .run-medallion-name { position: absolute; left: 50%; bottom: -18px; transform: translateX(-50%); font-size: .62rem; color: var(--text); white-space: nowrap; opacity: 0; transition: opacity var(--dur-micro) var(--ease-out); pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.9); }
  .run-medallion:hover .run-medallion-name { opacity: 1; }
  .run-medallion--mini { width: 34px; height: 34px; }
  .run-medallion--mini .run-medallion-name { display: none; }
  .run-medallion--mini img { filter: sepia(.2) brightness(.9); }
  /* 'Aktuelle Truppe' im Encounter-Dossier (GS v1: nur Erinnerung) */
  .run-detail-force { margin: 4px 0 14px; padding-top: 10px; border-top: 1px solid rgba(201,168,76,.25); }
  .run-detail-force-label { font-family: 'Cinzel', serif; font-size: .62rem; text-transform: uppercase; letter-spacing: 1.4px; color: var(--gold-3); opacity: .75; margin-bottom: 6px; }
  .run-detail-force-medaillons { display: flex; gap: 6px; flex-wrap: wrap; }
  /* Figuren-Dossier (GS v1: Karte bleibt sichtbar) */
  .run-figur-panel { position: fixed; right: 18px; bottom: 18px; width: min(320px, 88vw); z-index: 35; background: var(--surface-panel); border: 2px solid var(--accent-strong); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--elev-3); opacity: 0; pointer-events: none; transform: translateY(16px); transition: opacity var(--dur-normal) var(--ease-out), transform var(--dur-normal) var(--ease-overshoot); }
  .run-figur-panel.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .run-figur-close { position: absolute; top: 10px; right: 10px; }
  .run-figur-portrait { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent-strong); display: block; margin-bottom: 10px; filter: sepia(.15); }
  /* Run-Management-Folio (GS v1: physisches Dokument, Karte bleibt sichtbar) */
  .run-deck-overlay { background: rgba(8,6,4,.55); padding: 32px; }
  .run-deck-panel { width: min(1060px, 86vw); transform: translateY(14px) rotate(-.4deg); }
  .run-folio-grid { display: grid; grid-template-columns: minmax(200px, 1fr) 2.2fr; gap: 20px; }
  .run-folio-col { min-width: 0; }
  .run-folio-col-titel { font-family: 'Cinzel', serif; font-size: .7rem; text-transform: uppercase; letter-spacing: 1.6px; color: var(--gold-3); border-bottom: 1px solid rgba(201,168,76,.3); padding-bottom: 6px; margin-bottom: 10px; }
  .run-folio-figuren { display: flex; flex-direction: column; gap: 8px; }
  .run-folio-figur { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: rgba(255,255,255,.02); cursor: pointer; }
  .run-folio-figur:hover, .run-folio-figur:focus-visible { border-color: var(--accent-strong); background: rgba(201,168,76,.06); outline: none; }
  .run-folio-figur img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid #6a5a3a; filter: sepia(.2); }
  .run-folio-figur-name { font-size: .8rem; color: var(--text); }
  .run-folio-figur-rolle { font-size: .66rem; color: var(--text-muted); }
  @media (max-width: 860px) { .run-folio-grid { grid-template-columns: 1fr; } }
/* ═══════════════════════════════════════════════════
   ROGUELIKE — STORY-INTRO (Vollbild, Autoplay) & START-DECK-WAHL
   ═══════════════════════════════════════════════════ */
.run-intro-screen { position: relative; overflow: hidden; background: #050403; padding: 0; }
.run-intro-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center center; z-index: 1; display: block;
  background: #050403; border: none;
  animation: kenburns 6s ease-out forwards;
}
.run-intro-dunkel {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.25) 38%, transparent 55%);
}
.run-intro-text {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 78px; z-index: 3;
  width: min(900px, 92vw); padding: 16px 24px; border-radius: 12px;
  background: var(--surface-panel); border: 2px solid var(--accent-strong);
  box-shadow: var(--elev-3); text-align: center;
  font-family: 'Georgia', serif; font-style: italic; font-size: 1.05rem; line-height: 1.55; color: var(--text);
}
.run-intro-controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; align-items: center;
  justify-content: center; gap: 12px; padding: 12px 16px;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent);
}
.run-intro-controls, .run-intro-controls * { cursor: pointer; }
.run-intro-zaehler {
  font-family: 'Cinzel', serif; font-size: .78rem; letter-spacing: 2px; color: var(--gold-3);
}
/* Skip-Hinweis — rechts unten auf dem Bild, erscheint beim Hover */
.run-intro-skip-hint {
  position: absolute; right: 24px; bottom: 96px; z-index: 5;
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(0,0,0,.45); border: 2px solid rgba(244,236,216,.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: rgba(244,236,216,.7); pointer-events: none;
  opacity: 0; transition: opacity .3s ease;
}
.run-intro-screen:hover .run-intro-skip-hint { opacity: 1; }
@keyframes kenburns {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}
.run-gallery {
  width: min(1080px, 96vw); text-align: center; background: var(--surface-panel);
  border: 3px solid var(--accent-strong); border-radius: 16px; padding: 28px 26px;
  box-shadow: var(--elev-3);
  position: relative;
}
.run-gallery-head {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  position: relative;
}
.run-gallery-head .run-gallery-deck-toggle { position: absolute; right: 0; }
.run-gallery-hinweis { color: var(--text-muted); font-size: .88rem; margin: 4px 0 0; }
.run-gallery-actions { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }
.run-gallery-actions .btn { min-width: 220px; }
@media (max-width: 860px) { .run-intro-text { bottom: 76px; font-size: .92rem; } }

/* ═══════════════════════════════════════════════════
   ROGUELIKE — START-DECK-WAHL als „Magnetic Carousel“
   ═══════════════════════════════════════════════════
   Portiert aus Originkit `magneticcarousel` (macOS-Dock-Effekt) in Vanilla-JS:
   eine Reihe schmaler Karten-Balken, die sich beim Nähern des Cursors
   vergrößern — die Karte unter dem Cursor wächst am stärksten, Nachbarn
   klingen mit dem Abstand ab. Das Magnify wird von einem rAF-Easing-Loop in
   run.js getrieben (keine CSS-Transition), damit es dem Cursor glatt folgt.
   Klick wählt die Karte aus (2 von 4), nicht „groß öffnen“: die Auswahl ist
   hier die Interaktion, nicht eine Galerie-Vorschau. */
.run-deck-carousel {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  gap: 20px;
  margin-top: 22px;
  padding: 32px 12px;
  min-height: 340px;
  overflow: visible;
}
.run-deck-carousel-item {
  flex: none;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  outline: none;
  /* Breite/Höhe setzt der rAF-Loop inline; Transform-Origin Mitte. */
}
.run-deck-carousel-scaler {
  flex: none;
  width: 140px; height: 210px; /* entspricht buildCardNode().card */
  will-change: transform;
  transform-origin: center center;
}
/* Im Karussell übernimmt der JS-Loop das Schweben — die statische
   Karten-Hover-Transformation (translateY/rotate) würde dem Magnify
   ins Gehege kommen. */
.run-deck-carousel-item .card { transition: box-shadow .15s, border-color .15s; }
.run-deck-carousel-item .card:hover { transform: none; }
.run-deck-carousel-item:focus-visible .card {
  box-shadow: 0 0 0 3px rgba(201,168,76,.65);
}
/* Ausgewählte Karte: goldener Ring + Glow, bleibt erkennbar vergrößert. */
.run-deck-carousel-item.selected .card {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--accent-strong), 0 12px 34px rgba(201,168,76,.55);
}
@media (max-width: 620px) {
  .run-deck-carousel { gap: 10px; padding: 24px 8px; min-height: 240px; }
}

/* ── Deck-Seitenleiste (aufklappbar, von rechts) ── */
.run-gallery-deck {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(360px, 92vw);
  background: linear-gradient(170deg, #1c1813 0%, #15110c 100%);
  border-left: 2px solid var(--accent-strong);
  box-shadow: var(--elev-3);
  z-index: 60;
  padding: 18px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.run-gallery-deck.open { transform: translateX(0); }
.run-gallery-deck-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.run-gallery-deck-titel { font-family: 'Cinzel', serif; font-size: 1rem; color: var(--accent-strong); }
.run-gallery-deck-close { margin-left: auto; }
.run-gallery-deck-cards { display: flex; flex-direction: column; gap: 14px; }
.run-gallery-deck-cards .run-deck-gitter { justify-content: center; }

/* Verpasste Bonuskarte (Ansicht-Modus) */
.run-gallery-verpasst {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  z-index: 4; font-size: .62rem; letter-spacing: .6px; text-transform: uppercase;
  background: rgba(120,20,20,.85); color: #f6d8d0;
  padding: 2px 10px; border-radius: var(--r-pill); font-weight: 700;
  pointer-events: none;
}
.run-deck-carousel-item.verpasst .card { opacity: .45; filter: grayscale(.5); }
.run-deck-carousel-item.verpasst { cursor: default; }

/* Rast-Karten: echte Karten im umbrechenden Raster */
.run-rast-card { position: relative; }
.run-rast-card.off { opacity: .35; pointer-events: none; }

/* ── EINSTELLUNGEN (Audio) ──
   Zahnrad-Button + Overlay. Das Overlay liegt über Menü UND laufendem Spiel. */
.settings-gear {
  width: 38px; height: 38px; padding: 0; border-radius: 50%;
  background: var(--surface-panel); border: 2px solid var(--accent-strong);
  box-shadow: 0 3px 0 var(--border), var(--rim-light);
  font-size: 1.05rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s;
}
.settings-gear:hover { transform: scale(1.08); }
.settings-gear:active { transform: scale(.95); }
#settingsBtnMenu.settings-gear { position: fixed; top: 12px; right: 14px; z-index: 85; }

.settings-overlay {
  position: fixed; inset: 0; z-index: 95;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,6,4,.72);
  backdrop-filter: blur(3px);
}
.settings-box {
  width: min(340px, calc(100vw - 40px));
  background: var(--surface-panel);
  border: 2px solid var(--accent-strong);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.settings-row { display: flex; align-items: center; gap: 14px; margin: 14px 0; }
.settings-label {
  min-width: 84px; color: var(--text-muted); font-size: .78rem;
  text-transform: uppercase; letter-spacing: .06em;
}
.settings-value { color: var(--text); font-size: .85rem; min-width: 42px; text-align: right; }
.settings-box input[type="range"] { flex: 1; accent-color: var(--accent-strong); }
#audioMuteBtn.is-muted { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ── GEGNER-LEITER (vs KI) ────────────────────────────── */
.bot-ladder-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  max-height: 300px;
  overflow-y: auto;
}
.bot-ladder-item {
  text-align: left;
  border: 1px solid var(--border, #333);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  background: var(--surface-panel, rgba(0,0,0,.25));
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.bot-ladder-item:hover:not(.locked) { border-color: var(--accent-strong, #c8a24a); }
.bot-ladder-item.picked {
  border-color: var(--accent-strong, #c8a24a);
  box-shadow: 0 0 0 1px var(--accent-strong, #c8a24a) inset;
}
.bot-ladder-item.locked {
  opacity: .5;
  cursor: not-allowed;
}
.bot-ladder-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.bot-ladder-name { font-weight: 600; color: var(--text, #eee); font-size: .9rem; }
.bot-ladder-rating { color: var(--text-muted, #999); font-size: .8rem; font-variant-numeric: tabular-nums; }
.bot-ladder-focus { color: var(--accent-strong, #c8a24a); font-size: .72rem; margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }
.bot-ladder-desc { color: var(--text-muted, #999); font-size: .76rem; margin-top: 4px; line-height: 1.35; }

/* ═══════════════════════════════════════════════════
   SPIELER-PROFIL (js/ui/playerprofile.js)
   Overlay über dem Menü. Alle Farben pro Profil laufen über --pp-accent /
   --pp-glow und bleiben damit auf die Profil-UI beschränkt — das globale
   Menü-Theme wird bewusst NICHT überschrieben.
   ═══════════════════════════════════════════════════ */
body.pp-lock { overflow: hidden; }

.pp-overlay {
  position: fixed; inset: 0; z-index: 96;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,6,4,.80);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 20px;
}
.pp-panel {
  position: relative;
  display: grid; grid-template-columns: 264px 1fr; gap: 26px;
  width: min(880px, 100%); max-height: 92vh; overflow: auto;
  background: var(--surface-panel);
  border: 2px solid var(--border); border-radius: 18px;
  padding: 26px;
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
}
.pp-close {
  position: absolute; top: 12px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface-subtle);
  color: var(--text); cursor: pointer; font-size: .95rem; line-height: 1;
  transition: border-color .15s, color .15s, transform .12s;
}
.pp-close:hover { border-color: var(--accent-strong); color: var(--accent-strong); transform: scale(1.06); }

/* ── Vorschau: die „Identitätskarte" ── */
.pp-preview {
  --pp-accent: #4a7a9a; --pp-glow: #7ab8d4;
  align-self: start;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 18px 16px 20px; border-radius: 16px;
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--pp-accent) 34%, transparent), transparent 70%),
    var(--surface-subtle);
  border: 1px solid color-mix(in srgb, var(--pp-accent) 55%, var(--border));
  box-shadow: inset 0 0 40px color-mix(in srgb, var(--pp-accent) 18%, transparent);
  overflow: hidden;
}
.pp-preview-flag {
  min-height: 1.1em; font-size: .6rem; letter-spacing: .18em;
  text-transform: uppercase; text-align: center;
  color: color-mix(in srgb, var(--pp-glow) 82%, white);
}
.pp-preview-portrait {
  width: 150px; height: 184px; border-radius: 10px; overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--pp-accent) 70%, var(--border));
  background: linear-gradient(180deg, color-mix(in srgb, var(--pp-accent) 30%, transparent), transparent);
  box-shadow: 0 8px 26px color-mix(in srgb, var(--pp-accent) 45%, transparent);
}
.pp-preview-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-preview-name {
  max-width: 100%; margin-top: 4px; text-align: center;
  font-family: 'Cinzel', Georgia, serif; font-size: 1.15rem; font-weight: 700;
  color: var(--text); letter-spacing: .5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pp-preview-house { font-size: .82rem; color: color-mix(in srgb, var(--pp-glow) 85%, white); }
.pp-preview-motto { font-size: .74rem; font-style: italic; text-align: center; color: var(--text-muted); }
.pp-preview-rank {
  margin-top: 6px; padding: 4px 12px; border-radius: 999px;
  background: var(--gold-sheen); color: var(--on-accent);
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.pp-preview-sub {
  min-height: 1.1em; font-size: .68rem; text-align: center; color: var(--text-muted);
}

/* ── Rechte Seite ── */
.pp-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pp-title {
  margin: 0; font-family: 'Cinzel', serif; font-size: 1.35rem;
  letter-spacing: 1px; color: var(--accent-strong);
}
.pp-sub { margin: -8px 0 0; font-size: .78rem; line-height: 1.5; color: var(--text-muted); }
.pp-step { display: flex; flex-direction: column; gap: 8px; }
.pp-step-label {
  display: flex; align-items: center; gap: 8px;
  font-size: .72rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-muted);
}
.pp-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #2a1d0a;
  font-size: .68rem; font-weight: 700; letter-spacing: 0; text-transform: none;
}
.pp-step-hint {
  margin-left: auto; font-size: .68rem; font-weight: 400;
  letter-spacing: 0; text-transform: none; color: var(--text-muted);
}

/* Häuser */
.pp-factions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pp-faction {
  --fc: #4a7a9a;
  display: flex; gap: 10px; align-items: flex-start; text-align: left;
  padding: 12px; border-radius: 12px; cursor: pointer; color: var(--text);
  background: var(--surface-subtle); border: 1px solid var(--border);
  font-family: inherit;
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.pp-faction:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--fc) 60%, var(--border)); }
.pp-faction.picked {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 1px var(--accent-strong) inset, 0 6px 20px color-mix(in srgb, var(--fc) 40%, transparent);
}
.pp-faction-swatch {
  flex: 0 0 auto; width: 14px; height: 46px; border-radius: 4px;
  background: linear-gradient(180deg, var(--fc), color-mix(in srgb, var(--fc) 55%, black));
  box-shadow: 0 0 12px color-mix(in srgb, var(--fc) 60%, transparent);
}
.pp-faction-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pp-faction-name { font-size: .9rem; font-weight: 700; }
.pp-faction-desc { font-size: .68rem; color: var(--text-muted); }
.pp-faction-motto { font-size: .66rem; font-style: italic; color: color-mix(in srgb, var(--fc) 70%, white); }

/* Ränge — gesperrte bleiben sichtbar (Aufstieg als Ziel, wie die Gegner-Leiter) */
.pp-ranks { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.pp-rank {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 4px 8px; border-radius: 10px; cursor: pointer; color: var(--text);
  background: var(--surface-subtle); border: 1px solid var(--border);
  font-family: inherit;
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.pp-rank img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; display: block; }
.pp-rank-name { font-size: .6rem; color: var(--text-muted); }
.pp-rank:hover:not(.locked) { transform: translateY(-2px); border-color: var(--accent-strong); }
.pp-rank.picked { border-color: var(--accent-strong); box-shadow: 0 0 0 1px var(--accent-strong) inset; }
.pp-rank.picked .pp-rank-name { color: var(--text); font-weight: 700; }
.pp-rank.locked { cursor: not-allowed; opacity: .42; filter: grayscale(.6); }
.pp-rank-lock {
  position: absolute; top: 4px; right: 4px;
  padding: 1px 5px; border-radius: 999px;
  background: rgba(0,0,0,.62); color: #ffe9b0;
  font-size: .56rem; letter-spacing: .02em;
}

/* Name + Aktionen */
.pp-input {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  background: var(--surface-subtle); border: 1px solid var(--border);
  color: var(--text); font-size: .95rem; font-family: inherit;
}
.pp-input:focus {
  outline: none; border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-strong) 30%, transparent);
}
.pp-actions { display: flex; gap: 10px; margin-top: 4px; }
.pp-actions .btn { flex: 1; }

/* ── Menükarte: Identität ── */
.pp-card { --pp-accent: #4a7a9a; --pp-glow: #7ab8d4; gap: 12px; cursor: pointer; }
.pp-card:hover { border-color: color-mix(in srgb, var(--pp-accent) 60%, var(--border)); }
.pp-card:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.pp-card-head { display: flex; align-items: center; gap: 12px; }
.pp-avatar {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; overflow: hidden;
  background: var(--surface-subtle);
  border: 2px solid color-mix(in srgb, var(--pp-accent) 70%, var(--border));
  box-shadow: 0 0 14px color-mix(in srgb, var(--pp-accent) 45%, transparent);
}
.pp-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-card-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.pp-house {
  font-size: .7rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pp-edit-btn { flex: 0 0 auto; }
.pp-card .profile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 760px) {
  .pp-panel { grid-template-columns: 1fr; padding: 20px; gap: 18px; }
  .pp-preview { flex-direction: row; align-items: center; text-align: left; flex-wrap: wrap; }
  .pp-preview-portrait { width: 84px; height: 104px; }
  .pp-preview-name { text-align: left; }
  .pp-ranks { grid-template-columns: repeat(4, 1fr); }
}

/* ═══════════════════════════════════════════════════
   ONLINE — ein Einstieg (Erstellen / Beitreten)
   Die Identität oben kommt aus dem Spielerprofil (--pp-accent), der Rest ist
   bewusst schlicht: zwei Wege, ein Status, ein Start-Knopf. Server und Konto
   (geplanter Ausbau) liegen unter „Erweitert" (details).
   ═══════════════════════════════════════════════════ */
.pp-online-strip {
  --pp-accent: #4a7a9a; --pp-glow: #7ab8d4;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 10px; border-radius: 12px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--pp-accent) 18%, transparent), transparent),
    var(--surface-subtle);
  border: 1px solid color-mix(in srgb, var(--pp-accent) 45%, var(--border));
}
.pp-online-avatar {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--pp-accent) 70%, var(--border));
  box-shadow: 0 0 12px color-mix(in srgb, var(--pp-accent) 40%, transparent);
  background: var(--surface-panel);
}
.pp-online-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-online-id { flex: 1; min-width: 0; }
.pp-online-name {
  font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: .95rem;
  color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pp-online-house { font-size: .72rem; color: var(--text-muted); }
.pp-online-edit { flex: 0 0 auto; }

.online-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.online-pane {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px; border-radius: 12px;
  background: var(--surface-subtle); border: 1px solid var(--border);
}
.online-pane-title {
  font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700;
}
.online-code-actions { display: flex; gap: 8px; }
.online-code-actions .btn { flex: 1; padding: 8px 10px; font-size: .78rem; }

.online-advanced { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.online-advanced > summary {
  cursor: pointer; list-style: none; user-select: none;
  font-size: .76rem; color: var(--text-muted); padding: 6px 0;
}
.online-advanced > summary::-webkit-details-marker { display: none; }
.online-advanced > summary::before { content: '▸ '; color: var(--accent-strong); }
.online-advanced[open] > summary::before { content: '▾ '; }
.online-advanced > summary:hover { color: var(--text); }
.online-advanced .settings-box { margin-top: 10px; }
.online-tabs { display: flex; gap: 8px; margin: 12px 0 8px; flex-wrap: wrap; }
.online-tabs .online-tab { flex: 1; min-width: 104px; font-size: .76rem; }

@media (max-width: 620px) {
  .online-grid { grid-template-columns: 1fr; }
}

/* Verbindungsaufbau im Online-Panel: der Status pulsiert, solange der Peer aufbaut. */
#statusMsg.is-busy { color: var(--accent-strong); animation: onlineBusy 1.1s ease-in-out infinite; }
@keyframes onlineBusy { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
/* ═══ ANGRIFFS-ANZEIGE ══════════════════════════════════════════════
   Drei Aussagen, die zusammen die Angriffsphase lesbar machen, ohne dass
   irgendetwas angeklickt werden muss:

     1. .cell.attack-target  — hier steht eine gegnerische Figur, die JETZT
        von mindestens einer eigenen Figur erreicht wird (rot).
     2. .piece.kann-angreifen — diese eigene Figur hat ein Ziel und kann
        zuschlagen (goldener Ring + Klingen-Marke).
     3. .piece.kein-angriff  — diese Figur kann nichts mehr tun: hatten
        angreifen, kein Ziel, eingefroren oder blockiert. Sie wird abgeblendet,
        damit der Blick von selbst zu den einsatzfähigen Figuren wandert.

   Quellen: angriffsUebersicht()/angriffsStatus() (game.js) → render.js.
   Nur in Phasen mit Angriff — sonst wäre „kann nicht angreifen" für jede
   Figur wahr und damit wertlos.

   Kein ::before/::after auf der Zelle: beide sind auf dem Brett schon
   vergeben (Aura-Radial, Zug-/Angriffs-Motiv, Taunt-Warnung, Airdrop-Kiste).
   Deshalb Ring + Schein über outline/box-shadow. */

.cell.attack-target {
  outline: 3px solid rgba(226, 74, 62, .85);
  outline-offset: -3px;
  box-shadow: inset 0 0 16px rgba(226, 74, 62, .38);
  animation: attackTargetPuls 1.5s ease-in-out infinite;
}
@keyframes attackTargetPuls {
  0%, 100% { outline-color: rgba(226, 74, 62, .55); box-shadow: inset 0 0 10px rgba(226, 74, 62, .22); }
  50%      { outline-color: rgba(240, 96, 82, 1);   box-shadow: inset 0 0 20px rgba(240, 96, 82, .48); }
}

/* Einsatzbereite Figur: goldener Ring, leichtes Atmen, Klingen-Marke oben
   rechts. Bewusst NICHT rot — Rot gehört auf dem Brett den gegnerischen
   Zielfeldern, und eine Figur soll nicht wie eine Bedrohung aussehen.
   Die Marke ist ein echtes <span class="atk-badge"> (render.js), weil ::after
   an der Figur schon den Roguelike-Held markiert. */
.piece.kann-angreifen {
  outline: 2.5px solid rgba(var(--accent-rgb), .95);
  outline-offset: 1px;
  animation: kannAngreifenPuls 1.8s ease-in-out infinite;
  z-index: 3;
}
.piece .atk-badge {
  position: absolute; top: -6px; right: -6px; z-index: 3;
  font-size: clamp(9px, calc(var(--cell) * .22), 16px);
  line-height: 1;
  color: #fff3cf;
  text-shadow: 0 0 4px rgba(0, 0, 0, .95), 0 1px 2px #000;
  pointer-events: none;
}
@keyframes kannAngreifenPuls {
  0%, 100% { box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .30), 0 0 8px rgba(var(--accent-rgb), .35); }
  50%      { box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .16), 0 0 16px rgba(var(--accent-rgb), .55); }
}

/* Verbrauchte Figur: entsättigt, leicht unscharf, abgedunkelt. Der Blur sitzt
   auf dem Chip (.picon), nicht auf dem Rahmen — sonst verlöre die Figur ihre
   Silhouette gegen das Brett. Die Klasse .frozen-piece setzt ebenfalls einen
   filter; die Kombination unten hält den Eis-Ton, statt ihn zu überschreiben. */
.piece.kein-angriff { opacity: .72; }
.piece.kein-angriff .picon { filter: grayscale(.9) brightness(.72) blur(.5px); }
.piece.frozen-piece.kein-angriff .picon { filter: hue-rotate(180deg) saturate(.35) brightness(.95) blur(.4px); }

/* Hover-Vorschau auf eine GEGNERISCHE Figur: gestrichelter Ring auf den
   eigenen Figuren, die sie erreichen könnten (input.js:_zeigeAngreiferVorschau).
   Bewusst schwächer als .kann-angreifen — es ist eine Antwort auf „wer hier?",
   keine Daueranzeige. */
.piece.preview-source {
  outline: 2px dashed rgba(var(--accent-rgb), .9);
  outline-offset: 2px;
}

/* Textzeile im Figuren-Tooltip (render.js:_angriffsHinweisHTML). */
.tooltip-attack { color: var(--success); margin-top: 4px; }

/* Statischer Wucht-Rest im Kampfdialog: bei „Bewegung reduzieren" oder ohne
   GSAP gibt es keine Partikel, aber die Trefferstufe bleibt ablesbar
   (combat.js setzt data-treffer-stufe). outline statt box-shadow, damit die
   Sieg-/Niederlage-Einfärbung von #combatBox unangetastet bleibt. */
#combatBox[data-treffer-stufe="2"] { outline: 2px solid rgba(255, 186, 96, .45); outline-offset: 3px; }
#combatBox[data-treffer-stufe="3"] { outline: 3px solid rgba(255, 138, 58, .62); outline-offset: 5px; }

/* ── KAMPF-EFFEKTE (js/rendering/combat-fx.js) ──────────────────────
   Die Chips verlassen für den Flug das Brett (fixed, an <body>) — dieselbe
   Technik wie die Geister in render.js. Alles pointer-events:none: der Flug
   darf keinen Klick schlucken. */
.fx-flug-chip { border-radius: 50%; will-change: transform; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .65)); }
/* Der Treffer auf dem Brett: dieselbe Kopie, aber über dem Brett statt darüber
   schwebend — der Schatten fällt kürzer aus, weil die Figur hier „steht". */
.fx-schlag-chip { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .7)); }
.fx-flug-schatten {
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 62%, rgba(0, 0, 0, .6) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(3px);
  opacity: .32;
  will-change: transform, opacity;
}
.fx-partikel { display: block; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; will-change: transform, opacity; }
.fx-funken  { background: radial-gradient(circle, #fff8d0 0%, #ffcf5c 45%, rgba(255, 150, 40, 0) 72%); box-shadow: 0 0 6px rgba(255, 210, 120, .9); }
.fx-staub   { width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px; border-radius: 50%; filter: blur(1px); background: radial-gradient(circle, rgba(216, 198, 162, .8) 0%, rgba(150, 128, 96, 0) 72%); }
.fx-brocken { width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 2px; background: linear-gradient(140deg, #b9ab93, #6d6151); box-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.fx-blitz {
  width: var(--fx-blitz-groesse, 90px); height: var(--fx-blitz-groesse, 90px);
  margin: calc(var(--fx-blitz-groesse, 90px) / -2) 0 0 calc(var(--fx-blitz-groesse, 90px) / -2);
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(255, 244, 214, .85) 35%, rgba(255, 200, 90, 0) 70%);
  mix-blend-mode: screen;
}
/* Spitze Trefferblase (Hearthstone: „spiky impact bubble") — bei JEDEM Treffer,
   wachsend mit der Stufe. Sie ist der Grund, warum ein 4:3 anders aussieht als
   ein 6:1, noch bevor das Ergebnis dasteht. */
.fx-trefferblase {
  width: var(--fx-blase, 54px); height: var(--fx-blase, 54px);
  margin: calc(var(--fx-blase, 54px) / -2) 0 0 calc(var(--fx-blase, 54px) / -2);
  background: radial-gradient(circle, #fffdf2 0%, #ffd869 55%, rgba(255, 150, 40, 0) 78%);
  clip-path: polygon(50% 0%, 60% 26%, 84% 12%, 76% 40%, 100% 50%, 76% 60%,
                     84% 88%, 60% 74%, 50% 100%, 40% 74%, 16% 88%, 24% 60%,
                     0% 50%, 24% 40%, 16% 12%, 40% 26%);
  filter: drop-shadow(0 0 6px rgba(255, 190, 80, .85));
}

@media (prefers-reduced-motion: reduce) {
  .cell.attack-target { animation: none; outline-color: rgba(240, 96, 82, 1); }
  .piece.kann-angreifen { animation: none; outline-width: 3px; }
  /* Ohne Puls muss die Aussage ruhen: der Ring bleibt, die Marke bleibt. */
  .fx-flug-chip, .fx-flug-schatten, .fx-partikel, .fx-blitz, .fx-trefferblase { display: none; }
}


/* ═══ 3D-WÜRFEL-EBENE (js/rendering/dice3d.js) ═══════════════════════
   Die Leinwand der Dice-Box liegt in #diceLayer. Vier Eigenschaften sind hier
   Absicht und dürfen nicht wegoptimiert werden:

     position:absolute  → wird von _dice3dPositionieren() exakt auf das
                          Rechteck von #board gelegt (left/top/width/height).
     overflow:hidden    → DIE Begrenzung. Physikalisch geworfene Würfel können
                          über den Rand fliegen; hier werden sie abgeschnitten,
                          statt über Panels, Knöpfe oder Menüs zu rutschen.
     pointer-events:none→ Klicks gehen immer an die Zellen darunter. Die
                          Würfelbedienung bleibt exakt die bisherige.
     z-index:4          → über Figuren (2) und über dem Fackellicht-Overlay (3),
                          aber unter Dialogen (ab 100).

   Wer die Klammer testet: #diceLayer darf nie größer sein als #board. */
#diceLayer {
  position: absolute;
  left: 0; top: 0; width: 0; height: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 4;
  border-radius: 6px;      /* gleiche Rundung wie der Brettrahmen */
}
/* Die Bibliothek setzt nur .dice-box-canvas und bringt keine Größe mit. */
#diceLayer canvas,
#diceLayer .dice-box-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  background: transparent;
}


/* The journal uses the same dark surface and house colors as the board. */
.journal {
  width: min(940px, calc(100vw - 32px));
  max-height: min(880px, calc(100dvh - 36px));
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  color: #eee5da;
  background: #17141a;
  border: 1px solid #6f5741;
  border-radius: 12px;
  box-shadow: 0 24px 80px #080609b3;
  color-scheme: dark;
}
.journal::backdrop { background: #09070bd9; }
.journal-cover {
  position: relative;
  min-height: 172px;
  display: grid;
  align-content: end;
  gap: 5px;
  padding: 24px 30px;
  border-bottom: 1px solid #694f37;
  background: linear-gradient(90deg, #19131af5 10%, #19131a40 72%), #241d23 url('assets/ui/menu/duellbuch.webp') center / cover no-repeat;
}
.journal-cover h2 { margin: 0; font-size: clamp(2.35rem, 6vw, 4rem); line-height: 1; letter-spacing: -.035em; }
.journal-cover p { margin: 0; color: #e0c8ab; }
.journal-close {
  position: absolute;
  inset: 14px 14px auto auto;
  width: 42px;
  height: 42px;
  border: 1px solid #9a7d61;
  border-radius: 50%;
  background: #160f15e8;
  color: #fff3e1;
  font-size: 1.5rem;
  cursor: pointer;
}
.journal-body { padding: 22px 30px; }
.journal-summary, .journal-lives { display: grid; gap: 10px; margin: 0; }
.journal-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 0 18px; }
.journal-summary > div { border-top: 1px solid #665244; padding-top: 10px; }
.journal-summary dt, .journal-life dt, .journal-mode, .journal-meta { color: #d3bba4; font-size: .82rem; }
.journal-summary dd { margin: 4px 0 0; font-size: 1.65rem; font-variant-numeric: tabular-nums; }
.journal-saves { display: grid; gap: 8px; margin-bottom: 18px; }
.journal-saves[hidden] { display: none; }
.journal-save {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #242025;
  border: 1px solid #544437;
  border-radius: 6px;
}
.journal-save span { display: block; color: #d3bba4; font-size: .8rem; }
.journal-save button { flex-shrink: 0; }
.journal-controls { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 12px; }
.journal-controls label { display: grid; gap: 4px; color: #d3bba4; font-size: .8rem; }
.journal-controls select { padding: 7px 10px; border: 1px solid #78614d; border-radius: 5px; background: #272026; color: #fff3e1; }
.journal-index { display: grid; grid-template-columns: minmax(180px, .75fr) minmax(0, 1.4fr); gap: 18px; border-top: 1px solid #58483d; padding-top: 14px; }
.journal-matches, .journal-events { list-style: none; padding: 0; margin: 0; }
.journal-matches { display: grid; align-content: start; gap: 4px; max-height: 372px; overflow: auto; }
.journal-match {
  display: grid;
  text-align: left;
  gap: 4px;
  width: 100%;
  min-height: 50px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #f0dfc8;
  background: #221d22;
  font: inherit;
  cursor: pointer;
}
.journal-match[aria-pressed='true'] { border-color: #9c7956; background: #382a25; }
.journal-match span { font-size: .75rem; color: #d3bba4; }
.journal-detail h3 { margin: 3px 0; font-size: clamp(1.3rem, 3vw, 2rem); }
.journal-detail h4 { border-top: 1px solid #58483d; margin: 14px 0 10px; padding-top: 10px; }
.journal-mode, .journal-meta { margin: 0 0 8px; }
.journal-lives { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.journal-life { border-inline-start: 3px solid #577b9d; padding-inline-start: 9px; }
.journal-life--black { border-inline-start-color: #a75752; }
.journal-life dd { margin: 4px 0 0; }
.journal-events { max-height: 210px; overflow: auto; }
.journal-event-turn { margin: 10px 0 4px; color: #e9c295; font-weight: 700; }
.journal-event { margin-bottom: 4px; color: #e8dbcc; font-size: .9rem; overflow-wrap: anywhere; }
.journal-status:empty { display: none; }
.journal :focus-visible { outline: 2px solid #edc997; outline-offset: -2px; }
.private-online-grid { margin-block: 14px 8px; }
.private-online-grid h3 { margin-top: 0; }
.private-online-grid label { display: block; margin-bottom: 6px; }
.private-online-grid input { min-width: 0; }
.invite-code-wrap { margin-top: 14px; }
.invite-code-wrap code { display: block; margin-bottom: 10px; font-size: 1rem; letter-spacing: .12em; }
.private-online-status { min-height: 1.4em; margin: 10px 0; }
.private-online-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
@media (max-width: 620px) {
  .journal { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .journal-cover { min-height: 135px; padding: 18px; }
  .journal-body { padding: 16px; }
  .journal-index { grid-template-columns: 1fr; gap: 12px; }
  .journal-matches { max-height: 150px; }
  .journal-events { max-height: none; }
  .journal-summary { gap: 6px; }
  .journal-summary dt { font-size: .75rem; }
}
