/* Präzise, dezente Endpunkt-Handles für Linien */
.line-handle {
    opacity: 0.2 !important;
}
/* === Spielfeld PNG nicht verschiebbar, nicht auswählbar === */
#feld, .feld-img, .taktik-field-bg {
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    -webkit-user-select: none !important;
}

#fieldContainer {
    pointer-events: auto;
}
/* === Tore (Goals) === */
.taktik-goal {
    position: absolute;
    cursor: move;
    user-select: none;
    z-index: 65;
    transition: box-shadow 0.2s, border 0.2s;
    box-shadow: 0 2px 8px rgba(30,64,175,0.10);
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: rgba(255,255,255,0.95);
    min-width: 24px;
    min-height: 12px;
    max-width: 180px;
    max-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.taktik-goal:focus-visible {
    outline: 2px solid #1e40af;
    border-color: #1e40af;
}
.taktik-goal .resize-handle {
    position: absolute;
    right: -10px;
    bottom: -10px;
    width: 18px;
    height: 18px;
    background: #f59e0b;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(245,158,11,0.18);
    cursor: nwse-resize;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}
.taktik-goal .resize-handle:after {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    background: url('images/svg/resize.svg') center/contain no-repeat;
    opacity: 0.7;
}
.taktik-line.selected {
    stroke: #f59e0b !important;
    stroke-width: 6 !important;
    filter: drop-shadow(0 2px 8px rgba(245,158,11,0.18));
    cursor: pointer;
    transition: stroke 0.2s, stroke-width 0.2s;
}
/* =============================
   Linien & Pfeile (SVG-Layer)
   ============================= */
.taktik-line-layer {
    pointer-events: auto;
    z-index: 30;
}
.taktik-line {
    stroke: #222;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.2s, stroke-width 0.2s;
    pointer-events: visibleStroke;
    touch-action: none;
}
.taktik-line[data-type="line-solid"] {
    stroke: #222;
    stroke-dasharray: none;
}
.taktik-line[data-type="line-dashed"] {
    stroke: #222;
    stroke-dasharray: 8,8;
}
.taktik-line[data-type^="arrow"] {
    stroke: #1e40af;
}
.taktik-line[data-type="arrow-solid"] {
    marker-end: url(#arrowhead-solid);
    stroke-dasharray: none;
}
.taktik-line[data-type="arrow-dashed"] {
    marker-end: url(#arrowhead-dashed);
    stroke-dasharray: 8,8;
}
.taktik-line:hover {
    stroke-width: 5;
    filter: drop-shadow(0 2px 6px rgba(30,64,175,0.12));
    cursor: pointer;
}
@media (max-width: 900px) {
    .taktik-line {
        stroke-width: 4;
    }
}
@media (max-width: 600px) {
    .taktik-line {
        stroke-width: 5;
    }
}
/* =============================
   Moderne Toolbar/Palette UI
   ============================= */
.taktik-object-toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 0 18px 0;
    background: var(--gray-light);
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
}

.toolbar-btn {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 8px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    position: relative;
}
.toolbar-btn:focus-visible {
    outline: 2px solid var(--secondary-blue);
    border-color: var(--secondary-blue);
    z-index: 2;
}
.toolbar-btn:hover,
.toolbar-btn.active {
    border-color: var(--secondary-blue);
    background: #f1f5f9;
    box-shadow: 0 2px 8px rgba(37,99,235,0.08);
}


@media (max-width: 900px) {
    .taktik-object-toolbar {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 0 12px 0;
    }
    .toolbar-btn {
        min-width: 36px;
        min-height: 36px;
        padding: 4px 6px;
    }
}

@media (max-width: 600px) {
    .taktik-object-toolbar {
        flex-direction: row;
        gap: 4px;
        padding: 6px 0 8px 0;
    }
    .toolbar-btn {
        min-width: 32px;
        min-height: 32px;
        padding: 2px 4px;
    }
}
/* =================================================================
   TaktikBoard - CSS Variablen & Global Styles
   ================================================================= */
:root {
    --primary-red: #dc2626;
    --primary-blue: #1e40af;
    --secondary-blue: #3b82f6;
    --success-green: #16a34a;
    --warning-orange: #f59e0b;
    --danger-red: #dc2626;
    --gray-light: #f8fafc;
    --gray-medium: #64748b;
    --gray-dark: #1e293b;
    --field-green: #22c55e;
    --field-green-light: #4ade80;
    --field-green-dark: #16a34a;
    --white: #ffffff;
    --black: #000000;
    
    /* Moderne Gradientenfarben */
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
    --field-gradient: linear-gradient(135deg, #22c55e 0%, #16a34a 50%, #15803d 100%);
    --panel-gradient: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    
    /* Erweiterte Variablen für Animation Controls */
    --anim-primary: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    --anim-success: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    --anim-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --anim-danger: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    --anim-accent: #fbbf24;
    --anim-bg-overlay: rgba(255,255,255,0.1);
    --anim-border: rgba(255,255,255,0.2);
    
    /* Container-Variablen */
    --container-padding: 12px;
    --border-radius: 16px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* =================================================================
   Grundlegendes Layout
   ================================================================= */
.taktikboard-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px; /* Reduziert von var(--container-padding) */
    max-width: 100%;
    margin: 0;  /* Entfernt auto - Container geht bis zum Rand */
    min-height: 100vh;
    height: 100vh; /* Feste Viewport-Höhe für maximale Raumnutzung */
}

@media (min-width: 1024px) {
    .taktikboard-container {
        flex-direction: row;
        align-items: flex-start;
        gap: 15px; /* Reduzierter Gap für mehr Platz */
        padding: 5px; /* Minimaler Padding */
        height: 100vh; /* Volle Bildschirmhöhe nutzen */
        /* Höhe passt sich dem Inhalt an */
    }
}

.spieler-liste {
    flex: 1;
    max-width: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 12px; /* Kompakteres Padding */
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.05);
    overflow-y: visible; /* Kein Scroll - alles sichtbar */
    margin-left: 0; /* Explizit am linken Rand */
    border: 1px solid rgba(226, 232, 240, 0.8);
    /* Erweiterte Breite für vollständige Spaltenanzeige */
    min-width: 350px; /* Breitere Mindestbreite für alle Spalten */
    height: auto; /* Automatische Höhe */
    max-height: none; /* Keine Höhenbeschränkung */
}

@media (min-width: 1024px) {
    .spieler-liste {
        max-width: 380px; /* Erweiterte Breite für alle Spalten */
        min-width: 350px; /* Breitere Mindestbreite */
        height: 100%;
        flex-shrink: 0; /* Verhindert weitere Verkleinerung */
        margin-left: 0; /* Direkt am linken Rand */
        margin-right: 0; /* Kein rechter Margin */
    }
    
    .main-content {
        flex: 4; /* Noch mehr Platz für das Spielfeld */
        max-width: calc(100% - 250px); /* Angepasst an neue Spielerlisten-Breite */
        margin-left: 0; /* Kein linker Margin */
    }
}

/* Spezielle Optimierung für große Bildschirme */
@media (min-width: 1440px) {
    .taktikboard-container {
        gap: 15px; /* Optimaler Abstand */
        padding: 8px;
    }
    
    .spieler-liste {
        max-width: 260px; /* Etwas mehr Platz für große Screens */
        margin-left: 0;
    }
    
    .main-content {
        max-width: calc(100% - 275px);
    }
    
    #feld {
        height: 100% !important; /* Nutzt die verfügbare Container-Höhe */
        max-width: none !important; /* Keine Breitenbegrenzung */
    }
}

/* Maximale Raumnutzung für sehr große Bildschirme */
@media (min-width: 1920px) {
    .taktikboard-container {
        padding: 10px;
        gap: 25px;
    }
    
    .spieler-liste {
        max-width: 350px;
    }
    
    .main-content {
        max-width: calc(100% - 385px);
    }
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 0; /* Kein Gap - Spielfeld direkt unter Einstellungen */
    flex: 1;
    min-height: 0;
    height: 100%; /* Volle Höhe nutzen */
}

.settings-section {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex-shrink: 0; /* Behält Größe bei */
}

.field-animation-row {
    display: flex; /* Flexbox für Spielfeld + Animationspanel */
    flex-direction: row; /* Nebeneinander anordnen */
    gap: 5px; /* Kleiner Abstand zwischen Spielfeld und Panel */
    background: transparent; /* Entferne den Container-Hintergrund */
    border-radius: 0; /* Entferne den Container-Rahmen */
    padding: 0; /* Entferne Padding für originale Bildgröße */
    box-shadow: none; /* Entferne Container-Schatten */
    position: relative; /* Für absolute Positionierung der Spielerelemente */
    overflow: visible; /* Überlauf sichtbar machen */
    align-items: flex-start; /* Elemente oben ausrichten */
    /* Container für Originalgröße 649×936px */
    width: auto; /* Automatische Breite */
    height: auto; /* Automatische Höhe */
    min-width: auto; /* Keine Mindestbreite */
    min-height: auto; /* Keine Mindesthöhe */
    max-width: none; /* Keine Breitenbegrenzung */
    max-height: none; /* Keine Höhenbegrenzung */
}

/* Container passt sich dem Inhalt an */

/* Spielfeld Container für Bild + Spieler */
.field-container {
    position: relative;
    display: inline-block;
    width: 649px;
    height: 936px;
    background: transparent;
}

/* .feld-section entfernt - Bild wird direkt in .field-container platziert */

.animation-panel {
    width: 84px; /* abgestimmt mit animation-modern.css */
    min-width: 84px;
    height: auto; /* Automatische Höhe */
    max-height: 936px; /* Maximale Höhe entspricht dem Spielfeld */
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border-radius: 16px;
    padding: 8px 4px; /* Kompakteres Padding */
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    overflow-y: auto;
    border: 1px solid rgba(226, 232, 240, 0.6);
    flex-shrink: 0; /* Panel behält seine Größe */
}

/* =================================================================
   Ausklappbare Bereiche
   ================================================================= */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 5px;
    transition: background-color 0.2s ease;
    user-select: none;
}

