* {
    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%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.game-container {
    position: relative;
    width: 900px;
    height: 600px;
    background: #0f0f1e;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 10;
}

.top-bar {
    padding: 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
}

.level-info {
    text-align: center;
    margin-bottom: 15px;
}

.level-label {
    font-size: 20px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5),
                 0 2px 4px rgba(0, 0, 0, 0.8);
}

.health-bars {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.player-health-container,
.boss-health-container {
    flex: 1;
}

.health-label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.health-bar {
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
}

.health-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.player-health {
    background: linear-gradient(90deg, #00ff88 0%, #00cc6a 100%);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    width: 100%;
}

.boss-health {
    background: linear-gradient(90deg, #ff4444 0%, #cc0000 100%);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
    width: 100%;
}

.health-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: healthShine 2s infinite;
}

@keyframes healthShine {
    to {
        left: 200%;
    }
}

.health-text {
    display: block;
    font-size: 11px;
    color: #fff;
    margin-top: 3px;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.game-overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, rgba(30, 30, 60, 0.9) 0%, rgba(20, 20, 40, 0.9) 100%);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#overlayTitle {
    font-size: 48px;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5),
                 0 4px 8px rgba(0, 0, 0, 0.8);
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#overlayMessage {
    font-size: 18px;
    color: #ccc;
    margin-bottom: 30px;
    line-height: 1.6;
}

.game-button {
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    pointer-events: auto;
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.game-button:active {
    transform: translateY(0);
}

.controls-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    font-size: 14px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 10;
}

/* Victory/Defeat animations */
@keyframes victory {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes defeat {
    0% { filter: brightness(1); }
    100% { filter: brightness(0.3); }
}

.victory .overlay-content {
    animation: victory 0.5s ease;
}

/* Damage flash */
@keyframes damageFlash {
    0%, 100% { background-color: rgba(255, 0, 0, 0); }
    50% { background-color: rgba(255, 0, 0, 0.3); }
}

.damage-flash {
    animation: damageFlash 0.3s;
}



