body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    background: #111;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: sans-serif;
}

.wrapper {
    position: relative;
    width: 600px;
    height: 100px;
}

.letter {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 64px;
    /* was 48px */
    font-weight: 900;
    /* boldest weight */
    color: rgb(255, 0, 0);
    text-shadow:
        0 0 5px #000000,
        0 0 10px #000000,
        0 0 15px rgb(0, 0, 0);

}


/* Static Positions */
.G1 {
    left: 0%;
}

.I {
    left: 16.6%;
}

.N {
    left: 33.2%;
}

.G2 {
    left: 49.8%;
}

.E {
    left: 66.4%;
}

.R {
    left: 83%;
}

/* ----------- ANIMATION STATES ----------- */
.swap-forward .G1 {
    animation: swapG1Arc 2s forwards;
}

.swap-forward .N {
    animation: swapNArc 2s forwards;
}

.swap-backward .G1 {
    animation: swapG1ArcReverse 2s forwards;
}

.swap-backward .N {
    animation: swapNArcReverse 2s forwards;
}

.swap-style-slide .G1 {
    animation: swapG1Slide 2s forwards;
}

.swap-style-slide .N {
    animation: swapNSlide 2s forwards;
}

.swap-style-bounce .G1 {
    animation: swapG1Bounce 3s forwards;
}

.swap-style-bounce .N {
    animation: swapNBounce 3s forwards;
}

.bg-active {
    background: url('https://uginger.com/brain-big-brain.gif') no-repeat center center fixed;
    background-size: cover;
}


/* ----------- ARC STYLE (Curved Path + Rotate) ----------- */
@keyframes swapG1Arc {
    0% {
        left: 0%;
        top: 50%;
        transform: translateY(-50%) rotate(0deg);
    }

    50% {
        left: 16.6%;
        top: 10%;
        transform: translateY(-50%) rotate(180deg);
    }

    100% {
        left: 33.2%;
        top: 50%;
        transform: translateY(-50%) rotate(360deg);
    }
}

@keyframes swapNArc {
    0% {
        left: 33.2%;
        top: 50%;
        transform: translateY(-50%) rotate(0deg);
    }

    50% {
        left: 16.6%;
        top: 90%;
        transform: translateY(-50%) rotate(-180deg);
    }

    100% {
        left: 0%;
        top: 50%;
        transform: translateY(-50%) rotate(-360deg);
    }
}

@keyframes swapG1ArcReverse {
    0% {
        left: 33.2%;
        top: 50%;
        transform: translateY(-50%) rotate(0deg);
    }

    50% {
        left: 16.6%;
        top: 90%;
        transform: translateY(-50%) rotate(-180deg);
    }

    100% {
        left: 0%;
        top: 50%;
        transform: translateY(-50%) rotate(-360deg);
    }
}

@keyframes swapNArcReverse {
    0% {
        left: 0%;
        top: 50%;
        transform: translateY(-50%) rotate(0deg);
    }

    50% {
        left: 16.6%;
        top: 10%;
        transform: translateY(-50%) rotate(180deg);
    }

    100% {
        left: 33.2%;
        top: 50%;
        transform: translateY(-50%) rotate(360deg);
    }
}

/* ----------- SLIDE STYLE (Linear Horizontal) ----------- */
@keyframes swapG1Slide {
    0% {
        left: 0%;
        top: 50%;
    }

    100% {
        left: 33.2%;
        top: 50%;
    }
}

@keyframes swapNSlide {
    0% {
        left: 33.2%;
        top: 50%;
    }

    100% {
        left: 0%;
        top: 50%;
    }
}

/* ----------- BOUNCE STYLE (Vertical Bounce Motion) ----------- */
@keyframes swapG1Bounce {
    0% {
        left: 0%;
        top: 50%;
    }

    30% {
        left: 15%;
        top: 40%;
    }

    60% {
        left: 25%;
        top: 60%;
    }

    100% {
        left: 33.2%;
        top: 50%;
    }
}

@keyframes swapNBounce {
    0% {
        left: 33.2%;
        top: 50%;
    }

    30% {
        left: 20%;
        top: 60%;
    }

    60% {
        left: 5%;
        top: 40%;
    }

    100% {
        left: 0%;
        top: 50%;
    }
}


/* Overlay START styles */
#overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

#startBtn {
    font-size: 2rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    background: #00ffae;
    color: #111;
    cursor: pointer;
    box-shadow: 0 0 20px #00ffae;
    transition: transform 0.2s ease;
}

#startBtn:hover {
    transform: scale(1.05);
}