/* ── Dragan: Space Defender ── Styles ── */

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

body {
    background: #020010;
    color: #fff;
    font-family: 'Rajdhani', Arial, sans-serif;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ── Game Container ── */
#game-container {
    position: relative;
    width: 800px;
    height: 600px;
    background: #000;
    overflow: hidden;
    border-radius: 8px;
    box-shadow:
        0 0 40px rgba(0, 229, 255, 0.15),
        0 0 120px rgba(100, 0, 255, 0.1),
        inset 0 0 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 229, 255, 0.1);
}

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

/* ── UI Overlay ── */
#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* ── HUD ── */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    pointer-events: all;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.hud-label {
    font-family: 'Orbitron', monospace;
    font-size: 10px;
    letter-spacing: 3px;
    color: rgba(0, 229, 255, 0.5);
    font-weight: 400;
}

.hud-value {
    font-family: 'Orbitron', monospace;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.lives-display .hud-value {
    color: #ff1744;
    text-shadow: 0 0 10px rgba(255, 23, 68, 0.5);
}

/* ── Screen Overlays ── */
#start-screen,
#game-over-screen,
#pause-screen {
    position: relative;
    background: rgba(2, 0, 16, 0.92);
    padding: 40px 50px;
    border-radius: 16px;
    text-align: center;
    pointer-events: all;
    border: 1px solid rgba(0, 229, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

.screen-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(0, 229, 255, 0.06) 0%, transparent 60%);
    pointer-events: none;
    animation: pulseGlow 3s ease-in-out infinite;
}

.screen-glow.red {
    background: radial-gradient(circle at center, rgba(255, 23, 68, 0.08) 0%, transparent 60%);
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

#start-screen h1,
#game-over-screen h1,
#pause-screen h1 {
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    font-size: 42px;
    letter-spacing: 8px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #00e5ff 0%, #d500f9 50%, #ffea00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.4));
    animation: titleShimmer 4s ease-in-out infinite;
}

@keyframes titleShimmer {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.4)); }
    50% { filter: drop-shadow(0 0 30px rgba(213, 0, 249, 0.5)); }
}

#game-over-screen h1 {
    background: linear-gradient(135deg, #ff1744, #ff6d00, #ffea00);
    -webkit-background-clip: text;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(255, 23, 68, 0.4));
}

.subtitle {
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    letter-spacing: 12px;
    color: rgba(0, 229, 255, 0.5);
    font-weight: 400;
    margin-bottom: 28px;
}

.controls-hint {
    margin-bottom: 24px;
    padding: 14px 20px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.controls-hint p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.8;
    letter-spacing: 1px;
}

.final-label {
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    letter-spacing: 5px;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 16px;
}

.final-score-value {
    font-family: 'Orbitron', monospace;
    font-size: 48px;
    font-weight: 900;
    color: #ffea00;
    text-shadow: 0 0 30px rgba(255, 234, 0, 0.4);
    margin-bottom: 8px;
}

/* ── Buttons ── */
button {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 4px;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(213, 0, 249, 0.15));
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: #00e5ff;
    padding: 14px 36px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.1), transparent);
    transition: left 0.5s;
}

button:hover {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.25), rgba(213, 0, 249, 0.25));
    border-color: rgba(0, 229, 255, 0.6);
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.2), inset 0 0 25px rgba(0, 229, 255, 0.05);
    transform: translateY(-2px);
    color: #fff;
}

button:hover::before {
    left: 100%;
}

button:active {
    transform: translateY(0);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.15);
}

#restartButton {
    background: linear-gradient(135deg, rgba(255, 23, 68, 0.15), rgba(255, 109, 0, 0.15));
    border-color: rgba(255, 23, 68, 0.3);
    color: #ff1744;
}

#restartButton:hover {
    background: linear-gradient(135deg, rgba(255, 23, 68, 0.25), rgba(255, 109, 0, 0.25));
    border-color: rgba(255, 23, 68, 0.6);
    box-shadow: 0 0 25px rgba(255, 23, 68, 0.2);
    color: #fff;
}

/* ── Hide screens by default ── */
#game-over-screen,
#pause-screen {
    display: none;
}