:root {
    --bg-dark: #050505;
    --neon-white: #ffffff;
    --neon-red: #ff3131;
    --neon-glow-red: rgba(255, 49, 49, 0.6);
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    background: var(--bg-dark);
    color: var(--neon-white);
    font-family: var(--font-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #111 0%, #050505 100%);
}

canvas {
    display: block;
}

.overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.1s ease;
    z-index: 10;
    width: 100%;
}

.overlay.active {
    visibility: visible;
    opacity: 1;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 4px;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.blink {
    animation: blink 1s infinite alternate;
    font-weight: 700;
    letter-spacing: 2px;
    opacity: 0.8;
}

@keyframes blink {
    from {
        opacity: 0.2;
    }

    to {
        opacity: 1;
    }
}

#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 5;
}

#current-score {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    pointer-events: auto;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.icon-btn:hover {
    opacity: 1;
}

.icon-btn.muted {
    color: var(--neon-red);
    opacity: 0.8;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.label {
    font-size: 0.75rem;
    color: #555;
    letter-spacing: 2px;
}

.value {
    font-size: 2.5rem;
    font-weight: 700;
}

#restart-btn {
    background: white;
    color: black;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

#restart-btn:active {
    transform: scale(0.95);
}

/* Shake Animation */
.shake {
    animation: shake 0.3s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-2px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(4px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-6px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(6px, 0, 0);
    }
}