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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    overflow: hidden;
    height: 100vh;
}

.game-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

#gameCanvas {
    border: 3px solid #e94560;
    border-radius: 10px;
    background: #0a0a0a;
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
    max-width: 100%;
    max-height: 70vh;
}

.hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    padding: 10px 20px;
    margin-bottom: 10px;
}

.player-health, .enemy-health {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.health-label {
    font-size: 14px;
    font-weight: bold;
    text-align: center;
}

.health-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.health-bar {
    flex: 1;
    height: 25px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.health-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

#playerHealthFill {
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    width: 100%;
}

#enemyHealthFill {
    background: linear-gradient(90deg, #f44336, #e91e63);
    width: 100%;
}

.health-text {
    font-size: 14px;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.score {
    font-size: 20px;
    font-weight: bold;
    color: #00fff5;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.level {
    font-size: 18px;
    font-weight: bold;
    color: #ffaa00;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.controls {
    margin-top: 10px;
}

.mobile-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.movement-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.vertical-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-controls button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid white;
    background: rgba(233, 69, 96, 0.8);
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.mobile-controls button:active {
    transform: scale(0.9);
    background: rgba(233, 69, 96, 1);
}

#attackBtn {
    width: 120px;
    height: 60px;
    border-radius: 30px;
    font-size: 18px;
    background: rgba(255, 193, 7, 0.8);
    border-color: #ffc107;
}

#attackBtn:active {
    background: rgba(255, 193, 7, 1);
}

.menu, .game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.menu h1, .game-over h2 {
    font-size: 3em;
    margin-bottom: 20px;
    color: #e94560;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.menu-description {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #ccc;
    text-align: center;
}

.menu button, .game-over button {
    padding: 15px 40px;
    font-size: 1.2em;
    background: #e94560;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    margin: 10px;
}

.menu button:hover, .game-over button:hover {
    background: #ff6b6b;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.5);
}

.high-score {
    margin-top: 20px;
    font-size: 1.1em;
    color: #00fff5;
}

.difficulty-selector {
    margin: 20px 0;
    text-align: center;
}

.difficulty-selector label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #00fff5;
    font-weight: bold;
}

.difficulty-selector select {
    padding: 10px 20px;
    font-size: 1em;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.difficulty-selector select:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #e94560;
}

.difficulty-selector select:focus {
    outline: none;
    border-color: #e94560;
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
}

.difficulty-selector select option {
    background: #1a1a2e;
    color: white;
}

.controls-info {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    text-align: center;
}

.controls-info h3 {
    margin-bottom: 10px;
    color: #00fff5;
}

.controls-info p {
    margin: 5px 0;
    color: #ccc;
}

.final-score {
    font-size: 1.5em;
    margin: 20px 0;
    color: #00fff5;
    font-weight: bold;
}

.game-over {
    display: none;
}

@media (max-width: 768px) {
    .hud {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .player-health, .enemy-health {
        width: 100%;
    }

    #gameCanvas {
        max-height: 60vh;
    }

    .menu h1, .game-over h2 {
        font-size: 2em;
    }
}
