*,
*::after,
*::before {
    box-sizing: border-box;
}

:root {
    --cell-size: 100px;
    --mark-size: calc(var(--cell-size)* .9);
}

body {
    margin: 0;
    font-family: cursive;
    background-color: aliceblue;
}

.box

/* board*/
    {

    width: 100vw;
    height: 100vh;
    display: grid;
    justify-content: center;
    justify-items: center;
    align-content: center;
    align-items: center;
    grid-template-columns: repeat(3, auto);

}

.top

/*cell*/
    {
    width: var(--cell-size);
    height: var(--cell-size);
    border: 1px solid black;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;

}

/*remove border*/
.top:first-child,
.top:nth-child(2),
.top:nth-child(3) {
    border-top: none;
}

/*remove border*/
.top:last-child,
.top:nth-child(8),
.top:nth-child(7) {
    border-bottom: none;
}

/*removing left border*/
.top:nth-child(3n +1) {
    border-left: none;
}

/*removing right border*/
.top:nth-child(3n + 3) {
    border-right: none;
}

.top span {

    color: black;
}

.top.x,
.top.circle {
    cursor: not-allowed;
}

.top.x::before,
.top.x::after {
    background-color: #14751aed;
}

.top.circle::before {
    background-color: red;
}

/*hover effect */
.box.x .top:not(.x):not(.circle):hover::before,
.box.x .top:not(.x):not(.circle):hover::after,
.box.circle .top:not(.x):not(.circle):hover::before {
    background-color: lightgray;
}


/*creating x class*/
.top.x::before,
.top.x::after,
.box.x .top:not(.x):not(.circle):hover::before,
.box.x .top:not(.x):not(.circle):hover::after {
    content: '';
    position: absolute;
    width: calc(var(--mark-size)* .15);
    height: var(--mark-size);

}

/*rotaititng linies*/
.top.x::before,
.box.x .top:not(.x):not(.circle):hover::before {
    transform: rotate(45deg);
}

.top.x::after,
.box.x .top:not(.x):not(.circle):hover::after {
    transform: rotate(-45deg);
}

/*creating circle class*/
.top.circle::before,
.top.circle::after,
.box.circle .top:not(.x):not(.circle):hover::before,
.box.circle .top:not(.x):not(.circle):hover::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

/*first circle in background*/
.top.circle::before,
.box.circle .top:not(.x):not(.circle):hover::before {

    width: var(--mark-size);
    height: var(--mark-size);

}

/*2nd circle on top */
.top.circle::after,
.box.circle .top:not(.x):not(.circle):hover::after {

    width: calc(var(--mark-size) * .7);
    height: calc(var(--mark-size) * .7);
    background-color: white;
}

/*
winning message */

.winnerMessage {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, .9);
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 4em;
    flex-direction: column;
}

.data-text {
    align-items: center;
}

#select-X,
#select-C {

    font-size: 0.4em;
    background-color: white;
    border: 1px solid black;
    padding: .5em .5em;
    cursor: pointer;
    border-radius: 5%;
}

#select-X:hover {
    background-color: black;
    color: white;
    border-color: white;
}

#select-C:hover {
    background-color: black;
    color: white;
    border-color: white;
}

/*Buttons Style*/
#restartButton {
    font-size: 0.6em;
    background-color: white;
    border: 1px solid black;
    padding: .25em .25em;
    cursor: pointer;
    border-radius: 5%;
}

#restartButton:hover {
    background-color: black;
    color: white;
    border-color: white;

}

.restartButton-Outer {
    font-size: 0.6em;
    background-color: white;
    border: 1px solid black;
    padding: .25em .25em;
    cursor: pointer;
    border-radius: 5%;

}

.restartButton-Outer:hover {
    background-color: black;
    color: white;
    border-color: white;

}


.welcome {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    /* color: black;*/
    font-size: 2em;
    flex-direction: column;
}

.welcome-Note {
    font-size: 1em;
    text-shadow: 0px 0px 30px black, 0px 0px 30px black, 0px 0px 30px black, 0px 0px 10px #553300, 0px 0px 10px #553300;
}

.winnerMessage.show {
    display: flex;
}

/*Background*/
body {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/*text style*/
.ml16 {
    color: #402d2d;
    padding: 40px 0;
    font-weight: 900;
    font-size: 1.5em;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    overflow: hidden;
    text-align: center;
    margin-top: 3%;
}

.ml16 .letter {
    display: inline-block;
    line-height: 1em;
}
