* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-blue: #26547c;
    --color-light-blue: rgb(78, 122, 160) c;
    --color-red: #ef476f;
    --color-yellow: #ffd166;
    --color-green: #06d6a0;
    --color-white: #fcfcfc;
    --shadow-color: rgba(0, 0, 0, 0.29);
}

/* KEYFRAME */

@keyframes appear {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* GENERAL */

html {
    height: 100%;
}

body {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--color-white);
}

/* HEADER */
header {
    /* position */
    width: 100%;
    height: auto;
    padding: 1rem;
    /* display */
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* other */
    box-shadow: 3px 17px 18px -11px var(--shadow-color);
    -webkit-box-shadow: 3px 17px 18px -11px var(--shadow-color);
    -moz-box-shadow: 3px 17px 18px -11px var(--shadow-color);
    /* color */
    background-color: var(--color-blue);
}

h1 {
    font-family: Grotesk;
    font-weight: 400;
    font-size: 4rem;
    color: var(--color-white);
}

/* MAIN */
main {
    width: 100%;
    padding: 3rem;
    /* display */
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
    gap: 3.5rem;
}

.tictactoe__scoreContainer {
    grid-area: 1 / 1 / 2 / 2;
}
.tictactoe__difficultyContainer {
    grid-area: 2 / 1 / 3 / 2;
}
.tictactoe__grid {
    grid-area: 3 / 1 / 4 / 2;
}
.tictactoe__restartContainer {
    grid-area: 4 / 1 / 5 / 2;
}









/* SCORE */
.tictactoe__scoreContainer {
    width: 200px;
    margin: 0 auto;
    display: flex;
    align-items: start;
    justify-content: center;
    gap: 2rem;
}
.tictactoe__scoreWin,
.tictactoe__scoreDraw,
.tictactoe__scoreLose,
.tictactoe__scoreSeparator {
    /* other */
    font-size: 2rem;
    font-family: Grotesk;
}
.tictactoe__scoreWin {
    color: var(--color-green);
}
.tictactoe__scoreDraw {
    color: var(--color-blue);
}
.tictactoe__scoreLose {
    color: var(--color-red);
}
.tictactoe__scoreSeparator {
    color: var(--color-blue);
}








/* GRID */
.tictactoe__grid {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}

.tictactoe__cell {
    width: 100%;
    aspect-ratio: 1/1;
    background-color: transparent;
    border-color: transparent;
    border-radius: 0;
    border-width: 0.5rem;
    border-style: none;
    font-size: 2rem;
    cursor: pointer;
}
.tictactoe__cell > svg {
    opacity: 0;
    transition: transform 0.2s ease-out;
}
.tictactoe__cell[data-symbol="PLAYER"] > svg {
    color: var(--color-blue);
    width: 60%;
    animation: appear 0.3s ease-out forwards;
    transform-origin: center;
}
.tictactoe__cell[data-symbol="COMPUTER"] > svg {
    color: var(--color-blue);
    width: 60%;
    animation: appear 0.3s ease-out 0.25s forwards;
    transform-origin: center;
}

/* END GAME */
.tictactoe__cell.end > svg {
    opacity: 0.35 !important;
}
.tictactoe__cell.end.winningCell > svg {
    opacity: 1 !important;
    transform: scale(1.2) !important;
}

.tictactoe__cell[data-cell="0"],
.tictactoe__cell[data-cell="1"],
.tictactoe__cell[data-cell="3"],
.tictactoe__cell[data-cell="4"],
.tictactoe__cell[data-cell="6"],
.tictactoe__cell[data-cell="7"] {
    border-right-color: var(--color-blue);
    border-right-style: solid;
}
.tictactoe__cell[data-cell="0"],
.tictactoe__cell[data-cell="1"],
.tictactoe__cell[data-cell="2"],
.tictactoe__cell[data-cell="3"],
.tictactoe__cell[data-cell="4"],
.tictactoe__cell[data-cell="5"] {
    border-bottom-color: var(--color-blue);
    border-bottom-style: solid;
}









/* RESTART BUTTON */
.tictactoe__restartContainer {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tictactoe__button--restart {
    padding: 0.5rem 1.5rem;
    border: 3px solid transparent;
    border-radius: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.2s ease-out;
    cursor: pointer;
    /* color */
    color: var(--color-red);
    background-color: var(--color-white);
    border-color: var(--color-red);
}
.tictactoe__button--restart:hover {
    background-color: var(--color-red);
    color: var(--color-white);
}
.tictactoe__button--restart.hidden {
    opacity: 0;
    cursor: default;
}







/* SWITCH */
.tictactoe__difficultyContainer {
    width: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.tictactoe__switchExplanation {
    padding-bottom: 0.25rem;
    font-size: 1.3rem;
    font-weight: 600;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

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

.tictactoe__switchInput[type="checkbox"] {
    height: 0;
    width: 0;
    visibility: hidden;
}

.tictactoe__switchLabel {
    cursor: pointer;
    text-indent: -9999px;
    width: 40px;
    height: 20px;
    background: var(--color-green);
    display: block;
    border-radius: 20px;
    position: relative;
}

.tictactoe__switchLabel:after {
    content: "";
    position: absolute;
    top: 1px;
    left: 1px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 18px;
    transition: 0.3s;
}

.tictactoe__switchInput:checked + label {
    background: var(--color-red);
}

.tictactoe__switchInput:checked + label:after {
    left: calc(100% - 1px);
    transform: translateX(-100%);
}

.tictactoe__switchLabel:active:after {
    width: 26px;
}





/* version ordinateur de 769px*/
@media (min-width: 900px) {
    main {
        padding-top: 1rem;
        grid-template-columns: 1fr 3fr 1fr;
        grid-template-rows: auto 1fr auto;
        gap: 1rem;
    }
    .tictactoe__scoreContainer {
        grid-area: 1 / 2 / 2 / 3;
    }
    .tictactoe__difficultyContainer {
        grid-area: 1 / 3 / 2 / 4;
    }
    .tictactoe__grid {
        grid-area: 2 / 2 / 3 / 3;
    }
    .tictactoe__restartContainer {
        grid-area: 3 / 2 / 4 / 3;
    }
}