@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #000;
    color: white;
    font-family: 'Press Start 2P', cursive;
    text-align: center;
    overflow: hidden;
}

.gameScreenC {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
}

.hidden {
    display: none;
}

.button {
    margin: 10px;
    padding: 10px 20px;
    background: transparent;
    color: white;
    border: 2px solid white;
    font-size: 14px;
    cursor: pointer;
    text-transform: uppercase;
    width: 133.469px;
}

.button:hover {
    background: white;
    color: black;
}

/* ButtonAnimation */

@keyframes pixelate {
    0% { transform: scale(1.02); filter: contrast(120%) brightness(110%); }
    50% { transform: scale(1.05); filter: contrast(90%) brightness(90%); } 
    100% { transform: scale(1.02); filter: contrast(120%) brightness(110%); } 
}

@keyframes scanline {
    0% { background-position: 0 0; }
    100% { background-position: 0 100px; }
}

 .button {
    animation: pixelate 0.2s infinite alternate;
    background-image: linear-gradient(
        rgba(255,255,255,0.1) 50%,
        rgba(0,0,0,0.1) 50%
    );
    background-size: 100% 4px;
    animation: scanline 0.5s linear infinite, pixelate 0.2s infinite alternate, glitchColor 0.2s infinite alternate;
}

@keyframes glitchColor {
    0% { text-shadow: -2px 0 red, 2px 0 cyan; }
    50% { text-shadow: 2px 0 red, -2px 0 cyan; }
    100% { text-shadow: -2px 0 red, 2px 0 cyan; }
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 80px);
    grid-template-rows: repeat(3, 80px);
    gap: 5px;
    margin-top: 20px;
}

.cell {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: white;
    color: black;
    cursor: pointer;
    border-radius: 5px;
}

.cell.taken {
    pointer-events: none;
}

/* MusicButton */

@keyframes dance {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-10deg) scale(1.1); }
    50% { transform: rotate(10deg) scale(1); }
    75% { transform: rotate(-5deg) scale(1.05); }
    100% { transform: rotate(0deg) scale(1); }
}

.dancing {
    animation: dance 0.5s infinite alternate ease-in-out;
}

.music-button {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s ease;
}

.music-button:hover {
    background-color: white;
}

.music-button span {
    font-size: 24px;
    color: white;
    transition: 0.3s ease;
}

.music-button:hover span {
    color: black;
}

/* WinMessageAnimation */

#win-screen {
    font-size: 36px;
    white-space: nowrap;
    opacity: 0;
}

.show-message {
    opacity: 1;
    animation: slide-in 1s forwards;
}

@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* WinnerAnimation */

@keyframes flash {
    0% { background-color: white; color: black; }
    50% { background-color: red; color: black; }
    100% { background-color: white; color: black; }
}

.winner {
    animation: flash 0.5s alternate infinite;
}

/* GameStartAnimation */

@keyframes glitch {
    0% { transform: translate(0); }
    25% { transform: translate(2px, -2px); }
    50% { transform: translate(-2px, 2px); }
    75% { transform: translate(2px, 2px); }
    100% { transform: translate(0); }
}
.glitch {
    animation: glitch 0.2s infinite;
}


/* Loading Screen Animation */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 2rem;
    font-family: 'Press Start 2P', cursive;
    animation: glitch 1s infinite alternate;
    z-index: 9999;
    transition: opacity 1s ease-in-out;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-text {
    text-shadow: 
        -2px 0 red, 
        2px 0 cyan, 
        0 -2px yellow, 
        0 2px blue;
    animation: glitchLoad 1s infinite alternate;
}

@keyframes glitchLoad {
    0% {
        transform: translate(0);
    }
    25% {
        transform: translate(2px, -2px);
    }
    50% {
        transform: translate(-2px, 2px);
    }
    75% {
        transform: translate(2px, 2px);
    }
    100% {
        transform: translate(0);
    }
}

/* Placing X n O Animations */

@keyframes placeSymbol {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.cell.placed {
    animation: placeSymbol 0.3s ease-out;
}

#difficultySelection {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

#difficultySelection.hidden {
    display: none;
}

#difficultySelection {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

/* Custom Rules */

#customRules {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

#customRules.hidden {
    display: none;
}

#customRules select {
    padding: 5px;
    font-size: 16px;
    margin: 5px;
}

#customRules {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

#customRules.hidden {
    display: none;
}

#customRules select {
    padding: 5px;
    font-size: 16px;
    margin: 5px;
}




