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

body,
html {
    width: 100%;
    height: 100%;
    background-color: #050510;
    font-family: 'Orbitron', sans-serif;
    color: #fff;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#bgCanvas {
    z-index: 1;
}

#gameCanvas {
    z-index: 2;
}

/* Glassmorphism HUD */
#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.hud-item {
    background: rgba(10, 15, 30, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 12px;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.1);
    min-width: 120px;
}

.label {
    font-size: 0.8rem;
    color: #00ffff;
    letter-spacing: 2px;
    opacity: 0.8;
}

.value {
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 0 10px #00ffff;
}

.lives-container .label {
    color: #ff3366;
}

.lives-container .value {
    text-shadow: 0 0 10px #ff3366;
}


/* Overlays (Start & Game Over screens) */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 10, 0.85);
    backdrop-filter: blur(8px);
    z-index: 20;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.overlay.active {
    display: flex;
    opacity: 1;
}

.overlay h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #00ffff, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    letter-spacing: 5px;
}

.overlay p {
    font-size: 1.2rem;
    margin: 10px 0;
    color: #aaa;
    letter-spacing: 1px;
}

.final-score {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #00ffff;
}

.difficulty-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
}

/* Awesome glowing button */
.glow-on-hover {
    width: 220px;
    height: 60px;
    border: none;
    outline: none;
    color: #fff;
    background: #111;
    cursor: pointer;
    position: relative;
    z-index: 0;
    border-radius: 30px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-top: 30px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
    transition: transform 0.2s ease;
}

.glow-on-hover:before {
    content: '';
    background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    position: absolute;
    top: -2px;
    left: -2px;
    background-size: 400%;
    z-index: -1;
    filter: blur(5px);
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    animation: glowing 20s linear infinite;
    opacity: 1;
    transition: opacity .3s ease-in-out;
    border-radius: 30px;
}

.glow-on-hover:active {
    color: #000;
    transform: scale(0.95);
}

.glow-on-hover:active:after {
    background: transparent;
}

.glow-on-hover:hover:before {
    opacity: 1;
    filter: blur(8px);
}

.glow-on-hover:after {
    z-index: -1;
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: #151525;
    left: 0;
    top: 0;
    border-radius: 30px;
}

@keyframes glowing {
    0% {
        background-position: 0 0;
    }

    50% {
        background-position: 400% 0;
    }

    100% {
        background-position: 0 0;
    }
}

/* Links */
.back-link {
    margin-top: 20px;
    color: #00ffff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.back-link:hover {
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff;
}

/* Media Queries for small screens */
@media (max-width: 600px) {
    .overlay h1 {
        font-size: 2.5rem;
    }

    .hud-item {
        min-width: 80px;
        padding: 5px 10px;
    }

    .value {
        font-size: 1.5rem;
    }

    .glow-on-hover {
        width: 160px;
        font-size: 1rem;
        height: 50px;
    }
}