:root{
    font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

body{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    flex-direction: column;
    background: #3CA55C;
    background: -webkit-linear-gradient(to right, #B5AC49, #3CA55C);
    background: linear-gradient(to right, #B5AC49, #3CA55C);
}


.content {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    display: none;
}

.grid-container{
    width: 450px;
    height: 450px;
    background-color: transparent;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    display: none;
}

.square{
    background-color: transparent;
    color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
}

.square[data-index="0"]{
    border-bottom: 0;
    border-left: 0;
}

.square:nth-child(-n + 3){
    border-top: 0;
}

.square:nth-child(-n + 9){
    border-bottom: 0;
}

.square:nth-child(3n){
    border-right: 0;
}

.square {
    border: 4px solid rgba(0, 0, 0, 0.199);
}

.square + .square {
    border-left: 0;
    border-bottom: 0;
}

@keyframes down {
    0%{
        transform: scale(1.5);
    }

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

@keyframes up-down {
    0%{
        transform: scale(1);
    }

    50%{
        transform: scale(1.14);
    }

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

@keyframes popup {
    0%{
        transform: scale(0.7);
    }

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

img.X, img.O{
    height: 60%;
    width: 60%;
    animation: down 0.34s;
}

img.winX, img.winO{
    height: 65%;
    width: 65%;
    animation: up-down 2s;
    animation-iteration-count: infinite;
}

h1.title-start {
    font-size: 3rem;
}

.start-screen{
    min-height: calc(400px + 1vh);
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    background:  #0058516e;
    background: -webkit-linear-gradient(to top, #c7d82c18, #00585142);
    background: linear-gradient(to top, #c7d82c3a, #00585154);
    border-radius: 12px;
    box-shadow: 13px 13px 3px rgba(73, 73, 73, 0.301);
    padding-bottom: 75px;
    animation: popup 0.6s;
    text-align: center;
}

.modes {
    display: flex;
    justify-content: space-around   ;
    align-items: center;
    flex-direction: column;
    width: 80%;
    margin-bottom: 50px;
    height: 150px;
}

.options {
    width: 80%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 70px;
    margin-top: 30px;
}

button{
    width: 300px;
    min-width: 80px;
    height: 70px;
    background-color: rgba(0, 0, 0, 0.199);
    color: white;
    border: 3px solid white;
    border-radius: 4px;
    font-size: 1.17rem;
    transition: 0.27s;
    padding: 10px;
}

button:hover{
    transform: scale(1.03);
}

button:active{
    transform: scale(1);
}

.green{
    color: greenyellow;
}

.yellow{
    color: yellow;
}

h2.choose-text{
    color: white;
    font-size: 1.7rem;
}

.modal-container, .modal-container-AI{
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.432);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.modal-PvP, .modal-AI {
    min-height: 320px;
    left: 50%;
    top: 50%;
    height: 20%;
    width: 27%;
    background: #367248;
    background: -webkit-linear-gradient(to bottom, #3b8551, #4f754b);
    background: linear-gradient(to bottom, #3b8551, #4f754b);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    animation: popup 0.27s;
}

.modal-AI{
    min-height: 230px;
}

.modal-AI {
    align-items: center;
}

.modal-AI .close{
    align-self: flex-end;
}

.close {
    display: flex;
    justify-content: flex-end;
}

.close img {
    width: 40px;
    height: 40px;
    padding-right: 4px;
}

form {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

form h1 {
    margin-top: 0;
    color: white;
    font-size: 1.6rem;
    text-align: center;
}

form label {
    display: block;
    margin-bottom: 4px;
    color: white;
    position: absolute;
    top: 5px;
    transition: transform 150ms ease-out, font-size 150ms ease-out;;
}

form div {
    position: relative;
    width: 80%;
    margin-top: 15px;
}

input {
    background-color: transparent;
    border: none;
    border-radius: 3px;
    color: white;
    font-size: 1rem;
    min-height: 32px;
    width: 80%;
    position: relative;
}

div.p1 > input {
    border-bottom: 2px solid greenyellow;
}

div.p2 > input {
    border-bottom: 2px solid yellow;
}

input:focus {
    outline: none;
}

input.focused + label {
    transform: translateY(-140%);
    font-size: 0.75em;
}

button.submit, button.reset {
    width: 45%;
    height: 50px;
    background-color: transparent;
    border: 2px solid white;
    border-radius: 8px;
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.5s;
}

form > div::after{
    content: "";
    width: 40px;
    height: 40px;
    background-color: transparent;
    background-size: cover;
    background-position: center;
    position: absolute;
    right: 2px;
}

form > div.p1::after{
    background-image: url(../imgs/X.svg);
}

form > div.p2::after {
    background-image: url(../imgs/O.svg);
}

.submit_container {
    min-height: 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 80%;
    align-self: center;
}

div.submit_container > button > img {
    height: 25px;
    width: 25px;
    margin-bottom: 3px;
}

div.submit_container button:hover {
    transform: scale(1.05);
}

div.submit_container button:active {
    transform: scale(0.97);
}

.game-turns {
    display: none;
    margin: 0;
    width: 40%;
    min-height: 130px;
    border-radius: 7px;
    justify-content: space-around;
    align-items: center;
}

.info {
    display: flex;
    flex-direction: column;
    width: 200px;
    align-items: center;
    font-size: 1.3rem;
}

.info img {
    height: 40px;
    width: 40px;
    margin-bottom: 15px;
}

.player1.info {
    border-radius: 3px;
    padding-bottom: 5px;
    color: rgb(0, 255, 0);
    text-shadow: 0px 0px 10px rgb(31, 31, 31);
}

.player2.info {
    border-radius: 3px;
    padding-bottom: 5px;
    color: yellow;
    text-shadow: 0px 0px 10px rgb(31, 31, 31);
}

.player1-name, .player2-name{
    border-radius: 2px;
    padding-bottom: 5px;
    border-bottom: 3px solid transparent;
    transition: 0.27s;
    text-align: center;
}

.winner {
    display: none;
    flex-direction: column;
    align-items: center;
    animation: opacity 0.8s;
    min-height: 130px;
}

@keyframes opacity {
    0%{
        opacity: 0;
    }

    100%{
        opacity: 1;
    }
}

a {
    display: flex;
    justify-content: center;
    align-items: center;
}

.winner-name {
    text-shadow: 0 0 14px black;
    text-align: center;
}

.restart-btn{
    width: 100px;
    height: 50px;
    background-color: transparent;
    border: 2px solid rgb(255, 255, 255);
    color: rgb(255, 255, 255);
    border-radius: 20px;
}

.footer {
    display: none;
    justify-content: space-around;
    width: 100%;
}

.logo-container{
    align-items: center;
    color: white;
    font-size: 1.8rem;
    padding-bottom: 4px;
    display: flex;
}

.logo-container img {
    width: 80px;
    height: 80px;
}

.logo-container h1{
    margin: 0;
}

.logo-container {
    align-items: center;
    gap: 10px;
    color: rgb(36, 36, 36);
    font-size: 1.4rem;
    transition: 0.4s;
}

.logo-container div{
    transition: 0.4s;
}

.logo-container img {
    height: 40px;
    width: 40px;
    transition: 0.4s;
}

.logo-container:hover img{
    transform: rotate(360deg);
}

.logo-container:hover div{
    transform: scale(1.1);
}

.logo-container:hover{
    gap: 15px;
}

.logo-container div a:visited{
    color: rgb(36, 36, 36);
    text-decoration: none;
}

.logo-container div a:link{
    color: rgb(36, 36, 36);
    text-decoration: none;
}

.difficulty {
    display: flex;
    justify-content: space-around;
    width: 100%;
}

.difficulty button{
    width: 100px;
}

.modal-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-bottom: 30px;
    color: white;
}

img[alt ="home"]{
    transition: 0.27s;
}

img[alt="home"]:hover{
    transform: scale(1.08);
}

img[alt="home"]:active{
    transform: scale(0.99);
}

@media only screen and (min-width: 1300px) {
    .grid-container{
        width: 500px;
        height: 500px;
    }
}


@media only screen and (max-width: 1000px){
    :root{
        font-size: 12px;
    }

    .modal-PvP, .modal-AI{
        width: 40%;
    }

    .difficulty button {
        width: 60px;
    }

    .modal-content h1 {
        text-align: center;
    }
}

@media only screen and (max-width: 690px){
    .start-screen{
        width: 80%;
    }

    .options{
        width: 100%;
    }

    .grid-container{
        width: 330px;
        height: 330px;
    }
}

@media only screen and (max-width: 500px){
    .modal-PvP, .modal-AI{
        width: 72%;
    }
}

@media only screen and (max-height: 660px) {
    .grid-container{
        width: 350px;
        height: 350px;
    }
}

@media only screen and (max-height: 600px) {
    .grid-container{
        width: 330px;
        height: 330px;
    }
}

@media only screen and (max-height: 530px) {
    .grid-container{
        width: 240px;
        height: 240px;
    }

    .logo-container img {
        height: 30px;
        width: 30px;
    }

    .home {
        height: 50px;
        width: 50px;
    }

    .info img {
        height: 30px;
        width: 30px;
    }
    :root {
        font-size: 10px;
    }
}