.section-header:hover {
    background: #e5e7eb;
}

.section-header h3,
.section-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-dark);
}

.collapse-icon {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.collapsible-section {
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.4s ease;
    opacity: 1;
    flex: 1;
    overflow-y: visible; /* Kein Scroll - alles sichtbar */
}

/* Spezielle Regel für aufgeklappte Sections - nicht mehr nötig mit dynamischer maxHeight */

.collapsible-section.collapsed {
    display: none;
}

/* =================================================================
   Taktik-Toolbar
   ================================================================= */
.taktik-toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    background: var(--gray-light);
    border-radius: 8px;
}

.taktik-toolbar label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.taktik-toolbar input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

.taktik-toolbar button {
    padding: 10px 15px;
    background: var(--secondary-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.taktik-toolbar button:hover {
    background: #1d4ed8;
}

/* =================================================================
   SPIELER-TABELLE - HOHER KONTRAST
   ================================================================= */
.spieler-tabelle {
    width: 100% !important;
    border-collapse: collapse;
    flex: 1;
    margin-top: 15px;
    background: var(--white) !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    table-layout: fixed !important; /* Fixe Tabellenlayout für kontrollierte Spaltenbreiten */
}

/* Spezifische Spaltenbreiten - OPTIMIERT FÜR MEHR PLATZ BEI POSITIONEN */
.spieler-tabelle th:nth-child(1), /* Nr. */
.spieler-tabelle td:nth-child(1) {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
}

.spieler-tabelle th:nth-child(2), /* Nachname */
.spieler-tabelle td:nth-child(2) {
    width: 80px;
    min-width: 75px;
    max-width: 90px;
}

.spieler-tabelle th:nth-child(3), /* Vorname */
.spieler-tabelle td:nth-child(3) {
    width: 70px;
    min-width: 65px;
    max-width: 80px;
}

.spieler-tabelle th:nth-child(4), /* Position */
.spieler-tabelle td:nth-child(4) {
    width: auto; /* Rest der verfügbaren Breite */
    min-width: 120px;
}

.spieler-tabelle th,
.spieler-tabelle td {
    padding: 12px 8px !important;
    text-align: left;
    border-bottom: 1px solid #e5e7eb !important;
    color: var(--gray-dark) !important; /* Dunkler Text */
    font-size: 13px !important; /* Etwas kleinere Schrift für mehr Platz */
    font-weight: 500;
    white-space: nowrap; /* Verhindert Zeilenumbruch */
    overflow: hidden; /* Versteckt Overflow */
    text-overflow: ellipsis; /* Zeigt ... bei zu langem Text */
}

.spieler-tabelle th {
    background-color: #f8fafc !important;
    color: var(--gray-dark) !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0 !important;
}

/* Hover-Effekt für bessere Interaktion */
.spieler-tabelle tr:hover {
    background-color: #f1f5f9 !important;
}

/* Drag-State */
.spieler-draggable {
    cursor: grab !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 2px solid transparent !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

.spieler-draggable:hover {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
    border-color: #3b82f6 !important;
    box-shadow: 
        0 4px 16px rgba(59, 130, 246, 0.15),
        0 0 0 1px rgba(59, 130, 246, 0.1) !important;
    transform: translateY(-2px) !important;
}

.spieler-draggable:active {
    cursor: grabbing !important;
    transform: scale(1.02) !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.2) !important;
}

/* =================================================================
   SCHATTENKADER - KLARER
   ================================================================= */

/* Suchleiste für Schattenkader */
.search-container {
    position: relative;
    margin: 12px 0;
}

.search-input {
    width: 100%;
    padding: 10px 35px 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background-color: #f8fafc;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: #0ea5e9;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #64748b;
    font-size: 18px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: none;
}

.search-clear:hover {
    background-color: #f1f5f9;
    color: #374151;
}

.search-clear.visible {
    display: block;
}

.scouted-player-draggable {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 16px !important;
    margin: 8px 0 !important;
    cursor: grab !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.1),
        0 1px 2px rgba(0, 0, 0, 0.06) !important;
    min-height: 70px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    position: relative !important;
    overflow: hidden !important;
}

.scouted-player-draggable::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 4px !important;
    height: 100% !important;
    background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%) !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.scouted-player-draggable:hover::before {
    opacity: 1 !important;
}

