html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
}

body {
    padding: 20px;
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.game-container {
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

h1 {
    margin: 0 0 20px 0;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    color: #fff;
}

.score-board {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    font-size: 1.2em;
}

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

.player-score span:first-child {
    font-weight: bold;
    color: #FFD700;
}

.player-score span:last-child {
    font-size: 2em;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

#gameCanvas {
    border: 3px solid #FFD700;
    background: #000;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
    margin: 20px 0;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.game-controls {
    margin: 15px 0;
}

.pause-btn {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000;
    border: none;
    padding: 12px 24px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
    min-width: 100px;
}

.pause-btn:hover {
    background: linear-gradient(45deg, #FFA500, #FFD700);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 215, 0, 0.5);
}

.pause-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.controls {
    margin-top: 20px;
    font-size: 0.9em;
    line-height: 1.4;
}

.controls p {
    margin: 5px 0;
}

.controls strong {
    color: #FFD700;
}

.game-status {
    margin-top: 15px;
    font-size: 1.1em;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

@media (max-width: 900px) {
    #gameCanvas {
        width: 90vw;
        height: 45vw;
        max-width: 800px;
        max-height: 400px;
    }
    
    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .score-board {
        font-size: 1em;
    }
    
    .controls {
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    #gameCanvas {
        width: 95vw;
        height: 47.5vw;
    }
    
    body {
        padding: 5px;
    }
    
    h1 {
        font-size: 1.5em;
        margin: 0 0 15px 0;
    }
    
    .score-board {
        font-size: 0.9em;
        margin-bottom: 15px;
    }
    
    .controls {
        font-size: 0.8em;
    }
    
    .game-container {
        padding: 15px;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    body {
        padding: 5px;
    }
    
    h1 {
        font-size: 1.5em;
        margin: 0 0 10px 0;
    }
    
    .score-board {
        margin-bottom: 10px;
    }
    
    .controls {
        font-size: 0.7em;
        margin-top: 10px;
    }
    
    .game-container {
        padding: 10px;
    }
    
    #gameCanvas {
        width: 85vw;
        height: 42.5vw;
        max-height: 300px;
    }
}

/* Winner Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    border: 3px solid #FFD700;
    min-width: 300px;
}

.modal-content h2 {
    margin: 0 0 30px 0;
    font-size: 2.5em;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: winnerGlow 2s ease-in-out infinite alternate;
}

@keyframes winnerGlow {
    from {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 10px #FFD700;
    }
    to {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 20px #FFD700, 0 0 30px #FFD700;
    }
}

.play-again-btn {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.play-again-btn:hover {
    background: linear-gradient(45deg, #FFA500, #FFD700);
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(255, 215, 0, 0.5);
}

.play-again-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.3);
}

@media (max-width: 600px) {
    .modal-content {
        padding: 30px 20px;
        min-width: 250px;
        margin: 0 20px;
    }
    
    .modal-content h2 {
        font-size: 2em;
    }
    
    .play-again-btn {
        padding: 12px 25px;
        font-size: 1.1em;
    }
}