/* --- 1. BASIS & LAYOUT --- */
body {
    margin: 0; padding: 0; font-family: sans-serif;
    background: #1b5e20; color: #fff;
    height: 100vh; display: flex; flex-direction: column; overflow: hidden;
}

/* --- 2. SCOREBOARD & EVALUATION --- */
#status-container { position: relative; z-index: 3000 !important; background: #111; color: #eee; padding: 10px; font-family: 'Arial Black', sans-serif; }
.global-info { text-align: center; color: #f1c40f; margin-bottom: 10px; font-size: 0.9em; }
.scoreboard-ribbon { display: flex; align-items: stretch; justify-content: center; height: 85px; }
.team-block { flex: 1; display: flex; align-items: center; }
.spacer { flex: 1; }
.active-status-box { width: 100px; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 0.8em; background: #222; color: #444; border: 1px solid #333; transition: all 0.3s; }
.stat-box-active { border: 2px solid #f1c40f !important; }
.stat-box-active .active-status-box { background: #f1c40f; color: #000; font-weight: bold; }
.static-info { padding: 0 15px; min-width: 110px; font-size: 0.75em; }
.player-label { color: #888; margin-bottom: 2px; }
.team-a .player-label { color: #3498db; }
.team-b .player-label { color: #e74c3c; }
.es-block { width: 170px; text-align: center; }
.es-label { font-size: 0.85em; color: #666; letter-spacing: 1px; }
.eval-strength { font-size: 2.8em; line-height: 1; color: #333; }
.active-a { color: #3498db !important; text-shadow: 0 0 15px rgba(52, 152, 219, 0.6); }
.active-b { color: #e74c3c !important; text-shadow: 0 0 15px rgba(231, 76, 60, 0.6); }
.center-bridge { width: 140px; display: flex; flex-direction: column; justify-content: center; text-align: center; background: #1a1a1a; border-left: 2px solid #333; border-right: 2px solid #333; font-size: 0.75em; }
#stat-owner, #stat-zone { color: #fff; font-weight: bold; }

/* --- Torschuss-Anzeige an der Anzeigetafel (StatusUI.showShotReport) --- */
.center-bridge { transition: width 0.3s ease; }
#shot-banner { display: none; }
.center-bridge.shot-active { width: 220px; }
.center-bridge.shot-active > :not(#shot-banner) { display: none; }
.center-bridge.shot-active #shot-banner { display: block; animation: shot-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
#shot-banner-text {
    font-family: 'Arial Black', sans-serif;
    font-size: 1.9em;
    color: #bdc3c7;
    white-space: nowrap;
}
#shot-banner-sub { color: #fff; font-size: 1.1em; margin-top: 4px; }
.center-bridge.shot-goal #shot-banner-text {
    color: #f1c40f;
    text-shadow: 0 0 10px #f39c12, 0 0 20px #e67e22;
    animation: shot-goal-stretch 0.6s ease-in-out infinite alternate;
}
.eval-detail { font-size: 0.8em; color: #aaa; min-height: 1.2em; white-space: nowrap; }

@keyframes shot-pop {
    from { transform: scale(0.3); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
@keyframes shot-goal-stretch {
    from { letter-spacing: 0;     transform: scale(1); }
    to   { letter-spacing: 0.1em; transform: scale(1.08); }
}

.eval-strength-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
}

.keyword-bonus-tag {
    font-size: 1.2rem; /* Deutlich kleiner als die 2.8em der Hauptzahl */
    color: #f1c40f;    /* Gold */
    font-weight: bold;
    margin-left: 4px;
    margin-top: 5px;   /* Etwas nach oben versetzt */
    text-shadow: 0 0 8px rgba(241, 196, 15, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease-in;
}

.keyword-bonus-tag.show {
    opacity: 1;
    animation: keyword-pulse-gold 1s infinite alternate;
}

@keyframes keyword-pulse-gold {
    from { transform: scale(1); text-shadow: 0 0 5px #f1c40f; }
    to { transform: scale(1.1); text-shadow: 0 0 15px #f1c40f; }
}

/* Kompakte Zonen-Matrix im Ribbon */
.zone-matrix {
    display: flex;
    gap: 2px;
    margin-top: 5px;
    border: 1px solid #333;
    border-radius: 3px;
    overflow: hidden;
    background: #000;
}

.zm-cell {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: baseline;
    gap: 2px;
    padding: 2px 6px;
    min-width: 35px; /* Etwas breiter für die Bonus-Anzeige */
}

.zm-base {
    font-weight: bold;
}

.zm-bonus {
    font-size: 0.6rem;
    color: #f1c40f;
    text-shadow: none;
    border: 1px solid #f1c40f;
    border-radius: 3px;
    padding: 1px 3px;
}

/* Hide bonus if empty */
.zm-bonus:empty {
    display: none;
}

/* Farben passend zu deinen Karten-Zonen */
#zm-a-def, #zm-b-def { background: rgba(46, 125, 50, 0.4); } /* Def: Grün */
#zm-a-mid, #zm-b-mid { background: rgba(21, 101, 192, 0.4); } /* Mid: Blau */
#zm-a-att, #zm-b-att { background: rgba(198, 40, 40, 0.4); }  /* Att: Rot */

/* Active zone: frame instead of background change */
.zm-cell.active-zone {
   /* background: inherit !important;*/
    color: inherit;
    font-weight: bold;
    border: 2px solid #f1c40f;
    border-radius: 4px;
    box-shadow: inset 0 0 4px rgba(241, 196, 15, 0.4);
}

/* Bonus in active zone */
.zm-cell.active-zone .zm-bonus {
    color: #f1c40f;
    border-color: #f1c40f;
}

#evaluate-container { position: relative; z-index: 1000; background: #1a1a1a; padding: 10px; text-align: center; border-bottom: 2px solid #2e7d32; color: #fff; }
#evaluate-btn { padding: 8px 25px; font-weight: bold; background: #f1c40f; border: none; border-radius: 20px; cursor: pointer; text-transform: uppercase; }
#evaluate-btn:disabled { opacity: 0.4; }

/* Der Kasten der Anzeige */
.score-box-container {
    background-color: #111; /* Fast schwarz */
    border: 3px solid #444; /* Metallischer Rahmen */
    border-radius: 6px;
    padding: 5px 12px;
    min-width: 60px;
    text-align: center;
    box-shadow: inset 0 0 10px #000; /* Tiefeneffekt */
    margin: 0 15px; /* Abstand zu den Aktionswerten */
}

/* Die Beschriftung (TORE) */
.score-label {
    font-size: 0.65rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

/* Die eigentliche Zahl */
.score-digit {
    font-family: 'Courier New', Courier, monospace; /* Ersatz für echte Digital-Fonts */
    font-size: 3rem;
    font-weight: bold;
    /* Ein sattes Bernstein / Gelb-Orange */
    color: #ffcc00; 
    
    /* Der Glow-Effekt in der gleichen Farbfamilie */
    text-shadow: 0 0 12px rgba(255, 170, 0, 0.6), 
                 0 0 4px rgba(255, 200, 0, 0.4);
    line-height: 1;
    letter-spacing: 2px;
}

/* Optional: Ein leichter Raster-Effekt über die Zahl */
.score-box-container::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

/* --- 1. Die Hand-Sperrzonen (Transparent & Feinjustiert) --- */
.hand-container-top {
    width: 100%;
    height: 65px; /* Reduziert, damit es bündig mit der Torlinie abschließt */
    overflow: hidden;
    position: relative;
    z-index: 999;
    background: transparent; /* Das dunkle Grün kommt vom Body-Hintergrund */
}

/* Spieler B (Oben): Karten ragen von oben herein */
.hand-container-top .hand {
    position: absolute;
    top: -85px; /* Weniger Versatz nach oben -> Karte kommt weiter runter */
    width: 100%;
    display: flex;
    justify-content: center;
    transition: bottom 0.3s; /* Kleiner Bonus: Fährt beim Hover leicht hoch */
}

.hand-container-top,
.hand-container-bottom {
  overflow: visible;
  perspective: 1000px;
}

.hand-card-wrapper {
  position: relative;
  transform-style: preserve-3d;  /* bleibt */
  will-change: transform;        /* bleibt */
  transform: rotate(var(--rotation)) translateY(var(--y-pos));
  transition: transform 0.25s ease;
  z-index: 1;
}

/* Container für Spieler A (Ganz unten) */
.hand-container-bottom {
    width: 100%;
    height: 65px; /* Exakt so hoch wie der obere Bereich für Symmetrie */
    overflow: visible !important; /* Wichtig für deinen Hover! */
    position: relative;
    z-index: 2000;
    background: transparent;
}

.hand-container-bottom .hand {
    position: absolute;
    /* Wir schieben die Karte weit nach unten. 
       -45px oder mehr, bis nur noch der Name/Werte-Teil sichtbar ist */
    bottom: -90px;      
    width: 100%;
    display: flex;
    justify-content: center;
}

/* --- GRUNDAUSFAHREN DER KARTEN --- */
/* Spieler A (unten) - Karte ragt nach oben ins Spielfeld */
#hand-A .hand-card-wrapper {
    transform: rotate(var(--rotation)) translateY(var(--y-pos));
    transition: transform 0.3s ease;
}

/* Spieler B (oben) - Karte ragt nach unten ins Spielfeld */
#hand-B .hand-card-wrapper {
    transform: rotate(180deg) rotate(var(--rotation)) translateY(var(--y-pos));
    transition: transform 0.3s ease;
}

/* --- HOVER SPIELER A (Ganz unten) --- */
#hand-A .hand-card-wrapper:hover:not(.card-disabled) {
    transform: rotate(var(--rotation)) translateY(calc(var(--y-pos) - 55px)) scale(1.12); /* Ganze Karte fährt hoch */
    z-index: 5000 !important;                 /* Über Spielfeld & Nachbarn */
    box-shadow: 0 15px 30px rgba(0,0,0,0.6);  /* schöner Schatten */
    cursor: pointer;
}

/* --- HOVER SPIELER B (Oben, 180° gedreht) --- */
#hand-B .hand-card-wrapper:hover:not(.card-disabled) {
    transform: rotate(180deg) rotate(var(--rotation)) translateY(calc(var(--y-pos) + 55px)) scale(1.12); /* nach unten Richtung Spielfeld */
    z-index: 5000 !important;                               /* über Spielfeld & Header */
    box-shadow: 0 -15px 30px rgba(0,0,0,0.6);               /* Schatten nach oben */
    cursor: pointer;
}

/* --- Hover: Karten fahren ins Spielfeld --- */
#hand-A .hand-card-wrapper:hover:not(.card-disabled) {
    transform: translateY(calc(var(--y-pos) - 55px)) scale(1.12); 
    z-index: 5000 !important;
    box-shadow: 0 15px 30px rgba(0,0,0,0.6);
    cursor: pointer;
}

#hand-B .hand-card-wrapper:hover:not(.card-disabled) {
    transform: rotate(180deg) translateY(calc(var(--y-pos) - 55px)) scale(1.12);
    z-index: 5000 !important;
    box-shadow: 0 -15px 30px rgba(0,0,0,0.6);
    cursor: pointer;
}

.card-face {
  flex: 1;                /* füllt Rest unter Header */
  min-height: 0;          /* verhindert Flex-Reflow beim Hover */
  overflow: hidden;       /* verhindert neue White Paint Box */

  display: flex;
  
  background: transparent;
  flex-direction: column;
  transition: transform 0.25s ease;
  backface-visibility: hidden;

  -webkit-backface-visibility: hidden; /* Safari/Chrome fix */

  transform: translateZ(0);            /* verhindert White Layer */
}

.card-hidden .card-face {
  visibility: hidden;
}

/* Verdeckte Karte (Gegnerhand): Rückseite wie im Pack – Spielfeld von oben mit Mittelkreis, goldener Rand */
.card-hidden::after {
  content: "";
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border: 3px solid #c9a227;
  border-radius: inherit;
  background:
      radial-gradient(circle at 50% 50%, transparent 0 22%, rgba(255, 255, 255, 0.55) 23% 25%, transparent 26%),
      linear-gradient(0deg, transparent calc(50% - 1px), rgba(255, 255, 255, 0.55) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
      repeating-linear-gradient(0deg, #2e7d32 0 12px, #276b2b 12px 24px);
  z-index: 100;
}

/* --- 2. Die Arena (Pitch-Wrapper) --- */
.pitch-outer-wrapper {
    flex: 1; /* Füllt den Platz zwischen den Händen komplett aus */
    display: flex;
    flex-direction: column; /* Stapelt Sidebars und Main */
    justify-content: center;
    align-items: center;
    position: relative;
    background: transparent;
    z-index: 1;
    transform: translateZ(0); /* Zwingt den Browser, den Pitch als unterste Schicht zu berechnen */
    isolation: auto !important; /* WICHTIG: Erlaubt z-index-Vergleiche mit Elementen außerhalb */
    overflow: visible;
}

.pitch-inner-main {
    width: 82%; /* Spielfeldbreite */
    height: 98%;
    margin: 0 auto; /* Zentrieren */
    background-color: #2d5a27; /* Dein Original-Grün */
    position: relative;
    display: flex;
    flex-direction: column;
    border: 3px solid rgba(255, 255, 255, 0.8); /* Die weißen Außenlinien */
    box-shadow: 0 0 40px rgba(0,0,0,0.5), inset 0 -20px 20px rgba(0,0,0,0.2);
}

/* --- ECKBALL-VIERTELKREISE --- */

.pitch-inner-main::before,
.pitch-inner-main::after,
.corner-bottom-left,
.corner-bottom-right {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    pointer-events: none;
    z-index: 5;
}

/* Oben Links */
.pitch-inner-main::before {
    top: -3px; left: -3px;
    border-radius: 0 0 100% 0;
    border-top: none; border-left: none;
}
/* Oben Rechts */
.pitch-inner-main::after {
    top: -3px; right: -3px;
    border-radius: 0 0 0 100%;
    border-top: none; border-right: none;
}
/* Unten Links */
.corner-bottom-left {
    bottom: -3px; left: -3px;
    border-radius: 0 100% 0 0;
    border-bottom: none; border-left: none;
}
/* Unten Rechts */
.corner-bottom-right {
    bottom: -3px; right: -3px;
    border-radius: 100% 0 0 0;
    border-bottom: none; border-right: none;
}

.pitch-inner-main .field {
    flex: 1; 
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative; /* Wichtig für die Kartenpositionierung darin */
}

/* --- 3. DIE BALLZONE (MITTE) --- */
#ball-marker-zone {
    height: 100px;
    display: flex;
    justify-content: stretch;
    background: #236326;
    position: relative;
    border-top: 4px solid #fff;
    border-bottom: 4px solid #fff;
    z-index: 10;
    overflow: visible; 
}

/* DER MITTELKREIS: Absolut zentriert über der gesamten Zone */
#ball-marker {
    position: absolute; 
    /* WICHTIG: Kein 'top: 50%' hier, da status.ts das berechnet! */
    
    /* Sanftes Rollen und Farbübergang */
    transition: left 0.6s cubic-bezier(0.25, 0.1, 0.25, 1), border-color 0.3s, box-shadow 0.3s;
    
    /* Zentrierung über den eigenen Mittelpunkt (bleibt wichtig) */
    transform: translate(-50%, -50%);
    
    font-size: 28px;
    z-index: 100;
    
    /* ENGER KRINGEL: Ball ist 28px, Kringel 32px -> 2px Abstand pro Seite */
    width: 32px; 
    height: 32px;
    
    display: flex; 
    align-items: center; 
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

/* Die mittlere Zone als Anker für die Kreise */
/* --- FINALE MITTELKREIS-KORREKTUR --- */

/* 1. Das Mittelfeld-Element als Anker */
#ball-marker-zone .zone[data-zone="Mittelfeld"] {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Schiebt Text nach oben/unten */
    padding: 8px 0;
    /* Deine Linien */
    border-left: 2px solid #ffffff;
    border-right: 2px solid #ffffff;
    background: rgba(255, 255, 255, 0.03);
}

/* 2. Der Kreis - absolut positioniert, damit er den Text NICHT verdrängt */
/* Der Mittelkreis mit dynamischer Farbanpassung */
/* 1. Der weiße Grundkreis (überragend) */
#ball-marker-zone .zone[data-zone="Mittelfeld"]::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    border: 2px solid #ffffff; /* Solid weiß für das Spielfeld */
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* Wir legen eine Maske drüber, die den mittleren Teil transparent macht */
/* 2. Die Übermalung (Nur innerhalb der 100px Ballzone) */
#ball-marker-zone .zone[data-zone="Mittelfeld"]::after {
    content: "";
    position: absolute;
    top: 0; 
    left: 50%;
    transform: translateX(-50%);
    width: 144px; /* Minimal breiter zum sauberen Abdecken */
    height: 100%; /* Exakt so hoch wie die Ballzone */
    
    /* Wir nutzen einen radialen Gradienten, der NUR die Linie innerhalb der Zone dezent macht */
    background: #236326; /* Gleiche Farbe wie der Hintergrund der Ballzone */
    mask-image: radial-gradient(circle at center, transparent 67px, black 68px, black 72px, transparent 73px);
    -webkit-mask-image: radial-gradient(circle at center, transparent 67px, black 68px, black 72px, transparent 73px);
    
    opacity: 0.6; /* Macht die Linie innerhalb "dezent" */
    pointer-events: none;
    z-index: 1;
}

/* --- FARB-LOGIK (BLEIBT GLEICH) --- */
.ball-team-a {
    border-color: #3498db !important; 
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.8) !important;
}

.ball-team-b {
    border-color: #e74c3c !important; 
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.8) !important;
}

.ball-neutral {
    border-color: rgba(255, 255, 255, 0.6) !important;
}

.zone { flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 8px 0; border-right: 1px solid rgba(255,255,255,0.2); }
.zone-label { 
    width: 100%; 
    text-align: center; 
    font-size: 0.7em; 
    font-weight: bold; 
    text-transform: uppercase;
    /* Verhindert, dass der Text vom Kreis "überlagert" wird */
    position: relative;
    z-index: 5;
}
.zone-label.top { color: #ffcdd2; }
.zone-label.bottom { color: #bbdefb; }

/* --- 4. SPIELERBEREICHE & DAS SPIELFELD --- */
.player-area { display: flex; flex-direction: column; width: 100%; flex: 1; }
.hand-actions { display: flex; gap: 10px; height: 100px; padding: 5px; }
.hand {
  display: flex;
  justify-content: center;
  position: relative;
  min-width: 100px;
  width: 100%;
  height: 60px;
  gap: 10px;
  flex: 1;
  background: transparent;
  border-radius: 5px;
  padding: 5px;
  pointer-events: none; /* Container selbst klickt nicht */
}

/* --- 3. Die Sidebars für Buttons (team-a / team-b) --- */
.actions {
    position: absolute;
    right: 2%; /* Klebt rechts im outer-wrapper */
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

#actions-B { top: 20px; }
#actions-A { bottom: 20px; }

.field {
    position: relative;
    background-color: #2e7d32;
    /* Rasenstreifen */
    background-image: linear-gradient(0deg, rgba(255,255,255,0.05) 50%, transparent 50%);
    background-size: 100% 30px;
    display: flex; justify-content: center; align-items: center;
    gap: 30px; 
    flex: 1;
    overflow: visible;
}

/* Der 16er (Große Box) */
.field::before {
    content: ""; position: absolute; left: 50%; transform: translateX(-50%);
    pointer-events: none; border: 2px solid #fff; z-index: 1;
    width: 220px; height: 75px;
}

/* Der 5er (Kleine Box) und der Halbbogen */
.field::after {
    content: ""; position: absolute; left: 50%; transform: translateX(-50%);
    pointer-events: none; border: 2px solid #fff; z-index: 2;
    width: 100px; height: 25px; /* Kleinerer 5er */
}

/* --- SPIELER B (OBEN) --- */
#field-B {
    background-image: 
        radial-gradient(circle at 0% 0%, transparent 20px, #fff 21px, #fff 22px, transparent 23px),
        radial-gradient(circle at 100% 0%, transparent 20px, #fff 21px, #fff 22px, transparent 23px),
        /* Kleiner Halbbogen (Strafraum-D) - sitzt auf der Kante des 16ers */
        radial-gradient(circle at 50% 75px, transparent 25px, #fff 26px, #fff 28px, transparent 29px),
        linear-gradient(0deg, rgba(255,255,255,0.05) 50%, transparent 50%);
    background-repeat: no-repeat, no-repeat, no-repeat, repeat;
    background-size: 30px 30px, 30px 30px, 60px 30px, 100% 30px;
    background-position: left top, right top, center top, 0 0;
    position: relative;
}
#field-B::before { top: 0; border-top: none; }
#field-B::after { 
    top: 0; border-top: none; 
    /* Simuliert den Mittelkreis-Halbkreis unten an der Ballzone */
    box-shadow: 0 100px 0 -98px #fff; 
}

/* --- SPIELER A (UNTEN) --- */
#field-A {
    background-image: 
        radial-gradient(circle at 0% 100%, transparent 20px, #fff 21px, #fff 22px, transparent 23px),
        radial-gradient(circle at 100% 100%, transparent 20px, #fff 21px, #fff 22px, transparent 23px),
        /* Kleiner Halbbogen (Strafraum-D) unten */
        radial-gradient(circle at 50% calc(100% - 75px), transparent 25px, #fff 26px, #fff 28px, transparent 29px),
        linear-gradient(0deg, rgba(255,255,255,0.05) 50%, transparent 50%);
    background-repeat: no-repeat, no-repeat, no-repeat, repeat;
    background-size: 30px 30px, 30px 30px, 60px 30px, 100% 30px;
    background-position: left bottom, right bottom, center bottom, 0 0;
    position: relative;
}
#field-A::before { bottom: 0; border-bottom: none; }
#field-A::after { 
    bottom: 0; border-bottom: none; 
    /* Simuliert den Mittelkreis-Halbkreis oben an der Ballzone */
    box-shadow: 0 -100px 0 -98px #fff;
}

.cards-layer {
    display: flex;
    justify-content: center; /* Zentriert die Karten horizontal */
    align-items: center;     /* Zentriert die Karten vertikal im Feld */
    gap: 30px;               /* Der Abstand zwischen den Karten, den du vorher im .field hattest */
    width: 100%;
    height: 100%;
    position: absolute;      /* Deckungsgleich mit dem Feld */
    top: 0;
    left: 0;
    pointer-events: none;    /* Klicks gehen durch den Layer hindurch... */
    z-index: 10;
}

.cards-layer > .card {
    /* Die Karten selbst müssen wieder klickbar sein! */
    pointer-events: auto; 
}

.cards-layer > * {
    pointer-events: auto;    /* ...außer auf die Karten selbst! */
}

.goalkeeper-sidebar {
    position: absolute;
    /* Wir kleben sie an den linken Rand des grünen Bereichs */
    left: 3px; 
    /* Diese Werte müssen wir ggf. feinjustieren, 
       damit sie genau auf der Höhe der weißen Torlinien stoppen */
    top: 279px;    /* Startet bei der Torlinie von B */
    bottom: 65px; /* Endet bei der Torlinie von A */
    width: 120px;
    height: calc(100% - 344px);
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
    pointer-events: none; /* Klicks gehen durch zum Rasen */
    z-index: 1500;
}

.gk-slot {
    width: var(--card-w);
    height: var(--card-h);
    /* Ein sehr dezenter Rahmen als 'Parkplatz' Markierung */
    border: 2px dashed rgba(255, 255, 255, 0.15); 
    border-radius: 6px;
    pointer-events: auto; /* Die Karte selbst ist wieder klickbar */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Wichtig: Sicherstellen, dass Karten im GK-Slot NICHT gedreht werden, 
   selbst wenn sie zu Spieler B gehören */
.gk-slot .card {
    transform: rotate(0deg) !important;
}

/* --- 5. VERFEINERTE KARTEN (UPGRADED) --- */
.card { 
    width: var(--card-w); /* Kartengröße zentral: --card-w/--card-h im Kartendesign-Block */
    height: var(--card-h);
    background: #fff; 
    color: #000; 
    padding: 0; /* Padding auf 0, damit der Header oben bündig abschließt */
    border-radius: 6px; 
    border: 1px solid #444; 
    
    display: flex; 
    flex-direction: column; 
    flex-shrink: 0; 
    position: relative; 
    z-index: 5;

    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;

    overflow: hidden;   /* GANZ WICHTIG */
}

/* --- BESTEHENDE HIGHLIGHTS (ERHALTEN & VERFEINERT) --- */

.card.selected { 
    outline: 3px solid #ffcc00 !important; 
    transform: translateY(-5px) scale(1.03);
    z-index: 20;
}

/* Lila Torwart-Design */
.card.zone-gk { border: 2px solid #6a1b9a; }

/* Spezielle Handkarten-Regeln */
/* Container für die Handkarten */
.hand-container {
    display: flex;
    justify-content: center; /* Zentriert die Gruppe der Karten */
    align-items: flex-end;   /* Karten stehen auf einer Grundlinie */
    gap: -20px;              /* Negative Lücke für leichte Überlappung */
    width: 100%;
    padding: 20px 0;
    min-height: 160px;
}

#hand-A {
    display: flex;
    justify-content: center; /* Das sorgt für die horizontale Zentrierung der Gruppe */
    align-items: flex-end;   /* Karten stehen unten auf einer Linie */
    min-height: 160px;       /* Genug Platz für den Hover-Effekt nach oben */
    width: 100%;
    padding: 10px 0;
    pointer-events: none;    /* Verhindert, dass der leere Container Klicks abfängt */
}

#hand-B {
    z-index: 5; /* Niedriger als der schwarze Header-Balken oben */
    overflow: visible;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Die Karten in der Hand */
.hand-card {
  transform-style: preserve-3d;
  pointer-events: auto !important;
  margin: 0 -16px; /* Fächerung: leichte Überlappung, 7 Handkarten passen nebeneinander */
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform-origin: bottom center;
}

/* Globale Regel für den Cursor */
.hand-card:not(.card-disabled) {
    cursor: grab;
}
.hand-card:not(.card-disabled):active {
    cursor: grabbing;
}

/* Animationen definieren */
@keyframes pulse-blue {
    0% { box-shadow: 0 0 5px #1565c0; }
    50% { box-shadow: 0 0 20px #1565c0; }
    100% { box-shadow: 0 0 5px #1565c0; }
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 5px #c62828; }
    50% { box-shadow: 0 0 20px #c62828; }
    100% { box-shadow: 0 0 5px #c62828; }
}

/* Glow-Klassen zuweisen */
#hand-A .hand-card.card-playable {
    border: 2px solid #1565c0 !important;
    animation: pulse-blue 2s infinite !important;
}

#hand-B .hand-card.card-playable {
    border: 2px solid #c62828 !important;
    animation: pulse-red 2s infinite !important;
}

/* Wenn der Spieler nicht dran ist oder Eval läuft */
.card-disabled {
    opacity: 0.5;
    filter: grayscale(0.5);
    cursor: not-allowed;
    /* transform: none !important;  <-- DAS HIER LÖSCHEN! */
    pointer-events: none; /* Verhindert Hover/Klick bei Inaktivität */
}

/* Sicherstellen, dass der obere Balken (Status/Header) über den Karten liegt */
/* Falls dein Balken oben eine ID oder Klasse hat, hier z.B. .header-container */
.top-bar { 
    position: relative;
    z-index: 100; /* Höher als die Handkarten (z-index: 1/5) */
}

.hand-card.dragging {
    opacity: 0.3;
}

/* --- BALL-ANIMATION & AKTIVE ZONE --- */

/* 1. Die Markierung in der Ballzone (Wer ist am Zug?) */
/* Wir nutzen die Spieler-IDs A (Blau) und B (Rot) */
.field.active-a {
    box-shadow: inset 0 0 20px rgba(52, 152, 219, 0.3);
    border-color: #3498db !important;
}

.field.active-b {
    box-shadow: inset 0 0 20px rgba(231, 76, 60, 0.3);
    border-color: #e74c3c !important;
}

/* Ball auf Feldkarten vollständig sichtbar machen */
#field-A .card,
#field-B .card {
    overflow: visible; /* Ball darf über die Karte hinausragen */
    position: relative; /* Ball wird absolut relativ zur Karte positioniert */
}

/* 2. Der rollende Ball (Animation) */
/* Statusmarken auf Feldkarten (Standhaft, später Gelb-Token): kleine Plaketten oben links */
.card-marks {
    position: absolute;
    top: -8px;
    left: -8px;
    display: flex;
    gap: 2px;
    z-index: 3;
    pointer-events: auto;
}
.card-marks span {
    font-size: 15px;
    line-height: 1;
    background: #fff;
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.ball-on-card {
    position: absolute; 
    /* Horizontal zentrieren */
    left: 50%;
    /* Obere Mitte des Balls an der Unterkante der Karte + 4px nach oben versetzt */
    bottom: -16px; 
    transform: translateX(-50%);
    
    font-size: 18px; /* Etwas kleiner, damit er nicht zu wuchtig ist */
    background: #fff; 
    border-radius: 50%;
    width: 26px; 
    height: 26px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    border: 2px solid #ffcc00; /* Passend zum Ballbesitz-Glow */
    box-shadow: 0 2px 5px rgba(0,0,0,0.4); 
    z-index: 1000; 
}

/* --- WIEDERHERSTELLUNG DER PRÄZISEN HIGHLIGHTS --- */

/* 4. Die Ball-Karte kriegt zusätzlich ihren Glanz */
.card.has-ball {
    border-color: #f1c40f !important; /* Gold für den Ballträger */
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.4);
}

/* --- 7. AKTION-BUTTONS STYLING --- */
.action-btn {
    width: 100%;
    padding: 6px 4px;
    margin-bottom: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #fff;
    background: #222;
    border: 1px solid #444;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

/* Allgemeine Aktionen (ganze Mannschaft) - Blau */
.action-btn.action-general {
    border-left: 4px solid #3498db;
}
.action-btn.action-general:hover:not(:disabled) {
    background: #3498db;
    color: #fff;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.4);
}

/* Deklarierte Aktionen (kosten je Spieler AP) - Rot */
.action-btn.action-declared {
    border-left: 4px solid #e74c3c;
}
.action-btn.action-declared:hover:not(:disabled) {
    background: #e74c3c;
    color: #fff;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.4);
}

/* Sonstige (z. B. Tactical) - Grau */
.action-btn.action-other {
    border-left: 4px solid #888;
}
.action-btn.action-other:hover:not(:disabled) {
    background: #888;
    color: #fff;
}

/* Wenn der Spieler NICHT am Zug ist, Buttons ausgrauen */
/* Wir nutzen hier die Info vom Game-State */
.action-btn:disabled, .action-btn.inactive-player {
    opacity: 0.3;
    filter: grayscale(1);
    cursor: not-allowed;
}

/* Wir nutzen .action-btn.active-mode, um sicherzugehen, dass es Priorität hat */
.action-btn.active-mode {
    background-color: #f1c40f !important;
    color: #000 !important;
    border-color: #fff !important;
    border-left-color: #fff !important; /* Weißer Rand statt Team-Farbe im Aktiv-Modus */
    
    /* Die Animation zuweisen */
    animation: pulse-yellow-glow 1.2s infinite ease-in-out;
    
    /* Sicherstellen, dass der Button auch im aktiven Modus klickbar bleibt */
    opacity: 1 !important;
    filter: none !important;
}

@keyframes pulse-yellow-glow {
    0% {
        box-shadow: 0 0 5px rgba(241, 196, 15, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 15px rgba(241, 196, 15, 0.9);
        transform: scale(1.02); /* Ein ganz leichtes "Atmen" des Buttons */
    }
    100% {
        box-shadow: 0 0 5px rgba(241, 196, 15, 0.7);
        transform: scale(1);
    }
}

/* Das Overlay-Fenster */
.ap-exhausted-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 0, 0, 0.15); /* Sehr zartes Rot */
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    pointer-events: all; /* Wichtig: Man muss durchklicken können! */
    backdrop-filter: blur(2px); /* Erzeugt einen edlen "Frosted Glass" Effekt */
    transition: opacity 0.5s ease;
}

/* Der Puls-Effekt für das ganze Overlay */
.ap-exhausted-overlay.visible {
    display: flex !important;
    animation: backgroundPulse 2s infinite ease-in-out;
}

/* Die leere Batterie */
.battery-icon {
    font-size: 5rem;
    color: rgba(255, 50, 50, 0.8);
    animation: batteryShake 3s infinite ease-in-out;
    filter: drop-shadow(0 0 5px rgba(255, 0, 0, 0.5));
    margin-bottom: 10px;
}

@keyframes backgroundPulse {
    0% { background-color: rgba(255, 0, 0, 0.1); }
    50% { background-color: rgba(255, 0, 0, 0.25); }
    100% { background-color: rgba(255, 0, 0, 0.1); }
}

@keyframes batteryShake {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
    /* Kurzes Zittern zwischendurch */
    45%, 55% { transform: scale(1.1) rotate(-2deg); }
    50% { transform: scale(1.1) rotate(2deg); }
}

/* Der Text "Keine AP" */
.ap-text {
    font-family: 'Bernstein', sans-serif;
    font-size: 1.2rem;
    color: #ff4444; /* Ein helleres Warn-Rot */
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    font-weight: 800;
    margin-top: 10px;
}

@keyframes pulse-gold {
    0% { transform: scale(1); text-shadow: 0 0 5px rgba(241, 196, 15, 0.5); }
    50% { transform: scale(1.1); text-shadow: 0 0 15px rgba(241, 196, 15, 1); color: #f1c40f; }
    100% { transform: scale(1); text-shadow: 0 0 5px rgba(241, 196, 15, 0.5); }
}

.pulse-bonus {
    animation: pulse-gold 1.5s infinite ease-in-out;
    font-weight: bold;
}

/* Und für den Button "Aktion auswerten" bei Torschuss */
.btn-critical-pulse {
    animation: pulse-gold 0.8s infinite alternate;
    box-shadow: 0 0 20px rgba(255, 235, 59, 0.8) !important;
}

.hidden {
	display: none !important;
}

/* Vom Server abgelehnter Zug (StatusUI.showNotice) */
#eval-log.move-rejected {
	color: #ffcdd2;
	background: rgba(183, 28, 28, 0.6);
	font-weight: bold;
}

/* --- Taktikkarten: Panel über dem Spielfeld (TacticsUI) --- */
.tactic-panel {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2500;
    max-width: 90%;
    padding: 12px 18px 14px;
    background: rgba(12, 28, 24, 0.96);
    border: 2px solid #26a69a;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6);
    color: #fff;
    text-align: center;
}
.tactic-panel[hidden] { display: none; }
.tactic-panel-header { font-size: 1.05rem; font-weight: bold; color: #80cbc4; margin-bottom: 8px; letter-spacing: 0.5px; }
.tactic-panel-line { font-size: 0.95rem; margin: 8px 0; line-height: 1.35; }
.tactic-panel-btn {
    margin-top: 4px; padding: 8px 18px;
    font-size: 0.95rem; font-weight: bold;
    background: #26a69a; color: #fff;
    border: none; border-radius: 6px; cursor: pointer;
}
.tactic-panel-btn:hover { background: #2bbbad; }


/* Taktikkarten auf der Hand: anklicken statt ziehen; angeklickte (Zielwahl) markiert */
.hand-card.tactic-playable { cursor: pointer !important; }
.hand-card.tactic-pending { outline: 3px solid #ffeb3b; box-shadow: 0 0 18px rgba(255, 235, 59, 0.9); }

/* Zielwahl auf dem Feld */
.card.tactic-target { cursor: pointer; outline: 3px solid #ffeb3b; box-shadow: 0 0 18px rgba(255, 235, 59, 0.9); }
.card.tactic-not-target { opacity: 0.45; }
/* Elfmeter: wählbare Schützen pulsieren (anklicken, dann Knopf „Elfmeter“) */
.card.penalty-shooter { cursor: pointer; outline: 3px solid #fff; animation: penalty-pulse 1.1s ease-in-out infinite; }
@keyframes penalty-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(255, 255, 255, 0.5); }
  50% { box-shadow: 0 0 22px rgba(255, 255, 255, 1); }
}
@media (prefers-reduced-motion: reduce) { .card.penalty-shooter { animation: none; box-shadow: 0 0 16px rgba(255, 255, 255, 0.9); } }

/* Wirkende Effekte je Team unter der Anzeigetafel */
#effects-row { display: flex; justify-content: space-between; gap: 20px; margin-top: 6px; min-height: 0; }
.effects-list { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; font-family: sans-serif; }
.effects-list.team-b { justify-content: flex-end; }
.effect-chip { font-size: 0.78rem; padding: 3px 9px; border-radius: 12px; border: 1px solid; }
.effect-positive { background: rgba(46, 125, 50, 0.35); border-color: #66bb6a; color: #c8e6c9; }
.effect-negative { background: rgba(183, 28, 28, 0.35); border-color: #ef5350; color: #ffcdd2; }
.effect-until { opacity: 0.75; font-size: 0.72rem; margin-left: 4px; }
.hand-card.tactic-readonly { cursor: help !important; }

/* --- Halbzeit-Banner und Abpfiff (MatchUI, #match-overlay) --- */
.match-overlay {
    position: fixed; inset: 0;
    z-index: 5000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.55);
}
.match-overlay[hidden] { display: none; }
.match-box {
    min-width: 320px; max-width: 90%;
    padding: 22px 32px 24px;
    background: rgba(12, 28, 24, 0.97);
    border: 3px solid #f1c40f;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.7);
    color: #fff;
    text-align: center;
}
.match-title { font-size: 2rem; font-weight: bold; letter-spacing: 2px; color: #f1c40f; text-transform: uppercase; }
.match-score { font-size: 2.6rem; font-weight: bold; margin: 10px 0 6px; }
.match-team-a { color: #3498db; }
.match-team-b { color: #e74c3c; }
.match-line { font-size: 1rem; margin: 8px 0; }
.match-ready { font-size: 0.9rem; margin: 6px 0 12px; color: #b2dfdb; }
.match-result { font-size: 1.4rem; font-weight: bold; margin: 10px 0 14px; }
.match-reward { margin: -4px 0 14px; color: #f1c40f; font-weight: bold; }
.match-btn {
    margin: 4px 6px 0; padding: 10px 24px;
    font-size: 1rem; font-weight: bold;
    background: #f1c40f; color: #222;
    border: none; border-radius: 8px; cursor: pointer;
}
.match-btn:hover { background: #f5d33d; }

/* Nach der Ansage ausgespielt: zählt erst ab der nächsten Aktion */
.card.not-ready {
    opacity: 0.55;
    filter: grayscale(0.7);
    border-style: dashed !important;
}
.card.not-ready::after {
    content: "⏳";
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.8rem;
}

/* Einwechseln: zum Tauschen markierte Handkarte */
.card.sub-selected {
    outline: 3px solid #f1c40f;
    outline-offset: 2px;
    filter: brightness(0.75);
}

/* ============================================================
   HAUPTMENÜ (src/ui/menu.ts, Markup in index.html #game-startup)
   ============================================================ */
.menu {
    --menu-gold: #f1c40f;
    --menu-gold-soft: rgba(241, 196, 15, 0.35);
    --menu-blue: #3498db;
    --menu-red: #e74c3c;
    --menu-panel: rgba(10, 22, 13, 0.88);
    --menu-btn: #18261b;
    --menu-btn-hover: #213425;
    --menu-line: #2f4635;
    --menu-muted: #9fb3a3;
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    overflow-y: auto;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #fff;
    /* Rasen: Mittelkreis, Mittellinie, Mähstreifen, Vignette */
    background:
        radial-gradient(circle at 50% 50%, transparent 0 318px, rgba(255,255,255,0.16) 319px 321px, transparent 322px),
        linear-gradient(90deg, transparent calc(50% - 1px), rgba(255,255,255,0.16) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
        radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.55) 100%),
        repeating-linear-gradient(90deg, #1f6b25 0 80px, #1a5e20 80px 160px);
}

.menu-panel {
    width: min(440px, 100%);
    background: var(--menu-panel);
    border: 1px solid var(--menu-line);
    border-top: 3px solid var(--menu-gold);
    border-radius: 14px;
    padding: 28px 26px 22px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
}

.menu-header { text-align: center; margin-bottom: 22px; }
.menu-ball::before {
    content: "⚽";
    display: inline-block;
    font-size: 42px;
    animation: menu-bounce 2.4s ease-in-out infinite;
}
.menu-title {
    margin: 6px 0 0;
    font-family: 'Arial Black', 'Segoe UI', sans-serif;
    font-size: 2.1rem;
    line-height: 1;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--menu-gold);
    text-shadow: 0 2px 0 #000, 0 0 18px var(--menu-gold-soft);
}
.menu-title .menu-title-sub {
    display: block;
    margin-top: 6px;
    font-size: 0.55em;
    letter-spacing: 6px;
    color: #fff;
    text-shadow: 0 2px 0 #000;
}
.menu-tagline { margin: 10px 0 0; font-size: 0.8rem; letter-spacing: 3px; text-transform: uppercase; color: var(--menu-muted); }

/* Bildschirme: nur der aktive ist sichtbar */
.menu-screen { display: none; flex-direction: column; gap: 10px; animation: menu-in 0.25s ease-out; }
.menu[data-screen="main"] .menu-screen[data-screen="main"],
.menu[data-screen="play"] .menu-screen[data-screen="play"],
.menu[data-screen="options"] .menu-screen[data-screen="options"],
.menu[data-screen="tutorial"] .menu-screen[data-screen="tutorial"],
.menu[data-screen="tutorial-offer"] .menu-screen[data-screen="tutorial-offer"],
.menu[data-screen="decks-local"] .menu-screen[data-screen="decks-local"],
.menu[data-screen="decks-computer"] .menu-screen[data-screen="decks-computer"],
.menu[data-screen="decks-view"] .menu-screen[data-screen="decks-view"],
.menu[data-screen="collection"] .menu-screen[data-screen="collection"],
.menu[data-screen="deck-editor"] .menu-screen[data-screen="deck-editor"],
.menu[data-screen="deck-host"] .menu-screen[data-screen="deck-host"],
.menu[data-screen="host"] .menu-screen[data-screen="host"],
.menu[data-screen="join"] .menu-screen[data-screen="join"],
.menu[data-screen="connecting"] .menu-screen[data-screen="connecting"] { display: flex; }

.menu-heading {
    margin: 0 0 6px;
    text-align: center;
    font-family: 'Arial Black', 'Segoe UI', sans-serif;
    font-size: 1.15rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.menu-text { margin: 0; text-align: center; color: #dfe8e1; font-size: 0.95rem; }
.menu-hint { margin: 0; text-align: center; color: var(--menu-muted); font-size: 0.8rem; }

/* Große Menüknöpfe: Titel + Unterzeile, farbige Kante links */
.menu-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    width: 100%;
    padding: 14px 16px;
    text-align: left;
    color: #fff;
    background: var(--menu-btn);
    border: 1px solid var(--menu-line);
    border-left: 5px solid var(--menu-line);
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.menu-btn b { font-family: 'Arial Black', 'Segoe UI', sans-serif; font-size: 1.02rem; letter-spacing: 1px; text-transform: uppercase; }
.menu-btn small { color: var(--menu-muted); font-size: 0.8rem; }
.menu-btn:hover:not(:disabled), .menu-btn:focus-visible {
    background: var(--menu-btn-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    outline: none;
}
.menu-btn-primary { border-left-color: var(--menu-gold); }
.menu-btn-primary:hover:not(:disabled), .menu-btn-primary:focus-visible { box-shadow: 0 6px 22px var(--menu-gold-soft); }
.menu-btn.team-a { border-left-color: var(--menu-blue); }
.menu-btn.team-a:hover, .menu-btn.team-a:focus-visible { box-shadow: 0 6px 22px rgba(52, 152, 219, 0.35); }
.menu-btn.team-b { border-left-color: var(--menu-red); }
.menu-btn.team-b:hover, .menu-btn.team-b:focus-visible { box-shadow: 0 6px 22px rgba(231, 76, 60, 0.35); }
.menu-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.menu-back {
    align-self: center;
    margin-top: 4px;
    padding: 6px 12px;
    background: none;
    border: none;
    color: var(--menu-muted);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}
.menu-back:hover, .menu-back:focus-visible { color: #fff; outline: none; text-decoration: underline; }

/* Entwicklungsbereich: klein und abgesetzt */
.menu-dev {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--menu-line);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.menu-dev-label { font-size: 0.7rem; letter-spacing: 3px; text-transform: uppercase; color: #6f8574; }
.menu-link {
    background: none;
    border: none;
    color: var(--menu-muted);
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    text-align: center;
}
.menu-link:hover, .menu-link:focus-visible { color: var(--menu-gold); outline: none; text-decoration: underline; }

/* Spielcode (Host) und Eingabe (Beitreten) */
.menu-code {
    margin: 4px auto;
    min-width: 140px;
    padding: 12px 22px;
    text-align: center;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 2.6rem;
    font-weight: bold;
    letter-spacing: 8px;
    color: var(--menu-gold);
    background: #0c160e;
    border: 2px solid var(--menu-gold-soft);
    border-radius: 10px;
    user-select: all;
}
.menu-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    text-align: center;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 1.8rem;
    letter-spacing: 6px;
    color: #fff;
    background: #0c160e;
    border: 2px solid var(--menu-line);
    border-radius: 10px;
    outline: none;
}
.menu-input::placeholder { letter-spacing: 1px; font-size: 1.1rem; color: #5d7262; }
.menu-input:focus { border-color: var(--menu-gold); box-shadow: 0 0 0 3px var(--menu-gold-soft); }
.menu-error { min-height: 1.2em; text-align: center; color: #ffb3b3; font-size: 0.85rem; }

.menu-spinner {
    align-self: center;
    width: 34px;
    height: 34px;
    margin: 8px 0;
    border: 4px solid var(--menu-line);
    border-top-color: var(--menu-gold);
    border-radius: 50%;
    animation: menu-spin 0.9s linear infinite;
}

@keyframes menu-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes menu-spin { to { transform: rotate(360deg); } }
@keyframes menu-bounce { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-6px) rotate(180deg); } }

@media (prefers-reduced-motion: reduce) {
    .menu-ball::before, .menu-spinner, .menu-screen { animation: none; }
}
@media (max-width: 420px) {
    .menu-panel { padding: 22px 16px 18px; }
    .menu-title { font-size: 1.7rem; }
}

/* Torwart-Bank (Ersatztorhüter) in der linken Leiste: gedimmt wie „noch nicht bereit“ */
.goalkeeper-sidebar { justify-content: flex-start; gap: 6px; }
.gk-bench { display: flex; flex-direction: column; gap: 4px; width: var(--card-w); pointer-events: auto; }
.gk-bench-a { margin-top: auto; }
.card.gk-bench-card {
    height: 34px;
    min-height: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    box-sizing: border-box;
    opacity: 0.55;
    filter: grayscale(0.6);
    border-style: dashed;
    cursor: default;
}
.gk-bench-name { font-size: 0.7rem; font-weight: bold; color: #4a148c; }
.gk-bench-value { font-size: 1.1rem; font-weight: bold; color: #6a1b9a; }
.card.gk-bench-card.gk-selectable { opacity: 1; filter: none; cursor: pointer; border-style: solid; }
.card.gk-bench-card.gk-selectable:hover { box-shadow: 0 0 10px rgba(241, 196, 15, 0.6); }
.card.gk-bench-card.sub-selected { outline: 3px solid #f1c40f; outline-offset: 2px; }

/* Deckwahl im Menü (src/ui/menu.ts deckPicker) */
.menu[data-screen="decks-local"] .menu-panel,
.menu[data-screen="decks-computer"] .menu-panel { width: min(900px, 100%); }
.menu[data-screen="deck-host"] .menu-panel,
.menu[data-screen="join"] .menu-panel { width: min(640px, 100%); }
.deck-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.deck-col-title {
    margin: 0 0 8px;
    font-family: 'Arial Black', 'Segoe UI', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
}
.deck-col.team-a .deck-col-title { color: var(--menu-blue); }
.deck-col.team-b .deck-col-title { color: var(--menu-red); }
.deck-list { display: flex; flex-direction: column; gap: 8px; }
.deck-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.deck-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    text-align: left;
    color: #fff;
    background: var(--menu-btn);
    border: 2px solid var(--menu-line);
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease;
}
.deck-tile:hover, .deck-tile:focus-visible { background: var(--menu-btn-hover); transform: translateY(-1px); outline: none; }
.deck-tile.selected { border-color: var(--menu-gold); box-shadow: 0 0 14px var(--menu-gold-soft); }
.deck-tile.selected .deck-name::after { content: " ✓"; color: var(--menu-gold); }
/* „Mein Deck“ (Starterdeck aus der eigenen Sammlung) */
.deck-tile.own { border-style: dashed; }
.deck-tile.own .deck-name::before {
    content: attr(data-own); /* Text aus loca_de.json (menu.ts) */
    margin-right: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--menu-gold);
    color: #000;
    font-size: 0.65rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    vertical-align: middle;
}
.deck-name { font-family: 'Arial Black', 'Segoe UI', sans-serif; font-size: 0.95rem; letter-spacing: 1px; text-transform: uppercase; }
.deck-desc { font-size: 0.75rem; color: var(--menu-muted); line-height: 1.3; }
.deck-mix { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.deck-mix .mix {
    font-style: normal;
    font-size: 0.68rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    background: #0c160e;
    border: 1px solid var(--menu-line);
}
.mix-ang { color: #ff8a80; }
.mix-mf { color: #82b1ff; }
.mix-vt { color: #a5d6a7; }
.mix-tak { color: #80cbc4; }
.mix-tw { color: #ce93d8; }
.deck-keeper { font-size: 0.72rem; color: #dfe8e1; }
.menu-btn.menu-btn-center { align-items: center; }
@media (max-width: 640px) {
    .deck-columns, .deck-grid { grid-template-columns: 1fr; }
}

/* Menü: bei Überhöhe scrollen statt oben abschneiden; Deckwahl mit kompaktem Kopf */
.menu { align-items: flex-start; }
.menu-panel { margin: auto; }
.menu[data-screen="decks-local"] .menu-ball,
.menu[data-screen="decks-computer"] .menu-ball,
.menu[data-screen="decks-computer"] .menu-tagline,
.menu[data-screen="decks-local"] .menu-tagline { display: none; }
.menu[data-screen="decks-local"] .menu-header,
.menu[data-screen="decks-computer"] .menu-header { margin-bottom: 12px; }
.menu[data-screen="decks-local"] .menu-panel,
.menu[data-screen="decks-computer"] .menu-panel { padding-top: 18px; }

/* Decks & Collection ansehen (menu.ts initDeckViewer) */
.menu[data-screen="decks-view"] .menu-panel { width: min(1040px, 100%); padding-top: 18px; }
.menu[data-screen="decks-view"] .menu-ball,
.menu[data-screen="decks-view"] .menu-tagline { display: none; }
.menu[data-screen="decks-view"] .menu-header { margin-bottom: 10px; }
.deck-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.deck-tab {
    padding: 6px 14px;
    color: var(--menu-muted);
    background: var(--menu-btn);
    border: 1px solid var(--menu-line);
    border-radius: 999px;
    font: inherit;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
}
.deck-tab:hover, .deck-tab:focus-visible { color: #fff; outline: none; }
.deck-tab.active { color: #000; background: var(--menu-gold); border-color: var(--menu-gold); }
.deck-view-summary p { margin: 2px 0; }
.deck-view { max-height: 56vh; overflow-y: auto; padding-right: 4px; display: flex; flex-direction: column; gap: 12px; }
.deck-view-title {
    margin: 0 0 6px;
    font-family: 'Arial Black', 'Segoe UI', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #dfe8e1;
}
.deck-view-title small { color: var(--menu-muted); font-family: 'Segoe UI', Arial, sans-serif; letter-spacing: 0; }
.deck-view-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px 10px; padding: 8px 8px 4px 2px; }
/* Menükarten (mini_card.ts): Karte im Spieldesign, skaliert mit der Spaltenbreite */
.mini-card {
    position: relative;
    container-type: inline-size;
    aspect-ratio: 110 / 135;
}
.mini-card .cv { font-size: calc(100cqw / 11); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5); }
.mini-count {
    position: absolute;
    top: -7px;
    right: -7px;
    z-index: 7;
    min-width: 1.9em;
    padding: 2px 6px;
    box-sizing: border-box;
    border-radius: 999px;
    background: var(--menu-gold, #f1c40f);
    color: #000;
    font-size: 0.78rem;
    font-weight: 900;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* Würfel-Animation (src/ui/dice.ts): über dem Spielfeld, blockiert keine Klicks */
.dice-layer { position: fixed; inset: 0; z-index: 6000; pointer-events: none; transition: opacity 0.3s ease; }
.dice-layer.fading { opacity: 0; }
.die-holder {
    --team: #3498db;
    position: absolute;
    width: 72px;
    margin-left: -36px;
    margin-top: -36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.die-holder.team-b { --team: #e74c3c; }
.die {
    width: 72px;
    height: 72px;
    box-sizing: border-box;
    padding: 9px;
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    border: 3px solid var(--team);
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45), inset 0 -4px 0 rgba(0, 0, 0, 0.08);
}
.die-face { width: 100%; height: 100%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); place-items: center; }
.die-face .pip { width: 11px; height: 11px; border-radius: 50%; }
.die-face .pip.on { background: var(--team); box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.35); }
.die-label {
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-family: 'Arial Black', 'Segoe UI', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ============================================================
   SAMMLUNG (src/ui/collection_menu.ts, Markup in index.html data-screen="collection")
   ============================================================ */
.menu[data-screen="collection"] .menu-panel { width: min(1040px, 100%); padding-top: 18px; }
.menu[data-screen="collection"] .menu-ball,
.menu[data-screen="collection"] .menu-tagline { display: none; }
.menu[data-screen="collection"] .menu-header { margin-bottom: 10px; }
.coll-wallet { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.coll-wallet span {
    padding: 4px 12px;
    border: 1px solid var(--menu-line);
    border-radius: 999px;
    background: var(--menu-btn);
    font-weight: bold;
}
.coll-wallet .wallet-money { color: var(--menu-gold); }
.coll-wallet .wallet-premium { color: var(--menu-muted); }
.coll-top { display: flex; flex-wrap: wrap; gap: 14px; align-items: stretch; }
.coll-shelf-box { flex: 1 1 320px; min-width: 0; }
.coll-shop { flex: 0 1 240px; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.coll-shelf { display: flex; align-items: flex-end; min-height: 76px; padding: 6px 4px 6px 18px; flex-wrap: wrap; row-gap: 8px; }
.coll-shelf .menu-hint { margin-left: -14px; }
.shelf-pack {
    position: relative;
    width: 46px;
    height: 66px;
    margin-left: -14px;
    border: 2px solid var(--menu-gold);
    border-radius: 5px;
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 45%, #f1c40f 46%, #f1c40f 52%, #1b5e20 53%, #0f3d13 100%);
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transform: rotate(calc((var(--i) - 2) * 2deg));
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.shelf-pack:hover, .shelf-pack:focus-visible { transform: translateY(-8px) rotate(0deg); box-shadow: 0 8px 18px var(--menu-gold-soft); outline: none; z-index: 1; }
.shelf-pack-label { position: absolute; left: 0; right: 0; bottom: 6px; color: #fff; font-size: 0.55rem; font-weight: bold; letter-spacing: 1px; text-shadow: 0 1px 0 #000; }
.shelf-more { margin-left: 8px; color: var(--menu-muted); font-weight: bold; align-self: center; }
.coll-message { min-height: 1em; color: var(--menu-gold); }
.mini-card.missing { opacity: 0.35; filter: grayscale(1); }
.mini-card.missing .mini-count { background: #555; color: #ddd; }

/* ============================================================
   PACK-ÖFFNEN (src/ui/pack_opening.ts) – Overlay mit Stufen data-stage:
   sealed → tearing (Lasche fliegt, Fetzen) → emptied (Karten fächern auf) → fanned (umdrehen)
   ============================================================ */
.pack-overlay {
    --cw: clamp(84px, 16vw, 150px);   /* Kartenbreite */
    --menu-gold: #f1c40f;             /* liegt außerhalb von .menu: Farben hier noch einmal */
    --menu-gold-soft: rgba(241, 196, 15, 0.35);
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px;
    box-sizing: border-box;
    color: #fff;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: radial-gradient(ellipse at 50% 45%, rgba(241, 196, 15, 0.18) 0%, rgba(0, 0, 0, 0.88) 55%, rgba(0, 0, 0, 0.95) 100%);
    animation: pack-fade-in 0.25s ease-out;
}
.pack-overlay.closing { animation: pack-fade-out 0.22s ease-in forwards; }
.pack-stage { position: relative; width: 100%; height: min(62vh, 420px); }

/* Das Pack: Folie mit Glanzstreifen, oben eine Lasche mit Zackenrand */
.pack {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 200px;
    height: 290px;
    margin: -145px 0 0 -100px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    animation: pack-drop 0.55s cubic-bezier(.2, 1.4, .4, 1) both;
}
.pack:focus-visible { outline: 3px solid #f1c40f; outline-offset: 6px; border-radius: 10px; }
.pack-overlay[data-stage="sealed"] .pack:hover { animation: pack-wiggle 0.6s ease-in-out infinite; }
.pack-top, .pack-body {
    position: absolute;
    left: 0;
    right: 0;
    border: 3px solid #f1c40f;
    background:
        linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 45%, transparent 60%) no-repeat,
        linear-gradient(160deg, #2e7d32 0%, #1b5e20 50%, #0f3d13 100%);
    background-size: 250% 100%, 100% 100%;
    animation: pack-shine 2.8s ease-in-out infinite;
}
.pack-top {
    top: 0;
    height: 52px;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 90% 82%, 80% 100%, 70% 82%, 60% 100%, 50% 82%, 40% 100%, 30% 82%, 20% 100%, 10% 82%, 0 100%);
    transition: transform 0.5s cubic-bezier(.3, .7, .4, 1), opacity 0.5s ease;
    z-index: 2;
}
.pack-body {
    top: 44px;
    bottom: 0;
    border-top: none;
    border-radius: 0 0 10px 10px;
    clip-path: polygon(0 8%, 10% 0, 20% 8%, 30% 0, 40% 8%, 50% 0, 60% 8%, 70% 0, 80% 8%, 90% 0, 100% 8%, 100% 100%, 0 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.6));
    transition: transform 0.45s ease-in, opacity 0.45s ease-in;
}
.pack-emblem { font-size: 54px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.5)); }
.pack-title {
    font-family: 'Arial Black', 'Segoe UI', sans-serif;
    font-size: 1.05rem;
    line-height: 1.15;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
    color: #f1c40f;
    text-shadow: 0 2px 0 #000;
}
.pack-sub { font-size: 0.7rem; letter-spacing: 3px; text-transform: uppercase; color: #dfe8e1; }
.pack-overlay[data-stage="tearing"] .pack { animation: pack-shake 0.35s ease-in-out; cursor: default; }
.pack-overlay[data-stage="tearing"] .pack-top,
.pack-overlay[data-stage="emptied"] .pack-top,
.pack-overlay[data-stage="fanned"] .pack-top { transform: translate(90px, -170px) rotate(28deg); opacity: 0; }
.pack-overlay[data-stage="emptied"] .pack-body,
.pack-overlay[data-stage="fanned"] .pack-body { transform: translateY(70vh) rotate(-6deg); opacity: 0; }
.pack-overlay[data-stage="emptied"] .pack,
.pack-overlay[data-stage="fanned"] .pack { pointer-events: none; }

/* Papierfetzen am Riss */
.pack-scraps { position: absolute; left: 50%; top: calc(50% - 100px); width: 0; height: 0; pointer-events: none; }
.pack-scrap {
    position: absolute;
    width: 10px;
    height: 6px;
    background: #f1c40f;
    border-radius: 1px;
    animation: pack-scrap 0.85s cubic-bezier(.2, .8, .4, 1) forwards;
}
.pack-scrap:nth-child(3n) { background: #2e7d32; width: 8px; height: 8px; }
.pack-scrap:nth-child(3n + 1) { background: #fff; }

/* Karten: erst gestapelt in der Mitte, dann aufgefächert, Klick dreht um */
.pack-cards { position: absolute; inset: 0; pointer-events: none; }
.pack-card {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--cw);
    height: calc(var(--cw) * 1.45);
    padding: 0;
    border: none;
    background: none;
    perspective: 900px;
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.5);
    transition: transform 0.45s cubic-bezier(.2, 1.2, .4, 1), opacity 0.25s ease;
    cursor: pointer;
    pointer-events: none;
}
.pack-card.fanned {
    opacity: 1;
    pointer-events: auto;
    transform: translate(calc(-50% + var(--slot) * (var(--cw) + 14px)), -50%) rotate(calc(var(--slot) * 3deg));
}
.pack-card:focus-visible { outline: none; }
.pack-card:focus-visible .pack-card-inner { box-shadow: 0 0 0 3px #f1c40f; }
.pack-card:hover:not(.flipped) .pack-card-inner { transform: translateY(-8px); }
.pack-card-inner {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(.3, .7, .3, 1), box-shadow 0.3s ease;
}
.pack-card.flipped .pack-card-inner { transform: rotateY(180deg); }
.pack-card-back, .pack-card-front {
    position: absolute;
    inset: 0;
    border-radius: 8px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
}
/* Rückseite: Spielfeld von oben mit Mittelkreis, goldener Rand */
.pack-card-back {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #f1c40f;
    box-sizing: border-box;
    background:
        radial-gradient(circle at 50% 50%, transparent 0 26%, rgba(255, 255, 255, 0.5) 27% 29%, transparent 30%),
        linear-gradient(0deg, transparent calc(50% - 1px), rgba(255, 255, 255, 0.5) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
        repeating-linear-gradient(0deg, #2e7d32 0 14px, #276b2b 14px 28px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}
.pack-card-emblem { font-size: calc(var(--cw) * 0.28); filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5)); }
.pack-card-front { transform: rotateY(180deg); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6); }
.pack-overlay.all-flipped .pack-reveal { display: none; }
.pack-card.is-new.flipped .pack-card-inner { box-shadow: 0 0 22px 4px rgba(241, 196, 15, 0.75); animation: pack-new 1.2s ease-out 0.5s; }

.pack-hint { margin: 0; min-height: 1.2em; color: #dfe8e1; font-size: 0.95rem; text-align: center; }
.pack-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pack-overlay .menu-btn {
    min-width: 170px;
    padding: 10px 16px;
    color: #fff;
    background: #18261b;
    border: 1px solid #2f4635;
    border-left: 4px solid #2f4635;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
}
.pack-overlay .menu-btn-primary { border-left-color: #f1c40f; }
.pack-overlay .menu-btn:hover, .pack-overlay .menu-btn:focus-visible { background: #213425; outline: none; }
.pack-overlay .menu-btn b { font-family: 'Arial Black', 'Segoe UI', sans-serif; letter-spacing: 1px; text-transform: uppercase; }

@keyframes pack-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pack-fade-out { to { opacity: 0; } }
@keyframes pack-drop { from { transform: translateY(-60vh) rotate(-12deg); } to { transform: none; } }
@keyframes pack-wiggle { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-2.5deg); } 75% { transform: rotate(2.5deg); } }
@keyframes pack-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px) rotate(-2deg); } 40% { transform: translateX(6px) rotate(2deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes pack-shine { 0%, 60% { background-position: 150% 0, 0 0; } 100% { background-position: -100% 0, 0 0; } }
@keyframes pack-scrap { from { transform: none; opacity: 1; } to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }
@keyframes pack-new { 0% { box-shadow: 0 0 0 0 rgba(241, 196, 15, 0.9); } 100% { box-shadow: 0 0 22px 4px rgba(241, 196, 15, 0.75); } }

@media (max-width: 640px) {
    .pack-overlay { --cw: clamp(56px, 17vw, 110px); }
    .pack-card.fanned { transform: translate(calc(-50% + var(--slot) * (var(--cw) + 6px)), -50%) rotate(calc(var(--slot) * 2deg)); }
}
@media (prefers-reduced-motion: reduce) {
    .pack, .pack-top, .pack-body, .pack-scrap, .pack-card, .pack-card-inner, .pack-overlay, .shelf-pack { animation: none !important; transition-duration: 0.01s !important; }
}

/* ============================================================
   DECK-EDITOR „Meine Decks“ (src/ui/deck_editor.ts, Markup in index.html data-screen="deck-editor")
   ============================================================ */
.menu[data-screen="deck-editor"] .menu-panel { width: min(1180px, 100%); padding-top: 18px; }
.menu[data-screen="deck-editor"] .menu-ball,
.menu[data-screen="deck-editor"] .menu-tagline { display: none; }
.menu[data-screen="deck-editor"] .menu-header { margin-bottom: 8px; }
.ed-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.ed-label { display: flex; align-items: center; gap: 6px; color: var(--menu-muted); font-size: 0.85rem; }
.ed-select, .ed-input {
    min-width: 0;
    padding: 6px 10px;
    color: #fff;
    background: var(--menu-btn);
    border: 1px solid var(--menu-line);
    border-radius: 6px;
    font: inherit;
    font-size: 0.9rem;
}
.ed-select:focus-visible, .ed-input:focus-visible { outline: 2px solid var(--menu-gold); outline-offset: 1px; }
.ed-input { width: 180px; }
.ed-btn {
    padding: 6px 12px;
    color: #fff;
    background: var(--menu-btn);
    border: 1px solid var(--menu-line);
    border-radius: 6px;
    font: inherit;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
}
.ed-btn:hover:not(:disabled), .ed-btn:focus-visible { background: var(--menu-btn-hover); border-color: var(--menu-gold); outline: none; }
.ed-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ed-primary { color: #000; background: var(--menu-gold); border-color: var(--menu-gold); }
.ed-primary:hover:not(:disabled), .ed-primary:focus-visible { background: #f5d33d; color: #000; }
.ed-danger:hover:not(:disabled), .ed-danger:focus-visible { border-color: var(--menu-red); color: #ffb3a9; }

.ed-tabs { display: none; justify-content: center; gap: 6px; }
.ed-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 14px; min-height: 0; }
.ed-pool, .ed-deck { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ed-pool-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.ed-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.ed-filter { padding: 4px 10px; font-size: 0.78rem; }
.ed-filter.active { color: #000; background: var(--menu-gold); border-color: var(--menu-gold); }
.ed-search { width: 200px; }
.ed-pool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 12px 10px;
    max-height: 56vh;
    overflow-y: auto;
    padding: 6px 6px 4px 4px;
    align-content: start;
}
.ed-pool-card {
    position: relative;
    display: block;
    padding: 0;
    text-align: left;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    transition: transform 0.1s ease;
}
.ed-pool-card:hover:not(:disabled) { transform: translateY(-2px); }
.ed-pool-card:focus-visible { outline: 2px solid var(--menu-gold); outline-offset: 2px; }
.ed-pool-card:disabled { cursor: not-allowed; }
.ed-pool-card:disabled .mini-card { opacity: 0.6; }
.ed-have {
    position: absolute;
    z-index: 7;
    right: -5px;
    top: -6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #111;
    border: 1px solid var(--menu-gold, #f1c40f);
    color: #fff;
    font-size: 0.72rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.ed-deck { padding: 10px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--menu-line); border-radius: 8px; }
.ed-deck-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.ed-count { font-family: 'Arial Black', 'Segoe UI', sans-serif; font-size: 1.2rem; color: #ffb3a9; }
.ed-count.ok { color: #7bd88f; }
.ed-list { max-height: 40vh; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding-right: 4px; }
.ed-group { margin: 6px 0 2px; font-size: 0.72rem; letter-spacing: 2px; text-transform: uppercase; color: #dfe8e1; }
.ed-group small { color: var(--menu-muted); letter-spacing: 0; }
.ed-row { --t: #555; display: flex; align-items: stretch; border-left: 4px solid var(--t); border-radius: 4px; background: var(--menu-btn); }
.ed-row.t-angriff { --t: #c62828; }
.ed-row.t-mittelfeld { --t: #1565c0; }
.ed-row.t-verteidigung { --t: #2e7d32; }
.ed-row.t-torwart { --t: #6a1b9a; }
.ed-row.t-taktik { --t: #00897b; }
.ed-row.lacking { background: rgba(231, 76, 60, 0.25); }
.ed-row-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    color: #fff;
    background: none;
    border: none;
    font: inherit;
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
}
.ed-row-main:hover, .ed-row-main:focus-visible { background: var(--menu-btn-hover); outline: none; }
.ed-row-main:hover .ed-row-n::after { content: " −"; color: #ffb3a9; }
.ed-row-n { min-width: 2.6em; font-weight: bold; color: var(--menu-gold); }
.ed-row-name { flex: 1; }
.ed-row-val { color: var(--menu-muted); font-size: 0.78rem; }
.ed-row-val b { color: #fff; }
.ed-star { padding: 0 10px; color: var(--menu-muted); background: none; border: none; font-size: 1.1rem; cursor: pointer; }
.ed-star.on { color: var(--menu-gold); }
.ed-star:hover, .ed-star:focus-visible { color: var(--menu-gold); outline: none; }
.ed-issues { margin: 0; padding: 0 0 0 18px; max-height: 9em; overflow-y: auto; color: #ffb3a9; font-size: 0.82rem; }
.ed-issues li.ok { list-style: none; margin-left: -18px; color: #7bd88f; font-weight: bold; }
.ed-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* Deckwahl: ungültige eigene Decks nicht wählbar */
.deck-tile.invalid { opacity: 0.55; cursor: not-allowed; }
.deck-tile.invalid .deck-desc { color: #ffb3a9; }

@media (max-width: 760px) {
    .ed-tabs { display: flex; }
    .ed-main { grid-template-columns: 1fr; }
    .ed-main[data-tab="pool"] .ed-deck,
    .ed-main[data-tab="deck"] .ed-pool { display: none; }
    .ed-input, .ed-search { width: 100%; }
    .ed-label { flex: 1 1 100%; }
    .ed-label .ed-select, .ed-label .ed-input { flex: 1; }
    .ed-pool-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .ed-list { max-height: 50vh; }
}

/* Handkarten auf schmaleren Bildschirmen stärker überlappen (7 Karten) */
@media (max-width: 1000px) {
    .hand-card { margin: 0 -34px; }
}
@media (max-width: 700px) {
    .hand-card { margin: 0 -48px; }
}

/* ============================================================
   KARTENDESIGN „TRIKOT“ (src/ui/card_view.ts)
   Alle Maße in em: 1em = 1/11 der Kartenbreite (Feld/Hand 12px = 132 × 162 px); das Pack skaliert über --cw.
   ============================================================ */
/* Kartengröße: 162 px hoch (120 % des alten Maßes), auf niedrigen Fenstern kleiner, damit die Karten in die
   Spielfeldhälften passen (Hälfte ≈ 51vh − 238px). Breite im alten Seitenverhältnis 110:135. */
:root {
    --card-h: clamp(110px, calc(51vh - 253px), 162px);
    --card-w: calc(var(--card-h) * 110 / 135);
    --preview-w: clamp(170px, 26vh, 250px);
}
.cv {
    --c: #1565c0;
    --cl: #42a5f5;
    position: relative;
    overflow: hidden;
    font-size: calc(var(--card-w) / 11);
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #fff;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0 0.8em, transparent 0.8em 1.6em),
        linear-gradient(160deg, var(--cl) 0%, var(--c) 45%, color-mix(in srgb, var(--c) 45%, #000) 100%);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.55);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card.cv { background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0 0.8em, transparent 0.8em 1.6em),
        linear-gradient(160deg, var(--cl) 0%, var(--c) 45%, color-mix(in srgb, var(--c) 45%, #000) 100%);
    color: #fff; border-radius: 10px; padding: 0; }
.cv-def { --c: #2e7d32; --cl: #66bb6a; }
.cv-mid { --c: #1565c0; --cl: #42a5f5; }
.cv-att { --c: #c62828; --cl: #ef5350; }
.cv-gk  { --c: #6a1b9a; --cl: #ab47bc; }
.cv-tac { --c: #00796b; --cl: #4db6ac; }

/* Gold-Glanz beim Überfahren: ein Lichtstreifen läuft über die Karte, der Rand wird golden */
.cv-shine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 5;
    background: linear-gradient(115deg, transparent 35%, rgba(255, 236, 160, 0.55) 50%, transparent 65%);
    background-size: 250% 100%;
    background-position: 150% 0;
    transition: background-position 0.6s ease;
}
.cv:hover .cv-shine { background-position: -50% 0; }
/* Überfahren: gewöhnliche Karten bekommen einen Goldrand, Raritäten behalten ihre Randfarbe (nur Leuchten) */
.cv:hover { box-shadow: 0 0 14px rgba(241, 196, 15, 0.7), 0 4px 10px rgba(0, 0, 0, 0.55); }
.cv.cv-r-common:hover { border-color: #f1c40f; }
/* Ballträger: goldener Ring außen herum, damit der Raritätsrand sichtbar bleibt */
.card.cv.has-ball { box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.75), 0 0 0 6px #f1c40f, 0 0 18px rgba(241, 196, 15, 0.75); } /* dunkle Lücke, damit der Ring nicht wie ein Raritätsrand wirkt */

/* Positionskürzel oben links (später ZM, IV, ST, RA …) */
.cv-pos {
    position: absolute;
    top: 0.15em;
    left: 0.35em;
    z-index: 2;
    font-size: 1.8em;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.02em;
    text-shadow: 0 0.06em 0.12em rgba(0, 0, 0, 0.45);
}
.cv-sil { position: absolute; right: 0; top: 0.5em; height: 6.2em; z-index: 1; }
.cv-sil path { fill: #0b0b0b; }
.cv-sil path.cv-collar { fill: #262626; }
.cv-pbonus {
    position: absolute;
    top: 3em;
    left: 0.6em;
    z-index: 2;
    font-size: 0.8em;
    font-weight: 800;
    color: #ffe082;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 0.4em;
    padding: 0.05em 0.4em;
}
.cv-kw {
    position: absolute;
    top: 9.9em;
    left: 0;
    right: 0;
    z-index: 2;
    font-size: 0.72em;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    color: #ffe082;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.2em 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Weißer Werteblock unten, schräg angeschnitten */
.cv-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 5.2em;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 0.35em;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.96);
    color: #222;
    clip-path: polygon(0 18%, 100% 0, 100% 100%, 0 100%);
}
.cv-name {
    font-size: 0.9em;
    font-weight: 800;
    text-align: center;
    margin: 0 0.3em 0.2em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cv-stats { display: flex; justify-content: space-around; align-items: flex-end; }
.cv-stat {
    font-size: 1.4em;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    color: #333;
    padding: 0.05em 0.2em;
    border-radius: 0.25em;
}
.cv-stat small { display: block; font-size: 0.45em; font-weight: 700; color: #777; letter-spacing: 0.04em; }
.cv-stat sup { font-size: 0.5em; color: #b8860b; margin-left: 0.05em; }
.cv-stat sup.cv-neg { color: #c0392b; } /* negativer Bonus, z. B. Schlechter Einsatz */
.cv-stat.active { color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); box-shadow: inset 0 0 0 0.08em var(--c); }
.cv-stat.active small { color: var(--c); }
.cv-stats-gk .cv-stat { font-size: 2em; }
.cv-stats-gk .cv-stat.active { background: none; box-shadow: none; }
/* Werte-Box am oberen Kartenrand (Hand): sichtbar, obwohl die Karte zum großen Teil unter dem Bildschirmrand steckt */
.cv-topstats {
    position: absolute;
    top: 0.3em;
    right: 0.3em;
    z-index: 4;
    display: flex;
    gap: 0.15em;
    padding: 0.15em 0.25em;
    background: rgba(255, 255, 255, 0.95);
    color: #222;
    border-radius: 0.35em;
    box-shadow: 0 0.1em 0.3em rgba(0, 0, 0, 0.5);
}
.cv-topstats span {
    min-width: 1.3em;
    padding: 0.05em 0.1em;
    border-radius: 0.2em;
    font-size: 1.25em;
    font-weight: 900;
    line-height: 1;
    text-align: center;
}
.cv-topstats small { display: block; font-size: 0.42em; font-weight: 700; color: #777; letter-spacing: 0.04em; }
.cv-topstats span.active { color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); box-shadow: inset 0 0 0 0.08em var(--c); }
.cv-topstats span.active small { color: var(--c); }
/* Spieler B: Hand ist um 180° gedreht – Box zurückdrehen, damit man sie im Hotseat nicht auf dem Kopf liest */
#hand-B .cv-topstats { transform: rotate(180deg); }

/* Taktikkarte: Kürzel, AP-Münze, Name, Textfeld */
.cv-tac .cv-pos { font-size: 0.85em; top: 0.7em; left: 0.75em; letter-spacing: 0.12em; }
.cv-cost {
    position: absolute;
    top: 0.35em;
    right: 0.4em;
    z-index: 2;
    width: 1.7em;
    height: 1.7em;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    font-weight: 900;
    color: #3e2700;
    background: radial-gradient(circle at 35% 30%, #fff59d, #f9a825);
    box-shadow: 0 0.1em 0.2em rgba(0, 0, 0, 0.6);
}
.cv-tac-icon {
    position: absolute;
    top: 0.75em;
    left: 0;
    right: 0;
    z-index: 2;
    font-size: 2.3em;
    line-height: 1.2;
    text-align: center;
    filter: drop-shadow(0 0.06em 0.08em rgba(0, 0, 0, 0.6));
    background: radial-gradient(circle at 50% 55%, rgba(255, 255, 255, 0.35) 0 0.45em, transparent 0.75em);
}
.cv-tac-name {
    position: absolute;
    top: 4.15em;
    text-align: center;
    left: 0.6em;
    right: 0.6em;
    z-index: 2;
    font-size: 1em;
    font-weight: 800;
    line-height: 1.1;
    text-shadow: 0 0.06em 0.12em rgba(0, 0, 0, 0.45);
}
.cv-text {
    position: absolute;
    top: 7.3em;
    left: 0.65em;
    right: 0.65em;
    bottom: 0.65em;
    z-index: 2;
    overflow: hidden;
    font-size: 0.78em;
    line-height: 1.25;
    padding: 0.4em;
    border-radius: 0.6em;
    background: rgba(255, 255, 255, 0.96);
    color: #222;
}

/* Kartenvorschau beim Überfahren (card_view.ts → enableCardPreview): groß, oben rechts, klickt nicht mit;
   darunter die Keyword-Erklärungen */
.cv-preview {
    position: fixed;
    top: 225px; /* unter der Kopfleiste, oben rechts über dem Feld des Gegners */
    right: 18px;
    width: var(--preview-w);
    z-index: 9000;
    pointer-events: none;
    animation: cv-preview-in 0.14s ease-out;
}
.cv.cv-preview-card {
    width: 100%;
    height: calc(var(--preview-w) * 135 / 110);
    font-size: calc(var(--preview-w) / 11);
    box-sizing: border-box;
    border-color: #f1c40f;
    box-shadow: 0 0 22px rgba(241, 196, 15, 0.55), 0 14px 34px rgba(0, 0, 0, 0.7);
}
.cv-preview-help {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(10, 20, 12, 0.94);
    border: 1px solid rgba(241, 196, 15, 0.6);
    color: #e8efe9;
    font: 0.8rem/1.35 'Segoe UI', Arial, sans-serif;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}
.cv-preview-help p { margin: 0; }
.cv-preview-help p + p { margin-top: 4px; }
.cv-preview-help b { color: #f1c40f; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.75rem; margin-right: 4px; }
/* Text in der Vorschau kleiner, damit auch lange Kartentexte ganz hineinpassen (Lage in Karten-em umgerechnet) */
.cv-preview-card .cv-text, .fx-tactic-card .cv-text { font-size: 0.6em; top: 9.6em; left: 1.1em; right: 1.1em; bottom: 1.1em; }
.cv-preview-card .cv-shine { display: none; }
@keyframes cv-preview-in { from { opacity: 0; transform: translateY(8px) scale(0.96); } to { opacity: 1; transform: none; } }

/* Eigenständige Karte (Pack-Overlay): füllt den Block und skaliert mit der Kartenbreite */
.cv-fill { width: 100%; height: 100%; box-sizing: border-box; font-size: calc(var(--cw, 110px) / 11); }
.cv-badge {
    position: absolute;
    top: 3.1em; /* unter dem Positionskürzel, in Etikett-em (0,7 × Karten-em) */
    left: 0.6em;
    z-index: 6;
    font-size: 0.7em;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.1em 0.6em;
    border-radius: 0.4em;
    background: #f1c40f;
    color: #000;
}

/* ============================================================
   EFFEKTE (src/ui/effects.ts): Karte ausspielen, Taktikkarte, Zweikampf, Tor
   ============================================================ */
:root { --team-a: #3498db; --team-b: #e74c3c; }
.fx-team-a { --team: var(--team-a); }
.fx-team-b { --team: var(--team-b); }
.fx-overlay { position: fixed; inset: 0; z-index: 9500; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* Karte ausspielen: von oben aufs Feld knallen, goldener Ring breitet sich aus */
.card.fx-slam { animation: fx-slam 0.7s cubic-bezier(.2, 1.3, .4, 1) both; z-index: 50; }
@keyframes fx-slam {
    0% { transform: translateY(-90px) scale(1.6) rotate(-6deg); opacity: 0; filter: brightness(2); box-shadow: 0 30px 40px rgba(0, 0, 0, 0.5); }
    45% { transform: translateY(0) scale(0.92) rotate(1deg); opacity: 1; filter: brightness(1.6); }
    65% { transform: scale(1.04); }
    100% { transform: none; filter: none; }
}
.fx-ring {
    position: absolute; left: 50%; top: 50%; width: 100%; aspect-ratio: 1; z-index: -1;
    border: 5px solid rgba(241, 196, 15, 0.95); border-radius: 50%;
    box-shadow: 0 0 18px rgba(241, 196, 15, 0.8);
    transform: translate(-50%, -50%) scale(0.3); opacity: 0;
    animation: fx-ring 0.9s ease-out both;
}
@keyframes fx-ring {
    0% { transform: translate(-50%, -50%) scale(0.3); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
}

/* Taktikkarte: groß in der Mitte */
.fx-tactic { background: radial-gradient(circle, rgba(0, 0, 0, 0.55) 0%, transparent 60%); animation: fx-fade 1.5s ease forwards; }
.fx-tactic-who { font: 900 1.3rem 'Segoe UI', Arial, sans-serif; color: #fff; text-transform: uppercase; letter-spacing: 3px; margin-bottom: 12px; text-shadow: 0 0 12px var(--team); }
.fx-tactic-card { --cw: clamp(170px, 26vh, 240px); width: var(--cw); height: calc(var(--cw) * 135 / 110); animation: fx-tactic-card 1.5s cubic-bezier(.2, 1.2, .4, 1) forwards; }
.fx-tactic-card .cv { border-color: #f1c40f; box-shadow: 0 0 30px var(--team), 0 16px 40px rgba(0, 0, 0, 0.7); }
@keyframes fx-tactic-card {
    0% { transform: scale(0.3) rotate(-12deg); opacity: 0; }
    25% { transform: scale(1.05) rotate(2deg); opacity: 1; }
    35%, 80% { transform: scale(1) rotate(0); opacity: 1; }
    100% { transform: translateY(-60px) scale(0.6); opacity: 0; }
}
@keyframes fx-fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* Zweikampf: beide Seiten fliegen herein, prallen zusammen, der Sieger wächst */
.fx-duel { background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6) 0%, transparent 65%); animation: fx-fade 2.4s ease forwards; font-family: 'Segoe UI', Arial, sans-serif; }
.fx-duel-row { display: flex; align-items: center; gap: 18px; }
.fx-duel-side {
    width: 150px; padding: 12px 0; text-align: center; color: #fff; border-radius: 14px;
    background: linear-gradient(160deg, color-mix(in srgb, var(--team) 80%, #fff), var(--team) 50%, color-mix(in srgb, var(--team) 50%, #000));
    border: 3px solid rgba(255, 255, 255, 0.5); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.fx-duel-player { font-size: 0.8rem; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; opacity: 0.9; }
.fx-duel-total { font-size: 3.6rem; font-weight: 900; line-height: 1; text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4); }
.fx-duel-type { font-size: 0.9rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.fx-duel-vs { font: 900 2.2rem 'Segoe UI', Arial, sans-serif; color: #f1c40f; text-shadow: 0 0 14px rgba(241, 196, 15, 0.9), 0 3px 4px #000; animation: fx-vs 2.4s ease forwards; }
.fx-duel-result { margin-top: 16px; padding: 6px 18px; border-radius: 8px; font-weight: 900; font-size: 1.1rem; letter-spacing: 1px; text-transform: uppercase; color: #fff; background: var(--team); box-shadow: 0 0 18px var(--team); opacity: 0; animation: fx-result 2.4s ease forwards; }
/* Erst hereinfliegen (links/rechts), ab 0,75 s wächst der Sieger bzw. verblasst der Verlierer */
.fx-duel-side:first-child { animation: fx-duel-left 0.6s cubic-bezier(.3, 1.3, .5, 1) both; }
.fx-duel-side:last-child { animation: fx-duel-right 0.6s cubic-bezier(.3, 1.3, .5, 1) both; }
.fx-duel-side.fx-winner:first-child { animation: fx-duel-left 0.6s cubic-bezier(.3, 1.3, .5, 1) both, fx-win 0.5s ease 0.75s forwards; }
.fx-duel-side.fx-winner:last-child { animation: fx-duel-right 0.6s cubic-bezier(.3, 1.3, .5, 1) both, fx-win 0.5s ease 0.75s forwards; }
.fx-duel-side.fx-loser:first-child { animation: fx-duel-left 0.6s cubic-bezier(.3, 1.3, .5, 1) both, fx-lose 0.5s ease 0.75s forwards; }
.fx-duel-side.fx-loser:last-child { animation: fx-duel-right 0.6s cubic-bezier(.3, 1.3, .5, 1) both, fx-lose 0.5s ease 0.75s forwards; }
@keyframes fx-duel-left { 0% { translate: -60vw 0; } 70% { translate: 12px 0; } 100% { translate: 0 0; } }
@keyframes fx-duel-right { 0% { translate: 60vw 0; } 70% { translate: -12px 0; } 100% { translate: 0 0; } }
@keyframes fx-win { to { transform: scale(1.18); border-color: #f1c40f; box-shadow: 0 0 34px #f1c40f, 0 10px 30px rgba(0, 0, 0, 0.6); } }
@keyframes fx-lose { to { transform: scale(0.88); filter: grayscale(0.7) brightness(0.7); } }
@keyframes fx-vs { 0%, 18% { transform: scale(0); } 30% { transform: scale(1.6); } 40%, 100% { transform: scale(1); } }
@keyframes fx-result { 0%, 45% { opacity: 0; transform: translateY(10px); } 55%, 100% { opacity: 1; transform: none; } }

/* Tor: riesiges TOR!, Konfetti, Feld wackelt */
.fx-goal { background: radial-gradient(circle, color-mix(in srgb, var(--team) 35%, transparent) 0%, transparent 65%); animation: fx-fade 2.6s ease forwards; overflow: hidden; }
.fx-goal-text {
    font: 900 clamp(4rem, 14vw, 10rem) 'Segoe UI', Arial, sans-serif; line-height: 1; color: #fff; letter-spacing: 0.05em;
    -webkit-text-stroke: 4px var(--team);
    text-shadow: 0 0 30px var(--team), 0 0 60px #f1c40f, 0 8px 0 rgba(0, 0, 0, 0.4);
    animation: fx-goal-text 2.6s cubic-bezier(.2, 1.4, .4, 1) forwards;
}
.fx-goal-sub { font: 900 1.6rem 'Segoe UI', Arial, sans-serif; color: #fff; text-transform: uppercase; letter-spacing: 6px; text-shadow: 0 0 12px var(--team), 0 2px 3px #000; animation: fx-result 2.6s ease forwards; opacity: 0; }
@keyframes fx-goal-text {
    0% { transform: scale(3); opacity: 0; }
    15% { transform: scale(0.9); opacity: 1; }
    22% { transform: scale(1.05); }
    30%, 85% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}
.fx-confetti { position: absolute; inset: 0; }
.fx-confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; background: var(--team); animation: fx-confetti linear forwards; }
.fx-confetti i.fx-c1 { background: #f1c40f; width: 8px; height: 12px; }
.fx-confetti i.fx-c2 { background: #fff; width: 7px; height: 7px; border-radius: 50%; }
@keyframes fx-confetti { to { transform: translateY(110vh) rotate(var(--rot)); } }
.fx-shake { animation: fx-shake 0.5s ease 0.1s 2; }
@keyframes fx-shake {
    0%, 100% { transform: none; }
    20% { transform: translate(-6px, 3px) rotate(-0.4deg); }
    40% { transform: translate(5px, -4px) rotate(0.3deg); }
    60% { transform: translate(-4px, 2px); }
    80% { transform: translate(3px, -2px); }
}
@media (prefers-reduced-motion: reduce) {
    .card.fx-slam, .fx-ring, .fx-shake, .fx-duel-side, .fx-duel-vs, .fx-tactic-card, .fx-goal-text { animation: none !important; }
    .fx-duel-result, .fx-goal-sub { opacity: 1; animation: none; }
}

/* Gegen den Computer: Stärke wählen (menu.ts → botPicker) */
.bot-strength { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0 0 12px; }
.bot-strength-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.bot-strength-desc { margin: 0; color: var(--menu-muted); font-size: 0.85rem; text-align: center; }
/* Optionen im Startmenü: je Einstellung eine Zeile (Überschrift, Auswahl, Hinweis) */
.options-row { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* Erklärungen beim Überfahren (help_tooltip.ts): Aktionsknöpfe, Keywords in Menüs */
.help-tip {
    position: fixed;
    z-index: 9600;
    max-width: 280px;
    padding: 8px 11px;
    border-radius: 8px;
    background: rgba(10, 20, 12, 0.96);
    border: 1px solid rgba(241, 196, 15, 0.7);
    color: #e8efe9;
    font: 0.82rem/1.35 'Segoe UI', Arial, sans-serif;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    animation: help-tip-in 0.12s ease-out;
}
.help-tip-title { display: block; color: #fff; font-size: 0.9rem; margin-bottom: 2px; }
.help-tip-meta { display: block; color: #f1c40f; font-weight: 700; font-size: 0.76rem; margin-bottom: 4px; }
.help-tip-text { display: block; }
.help-tip-text + .help-tip-text { margin-top: 3px; color: #b9c7bc; }
.cv-kw[data-help] { cursor: help; }
@keyframes help-tip-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============================================================
   RARITÄTEN (collection.json → rarities; card_view.ts setzt cv-r-<stufe>)
   selten: Silberrand · episch: Violett + Holo · legendär: Gold + bewegte Regenbogenfolie
   ============================================================ */
:root { --r-rare: #dfe7ee; --r-epic: #c18cff; --r-legendary: #ffd54f; }
/* Dicke Ränder je Stufe (in em, wachsen mit der Karte) – auf den ersten Blick erkennbar */
.cv.cv-r-rare { border-width: 0.3em; border-color: var(--r-rare); box-shadow: 0 0 7px rgba(223, 231, 238, 0.55), 0 4px 10px rgba(0, 0, 0, 0.55); }
.cv.cv-r-epic { border-width: 0.34em; border-color: var(--r-epic); box-shadow: 0 0 10px rgba(193, 140, 255, 0.7), 0 4px 10px rgba(0, 0, 0, 0.55); }
.cv.cv-r-legendary { border-width: 0.38em; border-color: var(--r-legendary); box-shadow: 0 0 12px rgba(255, 213, 79, 0.85), 0 4px 10px rgba(0, 0, 0, 0.55); }

/* Edelstein oben rechts am Werteblock (Taktikkarten: unten rechts am Textfeld) */
.cv-gem {
    position: absolute;
    right: 0.45em;
    bottom: 4.35em;
    z-index: 6;
    font-size: 1em;
    line-height: 1;
    pointer-events: auto;
}
.cv-tac .cv-gem { bottom: 0.9em; right: 0.9em; }
.cv-r-rare .cv-gem { color: #9fb3c1; text-shadow: 0 0 3px #fff, 0 0 1px #000; }
.cv-r-epic .cv-gem { color: #9b4dff; text-shadow: 0 0 5px #d9b8ff; }
.cv-r-legendary .cv-gem { color: #ffb300; text-shadow: 0 0 6px #fff3c4, 0 0 2px #7a5200; }

/* Folie: episch = ruhiger Holo-Schimmer, legendär = Regenbogen, der langsam über die Karte wandert */
.cv-foil {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 4;
    mix-blend-mode: overlay;
    background-size: 300% 300%;
    animation: cv-foil 7s linear infinite;
}
.cv-r-epic .cv-foil {
    opacity: 0.75;
    background-image: linear-gradient(115deg, transparent 20%, rgba(214, 170, 255, 0.85) 35%, rgba(140, 230, 255, 0.75) 50%, rgba(255, 170, 235, 0.85) 65%, transparent 80%);
}
.cv-r-legendary .cv-foil {
    opacity: 0.38;
    background-image: linear-gradient(115deg, #ff5a5a, #ffb84d, #fff176, #7dff8a, #6ee7ff, #7f8cff, #e57bff, #ff5a5a);
    animation-duration: 5s;
}
@keyframes cv-foil { from { background-position: 0% 0%; } to { background-position: 300% 300%; } }
@media (prefers-reduced-motion: reduce) { .cv-foil { animation: none; } }

/* Vorschau: Stufe über den Keyword-Erklärungen */
.cv-preview-help .cv-preview-rarity b { text-transform: none; letter-spacing: 0; font-size: 0.8rem; }
.cv-preview-rarity.cv-r-rare b { color: var(--r-rare); }
.cv-preview-rarity.cv-r-epic b { color: var(--r-epic); }
.cv-preview-rarity.cv-r-legendary b { color: var(--r-legendary); }

/* Pack: verdeckte Karte leuchtet in ihrer Stufe, Legendäre mit Lichtstrahlen beim Aufdecken */
.pack-card.r-common .pack-card-back { border-color: #8fa596; }
.pack-card.r-rare .pack-card-back { border-color: var(--r-rare); box-shadow: 0 0 20px rgba(223, 231, 238, 0.95), 0 10px 24px rgba(0, 0, 0, 0.6); }
.pack-card.r-epic .pack-card-back { border-color: var(--r-epic); box-shadow: 0 0 28px rgba(193, 140, 255, 1), 0 0 50px rgba(150, 80, 255, 0.5), 0 10px 24px rgba(0, 0, 0, 0.6); }
.pack-card.r-legendary .pack-card-back { border-color: var(--r-legendary); box-shadow: 0 0 30px rgba(255, 213, 79, 1), 0 10px 24px rgba(0, 0, 0, 0.6); animation: pack-legend-pulse 1.1s ease-in-out infinite alternate; }
.pack-card.r-legendary.flipped .pack-card-back { animation: none; }
@keyframes pack-legend-pulse { to { box-shadow: 0 0 46px rgba(255, 213, 79, 1), 0 0 90px rgba(255, 180, 0, 0.5), 0 10px 24px rgba(0, 0, 0, 0.6); } }
.pack-card-rays { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: -1; }
.pack-card.r-legendary.flipped .pack-card-rays::before {
    content: "";
    position: absolute;
    left: calc(var(--cw) * -1.4);
    top: calc(var(--cw) * -1.4);
    width: calc(var(--cw) * 2.8);
    height: calc(var(--cw) * 2.8);
    border-radius: 50%;
    background: repeating-conic-gradient(rgba(255, 220, 110, 0.55) 0 8deg, transparent 8deg 24deg);
    mask-image: radial-gradient(circle, #000 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 70%);
    animation: pack-rays 1.4s ease-out both, pack-rays-spin 12s linear 1.4s infinite;
}
@keyframes pack-rays { from { transform: scale(0.2) rotate(0deg); opacity: 0; } 40% { opacity: 1; } to { transform: scale(1) rotate(40deg); opacity: 0.85; } }
@keyframes pack-rays-spin { from { transform: rotate(40deg); } to { transform: rotate(400deg); } }

/* Sammlung: Fanschals, Fortschritt je Stufe, Zerlegen/Herstellen unter jeder Karte */
.wallet-scarves { color: #ffb4b4; }
.rarity-progress { display: inline-block; margin: 4px 6px 0; font-weight: 700; font-size: 0.8rem; }
.rarity-progress.cv-r-common { color: #cfd8d1; }
.rarity-progress.cv-r-rare { color: var(--r-rare); }
.rarity-progress.cv-r-epic { color: var(--r-epic); }
.rarity-progress.cv-r-legendary { color: var(--r-legendary); }
.coll-card { display: flex; flex-direction: column; gap: 4px; }
.coll-card-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; min-height: 0; }
.coll-mini-btn {
    padding: 2px 7px;
    font: 700 0.7rem 'Segoe UI', Arial, sans-serif;
    color: #fff;
    background: var(--menu-btn, #1d2a20);
    border: 1px solid var(--menu-line, #3a4a3d);
    border-radius: 999px;
    cursor: pointer;
}
.coll-mini-btn:hover:not(:disabled), .coll-mini-btn:focus-visible { border-color: var(--menu-gold, #f1c40f); outline: none; }
.coll-mini-btn.craft { color: #ffe08a; }
.coll-mini-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Deck-Editor: Edelstein in der Deckliste */
.ed-gem { margin-right: 5px; }
.ed-gem.cv-r-rare { color: var(--r-rare); }
.ed-gem.cv-r-epic { color: var(--r-epic); }
.ed-gem.cv-r-legendary { color: var(--r-legendary); }

/* Ton an/aus (sound.ts): kleiner runder Knopf unten rechts, auch im Menü */
.sound-toggle {
    position: fixed;
    right: 12px;
    bottom: 12px;
    z-index: 9700;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(241, 196, 15, 0.6);
    background: rgba(10, 20, 12, 0.85);
    color: #fff;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}
.sound-toggle:hover, .sound-toggle:focus-visible { border-color: #f1c40f; outline: none; }

/* ============================================================
   KETTE (Taktik-Stack wie Kettenglieder): Panel (tactics.ts) und Auflösung (effects.ts → showChain)
   ============================================================ */
.chain { display: flex; justify-content: center; align-items: flex-start; padding: 14px 10px 4px 22px; }
.chain-link { --cw: 132px; position: relative; width: var(--cw); margin-left: -8px; z-index: calc(1 + var(--i)); transition: transform 0.2s ease; }
.chain-link:first-child { margin-left: 0; }
.chain-link .chain-card { height: calc(var(--cw) * 135 / 110); transform: rotate(calc((var(--i) - 1) * 2deg)) translateY(calc(var(--i) * -6px)); }
.chain-link .chain-card .cv { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6); }
.chain-link .chain-card .cv-text { font-size: 0.66em; top: 8.6em; }
.chain-num {
    position: absolute; left: -12px; top: -12px; z-index: 10;
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font: 900 1rem 'Segoe UI', Arial, sans-serif; color: #fff;
    background: radial-gradient(circle at 35% 30%, #4dd0c4, #00695c);
    border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
.chain-link.team-a .chain-num { background: radial-gradient(circle at 35% 30%, #74b9ff, #1e5fa8); }
.chain-link.team-b .chain-num { background: radial-gradient(circle at 35% 30%, #ff8a80, #a52a2a); }
.chain-owner { margin-top: 6px; font-size: 0.75rem; font-weight: 700; }
.chain-link.team-a .chain-owner { color: #90caf9; }
.chain-link.team-b .chain-owner { color: #ef9a9a; }
.chain-target { font-size: 0.72rem; color: #b2dfdb; font-weight: 700; }
.chain-top-badge { margin-top: 2px; font-size: 0.68rem; color: #80cbc4; font-weight: 700; }
.chain-link.chain-top .chain-card .cv { border-color: #80cbc4; animation: chain-top-pulse 1.2s ease-in-out infinite alternate; }
@keyframes chain-top-pulse { to { box-shadow: 0 0 22px rgba(128, 203, 196, 0.95), 0 6px 16px rgba(0, 0, 0, 0.6); } }
.chain-stamp { display: none; }

/* Auflösung: Glied leuchtet „WIRKT“ oder wird „GEKONTERT“ durchgestrichen */
.fx-chain { background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.7) 0%, transparent 70%); }
.fx-chain-title { font: 900 1.2rem 'Segoe UI', Arial, sans-serif; color: #80cbc4; letter-spacing: 3px; text-transform: uppercase; margin-bottom: 6px; text-shadow: 0 2px 4px #000; }
.fx-chain .chain-link { --cw: clamp(140px, 22vh, 190px); margin-left: -6px; }
.chain-link.chain-resolves, .chain-link.chain-countered { z-index: 30; }
.fx-chain .chain-link:first-child { margin-left: 0; }
.chain-link.chain-resolves .chain-card .cv { border-color: #f1c40f; box-shadow: 0 0 30px rgba(241, 196, 15, 0.95), 0 6px 16px rgba(0, 0, 0, 0.6); animation: chain-pop 0.35s ease-out; }
.chain-link.chain-countered .chain-card { filter: grayscale(0.85) brightness(0.6); }
.chain-link.chain-resolves .chain-stamp, .chain-link.chain-countered .chain-stamp {
    display: block; position: absolute; left: 50%; top: 42%; z-index: 12;
    transform: translate(-50%, -50%) rotate(-14deg);
    padding: 4px 10px; border-radius: 6px; border: 3px solid currentColor;
    font: 900 1rem 'Segoe UI', Arial, sans-serif; letter-spacing: 2px;
    background: rgba(0, 0, 0, 0.55); animation: chain-stamp 0.3s cubic-bezier(.2, 1.4, .4, 1);
}
.chain-link.chain-resolves .chain-stamp::after { content: attr(data-resolves); } /* Text aus loca_de.json (effects.ts) */
.chain-link.chain-resolves .chain-stamp { color: #f1c40f; }
.chain-link.chain-countered .chain-stamp::after { content: attr(data-countered); }
.chain-link.chain-countered .chain-stamp { color: #ff6b6b; }
@keyframes chain-pop { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes chain-stamp { from { transform: translate(-50%, -50%) rotate(-14deg) scale(2.2); opacity: 0; } to { transform: translate(-50%, -50%) rotate(-14deg) scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .chain-link.chain-top .chain-card .cv, .chain-stamp, .chain-link .cv { animation: none !important; } }

/* ============================================================
   DECK UND ABLAGE AUF DEM RASEN (piles.ts) – wie Zonen einer Spielmatte
   ============================================================ */
.piles {
    --pw: calc(var(--card-w) * 0.55);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 10px;
    z-index: 4;
    pointer-events: auto;
}
.piles-a { right: 34px; } /* etwas Abstand zu den Aktionsknöpfen, die auf schmalen Bildschirmen ins Feld ragen */
.piles-b { left: 14px; flex-direction: row-reverse; }
.pile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 0;
    background: none;
    border: none;
    color: #fff;
    font: inherit;
}
.pile-slot {
    position: relative;
    width: var(--pw);
    height: calc(var(--pw) * 135 / 110);
    border: 2px dashed rgba(255, 255, 255, 0.35);
    border-radius: 7px;
    box-sizing: border-box;
}
.pile-back {
    position: absolute;
    inset: -2px;
    border-radius: 6px;
    border: 2px solid #c9a227;
    box-sizing: border-box;
    background:
        radial-gradient(circle at 50% 50%, transparent 0 22%, rgba(255, 255, 255, 0.55) 23% 26%, transparent 27%),
        repeating-linear-gradient(0deg, #2e7d32 0 6px, #276b2b 6px 12px);
    transform: translate(calc(var(--k) * -1.5px), calc(var(--k) * -1.5px));
    box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
}
.pile-grave { cursor: pointer; }
.pile-grave .pile-slot .cv { position: absolute; inset: -2px; width: auto; height: auto; --cw: var(--pw); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5); }
.pile-grave:hover .pile-slot, .pile-grave:focus-visible .pile-slot { border-color: #f1c40f; outline: none; }
.pile-grave:focus-visible { outline: none; }
.pile-count {
    position: absolute;
    top: -8px;
    right: -8px;
    z-index: 3;
    min-width: 22px;
    padding: 1px 6px;
    box-sizing: border-box;
    border-radius: 999px;
    background: #111;
    border: 1px solid #f1c40f;
    font-weight: 900;
    font-size: 0.78rem;
    text-align: center;
}
.pile-deck.low .pile-count { background: #e67e22; border-color: #fff; }
.pile-deck.empty .pile-count { background: #c0392b; border-color: #fff; }
.pile-deck.empty .pile-slot { border-color: rgba(231, 76, 60, 0.8); }
.pile-count.bump { animation: pile-bump 0.4s ease-out; }
@keyframes pile-bump { 40% { transform: scale(1.45); } }
.pile-label { font-size: 0.68rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); }

/* Ablage ansehen */
.grave-overlay {
    position: fixed;
    inset: 0;
    z-index: 9400;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    animation: help-tip-in 0.15s ease-out;
}
.grave-panel {
    width: min(880px, 92vw);
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    background: rgba(10, 20, 12, 0.97);
    border: 2px solid rgba(241, 196, 15, 0.7);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
    color: #fff;
    font-family: 'Segoe UI', Arial, sans-serif;
}
.grave-head { display: flex; align-items: baseline; gap: 12px; padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.grave-head span { color: #b9c7bc; font-size: 0.85rem; flex: 1; }
.grave-close { background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; }
.grave-close:hover, .grave-close:focus-visible { color: #f1c40f; outline: none; }
.grave-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; padding: 14px 16px 18px; overflow-y: auto; }
.grave-cell { --cw: 110px; container-type: inline-size; aspect-ratio: 110 / 135; }
.grave-cell .cv { font-size: calc(100cqw / 11); }
.grave-empty { grid-column: 1 / -1; margin: 0; color: #b9c7bc; }

/* Phasenbanner (effects.ts → showBanner): breites Band in Teamfarbe quer über die Mitte */
.fx-banner { background: transparent; }
.fx-banner-band {
    width: 100%;
    padding: 14px 0;
    text-align: center;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--team, #26a69a) 85%, #000) 18%, color-mix(in srgb, var(--team, #26a69a) 85%, #000) 82%, transparent);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    animation: fx-banner 1.05s cubic-bezier(.2, .9, .3, 1) forwards;
}
.fx-banner-band span {
    display: inline-block;
    font: 900 clamp(1.6rem, 4vw, 2.6rem) 'Segoe UI', Arial, sans-serif;
    color: #fff;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
    animation: fx-banner-text 1.05s cubic-bezier(.2, .9, .3, 1) forwards;
}
@keyframes fx-banner { 0% { transform: scaleY(0); opacity: 0; } 15% { transform: scaleY(1); opacity: 1; } 80% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(0); opacity: 0; } }
@keyframes fx-banner-text { 0% { transform: translateX(-30vw); opacity: 0; } 20% { transform: translateX(0); opacity: 1; } 80% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(30vw); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fx-banner-band, .fx-banner-band span { animation: none; } }

/* Menü: Demo-Häkchen */
.demo-toggle { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 4px 0 10px; color: var(--menu-muted, #b9c7bc); font-size: 0.9rem; cursor: pointer; }
.demo-toggle input { width: 18px; height: 18px; accent-color: var(--menu-gold, #f1c40f); }

/* Kleines Banner (neue Runde): schmaleres, neutrales Band mit Unterzeile */
.fx-banner-small .fx-banner-band {
    padding: 8px 0 9px;
    background: linear-gradient(90deg, transparent, rgba(12, 40, 30, 0.92) 22%, rgba(12, 40, 30, 0.92) 78%, transparent);
    border-top: 1px solid rgba(241, 196, 15, 0.55);
    border-bottom: 1px solid rgba(241, 196, 15, 0.55);
    animation-duration: 1.3s;
}
.fx-banner-small .fx-banner-band span { font-size: clamp(1.1rem, 2.6vw, 1.7rem); color: #f1c40f; animation-duration: 1.3s; }
.fx-banner-band small {
    display: block;
    margin-top: 2px;
    font: 700 0.85rem 'Segoe UI', Arial, sans-serif;
    color: #dfe8e1;
    letter-spacing: 0.08em;
    animation: fx-banner-text 1.3s cubic-bezier(.2, .9, .3, 1) forwards;
}

/* Tutorial: Trainer-Box (src/ui/tutorial_ui.ts) und Markierung des nächsten Schritts */
.tutorial-coach {
    position: fixed;
    left: 8px; top: 50%; transform: translateY(-50%);
    z-index: 3100;   /* vor der Anzeigetafel (3000), unter Würfeln und Effekten */
    width: min(240px, calc(100vw - 32px));
    padding: 12px 16px 14px;
    background: rgba(12, 28, 24, 0.96);
    border: 2px solid #26a69a;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.4;
}
/* Platz je Szene/Schritt (coachPosition); left = Standard (oben), zwischen den Torhütern */
.tutorial-coach.tutorial-pos-right { left: auto; right: 8px; }
.tutorial-coach.tutorial-pos-top-left { top: 16px; left: 16px; transform: none; width: min(340px, calc(100vw - 32px)); }
.tutorial-coach.tutorial-pos-top-right { top: 16px; left: auto; right: 16px; transform: none; width: min(340px, calc(100vw - 32px)); }
.tutorial-label { font-size: 0.75rem; letter-spacing: 1px; text-transform: uppercase; color: #80cbc4; }
.tutorial-title { font-size: 1.1rem; font-weight: bold; margin: 2px 0 8px; }
.tutorial-intro { opacity: 0.85; margin-bottom: 8px; }
.tutorial-step { font-weight: bold; padding: 8px 10px; border-left: 3px solid #ffeb3b; background: rgba(255,255,255,0.06); border-radius: 4px; }
.tutorial-note { margin-top: 8px; color: #ffe082; }
.tutorial-step[hidden], .tutorial-note[hidden] { display: none; }
.tutorial-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tutorial-btn {
    padding: 6px 12px; font-size: 0.9rem; font-weight: bold;
    background: rgba(255,255,255,0.1); color: #fff;
    border: 1px solid rgba(255,255,255,0.3); border-radius: 6px; cursor: pointer;
}
.tutorial-btn:hover { background: rgba(255,255,255,0.2); }
.tutorial-btn-primary { background: #26a69a; border-color: #26a69a; }
.tutorial-btn-primary:hover { background: #2bbbad; }
.tutorial-coach.tutorial-result {
    top: 50%; left: 50%; right: auto; transform: translate(-50%, -50%);
    width: min(420px, calc(100vw - 32px)); text-align: center;
}
.tutorial-result .tutorial-intro { font-size: 1.5rem; font-weight: bold; opacity: 1; }
.tutorial-won .tutorial-intro { color: #ffeb3b; }
.tutorial-lost .tutorial-intro { color: #ef9a9a; }
.tutorial-result .tutorial-buttons { justify-content: center; }
.tutorial-shake { animation: tutorial-shake 0.4s ease-in-out; }
@keyframes tutorial-shake {
    0%, 100% { translate: 0; }
    25% { translate: -6px 0; }
    75% { translate: 6px 0; }
}
/* Nächster Schritt: pulsierender Rahmen; gesperrt (strenger Modus): abgeblendet und nicht klickbar */
.tutorial-highlight { outline: 3px solid #ffeb3b !important; outline-offset: 2px; animation: tutorial-pulse 1.1s ease-in-out infinite; }
@keyframes tutorial-pulse {
    0%, 100% { box-shadow: 0 0 6px rgba(255, 235, 59, 0.5); }
    50% { box-shadow: 0 0 22px rgba(255, 235, 59, 1); }
}
.tutorial-locked { opacity: 0.4; pointer-events: none; }

/* Tutorial-Rundgang durchs Menü (src/ui/menu_tour.ts): Box unten rechts über dem Menü (z-index 10000),
   eine durchsichtige Fläche fängt Klicks ins Menü ab */
.tutorial-coach.tutorial-tour {
    z-index: 10100;
    top: auto; left: auto; right: 16px; bottom: 16px; transform: none;
    width: min(360px, calc(100vw - 32px));
}
.tutorial-coach.tutorial-tour.tutorial-result {
    top: 50%; left: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%);
    width: min(420px, calc(100vw - 32px));
}
.tutorial-tour-blocker { position: fixed; inset: 0; z-index: 10050; background: transparent; }

/* Tutorial im Menü: Kapitel mit Szenen (menu.ts → refreshTutorialList) */
.tutorial-scenes { display: flex; flex-direction: column; gap: 8px; width: 100%; align-items: stretch; }
.tutorial-chapter { display: flex; flex-direction: column; align-items: center; margin-top: 6px; color: #dfe8e1; }
.tutorial-chapter small { opacity: 0.8; }
.menu-btn.tutorial-scene-done small { color: #a5d6a7; }

/* ============================================================
   STADION-LOOK (22.11.2026, überarbeitet): Ränge mit Zuschauern (SVG-Muster: Kopf + Oberkörper in Trikotfarben),
   Flutlichtmasten an den Ecken mit Lichtkegeln, Rasen mit Mähstreifen, Körnung und Lichtinseln, Kreidelinien,
   LED-Banden hinter den Toren in Feldern (jedes zweite mit Wort, Wechsel alle 60 s: src/ui/led_boards.ts).
   Nur Optik: überschreibt Farben und Hintergründe weiter oben, Layout und Ebenen (z-index) bleiben unverändert.
   ============================================================ */
:root {
    --pitch-line: rgba(255, 255, 255, 0.8);    /* Kreidelinien */
    --pitch-grass: #2d6d2b;                    /* Grundton Rasen (auch für die Abdeckung im Mittelkreis) */
    --stand: #1d2630;                          /* Grundton der Ränge */
    --led-green: #7dff9e;
    --led-gold: #ffd54f;
    --flood: 255, 250, 225;                    /* Farbe des Flutlichts (RGB) */
    /* Zuschauer: Kopf + Oberkörper in Haut- und Trikotfarben, Sitzreihen (kachelbar 72 × 40); Spiel und Menü */
    --crowd: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='40'%3E%3Crect x='4.4' y='6.8' width='6.2' height='5.2' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='7.5' cy='5.2' r='2.0' fill='%23e0b48c'/%3E%3Crect x='12.8' y='7.5' width='6.6' height='5.5' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='16.1' cy='5.9' r='2.1' fill='%23e0b48c'/%3E%3Crect x='21.4' y='6.6' width='6.1' height='5.1' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='24.4' cy='5.0' r='1.9' fill='%23f5dcc4'/%3E%3Crect x='28.8' y='7.8' width='6.4' height='5.3' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='32.0' cy='6.2' r='2.0' fill='%23c68e64'/%3E%3Crect x='36.8' y='7.0' width='5.9' height='4.9' rx='2' fill='%232b2b2b'/%3E%3Ccircle cx='39.7' cy='5.4' r='1.9' fill='%23f1d3b3'/%3E%3Crect x='44.3' y='7.8' width='6.5' height='5.4' rx='2' fill='%23b8362e'/%3E%3Ccircle cx='47.5' cy='6.2' r='2.1' fill='%23f5dcc4'/%3E%3Crect x='43.5' y='2.6' width='8' height='1.6' rx='0.8' fill='%23b8362e'/%3E%3Crect x='53.3' y='7.2' width='5.7' height='4.7' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='56.1' cy='5.6' r='1.8' fill='%23f5dcc4'/%3E%3Crect x='52.1' y='2.0' width='8' height='1.6' rx='0.8' fill='%23d9453b'/%3E%3Crect x='60.6' y='7.4' width='6.2' height='5.1' rx='2' fill='%235a6b7a'/%3E%3Ccircle cx='63.7' cy='5.8' r='2.0' fill='%23f1d3b3'/%3E%3Crect x='0.6' y='17.1' width='6.2' height='5.2' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='3.7' cy='15.5' r='2.0' fill='%238d5a3b'/%3E%3Crect x='72.6' y='17.1' width='6.2' height='5.2' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='75.7' cy='15.5' r='2.0' fill='%23e0b48c'/%3E%3Crect x='9.7' y='17.4' width='6.2' height='5.1' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='12.8' cy='15.8' r='2.0' fill='%23c68e64'/%3E%3Crect x='16.6' y='17.5' width='6.3' height='5.2' rx='2' fill='%232f66b8'/%3E%3Ccircle cx='19.8' cy='15.9' r='2.0' fill='%23e0b48c'/%3E%3Crect x='25.3' y='17.7' width='6.6' height='5.5' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='28.6' cy='16.1' r='2.1' fill='%23f1d3b3'/%3E%3Crect x='31.9' y='17.9' width='6.3' height='5.3' rx='2' fill='%232f66b8'/%3E%3Ccircle cx='35.1' cy='16.3' r='2.0' fill='%23f1d3b3'/%3E%3Crect x='39.8' y='17.8' width='6.7' height='5.6' rx='2' fill='%232b2b2b'/%3E%3Ccircle cx='43.2' cy='16.2' r='2.1' fill='%23f5dcc4'/%3E%3Crect x='48.7' y='16.5' width='5.5' height='4.6' rx='2' fill='%232f66b8'/%3E%3Ccircle cx='51.5' cy='14.9' r='1.7' fill='%23f1d3b3'/%3E%3Crect x='57.7' y='17.2' width='5.8' height='4.8' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='60.5' cy='15.6' r='1.8' fill='%23f5dcc4'/%3E%3Crect x='66.2' y='16.7' width='5.4' height='4.5' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='68.9' cy='15.1' r='1.7' fill='%23f5dcc4'/%3E%3Crect x='-5.8' y='16.7' width='5.4' height='4.5' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='-3.1' cy='15.1' r='1.7' fill='%238d5a3b'/%3E%3Crect x='4.1' y='27.9' width='6.4' height='5.3' rx='2' fill='%23b8362e'/%3E%3Ccircle cx='7.3' cy='26.3' r='2.0' fill='%23e0b48c'/%3E%3Crect x='12.9' y='26.6' width='6.5' height='5.4' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='16.1' cy='25.0' r='2.0' fill='%238d5a3b'/%3E%3Crect x='29.6' y='26.7' width='6.7' height='5.6' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='32.9' cy='25.1' r='2.1' fill='%23f1d3b3'/%3E%3Crect x='38.1' y='27.8' width='6.0' height='5.0' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='41.1' cy='26.2' r='1.9' fill='%23e0b48c'/%3E%3Crect x='44.4' y='26.8' width='6.7' height='5.6' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='47.8' cy='25.2' r='2.1' fill='%23c68e64'/%3E%3Crect x='53.5' y='27.0' width='6.0' height='5.0' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='56.5' cy='25.4' r='1.9' fill='%23f1d3b3'/%3E%3Crect x='61.7' y='27.4' width='6.8' height='5.6' rx='2' fill='%232b2b2b'/%3E%3Ccircle cx='65.1' cy='25.8' r='2.1' fill='%23f1d3b3'/%3E%3Crect x='0.6' y='37.3' width='6.8' height='5.7' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='4.0' cy='35.7' r='2.2' fill='%23c68e64'/%3E%3Crect x='72.6' y='37.3' width='6.8' height='5.7' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='76.0' cy='35.7' r='2.2' fill='%23f1d3b3'/%3E%3Crect x='9.3' y='37.2' width='6.2' height='5.1' rx='2' fill='%23b8362e'/%3E%3Ccircle cx='12.4' cy='35.6' r='2.0' fill='%238d5a3b'/%3E%3Crect x='16.1' y='36.9' width='5.7' height='4.8' rx='2' fill='%23b8362e'/%3E%3Ccircle cx='19.0' cy='35.3' r='1.8' fill='%238d5a3b'/%3E%3Crect x='25.1' y='37.1' width='6.6' height='5.5' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='28.4' cy='35.5' r='2.1' fill='%23f5dcc4'/%3E%3Crect x='33.1' y='37.8' width='6.5' height='5.5' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='36.4' cy='36.2' r='2.1' fill='%238d5a3b'/%3E%3Crect x='40.2' y='36.7' width='5.6' height='4.6' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='43.0' cy='35.1' r='1.8' fill='%23f1d3b3'/%3E%3Crect x='39.0' y='31.5' width='8' height='1.6' rx='0.8' fill='%233b7dd8'/%3E%3Crect x='50.1' y='36.8' width='5.7' height='4.8' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='53.0' cy='35.2' r='1.8' fill='%238d5a3b'/%3E%3Crect x='57.8' y='37.1' width='6.6' height='5.5' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='61.1' cy='35.5' r='2.1' fill='%23e0b48c'/%3E%3C/svg%3E");
    /* großflächige Hell-dunkel-Flecken über den Zuschauern: Gruppen und Lücken statt Tapete */
    --crowd-patches: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.018' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.02 0 0 0 0 0.03 0 0 0 0 0.04 0 0 0 -2.2 1.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
    --crowd-left: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='72'%3E%3Cg transform='translate(0,72) rotate(-90)'%3E%3Crect x='4.4' y='6.8' width='6.2' height='5.2' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='7.5' cy='5.2' r='2.0' fill='%23e0b48c'/%3E%3Crect x='12.8' y='7.5' width='6.6' height='5.5' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='16.1' cy='5.9' r='2.1' fill='%23e0b48c'/%3E%3Crect x='21.4' y='6.6' width='6.1' height='5.1' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='24.4' cy='5.0' r='1.9' fill='%23f5dcc4'/%3E%3Crect x='28.8' y='7.8' width='6.4' height='5.3' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='32.0' cy='6.2' r='2.0' fill='%23c68e64'/%3E%3Crect x='36.8' y='7.0' width='5.9' height='4.9' rx='2' fill='%232b2b2b'/%3E%3Ccircle cx='39.7' cy='5.4' r='1.9' fill='%23f1d3b3'/%3E%3Crect x='44.3' y='7.8' width='6.5' height='5.4' rx='2' fill='%23b8362e'/%3E%3Ccircle cx='47.5' cy='6.2' r='2.1' fill='%23f5dcc4'/%3E%3Crect x='43.5' y='2.6' width='8' height='1.6' rx='0.8' fill='%23b8362e'/%3E%3Crect x='53.3' y='7.2' width='5.7' height='4.7' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='56.1' cy='5.6' r='1.8' fill='%23f5dcc4'/%3E%3Crect x='52.1' y='2.0' width='8' height='1.6' rx='0.8' fill='%23d9453b'/%3E%3Crect x='60.6' y='7.4' width='6.2' height='5.1' rx='2' fill='%235a6b7a'/%3E%3Ccircle cx='63.7' cy='5.8' r='2.0' fill='%23f1d3b3'/%3E%3Crect x='0.6' y='17.1' width='6.2' height='5.2' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='3.7' cy='15.5' r='2.0' fill='%238d5a3b'/%3E%3Crect x='72.6' y='17.1' width='6.2' height='5.2' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='75.7' cy='15.5' r='2.0' fill='%23e0b48c'/%3E%3Crect x='9.7' y='17.4' width='6.2' height='5.1' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='12.8' cy='15.8' r='2.0' fill='%23c68e64'/%3E%3Crect x='16.6' y='17.5' width='6.3' height='5.2' rx='2' fill='%232f66b8'/%3E%3Ccircle cx='19.8' cy='15.9' r='2.0' fill='%23e0b48c'/%3E%3Crect x='25.3' y='17.7' width='6.6' height='5.5' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='28.6' cy='16.1' r='2.1' fill='%23f1d3b3'/%3E%3Crect x='31.9' y='17.9' width='6.3' height='5.3' rx='2' fill='%232f66b8'/%3E%3Ccircle cx='35.1' cy='16.3' r='2.0' fill='%23f1d3b3'/%3E%3Crect x='39.8' y='17.8' width='6.7' height='5.6' rx='2' fill='%232b2b2b'/%3E%3Ccircle cx='43.2' cy='16.2' r='2.1' fill='%23f5dcc4'/%3E%3Crect x='48.7' y='16.5' width='5.5' height='4.6' rx='2' fill='%232f66b8'/%3E%3Ccircle cx='51.5' cy='14.9' r='1.7' fill='%23f1d3b3'/%3E%3Crect x='57.7' y='17.2' width='5.8' height='4.8' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='60.5' cy='15.6' r='1.8' fill='%23f5dcc4'/%3E%3Crect x='66.2' y='16.7' width='5.4' height='4.5' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='68.9' cy='15.1' r='1.7' fill='%23f5dcc4'/%3E%3Crect x='-5.8' y='16.7' width='5.4' height='4.5' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='-3.1' cy='15.1' r='1.7' fill='%238d5a3b'/%3E%3Crect x='4.1' y='27.9' width='6.4' height='5.3' rx='2' fill='%23b8362e'/%3E%3Ccircle cx='7.3' cy='26.3' r='2.0' fill='%23e0b48c'/%3E%3Crect x='12.9' y='26.6' width='6.5' height='5.4' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='16.1' cy='25.0' r='2.0' fill='%238d5a3b'/%3E%3Crect x='29.6' y='26.7' width='6.7' height='5.6' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='32.9' cy='25.1' r='2.1' fill='%23f1d3b3'/%3E%3Crect x='38.1' y='27.8' width='6.0' height='5.0' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='41.1' cy='26.2' r='1.9' fill='%23e0b48c'/%3E%3Crect x='44.4' y='26.8' width='6.7' height='5.6' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='47.8' cy='25.2' r='2.1' fill='%23c68e64'/%3E%3Crect x='53.5' y='27.0' width='6.0' height='5.0' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='56.5' cy='25.4' r='1.9' fill='%23f1d3b3'/%3E%3Crect x='61.7' y='27.4' width='6.8' height='5.6' rx='2' fill='%232b2b2b'/%3E%3Ccircle cx='65.1' cy='25.8' r='2.1' fill='%23f1d3b3'/%3E%3Crect x='0.6' y='37.3' width='6.8' height='5.7' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='4.0' cy='35.7' r='2.2' fill='%23c68e64'/%3E%3Crect x='72.6' y='37.3' width='6.8' height='5.7' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='76.0' cy='35.7' r='2.2' fill='%23f1d3b3'/%3E%3Crect x='9.3' y='37.2' width='6.2' height='5.1' rx='2' fill='%23b8362e'/%3E%3Ccircle cx='12.4' cy='35.6' r='2.0' fill='%238d5a3b'/%3E%3Crect x='16.1' y='36.9' width='5.7' height='4.8' rx='2' fill='%23b8362e'/%3E%3Ccircle cx='19.0' cy='35.3' r='1.8' fill='%238d5a3b'/%3E%3Crect x='25.1' y='37.1' width='6.6' height='5.5' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='28.4' cy='35.5' r='2.1' fill='%23f5dcc4'/%3E%3Crect x='33.1' y='37.8' width='6.5' height='5.5' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='36.4' cy='36.2' r='2.1' fill='%238d5a3b'/%3E%3Crect x='40.2' y='36.7' width='5.6' height='4.6' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='43.0' cy='35.1' r='1.8' fill='%23f1d3b3'/%3E%3Crect x='39.0' y='31.5' width='8' height='1.6' rx='0.8' fill='%233b7dd8'/%3E%3Crect x='50.1' y='36.8' width='5.7' height='4.8' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='53.0' cy='35.2' r='1.8' fill='%238d5a3b'/%3E%3Crect x='57.8' y='37.1' width='6.6' height='5.5' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='61.1' cy='35.5' r='2.1' fill='%23e0b48c'/%3E%3C/g%3E%3C/svg%3E");
    --crowd-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='72'%3E%3Cg transform='translate(40,0) rotate(90)'%3E%3Crect x='4.4' y='6.8' width='6.2' height='5.2' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='7.5' cy='5.2' r='2.0' fill='%23e0b48c'/%3E%3Crect x='12.8' y='7.5' width='6.6' height='5.5' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='16.1' cy='5.9' r='2.1' fill='%23e0b48c'/%3E%3Crect x='21.4' y='6.6' width='6.1' height='5.1' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='24.4' cy='5.0' r='1.9' fill='%23f5dcc4'/%3E%3Crect x='28.8' y='7.8' width='6.4' height='5.3' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='32.0' cy='6.2' r='2.0' fill='%23c68e64'/%3E%3Crect x='36.8' y='7.0' width='5.9' height='4.9' rx='2' fill='%232b2b2b'/%3E%3Ccircle cx='39.7' cy='5.4' r='1.9' fill='%23f1d3b3'/%3E%3Crect x='44.3' y='7.8' width='6.5' height='5.4' rx='2' fill='%23b8362e'/%3E%3Ccircle cx='47.5' cy='6.2' r='2.1' fill='%23f5dcc4'/%3E%3Crect x='43.5' y='2.6' width='8' height='1.6' rx='0.8' fill='%23b8362e'/%3E%3Crect x='53.3' y='7.2' width='5.7' height='4.7' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='56.1' cy='5.6' r='1.8' fill='%23f5dcc4'/%3E%3Crect x='52.1' y='2.0' width='8' height='1.6' rx='0.8' fill='%23d9453b'/%3E%3Crect x='60.6' y='7.4' width='6.2' height='5.1' rx='2' fill='%235a6b7a'/%3E%3Ccircle cx='63.7' cy='5.8' r='2.0' fill='%23f1d3b3'/%3E%3Crect x='0.6' y='17.1' width='6.2' height='5.2' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='3.7' cy='15.5' r='2.0' fill='%238d5a3b'/%3E%3Crect x='72.6' y='17.1' width='6.2' height='5.2' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='75.7' cy='15.5' r='2.0' fill='%23e0b48c'/%3E%3Crect x='9.7' y='17.4' width='6.2' height='5.1' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='12.8' cy='15.8' r='2.0' fill='%23c68e64'/%3E%3Crect x='16.6' y='17.5' width='6.3' height='5.2' rx='2' fill='%232f66b8'/%3E%3Ccircle cx='19.8' cy='15.9' r='2.0' fill='%23e0b48c'/%3E%3Crect x='25.3' y='17.7' width='6.6' height='5.5' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='28.6' cy='16.1' r='2.1' fill='%23f1d3b3'/%3E%3Crect x='31.9' y='17.9' width='6.3' height='5.3' rx='2' fill='%232f66b8'/%3E%3Ccircle cx='35.1' cy='16.3' r='2.0' fill='%23f1d3b3'/%3E%3Crect x='39.8' y='17.8' width='6.7' height='5.6' rx='2' fill='%232b2b2b'/%3E%3Ccircle cx='43.2' cy='16.2' r='2.1' fill='%23f5dcc4'/%3E%3Crect x='48.7' y='16.5' width='5.5' height='4.6' rx='2' fill='%232f66b8'/%3E%3Ccircle cx='51.5' cy='14.9' r='1.7' fill='%23f1d3b3'/%3E%3Crect x='57.7' y='17.2' width='5.8' height='4.8' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='60.5' cy='15.6' r='1.8' fill='%23f5dcc4'/%3E%3Crect x='66.2' y='16.7' width='5.4' height='4.5' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='68.9' cy='15.1' r='1.7' fill='%23f5dcc4'/%3E%3Crect x='-5.8' y='16.7' width='5.4' height='4.5' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='-3.1' cy='15.1' r='1.7' fill='%238d5a3b'/%3E%3Crect x='4.1' y='27.9' width='6.4' height='5.3' rx='2' fill='%23b8362e'/%3E%3Ccircle cx='7.3' cy='26.3' r='2.0' fill='%23e0b48c'/%3E%3Crect x='12.9' y='26.6' width='6.5' height='5.4' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='16.1' cy='25.0' r='2.0' fill='%238d5a3b'/%3E%3Crect x='29.6' y='26.7' width='6.7' height='5.6' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='32.9' cy='25.1' r='2.1' fill='%23f1d3b3'/%3E%3Crect x='38.1' y='27.8' width='6.0' height='5.0' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='41.1' cy='26.2' r='1.9' fill='%23e0b48c'/%3E%3Crect x='44.4' y='26.8' width='6.7' height='5.6' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='47.8' cy='25.2' r='2.1' fill='%23c68e64'/%3E%3Crect x='53.5' y='27.0' width='6.0' height='5.0' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='56.5' cy='25.4' r='1.9' fill='%23f1d3b3'/%3E%3Crect x='61.7' y='27.4' width='6.8' height='5.6' rx='2' fill='%232b2b2b'/%3E%3Ccircle cx='65.1' cy='25.8' r='2.1' fill='%23f1d3b3'/%3E%3Crect x='0.6' y='37.3' width='6.8' height='5.7' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='4.0' cy='35.7' r='2.2' fill='%23c68e64'/%3E%3Crect x='72.6' y='37.3' width='6.8' height='5.7' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='76.0' cy='35.7' r='2.2' fill='%23f1d3b3'/%3E%3Crect x='9.3' y='37.2' width='6.2' height='5.1' rx='2' fill='%23b8362e'/%3E%3Ccircle cx='12.4' cy='35.6' r='2.0' fill='%238d5a3b'/%3E%3Crect x='16.1' y='36.9' width='5.7' height='4.8' rx='2' fill='%23b8362e'/%3E%3Ccircle cx='19.0' cy='35.3' r='1.8' fill='%238d5a3b'/%3E%3Crect x='25.1' y='37.1' width='6.6' height='5.5' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='28.4' cy='35.5' r='2.1' fill='%23f5dcc4'/%3E%3Crect x='33.1' y='37.8' width='6.5' height='5.5' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='36.4' cy='36.2' r='2.1' fill='%238d5a3b'/%3E%3Crect x='40.2' y='36.7' width='5.6' height='4.6' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='43.0' cy='35.1' r='1.8' fill='%23f1d3b3'/%3E%3Crect x='39.0' y='31.5' width='8' height='1.6' rx='0.8' fill='%233b7dd8'/%3E%3Crect x='50.1' y='36.8' width='5.7' height='4.8' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='53.0' cy='35.2' r='1.8' fill='%238d5a3b'/%3E%3Crect x='57.8' y='37.1' width='6.6' height='5.5' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='61.1' cy='35.5' r='2.1' fill='%23e0b48c'/%3E%3C/g%3E%3C/svg%3E");
    --crowd-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='40'%3E%3Cg transform='translate(72,40) rotate(180)'%3E%3Crect x='4.4' y='6.8' width='6.2' height='5.2' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='7.5' cy='5.2' r='2.0' fill='%23e0b48c'/%3E%3Crect x='12.8' y='7.5' width='6.6' height='5.5' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='16.1' cy='5.9' r='2.1' fill='%23e0b48c'/%3E%3Crect x='21.4' y='6.6' width='6.1' height='5.1' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='24.4' cy='5.0' r='1.9' fill='%23f5dcc4'/%3E%3Crect x='28.8' y='7.8' width='6.4' height='5.3' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='32.0' cy='6.2' r='2.0' fill='%23c68e64'/%3E%3Crect x='36.8' y='7.0' width='5.9' height='4.9' rx='2' fill='%232b2b2b'/%3E%3Ccircle cx='39.7' cy='5.4' r='1.9' fill='%23f1d3b3'/%3E%3Crect x='44.3' y='7.8' width='6.5' height='5.4' rx='2' fill='%23b8362e'/%3E%3Ccircle cx='47.5' cy='6.2' r='2.1' fill='%23f5dcc4'/%3E%3Crect x='43.5' y='2.6' width='8' height='1.6' rx='0.8' fill='%23b8362e'/%3E%3Crect x='53.3' y='7.2' width='5.7' height='4.7' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='56.1' cy='5.6' r='1.8' fill='%23f5dcc4'/%3E%3Crect x='52.1' y='2.0' width='8' height='1.6' rx='0.8' fill='%23d9453b'/%3E%3Crect x='60.6' y='7.4' width='6.2' height='5.1' rx='2' fill='%235a6b7a'/%3E%3Ccircle cx='63.7' cy='5.8' r='2.0' fill='%23f1d3b3'/%3E%3Crect x='0.6' y='17.1' width='6.2' height='5.2' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='3.7' cy='15.5' r='2.0' fill='%238d5a3b'/%3E%3Crect x='72.6' y='17.1' width='6.2' height='5.2' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='75.7' cy='15.5' r='2.0' fill='%23e0b48c'/%3E%3Crect x='9.7' y='17.4' width='6.2' height='5.1' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='12.8' cy='15.8' r='2.0' fill='%23c68e64'/%3E%3Crect x='16.6' y='17.5' width='6.3' height='5.2' rx='2' fill='%232f66b8'/%3E%3Ccircle cx='19.8' cy='15.9' r='2.0' fill='%23e0b48c'/%3E%3Crect x='25.3' y='17.7' width='6.6' height='5.5' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='28.6' cy='16.1' r='2.1' fill='%23f1d3b3'/%3E%3Crect x='31.9' y='17.9' width='6.3' height='5.3' rx='2' fill='%232f66b8'/%3E%3Ccircle cx='35.1' cy='16.3' r='2.0' fill='%23f1d3b3'/%3E%3Crect x='39.8' y='17.8' width='6.7' height='5.6' rx='2' fill='%232b2b2b'/%3E%3Ccircle cx='43.2' cy='16.2' r='2.1' fill='%23f5dcc4'/%3E%3Crect x='48.7' y='16.5' width='5.5' height='4.6' rx='2' fill='%232f66b8'/%3E%3Ccircle cx='51.5' cy='14.9' r='1.7' fill='%23f1d3b3'/%3E%3Crect x='57.7' y='17.2' width='5.8' height='4.8' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='60.5' cy='15.6' r='1.8' fill='%23f5dcc4'/%3E%3Crect x='66.2' y='16.7' width='5.4' height='4.5' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='68.9' cy='15.1' r='1.7' fill='%23f5dcc4'/%3E%3Crect x='-5.8' y='16.7' width='5.4' height='4.5' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='-3.1' cy='15.1' r='1.7' fill='%238d5a3b'/%3E%3Crect x='4.1' y='27.9' width='6.4' height='5.3' rx='2' fill='%23b8362e'/%3E%3Ccircle cx='7.3' cy='26.3' r='2.0' fill='%23e0b48c'/%3E%3Crect x='12.9' y='26.6' width='6.5' height='5.4' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='16.1' cy='25.0' r='2.0' fill='%238d5a3b'/%3E%3Crect x='29.6' y='26.7' width='6.7' height='5.6' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='32.9' cy='25.1' r='2.1' fill='%23f1d3b3'/%3E%3Crect x='38.1' y='27.8' width='6.0' height='5.0' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='41.1' cy='26.2' r='1.9' fill='%23e0b48c'/%3E%3Crect x='44.4' y='26.8' width='6.7' height='5.6' rx='2' fill='%23d9453b'/%3E%3Ccircle cx='47.8' cy='25.2' r='2.1' fill='%23c68e64'/%3E%3Crect x='53.5' y='27.0' width='6.0' height='5.0' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='56.5' cy='25.4' r='1.9' fill='%23f1d3b3'/%3E%3Crect x='61.7' y='27.4' width='6.8' height='5.6' rx='2' fill='%232b2b2b'/%3E%3Ccircle cx='65.1' cy='25.8' r='2.1' fill='%23f1d3b3'/%3E%3Crect x='0.6' y='37.3' width='6.8' height='5.7' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='4.0' cy='35.7' r='2.2' fill='%23c68e64'/%3E%3Crect x='72.6' y='37.3' width='6.8' height='5.7' rx='2' fill='%23f2c94c'/%3E%3Ccircle cx='76.0' cy='35.7' r='2.2' fill='%23f1d3b3'/%3E%3Crect x='9.3' y='37.2' width='6.2' height='5.1' rx='2' fill='%23b8362e'/%3E%3Ccircle cx='12.4' cy='35.6' r='2.0' fill='%238d5a3b'/%3E%3Crect x='16.1' y='36.9' width='5.7' height='4.8' rx='2' fill='%23b8362e'/%3E%3Ccircle cx='19.0' cy='35.3' r='1.8' fill='%238d5a3b'/%3E%3Crect x='25.1' y='37.1' width='6.6' height='5.5' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='28.4' cy='35.5' r='2.1' fill='%23f5dcc4'/%3E%3Crect x='33.1' y='37.8' width='6.5' height='5.5' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='36.4' cy='36.2' r='2.1' fill='%238d5a3b'/%3E%3Crect x='40.2' y='36.7' width='5.6' height='4.6' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='43.0' cy='35.1' r='1.8' fill='%23f1d3b3'/%3E%3Crect x='39.0' y='31.5' width='8' height='1.6' rx='0.8' fill='%233b7dd8'/%3E%3Crect x='50.1' y='36.8' width='5.7' height='4.8' rx='2' fill='%233b7dd8'/%3E%3Ccircle cx='53.0' cy='35.2' r='1.8' fill='%238d5a3b'/%3E%3Crect x='57.8' y='37.1' width='6.6' height='5.5' rx='2' fill='%23e9e9e9'/%3E%3Ccircle cx='61.1' cy='35.5' r='2.1' fill='%23e0b48c'/%3E%3C/g%3E%3C/svg%3E");
}

/* Grund unter den Tribünen: Flutlicht aus den Ecken, Abdunklung (Zuschauer: .stadium-stands, perspektivisch) */
body {
    background-color: var(--stand);
    background-image:
        radial-gradient(ellipse 45% 40% at 4% 0%, rgba(var(--flood), 0.30), transparent 70%),
        radial-gradient(ellipse 45% 40% at 96% 0%, rgba(var(--flood), 0.30), transparent 70%),
        radial-gradient(ellipse 45% 40% at 4% 100%, rgba(var(--flood), 0.22), transparent 70%),
        radial-gradient(ellipse 45% 40% at 96% 100%, rgba(var(--flood), 0.22), transparent 70%);
}

/* Flutlichtmasten an den vier Ecken (index.html .stadium-lights): Lampenfeld, Schein und Lichtkegel in die Ränge */
.stadium-lights { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.stadium-lights .mast {
    position: absolute;
    width: 64px; height: 20px;
    border-radius: 3px;
    background:
        radial-gradient(circle, #ffffff 0 2.4px, rgba(var(--flood), 0.9) 3px, transparent 4px) 0 0 / 8px 10px,
        #6b7178;
    border: 2px solid #15191d;
    box-shadow: 0 0 8px 3px rgba(var(--flood), 1), 0 0 36px 16px rgba(var(--flood), 0.55), 0 0 120px 60px rgba(var(--flood), 0.22);
}
.stadium-lights .mast::after {
    content: "";
    position: absolute;
    width: 46vw; height: 46vh;
    mix-blend-mode: screen;
}
.stadium-lights .mast.tl { top: 222px; left: 14px; }
.stadium-lights .mast.tr { top: 222px; right: 14px; }
.stadium-lights .mast.bl { bottom: 14px; left: 14px; }
.stadium-lights .mast.br { bottom: 14px; right: 80px; }   /* Platz für den Ton-Knopf unten rechts */
.stadium-lights .mast.tl::after { top: 0; left: 0; background: radial-gradient(ellipse at 0% 0%, rgba(var(--flood), 0.32), transparent 65%); }
.stadium-lights .mast.tr::after { top: 0; right: 0; background: radial-gradient(ellipse at 100% 0%, rgba(var(--flood), 0.32), transparent 65%); }
.stadium-lights .mast.bl::after { bottom: 0; left: 0; background: radial-gradient(ellipse at 0% 100%, rgba(var(--flood), 0.26), transparent 65%); }
.stadium-lights .mast.br::after { bottom: 0; right: 0; background: radial-gradient(ellipse at 100% 100%, rgba(var(--flood), 0.26), transparent 65%); }

/* Rasen: kräftige Lichtinseln aus den Ecken, leichte Abdunklung zur Mitte der Seiten, Körnung, breite Mähstreifen */
.pitch-inner-main {
    background-color: var(--pitch-grass);
    background-image:
        radial-gradient(ellipse 70% 55% at 0% 0%, rgba(var(--flood), 0.26), transparent 70%),
        radial-gradient(ellipse 70% 55% at 100% 0%, rgba(var(--flood), 0.26), transparent 70%),
        radial-gradient(ellipse 70% 55% at 0% 100%, rgba(var(--flood), 0.20), transparent 70%),
        radial-gradient(ellipse 70% 55% at 100% 100%, rgba(var(--flood), 0.20), transparent 70%),
        radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.18) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E"),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.055) 0 56px, rgba(0, 0, 0, 0.06) 56px 112px);
    background-size: auto, auto, auto, auto, auto, 160px 160px, auto;
    border-color: var(--pitch-line);
    /* weicher Übergang zu den Rängen statt hartem Rahmen */
    box-shadow: 0 0 24px 6px rgba(var(--flood), 0.10), 0 10px 40px rgba(0, 0, 0, 0.45);
}
.pitch-inner-main::before,
.pitch-inner-main::after,
.corner-bottom-left,
.corner-bottom-right { border-color: var(--pitch-line); }

/* Spielfeldhälften durchsichtig, damit die Mähstreifen durchgehend laufen; Eckfahnen-Bögen und Strafraum-D bleiben */
.pitch-inner-main .field { background-color: transparent; }
#field-B {
    background-image:
        radial-gradient(circle at 0% 0%, transparent 20px, var(--pitch-line) 21px, var(--pitch-line) 22px, transparent 23px),
        radial-gradient(circle at 100% 0%, transparent 20px, var(--pitch-line) 21px, var(--pitch-line) 22px, transparent 23px),
        radial-gradient(circle at 50% 75px, transparent 25px, var(--pitch-line) 26px, var(--pitch-line) 28px, transparent 29px);
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-size: 30px 30px, 30px 30px, 60px 30px;
    background-position: left top, right top, center top;
}
#field-A {
    background-image:
        radial-gradient(circle at 0% 100%, transparent 20px, var(--pitch-line) 21px, var(--pitch-line) 22px, transparent 23px),
        radial-gradient(circle at 100% 100%, transparent 20px, var(--pitch-line) 21px, var(--pitch-line) 22px, transparent 23px),
        radial-gradient(circle at 50% calc(100% - 75px), transparent 25px, var(--pitch-line) 26px, var(--pitch-line) 28px, transparent 29px);
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-size: 30px 30px, 30px 30px, 60px 30px;
    background-position: left bottom, right bottom, center bottom;
}
.field::before, .field::after { border-color: var(--pitch-line); }
#field-B::after { box-shadow: 0 100px 0 -98px var(--pitch-line); }
#field-A::after { box-shadow: 0 -100px 0 -98px var(--pitch-line); }

/* Ballzone: leicht abgedunkelt statt eigener Grünton, Linien in Kreidefarbe */
#ball-marker-zone {
    background: rgba(0, 0, 0, 0.07);
    border-top-color: var(--pitch-line);
    border-bottom-color: var(--pitch-line);
}
#ball-marker-zone .zone[data-zone="Mittelfeld"] { border-left-color: var(--pitch-line); border-right-color: var(--pitch-line); }
#ball-marker-zone .zone[data-zone="Mittelfeld"]::before { border-color: var(--pitch-line); }
#ball-marker-zone .zone[data-zone="Mittelfeld"]::after { background: var(--pitch-grass); opacity: 0.5; }

/* --- LED-Banden hinter den Toren: Felder, jedes zweite mit Wort (led_boards.ts), hinter den Handkarten --- */
.hand-container-top .hand, .hand-container-bottom .hand { z-index: 1; }
.led-board {
    position: absolute;
    left: 0; right: 0;
    height: 18px;
    display: flex;
    gap: 3px;
    z-index: 0;
    pointer-events: none;
    background: #000;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
}
.led-board.led-top { bottom: 0; }
.led-board.led-bottom { top: 0; }
.led-panel {
    position: relative;
    flex: 1;
    overflow: hidden;
    background: linear-gradient(#050805, #0d150e);
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.9);
    font: 700 11px/18px 'Arial Black', 'Segoe UI', sans-serif;
    letter-spacing: 3px;
    text-align: center;
    white-space: nowrap;
    color: var(--led-green);
    text-shadow: 0 0 6px rgba(125, 255, 158, 0.8);
}
/* LED-Punktraster über dem Text */
.led-panel::after {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(transparent 0.8px, rgba(0, 0, 0, 0.55) 1.3px) 0 0 / 3px 3px;
}
/* Ein Wort steht still; beim Wechsel rollt es nach oben heraus, das neue kommt von unten (led_boards.ts) */
.led-word { position: absolute; inset: 0; transition: transform 0.6s cubic-bezier(.5, 0, .3, 1); }
.led-word.led-in { transform: translateY(100%); }
.led-word.led-out { transform: translateY(-100%); }
.led-goal { display: none; position: absolute; inset: 0; color: var(--led-gold); text-shadow: 0 0 8px rgba(255, 213, 79, 0.95); animation: led-blink 0.35s steps(2, jump-none) infinite; }
@keyframes led-blink { 0% { opacity: 1; } 100% { opacity: 0.25; } }
/* Tor: alle Felder zeigen „TOR!“ in Gold (Klasse fx-led-goal am body, showGoal) */
body.fx-led-goal .led-word { visibility: hidden; }
body.fx-led-goal .led-goal { display: block; }
body.fx-led-goal .led-board { box-shadow: 0 0 18px rgba(255, 213, 79, 0.55); }

/* --- Kamerablitze in den Rängen beim Tor (showGoal; unter dem Spielfeld, nur im Stadion sichtbar) --- */
.fx-flashes { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.fx-flashes i {
    position: absolute;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 14px 6px rgba(255, 255, 255, 0.85);
    opacity: 0;
    animation: fx-camera-flash 0.22s ease-out forwards;
}
@keyframes fx-camera-flash { 0% { opacity: 0; transform: scale(0.4); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.3); } }

/* --- Menü-Hintergrund: Stadion-Totale (nur Optik, keine Klicks – deshalb darf der Rasen hier perspektivisch kippen) ---
   .menu:        Ränge mit Zuschauern, oben dunkler Himmel
   .menu::before Rasen in Perspektive (Mähstreifen, Körnung, Seitenlinie, Mittellinie, Mittelkreis)
   .menu::after  Flutlichtmasten oben links/rechts, Lichtkegel, Abdunklung zum Rand (Lesbarkeit des Menüs) */
.menu {
    /* Himmel über der Tribüne (Tribüne: .menu-stand, Rasen: ::before, Licht: ::after) */
    background: linear-gradient(180deg, #05080c 0%, #0c1218 40%, var(--stand) 100%);
    isolation: isolate;   /* eigene Ebene: Tribüne, Rasen und Licht liegen hinter dem Menü-Inhalt */
}
.menu::before {
    content: "";
    position: fixed;
    left: -40vw; right: -40vw;
    top: 42vh; bottom: -60vh;
    z-index: -2;
    pointer-events: none;
    transform: perspective(700px) rotateX(58deg);
    transform-origin: 50% 0;
    background-color: var(--pitch-grass);
    background-image:
        /* Mittelkreis und Mittelpunkt */
        radial-gradient(circle at 50% 38%, transparent 0 196px, var(--pitch-line) 197px 201px, transparent 202px),
        radial-gradient(circle at 50% 38%, var(--pitch-line) 0 7px, transparent 8px),
        /* Mittellinie (zum Betrachter hin) */
        linear-gradient(90deg, transparent calc(50% - 2px), var(--pitch-line) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)),
        /* Seitenlinie hinten */
        linear-gradient(180deg, transparent 4%, var(--pitch-line) 4% calc(4% + 4px), transparent calc(4% + 4px)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E"),
        /* Mähstreifen quer zur Blickrichtung */
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 120px, rgba(0, 0, 0, 0.07) 120px 240px);
    background-size: auto, auto, auto, auto, 160px 160px, auto;
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 50% 0;
    /* Bande/Werbefläche am hinteren Rand */
    border-top: 14px solid #0b120c;
    box-shadow: 0 -2px 0 rgba(125, 255, 158, 0.35);
}
.menu::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        /* Flutlichtmasten: Lampenfeld mit Schein, oben links und rechts */
        radial-gradient(ellipse 34px 12px at 9% 9%, #fffef5 0 60%, transparent 100%),
        radial-gradient(ellipse 34px 12px at 91% 9%, #fffef5 0 60%, transparent 100%),
        radial-gradient(circle at 9% 9%, rgba(var(--flood), 0.55) 0, rgba(var(--flood), 0.18) 60px, transparent 200px),
        radial-gradient(circle at 91% 9%, rgba(var(--flood), 0.55) 0, rgba(var(--flood), 0.18) 60px, transparent 200px),
        /* Lichtkegel auf Ränge und Rasen */
        radial-gradient(ellipse 60% 75% at 9% 9%, rgba(var(--flood), 0.20), transparent 70%),
        radial-gradient(ellipse 60% 75% at 91% 9%, rgba(var(--flood), 0.20), transparent 70%),
        /* Abdunklung zum Rand, Mitte frei für das Menü */
        radial-gradient(ellipse 70% 70% at 50% 55%, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
}

/* --- Tribünen mit Perspektive (index.html .stadium-stands im Spiel, .menu-stand im Menü) ---
   Jede Tribüne ist eine Fläche mit Zuschauern, Umläufen (dunkle Querstreifen) und Licht (zum Feld hin hell),
   die am Feldrand angelenkt und nach außen in die Tiefe gekippt ist: hintere Reihen werden kleiner und dunkler.
   Liegt unter dem Spielfeld bzw. hinter dem Menü-Inhalt, keine Klicks. */
.stadium-stands { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.stadium-stands .stand { position: absolute; background-color: var(--stand); }
/* Seitentribünen: am Feldrand (9 % vom Bildrand) angelenkt, nach außen weggekippt */
.stadium-stands .stand.left {
    top: 190px; bottom: -40px; left: -21vw; width: 30vw;
    transform-origin: 100% 50%;
    transform: perspective(900px) rotateY(-22deg);
    background-image:
        linear-gradient(90deg, rgba(4, 7, 10, 0.9) 30%, rgba(4, 7, 10, 0.25) 65%, rgba(var(--flood), 0.10)),
        repeating-linear-gradient(90deg, transparent 0 90px, rgba(10, 14, 18, 0.92) 90px 100px),
        var(--crowd-patches),
        var(--crowd-left),
        var(--crowd-left);
    background-size: auto, auto, 420px 420px, 60px 108px, 50px 90px;
    background-position: 0 0, right 0 top 0, 0 0, right 0 top 0, right 23px top 41px;
}
.stadium-stands .stand.right {
    top: 190px; bottom: -40px; right: -21vw; width: 30vw;
    transform-origin: 0 50%;
    transform: perspective(900px) rotateY(22deg);
    background-image:
        linear-gradient(270deg, rgba(4, 7, 10, 0.9) 30%, rgba(4, 7, 10, 0.25) 65%, rgba(var(--flood), 0.10)),
        repeating-linear-gradient(270deg, transparent 0 90px, rgba(10, 14, 18, 0.92) 90px 100px),
        var(--crowd-patches),
        var(--crowd-right),
        var(--crowd-right);
    background-size: auto, auto, 420px 420px, 60px 108px, 50px 90px;
    background-position: 0 0, 0 0, 210px 0, 0 0, 23px 41px;
}
/* Tribünen hinter den Toren: an der Torlinie angelenkt, nach oben bzw. unten weggekippt */
.stadium-stands .stand.top {
    left: -10vw; right: -10vw; top: 80px; height: 200px;
    transform-origin: 50% 100%;
    transform: perspective(600px) rotateX(40deg);
    background-image:
        linear-gradient(0deg, rgba(var(--flood), 0.10), rgba(4, 7, 10, 0.25) 45%, rgba(4, 7, 10, 0.8)),
        repeating-linear-gradient(0deg, transparent 0 90px, rgba(10, 14, 18, 0.92) 90px 100px),
        var(--crowd-patches),
        var(--crowd),
        var(--crowd);
    background-size: auto, auto, 420px 420px, 108px 60px, 90px 50px;
    background-position: 0 0, 0 100%, 0 0, 0 100%, 41px 23px;
}
.stadium-stands .stand.bottom {
    left: -10vw; right: -10vw; bottom: -150px; height: 220px;
    transform-origin: 50% 0;
    transform: perspective(600px) rotateX(-40deg);
    background-image:
        linear-gradient(180deg, rgba(var(--flood), 0.10), rgba(4, 7, 10, 0.25) 45%, rgba(4, 7, 10, 0.8)),
        repeating-linear-gradient(180deg, transparent 0 90px, rgba(10, 14, 18, 0.92) 90px 100px),
        var(--crowd-patches),
        var(--crowd-down),
        var(--crowd-down);
    background-size: auto, auto, 420px 420px, 108px 60px, 90px 50px;
    background-position: 0 0, 0 0, 120px 0, 0 0, 41px 23px;
}

/* Menü: eine Tribüne hinter dem Rasen, an der hinteren Seitenlinie angelenkt und nach oben in die Tiefe gekippt */
.menu-stand {
    position: fixed;
    left: -50vw; right: -50vw;
    top: -40vh; height: 83vh;
    z-index: -3;
    pointer-events: none;
    transform-origin: 50% 100%;
    transform: perspective(700px) rotateX(38deg);
    background-color: var(--stand);
    background-image:
        linear-gradient(0deg, rgba(var(--flood), 0.12), rgba(4, 7, 10, 0.2) 35%, rgba(4, 7, 10, 0.85) 90%),
        repeating-linear-gradient(0deg, transparent 0 190px, rgba(10, 14, 18, 0.92) 190px 204px),
        var(--crowd-patches),
        var(--crowd),
        var(--crowd);
    background-size: auto, auto, 520px 520px, 126px 70px, 104px 58px;
    background-position: 0 0, 0 100%, 0 0, 0 100%, 47px 29px;
}

/* menu_match:start */
/* --- Spielszene auf dem Menü-Rasen (index.html .menu-match; erzeugt aus Wegpunkten, Größe nach Tiefe) ---
   Figuren: SVG-Sprite mit zwei Laufbildern (Beine wechseln), Schatten am Fuß; Ball mit Schatten, Pässe im Bogen.
   Nur Optik, keine Klicks. „Weniger Bewegung“: Szene steht still. */
.menu-match { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
.menu-match .mp, .menu-match .mb { position: absolute; left: 0; top: 0; will-change: transform; }
.menu-match .mp {
    width: 20px; height: 32px; margin: -32px 0 0 -10px;
    transform-origin: 50% 100%;
    background-size: 40px 32px;
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.6)) brightness(0.92);
}
.menu-match .mp.blue { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='32'%3E%3Cg transform='translate(0 0)'%3E%3Cpath d='M7 10 L3.5 15 M13 10 L16.5 13.5' stroke='%23e0b48c' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3Crect x='6.5' y='8.5' width='7' height='10' rx='2' fill='%233b7dd8'/%3E%3Crect x='6.5' y='17' width='7' height='4.5' rx='1' fill='%23ffffff'/%3E%3Cpath d='M8.5 21 L5 27 L3 31 M11.5 21 L14 26 L17 29' stroke='%23f1d3b3' stroke-width='2.2' stroke-linecap='round' fill='none'/%3E%3Ccircle cx='10' cy='5' r='3.4' fill='%23e0b48c'/%3E%3Cpath d='M7 3.6 Q10 0.6 13 3.6' stroke='%232b2b2b' stroke-width='1.6' fill='none'/%3E%3C/g%3E%3Cg transform='translate(20 0)'%3E%3Cpath d='M7 10 L6 16 M13 10 L14 16' stroke='%23e0b48c' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3Crect x='6.5' y='8.5' width='7' height='10' rx='2' fill='%233b7dd8'/%3E%3Crect x='6.5' y='17' width='7' height='4.5' rx='1' fill='%23ffffff'/%3E%3Cpath d='M9 21 L10 26 L8 31 M11 21 L12 27 L13 31' stroke='%23f1d3b3' stroke-width='2.2' stroke-linecap='round' fill='none'/%3E%3Ccircle cx='10' cy='5' r='3.4' fill='%23e0b48c'/%3E%3Cpath d='M7 3.6 Q10 0.6 13 3.6' stroke='%232b2b2b' stroke-width='1.6' fill='none'/%3E%3C/g%3E%3C/svg%3E"); }
.menu-match .mp.red { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='32'%3E%3Cg transform='translate(0 0)'%3E%3Cpath d='M7 10 L3.5 15 M13 10 L16.5 13.5' stroke='%23e0b48c' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3Crect x='6.5' y='8.5' width='7' height='10' rx='2' fill='%23d9453b'/%3E%3Crect x='6.5' y='17' width='7' height='4.5' rx='1' fill='%231b1b1b'/%3E%3Cpath d='M8.5 21 L5 27 L3 31 M11.5 21 L14 26 L17 29' stroke='%23f1d3b3' stroke-width='2.2' stroke-linecap='round' fill='none'/%3E%3Ccircle cx='10' cy='5' r='3.4' fill='%23e0b48c'/%3E%3Cpath d='M7 3.6 Q10 0.6 13 3.6' stroke='%232b2b2b' stroke-width='1.6' fill='none'/%3E%3C/g%3E%3Cg transform='translate(20 0)'%3E%3Cpath d='M7 10 L6 16 M13 10 L14 16' stroke='%23e0b48c' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3Crect x='6.5' y='8.5' width='7' height='10' rx='2' fill='%23d9453b'/%3E%3Crect x='6.5' y='17' width='7' height='4.5' rx='1' fill='%231b1b1b'/%3E%3Cpath d='M9 21 L10 26 L8 31 M11 21 L12 27 L13 31' stroke='%23f1d3b3' stroke-width='2.2' stroke-linecap='round' fill='none'/%3E%3Ccircle cx='10' cy='5' r='3.4' fill='%23e0b48c'/%3E%3Cpath d='M7 3.6 Q10 0.6 13 3.6' stroke='%232b2b2b' stroke-width='1.6' fill='none'/%3E%3C/g%3E%3C/svg%3E"); }
.menu-match .mp::after {
    content: ""; position: absolute; left: 1px; right: 1px; bottom: -2px; height: 5px;
    border-radius: 50%; background: radial-gradient(rgba(0, 0, 0, 0.45), transparent 70%);
}
.menu-match .mb { width: 7px; height: 7px; margin: -7px 0 0 -3.5px; transform-origin: 50% 100%; }
.menu-match .mb i {
    position: absolute; inset: 0; border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fff 0 45%, #cfcfcf 70%, #555 100%);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
}
.menu-match .mb::after {
    content: ""; position: absolute; left: -1px; right: -1px; bottom: -2px; height: 3px;
    border-radius: 50%; background: rgba(0, 0, 0, 0.35);
}
@keyframes mp-run { to { background-position: -40px 0; } }
.menu-match .mp.r-b1 { transform: translate(61vw, 89vh) scale(1.53); animation: mp-run 0.32s steps(2) infinite, mm-r-b1 14s linear infinite; }
@keyframes mm-r-b1 {
    0% { transform: translate(60vw, 90vh) scale(1.55); opacity: 0; }
    4% { transform: translate(61vw, 89vh) scale(1.53); opacity: 1; }
    35% { transform: translate(73vw, 77vh) scale(1.26); opacity: 1; }
    48% { transform: translate(76vw, 76vh) scale(1.24); opacity: 1; }
    88% { transform: translate(77vw, 76vh) scale(1.24); opacity: 1; }
    92% { transform: translate(77vw, 76vh) scale(1.24); opacity: 0; }
    100% { transform: translate(60vw, 90vh) scale(1.55); opacity: 0; }
}
.menu-match .mp.r-b2 { transform: translate(90vw, 58vh) scale(0.84); animation: mp-run 0.32s steps(2) infinite, mm-r-b2 14s linear infinite; }
@keyframes mm-r-b2 {
    0% { transform: translate(90vw, 58vh) scale(0.84); opacity: 0; }
    4% { transform: translate(90vw, 58vh) scale(0.84); opacity: 1; }
    35% { transform: translate(86vw, 62vh) scale(0.93); opacity: 1; }
    50% { transform: translate(86vw, 62vh) scale(0.93); opacity: 1; }
    75% { transform: translate(93vw, 56vh) scale(0.79); opacity: 1; }
    88% { transform: translate(93.5vw, 56vh) scale(0.79); opacity: 1; }
    92% { transform: translate(93.5vw, 56vh) scale(0.79); opacity: 0; }
    100% { transform: translate(90vw, 58vh) scale(0.84); opacity: 0; }
}
.menu-match .mp.r-r1 { transform: translate(69vw, 94vh) scale(1.64); animation: mp-run 0.32s steps(2) infinite, mm-r-r1 14s linear infinite; }
@keyframes mm-r-r1 {
    0% { transform: translate(69vw, 95vh) scale(1.66); opacity: 0; }
    4% { transform: translate(69vw, 94vh) scale(1.64); opacity: 1; }
    33% { transform: translate(75vw, 80vh) scale(1.33); opacity: 1; }
    42% { transform: translate(73vw, 79vh) scale(1.31) rotate(-62deg); opacity: 1; }
    50% { transform: translate(72.5vw, 79vh) scale(1.31) rotate(-62deg); opacity: 1; }
    56% { transform: translate(72.5vw, 79vh) scale(1.31); opacity: 1; }
    88% { transform: translate(73vw, 79vh) scale(1.31); opacity: 1; }
    92% { transform: translate(73vw, 79vh) scale(1.31); opacity: 0; }
    100% { transform: translate(69vw, 95vh) scale(1.66); opacity: 0; }
}
.menu-match .mp.r-r2 { transform: translate(79vw, 52vh) scale(0.71); animation: mp-run 0.32s steps(2) infinite, mm-r-r2 14s linear infinite; }
@keyframes mm-r-r2 {
    0% { transform: translate(79vw, 52vh) scale(0.71); opacity: 0; }
    4% { transform: translate(79vw, 52vh) scale(0.71); opacity: 1; }
    40% { transform: translate(81vw, 53vh) scale(0.73); opacity: 1; }
    78% { transform: translate(90vw, 57vh) scale(0.82); opacity: 1; }
    88% { transform: translate(91vw, 57vh) scale(0.82); opacity: 1; }
    92% { transform: translate(91vw, 57vh) scale(0.82); opacity: 0; }
    100% { transform: translate(79vw, 52vh) scale(0.71); opacity: 0; }
}
.menu-match .mp.l-r3 { transform: translate(8vw, 84vh) scale(1.42); animation: mp-run 0.32s steps(2) infinite, mm-l-r3 9s linear infinite; }
@keyframes mm-l-r3 {
    0% { transform: translate(8vw, 84vh) scale(1.42); opacity: 1; }
    30% { transform: translate(9vw, 83vh) scale(1.39); opacity: 1; }
    60% { transform: translate(8.5vw, 85vh) scale(1.44); opacity: 1; }
    100% { transform: translate(8vw, 84vh) scale(1.42); opacity: 1; }
}
.menu-match .mp.l-r4 { transform: translate(21vw, 66vh) scale(1.02); animation: mp-run 0.32s steps(2) infinite, mm-l-r4 9s linear infinite; }
@keyframes mm-l-r4 {
    0% { transform: translate(21vw, 66vh) scale(1.02); opacity: 1; }
    35% { transform: translate(22vw, 65vh) scale(0.99); opacity: 1; }
    70% { transform: translate(21.5vw, 67vh) scale(1.04); opacity: 1; }
    100% { transform: translate(21vw, 66vh) scale(1.02); opacity: 1; }
}
.menu-match .mp.l-r5 { transform: translate(31vw, 88vh) scale(1.51); animation: mp-run 0.32s steps(2) infinite, mm-l-r5 9s linear infinite; }
@keyframes mm-l-r5 {
    0% { transform: translate(31vw, 88vh) scale(1.51); opacity: 1; }
    40% { transform: translate(30vw, 87vh) scale(1.48); opacity: 1; }
    75% { transform: translate(31.5vw, 89vh) scale(1.53); opacity: 1; }
    100% { transform: translate(31vw, 88vh) scale(1.51); opacity: 1; }
}
.menu-match .mp.l-b3 { transform: translate(14vw, 78vh) scale(1.28); animation: mp-run 0.32s steps(2) infinite, mm-l-b3 9s linear infinite; }
@keyframes mm-l-b3 {
    0% { transform: translate(14vw, 78vh) scale(1.28); opacity: 1; }
    25% { transform: translate(18vw, 72vh) scale(1.15); opacity: 1; }
    58% { transform: translate(24vw, 80vh) scale(1.33); opacity: 1; }
    90% { transform: translate(15vw, 81vh) scale(1.35); opacity: 1; }
    100% { transform: translate(14vw, 78vh) scale(1.28); opacity: 1; }
}
.menu-match .mb.r-ball { transform: translate(62.2vw, 89vh) scale(1.53); animation: mm-r-ball 14s linear infinite; }
.menu-match .mb.r-ball i { animation: mm-r-ball-lift 14s ease-in-out infinite; }
@keyframes mm-r-ball {
    0% { transform: translate(61.2vw, 90vh) scale(1.55); opacity: 0; }
    4% { transform: translate(62.2vw, 89vh) scale(1.53); opacity: 1; }
    35% { transform: translate(74.2vw, 77vh) scale(1.26); opacity: 1; }
    42% { transform: translate(80vw, 69.5vh) scale(1.09); opacity: 1; }
    50% { transform: translate(85.6vw, 62.2vh) scale(0.93); opacity: 1; }
    75% { transform: translate(93.9vw, 56.2vh) scale(0.8); opacity: 1; }
    79% { transform: translate(99vw, 50vh) scale(0.66); opacity: 1; }
    82% { transform: translate(106vw, 44vh) scale(0.53); opacity: 1; }
    83% { transform: translate(106vw, 44vh) scale(0.53); opacity: 0; }
    100% { transform: translate(61.2vw, 90vh) scale(1.55); opacity: 0; }
}
@keyframes mm-r-ball-lift {
    0% { transform: translateY(0px); }
    4% { transform: translateY(0px); }
    35% { transform: translateY(0px); }
    42% { transform: translateY(-18px); }
    50% { transform: translateY(0px); }
    75% { transform: translateY(0px); }
    79% { transform: translateY(-26px); }
    82% { transform: translateY(-34px); }
    83% { transform: translateY(0px); }
    100% { transform: translateY(0px); }
}
.menu-match .mb.l-ball { transform: translate(9vw, 84vh) scale(1.42); animation: mm-l-ball 9s linear infinite; }
.menu-match .mb.l-ball i { animation: mm-l-ball-lift 9s ease-in-out infinite; }
@keyframes mm-l-ball {
    0% { transform: translate(9vw, 84vh) scale(1.42); opacity: 1; }
    22% { transform: translate(20vw, 66.2vh) scale(1.02); opacity: 1; }
    33% { transform: translate(20.6vw, 66vh) scale(1.02); opacity: 1; }
    55% { transform: translate(30vw, 88vh) scale(1.51); opacity: 1; }
    66% { transform: translate(30.4vw, 88vh) scale(1.51); opacity: 1; }
    88% { transform: translate(9.4vw, 84.2vh) scale(1.42); opacity: 1; }
    100% { transform: translate(9vw, 84vh) scale(1.42); opacity: 1; }
}
@keyframes mm-l-ball-lift {
    0% { transform: translateY(0px); }
    22% { transform: translateY(0px); }
    33% { transform: translateY(0px); }
    55% { transform: translateY(0px); }
    66% { transform: translateY(0px); }
    88% { transform: translateY(0px); }
    100% { transform: translateY(0px); }
}
@media (prefers-reduced-motion: reduce) {
    .menu-match .mp, .menu-match .mb, .menu-match .mb i { animation: none !important; }
}
/* menu_match:end */

@media (prefers-reduced-motion: reduce) {
    .led-word { transition: none; }
    .led-goal { animation: none; }
    .fx-flashes { display: none; }
}

/* Optionen: Ton-Regler je Kanal (menu.ts initSoundOptions) */
.options-sound { display: flex; flex-direction: column; gap: 8px; width: min(420px, 100%); margin: 6px auto 0; }
.sound-row { display: grid; grid-template-columns: 1fr 1.3fr 3.5em; align-items: center; gap: 10px; color: var(--menu-muted, #9fb3a3); font-size: 0.9rem; }
.sound-row input[type="range"] { width: 100%; accent-color: var(--menu-gold, #f1c40f); cursor: pointer; }
.sound-value { text-align: right; font-variant-numeric: tabular-nums; color: #fff; }
