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

body {
    text-align: center;
    min-height: 100vh;
    display: grid;
    grid-auto-rows: auto;
    font-family: 'Urbanist', sans-serif;
}

button {
    font-family: inherit;
    font-size: 100%;
    border: none;
    padding: 20px 50px;
    border-radius: 20px;
    cursor: pointer;
}

input {
    appearance: none;
    font-family: inherit;
    font-size: 100%;
}

.title {
    margin: 20px 0;
    font-size: 3rem;
}

.container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0 20px;
}

.gameboard {
    display: grid;
    margin: 0 20px;
    aspect-ratio: 1 / 1;
    width: min(80%, 500px);
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
}

.square {
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4.5rem;
}

.square:not(:nth-child(3n)) {
    border-right: 2px solid #000;
}

.square:not(:nth-child(n + 7)) {
    border-bottom: 2px solid #000;
}

.btn__start {
    background: #5ba4fc;
}

.btn__reset {
    display: none;
    background: #e33437;
    margin-bottom: 20px;
}

.modal {
    position: fixed;
    z-index: 1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.4);
}
.modal__content {
    position: relative;
    background: #fefefe;
    margin: 10% auto;
    width: 30%;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid #888;
    text-align: center;
    min-width: 300px;
}

.modal__content .input__box {
    padding: 20px;
}

.input__box label {
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.input__box input {
    border: 1px solid #000;
    border-radius: 5px;
    height: 35px;
    padding-left: 5px;
    margin-top: 20px;
    margin-left: 10px;
}

.modal__content.winner {
    display: none;
}

.name__winner {
    margin: 50px 0;
}

.error__message {
    display: none;
    color: #e33437;
    margin-bottom: 20px;
}

@media only screen and (max-width: 400px) {
    .name__player1,
    .name__player2 {
        font-size: 1rem;
    }

    .square {
        font-size: 1.5rem;
    }
}
