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

body {
    margin: 0;
    padding: 0;
    font-family: 'Nunito', sans-serif;
    color: #555;
}

#main {
    height: 100vh;
    height: 100svh;
    display: grid;
    place-items: center;
    padding: 1em;
}

#wrapper {
    position: relative;
    max-width: 450px;
    width: 100%;
    z-index: 0;
}

#board {
    aspect-ratio: 1/1;
    gap: 1em;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    background-color: white;
}

#board .cell {
    background-color: #eee;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cell {
    color: #888;
    transition: color 0.2s ease-in, background-color 0.2s ease-in;
}

#board .cell.highlight {
    color: white;
    background-color: #555;
}

.result {
    position: absolute;
    display: flex;
    justify-content: center;
    left: 0;
    right: 0;
    top: 0;
    text-transform: uppercase;
    letter-spacing: 5px;
    transition: transform 0.5s ease-in;
    transform: translateY(0);
    z-index: -5;
}

.reveal.result {
    transform: translateY(-200%);
}

.play-again {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    padding: 2em;
    transition: transform 0.5s ease-in;
    z-index: -5;
}

.reveal.play-again {
    transform: translateY(100%);
}

button {
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    padding: 0.75em 1em;
    background-color: #eee;
    border: none;
    font-size: 1.5em;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 5px;
    color: #555;
    transition: color 0.2s ease-in, background-color 0.2s ease-in;
}

button:hover {
    color: white;
    background-color: #555;
}

.circle svg {
    -webkit-transform: rotate(-90deg);
    transform: rotate(-90deg);
}

svg {
    pointer-events: none;
}

circle,
line {
    pointer-events: none;
    stroke: currentColor;
    stroke-width: 5px;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes draw {
    0% {
        stroke-dasharray: 0 600;
    }
    100% {
        stroke-dasharray: 600 0;
    }
}

@keyframes secondLine {
    0% {
        opacity: 0;
        stroke-dasharray: 0 600;
    }
    50% {
        opacity: 0;
        stroke-dasharray: 0 600;
    }
    60% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        stroke-dasharray: 600 0;
    }
}

.fixed {
    color: #555;
}

.fixed circle {
    animation: draw 1s linear;
}

.fixed .first-line {
    animation: draw 0.5s ease-in;
}

.fixed .second-line {
    animation: secondLine 0.5s ease-in;
}
