* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores principais - inspiradas no campo e uniformes */
    --primary: #1FAA5A;          /* Verde forte estilo gramado */
    --primary-dark: #158548;     /* Verde escuro para contrastes */

    /* Secundária baseada em tons esportivos/chuteiras/uniformes */
    --secondary: #1E3A8A;       /* Azul profundo estilo uniforme profissional */

    /* Status esportivos */
    --success: #22C55E;         /* Gol / aprovado */
    --warning: #FACC15;         /* Cartão amarelo vibe */
    --danger: #DC2626;          /* Cartão vermelho vibe */

    /* Tons neutros – estádio à noite */
    --light: #F1F5F9;           /* Cinza claro */
    --dark: #0F172A;            /* Azul quase preto – muito profissional */
    --border: #CBD5E1;          /* Linha sutil como marcações do campo */

    /* Sombra mais suave e moderna */
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}


body {
    font-family: 'Anton', sans-serif;
    letter-spacing: 0.5px;
    line-height: 1.6;
    color: var(--dark);

    background: 
        linear-gradient(rgba(0,0,0,0.95), rgba(0,0,0,0.35)),
        url('bg.jpg') no-repeat center center;
    
    background-size: cover;
    background-attachment: fixed; /* Evita redimensionamento ao scroll */
    image-rendering: -webkit-optimize-contrast; /* Melhora a renderização */
    image-rendering: crisp-edges;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Sections */
.main-content {
    display: grid;
    gap: 30px;
}

.section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
}

.section h2 {
    margin-bottom: 20px;
    color: var(--dark);
    font-size: 1.5rem;
}

/* Input Groups */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.input-group small {
    color: var(--secondary);
    font-size: 0.85rem;
}

/* Stars Input */
.stars-input {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.star {
    font-size: 2rem;
    cursor: pointer;
    color: #d1d5db;
    transition: color 0.2s;
    user-select: none;
}

.star.active,
.star:hover {
    color: var(--warning);
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-generate {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
}

.btn-generate {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    font-size: 1.1rem;
    padding: 15px 30px;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.btn-generate:disabled {
    background: var(--secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Players List */
.players-list {
    margin-top: 30px;
}

.players-list h3 {
    margin-bottom: 15px;
    color: var(--dark);
}

.player-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--light);
    border-radius: 8px;
    border-left: 4px solid var(--warning);
}

.player-info {
    flex: 1;
}

.player-name {
    font-weight: 600;
}

.player-stars {
    color: var(--warning);
    font-size: 0.9rem;
}

.delete-player {
    background: var(--danger);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.delete-player:hover {
    background: #dc2626;
}

/* Teams */
.teams-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

.team {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    background: var(--light);
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.team-header h3 {
    margin: 0;
}

.team-stats {
    font-size: 0.9rem;
    color: var(--secondary);
}

.players-grid {
    display: grid;
    gap: 10px;
}

.team-player {
    padding: 10px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Balance Info */
.balance-info {
    padding: 15px;
    background: #dbeafe;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    margin-bottom: 20px;
}

.balance-info.imbalance {
    background: #fef3c7;
    border-left-color: var(--warning);
}

/* Waiting List */
.waiting-list {
    margin-top: 30px;
    padding: 20px;
    background: #fef3c7;
    border-radius: 8px;
    border-left: 4px solid var(--warning);
}

/* Actions */
.actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Campo de Futebol - VERTICAL */
.field-container {
    border: 3px solid #8B4513;
    border-radius: 10px;
    padding: 0;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    background: #2d5a27;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.soccer-field {
    width: 100%;
    position: relative;
    aspect-ratio: 2/3; /* Proporção vertical */
}

.field-background {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.field-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Jogadores no campo */
.field-players {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.field-player {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 2;
}

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

.player-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 0.8em;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    border: 2px solid white;
    margin-bottom: 5px;
}

.team-a-player .player-marker {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.team-b-player .player-marker {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.goalkeeper-player .player-marker {
    background: linear-gradient(135deg, #26290F, #131505);
}

.player-name-marker {
    font-size: 0.7em;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    background: rgba(0,0,0,0.7);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.field-empty-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    background: rgba(0,0,0,0.7);
    padding: 20px;
    border-radius: 10px;
    font-size: 1.1em;
    z-index: 1;
}

/* Controles do campo */
.field-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    flex-wrap: wrap;
}

.field-controls button {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.field-controls button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 50px;
    color: white;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .section {
        padding: 20px;
    }
    
    .teams-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-generate {
        width: 100%;
        justify-content: center;
    }
    
    .player-marker {
        width: 35px;
        height: 35px;
        font-size: 0.7em;
    }
    
    .player-name-marker {
        font-size: 0.65em;
    }
    
    .field-container {
        max-width: 100%;
    }
    
    .soccer-field {
        aspect-ratio: 3/4; /* Mais vertical em mobile */
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .section {
        padding: 15px;
    }
    
    .team-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .field-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .field-controls button {
        width: 100%;
    }
    
    .stars-input {
        justify-content: center;
    }
    
    .star {
        font-size: 1.8rem;
    }
    
    .player-marker {
        width: 30px;
        height: 30px;
    }
    
    .player-name-marker {
        font-size: 0.6em;
        padding: 1px 4px;
    }
}

/* Estilos para a seção de goleiros manuais */
.manual-goalkeepers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.goalkeeper-select {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.goalkeeper-select select {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
}

.goalkeeper-select label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark);
}



@media (max-width: 768px) {
    .manual-goalkeepers {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}