.scouted-player-draggable.hidden {
    display: none;
}

.scouted-player-draggable:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border-color: #0ea5e9 !important;
    transform: translateY(-2px) !important;
    box-shadow:
        0 4px 12px rgba(14, 165, 233, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.scouted-player-draggable:active {
    transform: translateY(0) !important;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.1),
        0 1px 2px rgba(0, 0, 0, 0.06) !important;
}

/* Avatar-ähnliches Icon für jeden Spieler */
.scouted-player-draggable::after {
    content: "👤" !important;
    font-size: 20px !important;
    width: 36px !important;
    height: 36px !important;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3) !important;
    border: 2px solid rgba(255, 255, 255, 0.9) !important;
}

.scouted-player-draggable span {
    display: block;
    font-weight: 600 !important;
    color: #1e293b !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
    margin-bottom: 2px !important;
    flex: 1 !important;
    min-width: 0 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.scouted-player-draggable small {
    color: #64748b !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
    display: block !important;
    word-wrap: break-word !important;
    opacity: 0.8 !important;
    background: rgba(100, 116, 139, 0.1) !important;
    padding: 3px 6px !important;
    border-radius: 4px !important;
    margin-top: 4px !important;
    width: fit-content !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Drag-Feedback */
.scouted-player-draggable[aria-grabbed="true"] {
    opacity: 0.8 !important;
    transform: rotate(2deg) !important;
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4) !important;
}

/* Fokus für Accessibility */
.scouted-player-draggable:focus-visible {
    outline: 2px solid #0ea5e9 !important;
    outline-offset: 2px !important;
    border-color: #0ea5e9 !important;
}

/* Mobile Optimierungen für Schattenkader-Spieler */
@media (max-width: 768px) {
    .scouted-player-draggable {
        padding: 12px !important;
        margin: 6px 0 !important;
        min-height: 60px !important;
        gap: 10px !important;
        flex-wrap: wrap !important;
    }

    .scouted-player-draggable::after {
        width: 32px !important;
        height: 32px !important;
        font-size: 16px !important;
        flex-shrink: 0 !important;
    }

    .scouted-player-draggable span {
        font-size: 13px !important;
        min-width: 100px !important;
        flex: 1 !important;
    }

    .scouted-player-draggable small {
        font-size: 11px !important;
        padding: 2px 4px !important;
        margin-top: 3px !important;
        width: 100% !important;
    }

    #scoutedPlayersList {
        max-height: 250px !important;
        padding: 4px !important;
    }
}

