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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

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

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.hidden {
    display: none;
}

/* Spieler-Eingabe */
.player-input {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.player-input input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.player-input input:focus {
    outline: none;
    border-color: #3498db;
}

.player-input button {
    padding: 12px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.player-input button:hover {
    background: #2980b9;
}

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

.players-list h3 {
    margin-bottom: 15px;
    color: #555;
}

.players-list ul {
    list-style: none;
}

.players-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 5px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.remove-player {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
}

.remove-player:hover {
    background: #c0392b;
}

#start-tournament {
    width: 100%;
    padding: 15px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s;
}

#start-tournament:hover:not(:disabled) {
    background: #219a52;
}

#start-tournament:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Turnier-Bereich */
.tournament-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.info-card h3 {
    font-size: 14px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.info-card span {
    font-size: 2em;
    font-weight: bold;
}

.tournament-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tournament-controls button {
    flex: 1;
    min-width: 200px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

#generate-pairings {
    background: #3498db;
    color: white;
}

#generate-pairings:hover:not(:disabled) {
    background: #2980b9;
}

#finish-round {
    background: #e67e22;
    color: white;
}

#finish-round:hover:not(:disabled) {
    background: #d35400;
}

.tournament-controls button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Paarungen */
#pairings-section {
    margin-bottom: 30px;
}

#pairings-section h3 {
    margin-bottom: 20px;
    color: #555;
}

.pairing {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #3498db;
}

.pairing-players {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
}

.player-name {
    font-weight: bold;
    min-width: 120px;
}

.vs {
    color: #666;
    font-size: 18px;
}

.pairing-result {
    display: flex;
    gap: 10px;
}

.result-btn {
    padding: 8px 15px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.result-btn:hover {
    border-color: #3498db;
}

.result-btn.selected {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

#save-results {
    width: 100%;
    padding: 15px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
}

#save-results:hover:not(:disabled) {
    background: #219a52;
}

#save-results:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Tabelle */
#standings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#standings-table th,
#standings-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

#standings-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #555;
}

#standings-table tr:hover {
    background: #f8f9fa;
}

#standings-table tr:first-child td {
    background: #fff3cd;
    font-weight: bold;
}

/* Turnier-Ende */
#tournament-end {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border-radius: 15px;
}

#tournament-end h3 {
    font-size: 2em;
    margin-bottom: 20px;
}

#tournament-end button {
    padding: 15px 30px;
    background: white;
    color: #27ae60;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

#tournament-end button:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .tournament-controls {
        flex-direction: column;
    }
    
    .tournament-controls button {
        min-width: auto;
    }
    
    .pairing {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .pairing-players {
        flex-direction: column;
        gap: 10px;
    }
    
    #standings-table {
        font-size: 12px;
    }
    
    #standings-table th,
    #standings-table td {
        padding: 6px 2px;
    }
    
    /* Verstecke weniger wichtige Spalten auf mobilen Geräten */
    #standings-table th:nth-child(5),
    #standings-table td:nth-child(5),
    #standings-table th:nth-child(6),
    #standings-table td:nth-child(6) {
        display: none;
    }
}

/* Reset Section */
.reset-section {
    margin-top: 20px;
    text-align: center;
}

.reset-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.reset-btn:hover {
    background: #c0392b;
}
