/* Reset all margins, paddings, and box-sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: black;
    text-align: center;
}

body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: "Exo", monospace;
    animation: flicker 0.2s infinite;
    image-rendering: pixelated;
    /* Pixelated rendering */
}

html, body {
    overflow: hidden;
}

/* Body styling to mimic a CRT terminal */
main {
    max-width: 95%;
    margin: 0 auto;
    display: grid;
    color: #00FF00;
    text-shadow: 0 0 5px #00FF00, 0 0 10px #00FF00;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 30px;
    padding-bottom: 58px;
}


/* Flicker animation for a subtle CRT effect */
@keyframes flicker {
    0%, 50% {
        opacity: 1;
    }

    50% {
        opacity: 0.98;
        /* Slight dimming */
    }
}

/* Adding horizontal scan lines */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Avoid blocking interactions */
    background: repeating-linear-gradient(to bottom,
            rgba(0, 255, 0, 0.03) 0%,
            rgba(0, 255, 0, 0.03) 1%,
            transparent 1%,
            transparent 2%);
    z-index: 1;
    /* Ensure it overlays all elements */
}

.title {
    font-size: 3.5rem;
}

.choices {
    height: 130px;
    display: flex;
    justify-content: center;
    gap: 1%;
}

.choices img {
    width: 100%;
    max-width: 130px;
    cursor: pointer;
    transition: transform 0.5s;
    image-rendering: initial;
}

img:hover {
    transform: scale(1.1);
    /* Slight zoom effect on hover */
}

#updates {
    animation: fadeInOut 3.5s ease-in-out infinite;
    font-size: 1.9rem;
    font-size: clamp(1.9rem, 1.221705426356589rem + 0.18087855297157623vw, 4rem);
    font-weight: 200;
}

/* Fade-in animation (Choose your sign to start) */
@keyframes fadeInText {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

/* Initial prompt and game updates */
.fade-in-message {
    opacity: 0;
    animation: fadeInText 0.25s ease-in-out forwards, glowEffect 1.5s ease-in-out infinite alternate;
}

#playAgainBtn,
#playAgainBtn:after {
    width: 190px;
    height: 65px;
    background: linear-gradient(45deg, transparent 5%, #175c17 5%);
    border: 0;
    color: #00FF00;
    letter-spacing: 3px;
    box-shadow: 6px 0px 0px #00FF00;
    outline: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    cursor: pointer;
    font-weight: lighter;
    font-size: 1.2rem;
}

#playAgainBtn:after {
    --slice-0: inset(50% 50% 50% 50%);
    --slice-1: inset(80% -6px 0 0);
    --slice-2: inset(50% -6px 30% 0);
    --slice-3: inset(10% -6px 85% 0);
    --slice-4: inset(40% -6px 43% 0);
    --slice-5: inset(80% -6px 5% 0);
    content: 'PLAY AGAIN';
    display: flex;
    position: absolute;
    background: linear-gradient(45deg, transparent 3%, #00FF00 3%, #00FF00 5%, #175c17 5%);
    text-shadow: -3px -3px 0px #00FF00, 3px 3px 0px #00FF00;
    clip-path: var(--slice-0);
}

#playAgainBtn:hover:after {
    animation: 1s glitch;
    animation-timing-function: steps(2, end);
}

/* Play again button glitch animation */
@keyframes glitch {
    0% {
        clip-path: var(--slice-1);
        transform: translate(-20px, -10px);
    }

    10% {
        clip-path: var(--slice-3);
        transform: translate(10px, 10px);
    }

    20% {
        clip-path: var(--slice-1);
        transform: translate(-10px, 10px);
    }

    30% {
        clip-path: var(--slice-3);
        transform: translate(0px, 5px);
    }

    40% {
        clip-path: var(--slice-2);
        transform: translate(-5px, 0px);
    }

    50% {
        clip-path: var(--slice-3);
        transform: translate(5px, 0px);
    }

    60% {
        clip-path: var(--slice-4);
        transform: translate(5px, 10px);
    }

    70% {
        clip-path: var(--slice-2);
        transform: translate(-10px, 10px);
    }

    80% {
        clip-path: var(--slice-5);
        transform: translate(20px, -10px);
    }

    90% {
        clip-path: var(--slice-1);
        transform: translate(-10px, 0px);
    }

    100% {
        clip-path: var(--slice-1);
        transform: translate(0);
    }
}

.scores h2 {
    font-size: 2.5rem;
    font-size: clamp(2.5rem, 2.0155038759689923rem + 0.12919896640826875vw, 4rem);
}

.scores {
    font-size: 1.5rem;
    font-size: clamp(1.5rem, 1.0155038759689923rem + 0.12919896640826875vw, 3rem);
}

.scores #firstWins {
    letter-spacing: 3px;
    margin-bottom: 12px;
}

.footer {
    color: #00FF00;
    padding: 10px;
    border-top: 2px solid #00FF00;
    width: 100%;
    text-shadow: 0 0 5px #00FF00, 0 0 10px #00FF00;
    font-size: 1rem;
    font-size: clamp(1rem, 0.9149214659685864rem + 0.34904013961605584vw, 1.25rem);
    position: fixed;
    bottom: 0;
}

/* Small Devices */
@media (max-width: 640px) {
    main {
        padding-bottom: 43.2px;
        gap: 0px;
        min-height: 100dvh;
        /* More consistent height on mobile */
    }

    .title {
        font-size: 2.5rem;
    }

    #updates {
        height: 80px;
    }

    .scores h2 {
        font-size: 2rem;
    }

    .scores {
        font-size: 1.5;
        margin-bottom: 0px;
    }

    .choices img {
        max-width: 100px;
    }
}