#scoutedPlayersList {
    overflow-y: auto;
    margin-top: 12px;
    padding: 6px;
    max-height: 320px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

#scoutedPlayersList::-webkit-scrollbar {
    width: 6px;
}

#scoutedPlayersList::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#scoutedPlayersList::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#scoutedPlayersList::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* =================================================================
   Modern Position Badges - UX Optimiert
   ================================================================= */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px !important;
    border-radius: 20px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    color: var(--white) !important;
    margin: 1px 2px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
    transition: all 0.2s ease !important;
    cursor: default !important;
    min-width: 32px !important;
    height: 22px !important;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark)) !important;
}

.badge:hover {
    transform: translateY(-1px) scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25) !important;
    border-color: rgba(255,255,255,0.6) !important;
}

/* Torwart - Blau */
.badge-tw { 
    background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important; 
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3) !important;
}
.badge-tw:hover { box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important; }

/* Verteidigung - Grün */
.badge-iv, .badge-rv, .badge-lv, .badge-lav, .badge-rav, .badge-liv, .badge-riv { 
    background: linear-gradient(135deg, #10b981, #047857) !important; 
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3) !important;
}
.badge-iv:hover, .badge-rv:hover, .badge-lv:hover, .badge-lav:hover, .badge-rav:hover, .badge-liv:hover, .badge-riv:hover { 
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4) !important; 
}

/* Mittelfeld - Orange */
.badge-zdm, .badge-zm, .badge-zom, .badge-lm, .badge-rm, .badge-dm, .badge-om { 
    background: linear-gradient(135deg, #f59e0b, #d97706) !important; 
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3) !important;
}
.badge-zdm:hover, .badge-zm:hover, .badge-zom:hover, .badge-lm:hover, .badge-rm:hover, .badge-dm:hover, .badge-om:hover { 
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4) !important; 
}

/* Sturm - Rot */
.badge-rf, .badge-lf, .badge-hs, .badge-st, .badge-zs, .badge-ms, .badge-la, .badge-ra { 
    background: linear-gradient(135deg, #ef4444, #dc2626) !important; 
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3) !important;
}
.badge-rf:hover, .badge-lf:hover, .badge-hs:hover, .badge-st:hover, .badge-zs:hover, .badge-ms:hover, .badge-la:hover, .badge-ra:hover { 
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4) !important; 
}

/* Standard/Unbekannte Position */
.badge-default, .badge-unknown { 
    background: linear-gradient(135deg, #6b7280, #4b5563) !important; 
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3) !important;
}
.badge-default:hover, .badge-unknown:hover { 
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4) !important; 
}

/* Mehr-Indikator */
.badge-more { 
    background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important; 
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3) !important;
}
.badge-more:hover { 
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4) !important; 
}

/* Position Container für bessere Ausrichtung */
.positions-cell {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 2px !important;
    padding: 8px 6px !important;
}

/* =================================================================
   Ball-Element
   ================================================================= */
.ball-draggable {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px dashed #ccc;
    border-radius: 12px;
    cursor: grab;
    background: var(--gray-light);
    margin-top: 20px;
    transition: all 0.2s ease;
}

.ball-draggable:active {
    cursor: grabbing;
    background: #e0e0e0;
}

.ball-draggable:hover {
    border-color: var(--secondary-blue);
    transform: translateY(-2px);
}

.ball-icon {
    font-size: 32px;
    margin-right: 12px;
}

/* =================================================================
   Animation Controls - Kompakte Version
   ================================================================= */
.animation-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px 0;
    height: 100%;
    overflow-y: auto;
}

.animation-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 4px;
    border-bottom: 1px solid #e9ecef;
    align-items: center;
}

.animation-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 10px !important;
    font-weight: 600 !important;
    color: var(--gray-dark) !important;
    text-align: center !important;
    margin-bottom: 4px !important;
    writing-mode: vertical-rl !important;
    text-orientation: mixed !important;
    transform: rotate(180deg) !important;
    white-space: nowrap !important;
    letter-spacing: 0.5px !important;
}

/* Animation Buttons - Kompakt & KLARER */
.btn-record, .btn-stop, .btn-capture, .btn-play, .btn-save, .btn-clear, .gegner-btn {
    width: 52px !important;
    height: 52px !important;
    border: none !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    font-size: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    margin: 0 4px !important;
}

.btn-record {
    background: #ef4444 !important;
    color: white !important;
}

.btn-record:hover:not(:disabled) {
    background: #dc2626 !important;
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4) !important;
}

