* {
    box-sizing: border-box;
}


body {

    margin: 0;

    min-height: 100vh;

    background:
        radial-gradient(
            circle at top,
            #172554,
            #050505 60%
        );

    color: white;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    display: flex;

    justify-content: center;

    align-items: center;

    padding: 25px;

}


.game-wrapper {

    width: 100%;

    max-width: 650px;

}


.game-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 25px;

}


.game-label {

    color: #8b5cf6;

    font-size: 11px;

    letter-spacing: 3px;

    font-weight: bold;

}


h1 {

    margin: 7px 0 0;

    font-size: 34px;

}


.score-box {

    display: flex;

    gap: 7px;

}


.score-box div {

    min-width: 65px;

    padding: 9px;

    text-align: center;

    background: #111113;

    border: 1px solid #27272a;

    border-radius: 9px;

}


.score-box small {

    display: block;

    color: #71717a;

    font-size: 8px;

}


.score-box strong {

    display: block;

    margin-top: 3px;

    font-size: 19px;

}


/* GAME */

.game-area {

    position: relative;

    width: min(
        100%,
        520px
    );

    margin: auto;

}


.board {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 10px;

    padding: 10px;

    background: #111113;

    border: 1px solid #27272a;

    border-radius: 18px;

}


.board button {

    aspect-ratio: 1;

    border: none;

    border-radius: 12px;

    background: #09090b;

    color: white;

    font-size: clamp(
        50px,
        12vw,
        90px
    );

    font-weight: bold;

    cursor: pointer;

    transition: .15s;

}


.board button:hover {

    background: #18181b;

    transform: scale(.98);

}


.board button.x {

    color: #a78bfa;

}


.board button.o {

    color: #22d3ee;

}


.board button.winner {

    background: #27272a;

    box-shadow:
        0 0 25px
        rgba(139,92,246,.35);

}


.status {

    text-align: center;

    margin-top: 18px;

    color: #a1a1aa;

    font-size: 15px;

}


/* OVERLAY */

.overlay {

    position: absolute;

    inset: 0;

    display: flex;

    justify-content: center;

    align-items: center;

    background:
        rgba(0,0,0,.78);

    backdrop-filter:
        blur(7px);

    border-radius: 18px;

}


.hidden {

    display: none;

}


.overlay-card {

    text-align: center;

    padding: 30px;

}


.big-icon {

    font-size: 55px;

}


.overlay-card h2 {

    font-size: 30px;

    margin: 10px 0;

}


.overlay-card p {

    color: #a1a1aa;

    margin-bottom: 20px;

}


.overlay-card label {

    display: block;

    color: #aaa;

    font-size: 13px;

    margin-bottom: 7px;

}


.overlay-card select {

    width: 190px;

    padding: 11px;

    margin-bottom: 20px;

    border-radius: 8px;

    border: 1px solid #333;

    background: #18181b;

    color: white;

}


.overlay-card button {

    padding: 14px 26px;

    border: none;

    border-radius: 9px;

    background: #7c3aed;

    color: white;

    font-weight: bold;

    cursor: pointer;

}


.overlay-card button:hover {

    background: #8b5cf6;

}


/* CONTROLS */

.controls {

    display: flex;

    justify-content: center;

    gap: 10px;

    margin-top: 20px;

}


.controls button {

    padding: 11px 20px;

    border-radius: 8px;

    border: 1px solid #27272a;

    background: #111113;

    color: white;

    cursor: pointer;

}


.controls button:hover {

    background: #1f1f23;

}


.instructions {

    text-align: center;

    color: #52525b;

    font-size: 12px;

    margin-top: 18px;

    line-height: 1.7;

}


@media(max-width:600px) {

    body {

        padding: 15px;

    }


    h1 {

        font-size: 27px;

    }


    .score-box div {

        min-width: 50px;

    }


    .board {

        gap: 7px;

        padding: 7px;

    }

}