:root {
    --primary-red: #ff3e3e;
    --primary-blue: #00d2ff;
    --primary-bg: #1a1a1a;
    --accent-yellow: #fffa65;
    --death-glow: rgba(255, 62, 62, 0.4);
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--primary-bg);
    font-family: 'Fredoka', sans-serif;
    user-select: none;
}

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

canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

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

#level-indicator,
#death-counter {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 10px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    font-size: 1.2rem;
    font-weight: 700;
}

#level-indicator {
    border-left: 5px solid var(--primary-red);
}

#death-counter {
    border-right: 5px solid var(--primary-blue);
}

#level-val {
    color: var(--primary-red);
}

#death-val {
    color: var(--primary-blue);
}

/* MENU OVERLAYS */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.menu-box {
    text-align: center;
    background: #fff;
    padding: 60px;
    border-radius: 40px;
    border: 6px solid #333;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 50px rgba(255, 62, 62, 0.2);
}

.logo {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.1);
    }
}

.logo-text {
    font-family: 'Oswald', sans-serif;
    font-size: 4rem;
    color: #2c3e50;
    font-weight: 900;
    margin-bottom: 10px;
}

.logo-text span {
    color: var(--primary-red);
}

.controls-guide {
    background: #f1f2f6;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 30px;
    font-size: 0.9rem;
    color: #555;
    font-weight: bold;
}

button {
    background: var(--primary-bg);
    color: white;
    font-size: 2rem;
    font-weight: 900;
    padding: 20px 60px;
    border-radius: 20px;
    box-shadow: 0 8px 0 #000;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    transform: translateY(-5px);
    background: #333;
    box-shadow: 0 12px 0 #000;
}

button:active {
    transform: translateY(2px);
    box-shadow: 0 4px 0 #000;
}

.game-over-title {
    font-size: 4rem;
    color: var(--primary-red);
    font-weight: 900;
}

.victory-title {
    font-size: 4rem;
    color: #2ecc71;
    font-weight: 900;
}

.final-stats {
    margin: 30px 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #555;
}

.hidden {
    display: none !important;
}

/* Effects */
.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}