/* ============================================================
   style.css — Iron Man MK-II Web Game
   Premium dark theme with glassmorphism HUD
   ============================================================ */

/* ---- Google Font import (Orbitron — futuristic tech) ---- */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&display=swap');

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0a14;
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

/* ---- Canvas ---- */
#gameCanvas {
    display: block;
    width: 100vw;
    height: 100vh;
    cursor: crosshair;
}

/* ---- HUD Overlay ---- */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 10;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    transition: opacity 0.5s ease;
    opacity: 0;
}

/* ---- Glass Panel ---- */
.glass-panel {
    background: rgba(10, 10, 30, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(0, 255, 255, 0.12);
    border-radius: 12px;
    padding: 10px 18px;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 100px;
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.06),
        inset 0 0 15px rgba(0, 255, 255, 0.03);
}

.glass-panel .label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.glass-panel .value {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 12px rgba(0, 255, 255, 0.5);
    line-height: 1.1;
}

/* Score panel */
#panel-score .value {
    color: #FFD700;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}

/* Wave panel */
#panel-wave .value {
    color: #00FFFF;
    text-shadow: 0 0 12px rgba(0, 255, 255, 0.6);
}

/* High score panel */
#panel-high .value {
    font-size: 16px;
    color: rgba(255, 215, 0, 0.7);
}

/* Combo */
#combo-value {
    position: fixed;
    top: 75px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    font-weight: 800;
    color: #FFD700;
    text-shadow: 0 0 18px rgba(255, 215, 0, 0.8);
    pointer-events: none;
    z-index: 11;
    transition: opacity 0.3s ease;
    opacity: 0;
    font-family: 'Orbitron', sans-serif;
}

/* ---- Health Bar ---- */
#health-bar-container {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    max-width: 320px;
    pointer-events: none;
    z-index: 10;
}

#health-bar-wrapper {
    background: rgba(10, 10, 30, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 255, 0.12);
    border-radius: 10px;
    padding: 8px 14px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.05);
}

.hp-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.hp-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

#hp-text {
    font-size: 13px;
    font-weight: 700;
    color: #00FF88;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
    font-family: 'Orbitron', sans-serif;
}

#hp-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

#hp-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #00FF88, #00cc66);
    border-radius: 4px;
    transition: width 0.25s ease, background 0.4s ease;
    position: relative;
}

#hp-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 0 4px 4px 0;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    #hud {
        padding: 8px 10px;
        gap: 6px;
    }

    .glass-panel {
        padding: 6px 10px;
        min-width: 70px;
        border-radius: 8px;
    }

    .glass-panel .label {
        font-size: 7px;
        letter-spacing: 1.5px;
    }

    .glass-panel .value {
        font-size: 16px;
    }

    #panel-high .value {
        font-size: 12px;
    }

    #gameCanvas {
        cursor: default;
    }

    #health-bar-container {
        bottom: 80px;
        left: 10px;
        right: auto;
        max-width: 180px;
    }
}

/* ---- Animations ---- */
@keyframes pulse-cyan {
    0%, 100% { box-shadow: 0 0 8px rgba(0, 255, 255, 0.1); }
    50% { box-shadow: 0 0 20px rgba(0, 255, 255, 0.25); }
}

.glass-panel {
    animation: pulse-cyan 4s ease-in-out infinite;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

#hud .glass-panel {
    animation: fade-in 0.6s ease forwards, pulse-cyan 4s ease-in-out infinite;
}

#hud .glass-panel:nth-child(2) { animation-delay: 0.1s, 0s; }
#hud .glass-panel:nth-child(3) { animation-delay: 0.2s, 0s; }
