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

body {
    font-family: 'Arial', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.scoreboard {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    max-width: 900px;
    width: 100%;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #2c3e50;
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 15px;
}

.help-section {
    margin-bottom: 20px;
}

.help-btn {
    background: #666;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 10px;
}

.help-btn:hover {
    background: #555;
}

.help-content {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-top: 10px;
    text-align: left;
}

.help-content h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.help-content ul {
    list-style: none;
    padding: 0;
}

.help-content li {
    margin: 8px 0;
    padding: 5px 0;
    border-bottom: 1px solid #ecf0f1;
}

.help-content li:last-child {
    border-bottom: none;
}

.match-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.match-type label {
    display: block;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 14px;
}

.tournament input, .match-type select {
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.players-section {
    margin-bottom: 30px;
}

.players-section h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.player-name label {
    display: block;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
    text-align: center;
}

.player-names {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.player-name input {
    width: 100%;
    padding: 15px;
    border: 2px solid #3498db;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    background: #f8f9fa;
}

.score-display {
    margin-bottom: 30px;
}

.sets-section {
    margin-bottom: 25px;
}

.sets-header {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.sets-explanation {
    text-align: center;
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 15px;
    font-style: italic;
}

.sets-grid {
    display: grid;
    grid-template-columns: 60px 1fr 1fr;
    gap: 10px;
    align-items: center;
}

.set-numbers {
    display: grid;
    grid-template-rows: repeat(5, 1fr);
    gap: 5px;
}

.set-numbers div {
    background: #34495e;
    color: white;
    padding: 8px;
    text-align: center;
    border-radius: 5px;
    font-weight: bold;
}

.player-sets {
    display: grid;
    grid-template-rows: repeat(5, 1fr);
    gap: 5px;
}

.set-score {
    background: #ecf0f1;
    padding: 8px;
    text-align: center;
    border-radius: 5px;
    font-weight: bold;
    font-size: 16px;
    border: 2px solid transparent;
}

.set-score.won {
    background: #2ecc71;
    color: white;
    border-color: #27ae60;
}

.current-score {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.score-label {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.score-explanation {
    text-align: center;
    font-size: 11px;
    color: #7f8c8d;
    margin-bottom: 10px;
    font-style: italic;
}

.games-display, .points-display {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
}

.game-score, .point-score {
    background: #3498db;
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: 10px;
    font-size: 2.5em;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.point-score {
    background: #e74c3c;
}

.server-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.server-label {
    font-weight: bold;
    color: #333;
}

.server-display {
    color: #333;
    font-weight: bold;
    font-size: 16px;
}

.tiebreak-indicator {
    text-align: center;
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: bold;
}

.controls {
    margin-bottom: 20px;
}







.player-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.player-control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.player-label {
    font-weight: bold;
    color: #2c3e50;
    font-size: 16px;
}

.point-btn {
    background: #333;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    width: 120px;
}

.point-btn:hover {
    background: #555;
}

.undo-btn {
    background: #666;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    width: 120px;
}

.undo-btn:hover {
    background: #777;
}

.match-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.control-btn {
    background: #666;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.control-btn:hover {
    background: #777;
}

.match-status {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #e74c3c;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e74c3c;
}

.match-status.winner {
    color: #27ae60;
    border-color: #27ae60;
    background: #d5f4e6;
}

@media (max-width: 768px) {
    .scoreboard {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .current-score {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .player-controls {
        grid-template-columns: 1fr;
    }
    
    .match-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .game-score, .point-score {
        font-size: 2em;
        padding: 15px;
    }
}