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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameContainer {
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

/* Start Screen */
#startScreen {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#startScreen h1 {
    font-size: 3rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #fff, #a8e6cf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.control-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.control-group label {
    font-weight: bold;
    min-width: 80px;
}

select {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

select:hover {
    background: white;
    transform: translateY(-2px);
}

#startButton {
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

#startButton:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

.instructions {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    font-size: 16px;
    line-height: 1.6;
}

/* Game Screen */
#gameScreen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.hidden {
    display: none !important;
}

/* HUD */
#hud {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 600px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
}

#leftHud, #rightHud {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#rightHud {
    text-align: right;
}

#targetWord {
    color: #ffeb3b;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Audio Controls */
#audioControls {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

#repeatButton {
    background: #ff9800;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(255, 152, 0, 0.4);
}

#repeatButton:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.6);
}

.audio-control {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.audio-control label {
    min-width: 50px;
    font-weight: bold;
}

.audio-control select {
    padding: 5px 10px;
    font-size: 14px;
}

.audio-control input[type="range"] {
    width: 80px;
}

.audio-control span {
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

/* Game Canvas */
#gameCanvas {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: #000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    min-width: 300px;
}

.modal-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#finalScore {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #ffeb3b;
}

#playAgainButton {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

#playAgainButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

.pulse {
    animation: pulse 0.5s ease-in-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    #gameContainer {
        padding: 10px;
    }
    
    #startScreen h1 {
        font-size: 2.5rem;
    }
    
    #audioControls {
        flex-direction: column;
        gap: 10px;
    }
    
    .audio-control {
        justify-content: space-between;
        width: 100%;
        max-width: 250px;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
        max-width: 600px;
    }
    
    #hud {
        font-size: 16px;
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    #startScreen h1 {
        font-size: 2rem;
    }
    
    .controls {
        gap: 15px;
    }
    
    .control-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .control-group label {
        min-width: auto;
    }
}