body {
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    background: linear-gradient(135deg, #b6fcb6 0%, #7be87b 100%);
    min-height: 100vh;
    margin: 0;
    color: #222;
}

header {
    padding: 30px 0 10px 0;
    background: rgba(255,255,255,0.85);
    border-bottom: 2px solid #2e7d32;
    margin-bottom: 30px;
}

header h1 {
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    font-size: 2.2em;
    color: #1e6b22;
    letter-spacing: 2px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

header h1::before {
    content: "";
    display: inline-block;
    width: 32px;
    height: 32px;
    background: url('img/logo.png') no-repeat center center;
    background-size: contain;
}

.container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: 20px;
    gap: 30px;
}

.column {
    min-width: 180px;
    border-radius: 12px;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 2px 12px 0 rgba(30,107,34,0.08);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 18px 20px;
}

.column:first-child {
    width: 40%;
    max-width: 340px;
}

.column:last-child {
    width: 60%;
    max-width: 520px;
}

button {
    margin-top: 20px;
    padding: 12px 28px;
    font-size: 17px;
    cursor: pointer;
    background: #3ba935;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    font-weight: 600;
    letter-spacing: 1px;
    transition: background 0.2s;
}

button:hover {
    background: #1e6b22;
}

#players-list {
    text-align: left;
    margin-top: 10px;
}

#players-list div {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#players-list input[type="checkbox"] {
    width: 1.5em;
    height: 1.5em;
    accent-color: #2196f3; /* azul para coherencia con el equipo 1 */
    border-radius: 6px;
    margin-right: 8px;
    cursor: pointer;
    transition: box-shadow 0.2s;
    box-shadow: 0 0 0 2px #b6fcb6;
}

#players-list input[type="checkbox"]:focus {
    outline: 2px solid #1e6b22;
    box-shadow: 0 0 0 3px #7be87b;
}

#players-list label {
    font-size: 1.15em;
    color: #1e6b22;
    cursor: pointer;
    user-select: none;
}

.error {
    color: #c62828;
    background: #fff3f3;
    border: 1px solid #c62828;
    border-radius: 6px;
    font-weight: bold;
    margin-top: 20px;
    padding: 10px 18px;
    display: inline-block;
}

#teams h3 {
    color: #388e3c;
    margin-bottom: 6px;
    margin-top: 18px;
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
}

#teams p {
    margin: 0 0 10px 0;
    color: #222;
    font-size: 1.08em;
}

#split-button {
    margin: 0;
    margin-top: 40px;
    margin-bottom: 40px;
    position: static;
    display: block;
}

.spinner {
    border: 5px solid #e0f2e9;
    border-top: 5px solid #1e6b22;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    animation: spin 1s linear infinite;
    position: fixed;
    left: 50%;
    top: 30%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}
@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg);}
    100% { transform: translate(-50%, -50%) rotate(360deg);}
}

.football-field {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    aspect-ratio: 2 / 1;
    background: linear-gradient(135deg, #b6fcb6 0%, #7be87b 100%);
    border-radius: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    padding: 18px 0;
}

.team-row {
    display: flex;
    justify-content: space-evenly;
    align-items: flex-end;
    margin-bottom: 10px;
    margin-top: 10px;
}

.player-shirt {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 4px;
}

.shirt {
    width: 32px;
    height: 32px;
    position: relative;
    margin-bottom: 4px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.shirt::before, .shirt::after {
    content: "";
    position: absolute;
    top: 0;
    width: 12px;
    height: 14px;
    border-radius: 4px 4px 0 0;
    background: inherit;
    z-index: 1;
}

.shirt::before {
    left: -10px; /* manga izquierda */
    transform: rotate(-18deg);
}

.shirt::after {
    right: -10px; /* manga derecha */
    transform: rotate(18deg);
}

.shirt-body {
    width: 20px;
    height: 28px;
    border-radius: 6px 6px 12px 12px;
    background: inherit;
    border: 2px solid #222;
    position: absolute;
    left: 50%;
    top: 4px;
    transform: translateX(-50%);
    z-index: 2;
}

/* Camiseta azul */
.shirt.team1, .shirt.team1 .shirt-body {
    background: #2196f3;
}

/* Peto amarillo */
.shirt.team2, .shirt.team2 .shirt-body {
    background: #d5d822;
}

.player-name {
    font-size: 0.95em;
    color: #222;
    text-align: center;
    max-width: 60px;
    word-break: break-word;
}
.teams-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    margin-top: 0;
}
.teams-labels span {
    font-weight: bold;
    font-size: 1.1em;
    color: #1e6b22;
}

@media (max-width: 1100px) {
    .container {
        flex-direction: column;
        align-items: center;
        gap: 18px;
    }
    .column, .button-column {
        width: 90%;
        max-width: 400px;
        min-width: unset;
    }
    #split-button {
        margin: 24px auto;
        width: 90%;
        max-width: 350px;
    }
}

@media (max-width: 900px) {
    .container {
        flex-direction: column;
        align-items: center;
    }
    .column, .button-column {
        width: 95% !important;
        max-width: 600px;
    }
}
