* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', 'Courier New', monospace;
    background: #0a0e1a;
    color: #00ffff;
    overflow: hidden;
    position: relative;

    display: flex;
    justify-content: center;
    align-items: center;

    min-height: 100vh;

    overflow: hidden;
}

/* Scanline effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 2px);
    pointer-events: none;
    z-index: 1000;
}

/* Grid background */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

#gameCanvas {
    position: relative;

    left: auto;
    top: auto;

    transform: none;

    width: min(95vw, 1000px);

    aspect-ratio: 1000/600;

}

.screen-pulse {
    animation: pulse 500ms ease-out;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.3), inset 0 0 20px rgba(0, 255, 255, 0.1);
    }

    50% {
        box-shadow: 0 0 40px rgba(0, 255, 255, 0.6), inset 0 0 40px rgba(0, 255, 255, 0.3);
    }
}

#hud {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1000px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    font-size: 16px;
    text-shadow: 0 0 10px currentColor;
}

.hud-item {
    background: rgba(10, 14, 26, 0.8);
    padding: 10px 20px;
    border: 2px solid rgba(0, 255, 255, 0.5);
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.health-bar {
    display: flex;
    gap: 5px;
}

.health-pip {
    width: 20px;
    height: 20px;
    background: #ff00ff;
    border: 2px solid #ff00ff;
    box-shadow: 0 0 10px #ff00ff;
    border-radius: 3px;
}

.health-pip.empty {
    background: rgba(255, 0, 255, 0.2);
    box-shadow: none;
}

.combo-display {
    color: #ffff00;
    font-weight: bold;
    font-size: 24px;
}

.combo-milestone {
    animation: comboFlash 0.5s ease-out;
}

@keyframes comboFlash {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
        color: #00ff00;
    }
}

#menu,
#gameOver,
#pauseMenu,
#countdown {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 26, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    text-align: center;
}

.hidden {
    display: none !important;
}

h1 {
    font-size: 72px;
    font-weight: 900;
    margin-bottom: 20px;
    text-shadow:
        0 0 20px #00ffff,
        0 0 40px #ff00ff,
        0 0 60px #00ffff;
    letter-spacing: 5px;
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {

    0%,
    100% {
        text-shadow: 0 0 20px #00ffff, 0 0 40px #ff00ff, 0 0 60px #00ffff;
    }

    50% {
        text-shadow: 0 0 30px #ff00ff, 0 0 60px #00ffff, 0 0 90px #ff00ff;
    }
}

.instructions {
    max-width: 600px;
    margin: 30px 0;
    text-align: left;
    background: rgba(0, 255, 255, 0.1);
    padding: 30px;
    border: 2px solid rgba(0, 255, 255, 0.5);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.instructions ul {
    list-style: none;
    padding: 0;
}

.instructions li {
    margin: 15px 0;
    padding-left: 30px;
    position: relative;
    color: #00ffff;
    font-size: 14px;
}

.instructions li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: #ff00ff;
}

.subtitle {
    font-size: 18px;
    color: #ff00ff;
    margin-bottom: 10px;
    text-shadow: 0 0 10px #ff00ff;
}

.prompt {
    font-size: 20px;
    color: #ffff00;
    margin-top: 30px;
    animation: blink 1.5s ease-in-out infinite;
    text-shadow: 0 0 10px #ffff00;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.stats {
    margin: 30px 0;
    font-size: 24px;
}

.stats div {
    margin: 15px 0;
}

.stat-label {
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}

.stat-value {
    color: #ffff00;
    font-weight: bold;
    font-size: 32px;
    text-shadow: 0 0 15px #ffff00;
}

#countdownNumber {
    font-size: 120px;
    font-weight: 900;
    color: #00ff00;
    text-shadow: 0 0 30px #00ff00, 0 0 60px #00ff00;
    animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.difficulty-indicator {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(10, 14, 26, 0.8);
    padding: 10px 20px;
    border: 2px solid rgba(255, 0, 255, 0.5);
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff;
    z-index: 10;
}

#mobileControls {
    display: none;
}

#hud {

    position: fixed;

    top: 10px;

    left: 50%;

    transform: translateX(-50%);

    width: min(95vw, 1000px);

    display: flex;

    justify-content: space-between;

    flex-wrap: wrap;

    gap: 10px;

    z-index: 100;

}

.hud-item {

    flex: 1;

    min-width: 120px;

    text-align: center;

}

/* Mobile Start Button Effect */
#startPrompt {
    display: inline-block;
    margin-top: 10px;
    transition: .2s;
    user-select: none;
}


@media (max-width:768px) {

    #startPrompt {

        cursor: pointer;

        padding: 18px 40px;
        margin-bottom: 10px;

        border: 2px solid #ffff00;

        border-radius: 12px;

        background: rgba(255, 255, 0, .08);

        box-shadow:
            0 0 20px rgba(255, 255, 0, .35),
            inset 0 0 15px rgba(255, 255, 0, .15);

    }

    #startPrompt:active {

        transform: scale(.95);

        box-shadow:
            0 0 35px rgba(255, 255, 0, .7),
            inset 0 0 25px rgba(255, 255, 0, .3);

    }

    h1 {
        font-size: 40px;
    }

    .subtitle {
        font-size: 14px;
    }

    .instructions {

        width: 90%;

        padding: 20px;

    }

    .instructions li {

        font-size: 13px;

    }

    .prompt {

        font-size: 18px;

    }

    .difficulty-indicator {

        right: 10px;
        top: 130px;

        font-size: 12px;

        padding: 8px 14px;

    }

    #countdownNumber {

        font-size: 80px;

    }


    #hud {
        top: 8px;
        width: 95%;
        gap: 6px;
    }

    .hud-item {
        min-width: 90px;
        padding: 8px;
        font-size: 12px;
    }

    .health-pip {
        width: 14px;
        height: 14px;
    }

    #score,
    #combo,
    #maxCombo {
        font-size: 18px !important;
    }

    #mobileControls {

        position: fixed;

        bottom: 40px;
        left: 50%;
        transform: translateX(-50%);

        display: none;
        flex-direction: column;
        align-items: center;
        gap: 12px;

        z-index: 500;
    }

    .bottom-row {
        display: flex;
        gap: 12px;
    }

    .mobile-btn {

        width: 70px;
        height: 70px;

        border: none;
        border-radius: 15px;

        background: #111;

        color: #00ffff;

        font-size: 30px;

        font-family: Orbitron;

        border: 2px solid cyan;

        box-shadow: 0 0 15px cyan;

        user-select: none;

        touch-action: manipulation;
    }

    .mobile-btn:active {

        background: #00ffff;
        color: black;

        transform: scale(.95);

    }

}


#menu,
#gameOver,
#pauseMenu {

    overflow-y: auto;

    padding: 20px;

}