.btn-record:disabled {
    background: var(--gray-medium);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-stop {
    background: var(--gray-medium);
    color: var(--white);
}

.btn-stop:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

.btn-capture {
    background: var(--secondary-blue);
    color: var(--white);
}

.btn-capture:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-play {
    background: #10b981 !important;
    color: white !important;
}

.btn-play:hover:not(:disabled) {
    background: #059669 !important;
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4) !important;
}

.btn-play:disabled {
    background: var(--gray-medium);
    opacity: 0.6;
}

.btn-save {
    background: #7c3aed;
    color: var(--white);
}

.btn-save:hover:not(:disabled) {
    background: #6d28d9;
    transform: translateY(-1px);
}

.btn-save:disabled {
    background: var(--gray-medium);
    opacity: 0.6;
}

.btn-clear {
    background: var(--warning-orange);
    color: var(--white);
}

.btn-clear:hover {
    background: #d97706;
    transform: translateY(-1px);
}

/* Gegner-Section */
.gegner-section {
    margin: 16px 0;
    text-align: center;
}

.gegner-btn {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: var(--white);
    padding: 12px 20px;
    width: 100%;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.gegner-btn:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Recording Controls - Kompakt */
#recordingControls {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    background: #e9ecef;
    border-radius: 6px;
    align-items: center;
}

.frame-counter {
    font-size: 11px;
    color: var(--gray-medium);
    font-weight: 500;
    background: var(--white);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Playback Controls - Kompakt */
#playbackControls {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

/* Timeline - Kompakt */
.timeline-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
}

.timeline {
    flex: 1;
    display: flex;
    gap: 3px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: #dee2e6 var(--gray-light);
}

.timeline::-webkit-scrollbar {
    height: 3px;
}

.timeline::-webkit-scrollbar-track {
    background: var(--gray-light);
}

.timeline::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 2px;
}

.frame-thumbnail {
    width: 32px;
    height: 24px;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.frame-thumbnail:hover {
    border-color: var(--secondary-blue);
    transform: scale(1.05);
}

.frame-thumbnail.selected {
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

.frame-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

.frame-number {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: var(--white);
    font-size: 7px;
    padding: 1px 2px;
    border-radius: 2px;
}

.frame-delete {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger-red);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.frame-delete:hover {
    background: #b91c1c;
}

/* =================================================================
   Professionelle Animation Controls - Erweiterte Version (Fallback)
   ================================================================= */
#animation-controls {
    background: var(--anim-primary);
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid var(--anim-border);
    backdrop-filter: blur(10px);
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.animation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--anim-border);
}

.animation-title {
    color: var(--white);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.animation-icon {
    width: 24px;
    height: 24px;
    background: var(--anim-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: var(--black);
}

/* Recording Controls - Erweitert */
#recordingControls {
    display: none;
    flex-direction: column;
    gap: 15px;
    background: var(--anim-bg-overlay);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--anim-border);
    margin-bottom: 15px;
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--anim-warning);
    font-weight: 500;
    justify-content: center;
    background: linear-gradient(90deg, 
        var(--gray-light) 25%, 
        rgba(37,99,235,0.1) 50%, 
        var(--gray-light) 75%);
    background-size: 400px 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

.recording-dot {
    width: 12px;
    height: 12px;
    background: var(--anim-warning);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

.control-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons - Erweitert */
.btn-animation {
    background: var(--anim-primary);
    color: var(--white);
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    min-width: 120px;
    justify-content: center;
}

.btn-animation:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-animation:active {
    transform: translateY(0);
}

.btn-animation:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-recording {
    background: var(--anim-warning);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-recording:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.btn-playback {
    background: var(--anim-success);
    box-shadow: 0 4px 15px rgba(16, 172, 132, 0.3);
}

.btn-playback:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(16, 172, 132, 0.4);
}

.btn-danger {
    background: var(--anim-danger);
    box-shadow: 0 4px 15px rgba(255, 65, 108, 0.3);
}

.btn-danger:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(255, 65, 108, 0.4);
}

/* Frame Counter - Erweitert */
.frame-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--white);
    font-size: 14px;
    margin: 10px 0;
    padding: 10px;
    background: var(--anim-bg-overlay);
    border-radius: 8px;
    border: 1px solid var(--anim-border);
}

.frame-number {
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

/* Timeline - Erweitert */
#timeline {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
    max-height: 120px;
}

#timeline::-webkit-scrollbar {
    height: 6px;
}

#timeline::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

#timeline::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.frame-thumbnail {
    position: relative;
    width: 80px;
    height: 60px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    overflow: hidden;
    flex-shrink: 0;
}

.frame-thumbnail:hover {
    transform: scale(1.05);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.frame-thumbnail.selected {
    border-color: var(--anim-accent);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.3);
    transform: scale(1.02);
}

.frame-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.frame-number {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0,0,0,0.7);
    color: var(--white);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.frame-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(255, 65, 108, 0.8);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
}

.frame-thumbnail:hover .frame-delete {
    opacity: 1;
}

.frame-delete:hover {
    background: var(--anim-danger);
    transform: scale(1.1);
}

/* Playback Controls - Erweitert */
#playbackControls {
    display: none;
    flex-direction: column;
    gap: 15px;
    background: var(--anim-bg-overlay);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--anim-border);
    margin-top: auto;
}

.playback-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* =================================================================
   FESSTE VERTIKALE IPAD-GRÖßE FÜR SPIELFELD - KLAR & FUNKTIONAL
   ================================================================= */

