/**
 * AUFSTELLUNG FELD CSS
 * Vereinfachtes 2D Fußballfeld
 * Nutzt globale CSS-Variablen aus eus.css
 */

/* ============================================
   STAGE (Container)
   ============================================ */

.js-stage.stage {
    position: relative;
    width: 100%;
    height: 700px;
    background: linear-gradient(to bottom,
        var(--field-sky) 0%,
        var(--field-sky) 15%,
        var(--field-green-dark) 15%,
        var(--field-green-dark) 100%);
    overflow: hidden;
    border-radius: 8px;
}

/* ============================================
   WORLD & TERRAIN (Feld-Wrapper)
   ============================================ */

.js-world.world {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 850px;
}

.js-terrain.terrain {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ============================================
   FIELD (Das Spielfeld)
   ============================================ */

.field.ground {
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(to bottom, 
            rgba(45, 122, 45, 0.8) 0%, 
            rgba(58, 138, 58, 0.8) 50%, 
            rgba(45, 122, 45, 0.8) 100%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 85px,
            rgba(255, 255, 255, 0.03) 85px,
            rgba(255, 255, 255, 0.03) 170px
        );
    border: 4px solid rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    box-shadow: 
        inset 0 0 80px rgba(0,0,0,0.15),
        0 4px 20px rgba(0,0,0,0.2);
}

/* Feldlinien */
.field__line {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1;
}

/* Mittellinie */
.field__line--mid {
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    transform: translateY(-1.5px);
}

/* Mittelkreis */
.field__line--circle {
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
}

/* Strafraum unten */
.field__line--penalty {
    bottom: 0;
    left: 50%;
    width: 280px;
    height: 120px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-bottom: none;
    transform: translateX(-50%);
    background: transparent;
}

/* Strafraum oben */
.field__line--penalty--far {
    top: 0;
    bottom: auto;
    border-top: none;
    border-bottom: 3px solid rgba(255, 255, 255, 0.8);
}

/* Torraum unten */
.field__line--goal {
    bottom: 0;
    left: 50%;
    width: 140px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-bottom: none;
    transform: translateX(-50%);
    background: transparent;
}

/* Torraum oben */
.field__line--goal--far {
    top: 0;
    bottom: auto;
    border-top: none;
    border-bottom: 3px solid rgba(255, 255, 255, 0.8);
}

/* ============================================
   TEAM CONTAINER
   ============================================ */

.js-team.team {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* ============================================
   FIELD PLAYERS (Spieler)
   ============================================ */

.field-player {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    z-index: 100;
}

.field-player:hover {
    transform: translate(-50%, -50%) scale(1.15);
    z-index: 200;
}

.field-player.active {
    transform: translate(-50%, -50%) scale(1.25);
    z-index: 300;
}

/* Position Badge (Kreis oben) */
.field-player-badge {
    width: 44px;
    height: 44px;
    margin: 0 auto 5px;
    background: linear-gradient(135deg, var(--gradient-purple-start) 0%, var(--gradient-purple-end) 100%);
    border: 3px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
    box-shadow: 
        0 4px 12px rgba(0,0,0,0.3),
        0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* Avatar/Icon */
.field-player-avatar {
    width: 70px;
    height: 70px;
    margin: 0 auto;
    background: white;
    border: 4px solid var(--gradient-purple-start);
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 
        0 6px 16px rgba(0,0,0,0.3),
        0 0 0 3px rgba(255,255,255,0.5);
}

.field-player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Name Label */
.field-player-name {
    margin-top: 8px;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}

/* Active State - hervorgehoben */
.field-player.active .field-player-badge {
    background: linear-gradient(135deg, var(--gradient-pink-start) 0%, var(--gradient-pink-end) 100%);
    animation: pulse 1.5s ease-in-out infinite;
}

.field-player.active .field-player-avatar {
    border-color: var(--gradient-pink-end);
    box-shadow: 
        0 8px 24px rgba(245, 87, 108, 0.5),
        0 0 0 4px rgba(245, 87, 108, 0.3);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .js-stage.stage {
        height: 500px;
    }
    
    .js-world.world {
        width: 90%;
        max-width: 450px;
        height: 650px;
    }
    
    .field-player-badge {
        width: 36px;
        height: 36px;
        font-size: 10px;
    }
    
    .field-player-avatar {
        width: 55px;
        height: 55px;
        border-width: 3px;
    }
    
    .field-player-name {
        font-size: 11px;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .js-stage.stage {
        height: 400px;
    }
    
    .js-world.world {
        height: 550px;
    }
}