* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Fredoka', 'Arial', sans-serif;
    background: #0a1628;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

#vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 8, 30, 0.5) 100%);
}

/* Menus */
.menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    animation: menuAppear 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.menu.hidden {
    display: none;
}

@keyframes menuAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.menu-inner {
    background: rgba(10, 25, 60, 0.92);
    padding: 45px 65px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 0 60px rgba(80, 180, 255, 0.15), 0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(92, 184, 212, 0.4);
    backdrop-filter: blur(12px);
}

.menu h1 {
    color: #7dd8f5;
    font-size: 2.8em;
    font-weight: 700;
    margin-bottom: 16px;
    text-shadow: 0 0 20px rgba(125, 216, 245, 0.4), 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.15em;
    margin: 6px 0;
}

.final-score-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1em;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.final-score-value {
    color: #FFE66D;
    font-size: 3.5em;
    font-weight: 700;
    margin: 4px 0 8px;
    text-shadow: 0 0 20px rgba(255, 230, 109, 0.4);
}

.menuButton {
    background: linear-gradient(135deg, #4FC3F7, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 16px 52px;
    font-size: 1.5em;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    border-radius: 14px;
    cursor: pointer;
    margin-top: 22px;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.35), 0 0 30px rgba(79, 195, 247, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: btnPulse 2s ease-in-out infinite;
}

@keyframes btnPulse {

    0%,
    100% {
        box-shadow: 0 6px 20px rgba(33, 150, 243, 0.35), 0 0 30px rgba(79, 195, 247, 0.15);
    }

    50% {
        box-shadow: 0 6px 25px rgba(33, 150, 243, 0.5), 0 0 50px rgba(79, 195, 247, 0.25);
    }
}

.menuButton:hover {
    transform: scale(1.08) translateY(-2px);
}

.menuButton:active {
    transform: scale(1.03);
}

.btn-text {
    position: relative;
    z-index: 2;
}

/* HUD */
#hud {
    position: absolute;
    top: 18px;
    left: 0;
    right: 0;
    z-index: 100;
    animation: hudSlideIn 0.5s ease-out forwards;
}

#hud.hidden {
    display: none;
}

@keyframes hudSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#hudTop {
    display: flex;
    justify-content: center;
    gap: 16px;
    align-items: center;
}

#scoreDisplay,
#sizeDisplay {
    background: rgba(10, 25, 60, 0.85);
    padding: 10px 22px;
    border-radius: 12px;
    color: white;
    font-size: 1.2em;
    font-weight: 600;
    border: 1.5px solid rgba(92, 184, 212, 0.35);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(8px);
}

#currentScore {
    color: #FFE66D;
    font-weight: 700;
}

#currentSize {
    color: #7dd8f5;
    font-weight: 700;
}

/* Combo */
#comboDisplay {
    background: linear-gradient(135deg, #FF6B35, #FF2D2D);
    padding: 8px 20px;
    border-radius: 12px;
    color: white;
    font-size: 1.3em;
    font-weight: 700;
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
    animation: comboPulse 0.4s ease-in-out infinite alternate;
}

#comboDisplay.hidden {
    display: none;
}

@keyframes comboPulse {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.08);
    }
}

/* Power-up indicator */
#powerupIndicator {
    position: absolute;
    top: 65px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 25, 60, 0.9);
    padding: 6px 18px;
    border-radius: 10px;
    color: white;
    font-size: 1.1em;
    font-weight: 600;
    border: 1.5px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

#powerupIndicator.hidden {
    display: none;
}

#powerupIcon {
    font-size: 1.3em;
}

/* Zone Banner */
#zoneBanner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
    pointer-events: none;
    animation: bannerFade 2.5s ease-in-out forwards;
}

#zoneBanner.hidden {
    display: none;
}

#zoneName {
    font-size: 2.2em;
    font-weight: 700;
    color: #7dd8f5;
    text-shadow: 0 0 30px rgba(125, 216, 245, 0.6), 2px 2px 6px rgba(0, 0, 0, 0.8);
    letter-spacing: 3px;
    text-transform: uppercase;
}

@keyframes bannerFade {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }

    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    75% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* Evolution Banner */
#evolutionBanner {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 250;
    pointer-events: none;
    text-align: center;
    animation: evolveFade 3s ease-in-out forwards;
}

#evolutionBanner.hidden {
    display: none;
}

#evolutionText {
    display: block;
    font-size: 3em;
    font-weight: 700;
    background: linear-gradient(135deg, #FFE66D, #FF6B35, #FFE66D);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 10px rgba(255, 200, 0, 0.6));
}

#evolutionName {
    display: block;
    font-size: 1.8em;
    font-weight: 600;
    color: white;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
    margin-top: 4px;
}

@keyframes evolveFade {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    10% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }

    20% {
        transform: translate(-50%, -50%) scale(1);
    }

    70% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* Boss Warning */
#bossWarning {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    pointer-events: none;
    animation: bossFlash 2s ease-in-out forwards;
}

#bossWarning.hidden {
    display: none;
}

#bossWarning span {
    font-size: 2em;
    font-weight: 700;
    color: #FF4444;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.6), 2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
}

@keyframes bossFlash {

    0%,
    20%,
    40%,
    60% {
        opacity: 1;
    }

    10%,
    30%,
    50% {
        opacity: 0.3;
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}