/* Container für das Spielfeld - passt sich an originale Bildgröße an */
/* feldContainer wurde entfernt - Feld wird direkt angezeigt */

/* Das eigentliche Spielfeld - MIT HINTERGRUNDBILD IN ORIGINALER GRÖßE */
#fieldContainer {
    position: relative !important;
    width: 649px !important;
    height: 936px !important;
    background: transparent !important;
    border-radius: 16px !important;
    overflow: visible !important;
    margin: 0 auto !important;
    z-index: 1 !important;
}

#feld {
    position: relative !important;
    border: 3px solid #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 
        0 12px 40px rgba(0,0,0,0.25),
        0 0 30px rgba(76, 175, 80, 0.3),
        inset 0 0 40px rgba(255,255,255,0.1) !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    display: block !important;
    width: 649px !important;
    height: 936px !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 649px !important;
    min-height: 936px !important;
    object-fit: none !important;
    object-position: center !important;
    background: transparent !important;
    z-index: 1 !important;
    pointer-events: auto !important;
}


/* Media-Query für kleinere Screens entfernt - Bild behält originale Größe */

/* CSS-Feld-Markierungen entfernt - werden durch Hintergrundbild ersetzt */

/* Sicherheits-Regel: Verstecke alle möglichen verbleibenden Spielfeld-Markierungen */
#feld .strafraum-oben,
#feld .strafraum-unten,
#feld .torraum-oben,
#feld .torraum-unten,
#feld .tor-oben,
#feld .tor-unten,
#feld .elfmeter-oben,
#feld .elfmeter-unten,
#feld .eckpunkt-tl,
#feld .eckpunkt-tr,
#feld .eckpunkt-bl,
#feld .eckpunkt-br,
#feld .eckball-tl,
#feld .eckball-tr,
#feld .eckball-bl,
#feld .eckball-br,
#feld .torraumlinie-oben,
#feld .torraumlinie-unten,
#feld .strafraumlinie-oben,
#feld .strafraumlinie-unten,
#feld .seitenlinie-links,
#feld .seitenlinie-rechts,
#feld .elfmeterkreis-oben,
#feld .elfmeterkreis-unten {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Verstecke auch Pseudo-Elemente falls vorhanden */
#feld::before,
#feld::after {
    display: none !important;
    content: "" !important;
}

/* =================================================================
   SPIELER-ICONS - KLAR SICHTBAR
   ================================================================= */
.spieler-icon {
    position: absolute !important;
    /* width und height werden dynamisch von JavaScript gesetzt */
    border-radius: 50% !important;
    background: var(--primary-red) !important;
    color: var(--white) !important;
    font-size: 18px !important; /* Grössere Nummer */
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transform: translate(-50%, -50%) !important;
    touch-action: none !important; /* Verhindert Standard-Touch-Verhalten */
    cursor: move !important;
    box-shadow:
        0 6px 20px rgba(0,0,0,0.4),
        inset 0 2px 4px rgba(255,255,255,0.2) !important;
    user-select: none !important;
    border: 3px solid rgba(255,255,255,0.9) !important;
    z-index: 100 !important; /* Höher als das Spielfeld-Bild */
    /* Nur spezifische Properties animieren, nicht left/top */
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease !important;
    touch-action: none !important;
    will-change: left, top, transform; /* Optimiert für Positionsänderungen */
    text-shadow: 0 1px 2px rgba(0,0,0,0.5) !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.spieler-icon.gegner {
    background: var(--primary-blue) !important;
    box-shadow: 0 6px 20px rgba(26, 54, 93, 0.4) !important;
}

.spieler-icon.scouted {
    background: #0284c7 !important;
    border: 3px dashed #06b6d4 !important;
    animation: pulse-scout 2s infinite !important;
}

@keyframes pulse-scout {
    0%, 100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.7); }
    50% { box-shadow: 0 0 0 12px rgba(6, 182, 212, 0); }
}

.spieler-icon.selected {
    outline: 4px solid #3b82f6 !important;
    box-shadow: 
        0 0 0 4px rgba(59, 130, 246, 0.3),
        0 8px 25px rgba(0,0,0,0.5) !important;
    transform: translate(-50%, -50%) scale(1.1) !important;
}

.spieler-icon.verletzt {
    background: linear-gradient(135deg, #991b1b 0%, #dc2626 55%, #ef4444 100%) !important;
    border-color: #fee2e2 !important;
    box-shadow:
        0 0 0 6px rgba(220, 38, 38, 0.35),
        0 14px 30px rgba(153, 27, 27, 0.55) !important;
}

.spieler-icon.verletzt::after {
    content: "✚";
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ef4444;
    color: #ffffff;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.45);
    pointer-events: none;
    border: 2px solid #fee2e2;
}

.spieler-name.verletzt {
    background: rgba(153, 27, 27, 0.95) !important;
}

.spieler-tabelle tr.verletzte-zeile td {
    background: rgba(254, 226, 226, 0.65);
    color: #7f1d1d;
}

.spieler-tabelle tr.verletzte-zeile td .badge {
    box-shadow: 0 1px 3px rgba(127, 29, 29, 0.15);
}

.taktik-injury-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    font-size: 14px;
    line-height: 1;
}

