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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 30px;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
}

h3 {
    color: #667eea;
    margin-bottom: 12px;
    font-size: 1.3em;
}

.section {
    margin-bottom: 30px;
}

.hidden {
    display: none;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
    font-size: 1em;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.player-input-group {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 20px;
}

.team-config-row {
    margin-bottom: 8px;
}

.team-count-group {
    max-width: 220px;
}


.player-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.player-inline-edit {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.player-inline-edit input {
    padding: 8px 10px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 0.95em;
    width: auto;
    flex: 1;
    min-width: 80px;
}

.players-list {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.overall-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.overall-stats-results {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.stat-chip {
    display: inline-block;
    background: #e9ecff;
    color: #334155;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.95em;
}

.stat-chip strong {
    color: #1e293b;
}

.empty-message {
    color: #999;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid #667eea;
}

.player-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.power-badge {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9em;
}

.section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    align-items: center;
}

.teams-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.team-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.team-card h3 {
    font-size: 1.4em;
    margin-bottom: 12px;
}

.team-card p {
    font-size: 1em;
    margin: 8px 0;
    color: #333;
}

.power-total {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
}

.team-players {
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.team-player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.95em;
}

.player-power {
    background: rgba(102, 126, 234, 0.2);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    color: #667eea;
}

.footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    text-align: center;
    color: #666;
}

.footer p {
    margin: 5px 0;
    font-size: 0.95em;
}

.footer strong {
    color: #667eea;
    font-size: 1.1em;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .player-input-group {
        grid-template-columns: 1fr;
    }
    
    .teams-container {
        grid-template-columns: 1fr;
    }
}
