* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #ffffff;
    font-family: 'Arial', sans-serif;
    color: #333;
    padding: 10px;
}
h1 {
    margin-bottom: 8px;
    font-size: clamp(1.5em, 4vw, 2.5em);
    color: #333;
}
#win-goal {
    font-size: clamp(0.9em, 2vw, 1.2em);
    color: #666;
    margin-bottom: 10px;
}
#win-goal strong {
    color: #ff6b6b;
    font-size: 1.2em;
}
#scoreboard {
    display: flex;
    gap: clamp(30px, 8vw, 100px);
    margin-bottom: 15px;
    font-size: clamp(1em, 3vw, 1.5em);
}
.score {
    padding: clamp(6px, 1.5vw, 10px) clamp(20px, 4vw, 35px);
    border-radius: 25px;
    background: #f0f0f0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: clamp(8px, 2vw, 15px);
    min-width: clamp(120px, 25vw, 180px);
    transition: transform 0.2s, box-shadow 0.2s;
}
.score.leading {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}
.score.red {
    border: 3px solid #ff6b6b;
    color: #ff6b6b;
}
.score.green {
    border: 3px solid #4ecdc4;
    color: #4ecdc4;
}
.score-label {
    font-size: 1em;
}
.score-value {
    font-size: clamp(1.3em, 4vw, 1.8em);
    font-weight: bold;
}
.score-value.animate {
    animation: scorePop 0.3s ease-out;
}
@keyframes scorePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.canvas-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    justify-content: center;
}
canvas {
    border: 3px solid #333;
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}
#controls {
    margin-top: 15px;
    display: flex;
    gap: clamp(20px, 5vw, 50px);
    text-align: center;
    flex-wrap: wrap;
    justify-content: center;
}
.player-controls {
    padding: clamp(10px, 2vw, 15px);
    border-radius: 10px;
    background: #f0f0f0;
    min-width: 140px;
}
.player-controls h3 {
    margin-bottom: 8px;
    font-size: clamp(1em, 2.5vw, 1.2em);
}
.player-controls p {
    font-size: clamp(0.8em, 2vw, 1em);
}
.player-controls.red h3 {
    color: #ff6b6b;
}
.player-controls.green h3 {
    color: #4ecdc4;
}
#game-over {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    padding: clamp(20px, 5vw, 40px);
    border-radius: 20px;
    text-align: center;
    z-index: 100;
    border: 3px solid #333;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 400px;
}
#game-over h2 {
    font-size: clamp(1.5em, 5vw, 2.5em);
    margin-bottom: 15px;
}
#game-over button {
    padding: clamp(10px, 3vw, 15px) clamp(25px, 6vw, 40px);
    font-size: clamp(1em, 3vw, 1.2em);
    background: #333;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: #ffffff;
    font-weight: bold;
    transition: transform 0.2s, background 0.2s;
}
#game-over button:hover {
    transform: scale(1.05);
    background: #555;
}

@media (max-aspect-ratio: 1/1) {
    body {
        padding: 5px;
    }
    #scoreboard {
        flex-direction: column;
        gap: 10px;
    }
    .score {
        justify-content: center;
    }
    #controls {
        flex-direction: column;
        gap: 10px;
    }
    .player-controls {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 5px;
    }
    h1 {
        margin-bottom: 5px;
    }
    #win-goal {
        margin-bottom: 8px;
    }
    #scoreboard {
        margin-bottom: 10px;
    }
    #controls {
        margin-top: 10px;
    }
}