.taktik-injury-text {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* NAMEN - DEUTLICH LESBAR */
.spieler-name {
    position: absolute !important;
    top: -35px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(0, 0, 0, 0.9) !important;
    color: var(--white) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 6px 10px !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    z-index: 60 !important;
    pointer-events: none !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
    min-width: 80px !important;
    text-align: center !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.spieler-name.hidden {
    display: none !important;
}

/* Ball auf dem Feld - KLAR SICHTBAR */
.ball-on-field {
    position: absolute !important;
    /* width und height werden dynamisch von JavaScript gesetzt */
    border-radius: 50% !important;
    background: radial-gradient(circle, #ffd700 0%, #ffed4e 50%, #ffc107 100%) !important;
    color: #333 !important;
    font-size: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transform: translate(-50%, -50%) !important;
    cursor: move !important;
    box-shadow: 
        0 6px 20px rgba(255, 215, 0, 0.4),
        inset 0 2px 4px rgba(255,255,255,0.6) !important;
    user-select: none !important;
    border: 3px solid rgba(255,255,255,0.9) !important;
    z-index: 60 !important;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease !important;
    touch-action: none !important;
    will-change: transform;
    animation: bounce 2s infinite !important;
}

@keyframes bounce {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

.ball-on-field:hover {
    transform: translate(-50%, -50%) scale(1.1) !important;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5) !important;
}

/* =================================================================
   REMOVE-ZONE - DEUTLICH & FUNKTIONAL
   ================================================================= */
.unterbereich {
    position: absolute !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 300px !important;
    height: 60px !important;
    background: #fef2f2 !important;
    border: 3px dashed #ef4444 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
    z-index: 100 !important;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2) !important;
    margin-bottom: 0;
    transition: all 0.3s ease;
}

@media (max-width: 850px) {
    .unterbereich {
        width: calc(100% - 40px);
        max-width: 300px;
    }
}

.remove-zone {
    padding: 12px 20px !important;
    border: 2px dashed #dc2626 !important;
    border-radius: 8px !important;
    text-align: center !important;
    color: #dc2626 !important;
    font-weight: 700 !important;
    background: rgba(254, 242, 242, 0.95) !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    z-index: 500 !important; /* Sehr hoch für Drop-Zone */
    width: 100% !important;
    cursor: pointer !important;
    position: relative !important; /* Wichtig für z-index */
}

.remove-zone::before {
    content: "🗑️ " !important;
    margin-right: 8px !important;
    font-size: 16px !important;
}

.remove-zone.dragover {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border-color: #991b1b !important;
    transform: scale(1.05) !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3) !important;
    animation: shake 0.5s ease-in-out !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0) scale(1.05); }
    25% { transform: translateX(-4px) scale(1.05); }
    75% { transform: translateX(4px) scale(1.05); }
}

