body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #0F2027;
    overflow: hidden;
    touch-action: none;
    font-family: "Futura", "Century Gothic", sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#hud-top {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 242, 254, 0.8);
    font-weight: bold;
    letter-spacing: 1px;
}

#dist-display {
    font-size: 32px;
}

#pb-container {
    font-size: 16px;
    opacity: 0.8;
    align-self: center;
}

#gauge-container {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    overflow: hidden;
    display: none;
}

#gauge-marker-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 70%;
    width: 20%;
    background: rgba(0, 255, 0, 0.3);
    border-left: 2px solid rgba(0, 255, 0, 0.5);
    border-right: 2px solid rgba(0, 255, 0, 0.5);
    z-index: 1;
}

#gauge-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ffdd00, #ff8800);
    transition: width 0.0s;
    z-index: 0;
}

#gauge-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 30px;
    color: white;
    font-size: 14px;
    text-shadow: 0 1px 2px black;
    z-index: 2;
}

#instruction-overlay {
    position: absolute;
    top: 40%;
    width: 100%;
    text-align: center;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    transition: opacity 0.5s;
    opacity: 0;
}

#instruction-overlay p {
    font-size: 24px;
    margin: 0;
    font-weight: bold;
    color: #ffd700;
}

#countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    display: none;
    background: rgba(0, 0, 0, 0.2);
}

#cnt-text {
    font-size: 120px;
    color: #fff;
    font-weight: 800;
    text-shadow: 0 0 20px rgba(0, 242, 254, 0.8);
    animation: pop 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
}

@keyframes pop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1.0);
        opacity: 0;
    }
}

#celebration-overlay {
    position: absolute;
    top: 30%;
    width: 100%;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
    transform: scale(0.8);
}

#celebration-overlay.show {
    opacity: 1;
    transform: scale(1);
    animation: celeb-pulse 1s infinite alternate;
}

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

    to {
        transform: scale(1.1);
    }
}

#celebration-overlay h1 {
    font-size: 48px;
    color: #ffdd00;
    margin: 0;
    text-shadow: 0 0 10px #ff0000;
}

#celebration-overlay p {
    font-size: 24px;
    color: white;
    margin: 10px 0;
}

#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 32, 39, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    pointer-events: auto;
    backdrop-filter: blur(5px);
}

#start-screen h1 {
    font-size: 56px;
    margin: 0;
    background: linear-gradient(to bottom, #fff, #00f2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(0, 242, 254, 0.5));
}

#start-screen p {
    font-size: 20px;
    opacity: 0.8;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}