* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

#gameArea {
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    touch-action: none;
}

.hud {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 60px;
    z-index: 50;
    display: flex;
    gap: 20px;
    pointer-events: none;
}

.hud-item {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 20px;
    font-weight: bold;
    backdrop-filter: blur(10px);
}

.score-display {
    color: #4CAF50;
}

.lives-display {
    color: #ff5252;
}

.menu-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    backdrop-filter: blur(10px);
    pointer-events: auto;
}

.menu-btn span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
}

.menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.menu-overlay.active {
    display: flex;
}

.menu-title {
    color: white;
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 20px;
}

.menu-button {
    background: #2196F3;
    color: white;
    border: none;
    padding: 20px 40px;
    border-radius: 15px;
    font-size: 20px;
    cursor: pointer;
    min-width: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.menu-button:active {
    background: #1976D2;
}

.menu-button.sound {
    background: #4CAF50;
}

.menu-button.sound:active {
    background: #388E3C;
}

.menu-button.close {
    background: #f44336;
}

.menu-button.close:active {
    background: #d32f2f;
}

#character {
    position: absolute;
    width: 60px;
    height: 60px;
    transition: all 0.1s ease;
    z-index: 10;
}

#character img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#fire {
    position: absolute;
    font-size: 40px;
    pointer-events: none;
    animation: pulse 0.5s infinite;
    z-index: 5;
}

.water-drop {
    position: absolute;
    font-size: 35px;
    pointer-events: none;
    z-index: 8;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.instructions {
    text-align: center;
    color: white;
    font-size: 20px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    background: rgba(0, 0, 0, 0.7);
    padding: 30px;
    border-radius: 15px;
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    z-index: 100;
    display: none;
}

.game-over h2 {
    font-size: 40px;
    margin-bottom: 20px;
    color: #ff5252;
}

.game-over p {
    font-size: 24px;
    margin-bottom: 30px;
}

.game-over button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 20px 40px;
    border-radius: 15px;
    font-size: 22px;
    cursor: pointer;
}