/* =================================================================
   Modal Styles
   ================================================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 30px;
    border: none;
    width: 90%;
    max-width: 600px;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.close {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover,
.close:focus {
    color: var(--black);
    text-decoration: none;
}

#screenshotPreview {
    margin: 20px 0;
    text-align: center;
}

#screenshotPreview img {
    max-width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.modal-buttons button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-download {
    background-color: var(--success-green);
    color: var(--white);
}

.btn-download:hover {
    background-color: #15803d;
}

.btn-close {
    background-color: var(--gray-medium);
    color: var(--white);
}

.btn-close:hover {
    background-color: #4b5563;
}

.modal-input {
    margin: 20px 0;
}

.modal-input label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 500;
}

.modal-input input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.modal-input input:focus {
    outline: none;
    border-color: var(--secondary-blue);
}

/* Animation Modal */
#animationModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.animation-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    min-width: 400px;
    max-width: 500px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: var(--gray-light);
    color: var(--gray-medium);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-medium);
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-frame-info {
    padding: 12px;
    background: var(--gray-light);
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    color: var(--gray-dark);
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.btn-modal {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary-modal {
    background: var(--anim-primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary-modal:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary-modal {
    background: var(--gray-medium);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.btn-secondary-modal:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

/* Frame Thumbnails - Erweitert */
.frame-thumbnail {
    width: 70px;
    height: 70px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.frame-thumbnail.active {
    border-color: var(--secondary-blue);
}

.frame-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.frame-number {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: var(--white);
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 4px;
}

/* =================================================================
   Responsive Design & Accessibility - Verbessert für Stabilität
   ================================================================= */

/* Allgemeine Mobile-Optimierungen */
@media (max-width: 768px) {
    .taktikboard-container {
        padding: 10px;
        gap: 15px;
    }

    .field-animation-row {
        flex-direction: column;
        height: auto;
        background: none;
        padding: 0;
        box-shadow: none;
    }

    .animation-panel {
        width: 100%;
        height: auto;
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        padding: 10px 0;
    }

    .taktik-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .animation-controls {
        flex-direction: row;
        align-items: stretch;
        gap: 10px;
        justify-content: space-around;
    }
    
    #recordingControls,
    #playbackControls {
        flex-direction: row;
        align-items: stretch;
        gap: 10px;
    }
    
    .animation-controls button {
        width: auto;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    .modal-buttons button {
        width: 100%;
    }
    
    .spieler-liste {
        padding: 15px;
    }
    
    .spieler-tabelle {
        font-size: 14px;
    }
    
    .spieler-icon {
        /* width und height werden dynamisch von JavaScript gesetzt */
        font-size: 16px !important;
    }
    
    .spieler-name {
        font-size: 11px !important;
        top: -32px !important;
        padding: 4px 8px !important;
    }
    
    .ball-on-field {
        /* width und height werden dynamisch von JavaScript gesetzt */
        font-size: 28px !important;
    }
    
    /* Erweiterte Animation Controls auf Mobile */
    #animation-controls {
        padding: 15px;
        margin: 10px;
        border-radius: 8px;
    }
    
    .control-group, .playback-buttons {
        flex-direction: row;
        align-items: center;
    }
    
    .btn-animation {
        width: auto;
        max-width: none;
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .frame-thumbnail {
        width: 60px;
        height: 45px;
    }
    
    .animation-modal-content {
        min-width: 90%;
        margin: 20px;
        padding: 20px;
        border-radius: 12px;
    }
    
    #timeline {
        gap: 5px;
        max-height: 100px;
    }
    
    .frame-counter {
        font-size: 16px;
        padding: 12px;
    }
    
    .recording-indicator {
        font-size: 16px;
    }
    
    /* Feld behält originale Größe auch auf Mobile */
    #feldContainer {
        width: fit-content !important;
        height: fit-content !important;
        min-height: auto !important;
        padding: 10px !important;
    }
    
    #feld {
        width: auto !important;
        height: auto !important;
        min-height: auto !important;
    }
    
    .unterbereich {
        width: calc(100% - 20px) !important;
        bottom: 10px !important;
    }
}

/* Spezielle Feld-Optimierungen für Mobile */
@media (max-width: 480px) {
    #feld {
        width: auto !important;
        height: auto !important;
        min-height: auto !important;
    }
    
    .btn-animation {
        min-width: auto;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .modal-frame-info {
        font-size: 14px;
    }
    
    .form-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .unterbereich {
        width: calc(100% - 20px) !important;
    }
    
    .spieler-icon {
        /* width und height werden dynamisch von JavaScript gesetzt */
        font-size: 15px !important;
    }
}

/* Responsive Optimierungen für Spielfeld-Skalierung */
@media (max-width: 768px) {
    .taktikboard-container {
        flex-direction: column;
        height: 100vh;
        padding: 8px;
    }
    
    .field-animation-row {
        flex-direction: column;
        height: auto;
        padding: 8px;
    }
    
    #feld {
        height: 60vh !important; /* Mobile: 60% der Viewport-Höhe */
        max-width: 90vw !important;
        min-height: 300px !important; /* Mindestgröße für Touch-Bedienung */
    }
    
    .animation-panel {
        width: 100%;
        flex-direction: row;
        height: 60px;
        justify-content: center;
        gap: 12px;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    #feld {
        width: auto !important;
        height: auto !important;
        /* Keine Größenbeschränkungen - Bild behält Proportionen */
    }
    
    .unterbereich {
        width: fit-content !important;
    }
}

/* Touch Device Optimierungen */
@media (hover: none) and (pointer: coarse) {
    .spieler-draggable {
        padding: 15px;
        margin: 5px 0;
        border: 2px solid #eee;
        border-radius: 8px;
    }
    
    .ball-draggable {
        padding: 20px;
    }
    
    /* Größere Touch Targets */
    .animation-controls button {
        padding: 15px 20px;
        min-height: 50px;
    }
    
    .taktik-toolbar label {
        padding: 10px;
    }
    
    .btn-record, .btn-stop, .btn-capture, .btn-play, .btn-save, .btn-clear, .gegner-btn {
        width: 60px !important;
        height: 60px !important;
        font-size: 24px !important;
    }
}

/* Bessere Touch-Targets */
@media (hover: none) {
    .spieler-draggable, .scouted-player-draggable {
        padding: 15px;
        font-size: 18px;
    }
}

/* Focus Styles für Accessibility */
button:focus-visible,
input:focus-visible,
[draggable]:focus-visible {
    outline: 2px solid var(--secondary-blue);
    outline-offset: 2px;
}

/* Loading States */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status Messages - Erweitert */
.status-message {
    padding: 10px 15px;
    border-radius: 8px;
    margin: 10px 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-success {
    background: rgba(22, 163, 74, 0.1);
    color: var(--success-green);
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.status-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-orange);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-error {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger-red);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.status-info {
    background: rgba(37, 99, 235, 0.1);
    color: var(--secondary-blue);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

/* Legacy Fallback für schmale Animation Panel */
@media (min-width: 1024px) {
    .animation-panel #animation-controls {
        background: transparent;
        box-shadow: none;
        border: none;
        padding: 0;
        margin: 0;
        height: 100%;
    }
    
    .animation-panel .animation-header,
    .animation-panel .status-message,
    .animation-panel #recordingControls,
    .animation-panel #playbackControls {
        display: none;
    }
    
    .animation-panel .control-group,
    .animation-panel .playback-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .animation-panel .btn-animation {
        min-width: auto;
        width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 8px;
        font-size: 18px;
    }
    
    .animation-panel .frame-counter {
        display: none;
    }
}

/* Toast-Feedback (für Status-Messages, z.B. "Frame erfasst") */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 1000;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    font-weight: 500;
}

@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes toastOut {
    to { opacity: 0; transform: translate(-50%, -20px); }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gray-medium);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
}

.search-clear.visible {
    display: flex;
}

.search-clear:hover {
    background: var(--danger-red);
}

/* Zusätzliche Stabilisierungen für UX - feld-section entfernt */

@media (min-width: 1024px) {
    
    .unterbereich {
        position: absolute !important;
        bottom: -100px !important; /* Unter dem Container, aber sichtbar */
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin-top: 0 !important;
    }
}