* {
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f0f0;
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 10px;
}

.github-link {
    position: absolute;
    top: 15px;
    right: 10px;
}

.github-link a {
    font-size: 1em;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.github-link a:hover {
    background-color: #e0e0e0;
}

.container {
    text-align: center;
    width: 100%;
    max-width: 450px;
    transform: translateY(-10%);
}

h2 {
    margin-bottom: 20px;
}

.players {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.player {
    padding: 10px;
    border: 2px solid #000;
    background-color: #fff;
    font-size: 1em;
    flex: 1;
    margin: 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 45%;
}

.player.active {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    background-color: #e6a254;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 5px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 450px;
    height: auto;
}

.cell {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    border: 2px solid #000;
    font-size: 5em;
    aspect-ratio: 1;
    cursor: pointer;
}

.flex {
    display: flex;
}

#message-container {
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 300px;
    height: auto;
    text-align: center;
}

button {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #333;
    color: #fff;
    font-size: 1em;
    cursor: pointer;
    border: 1px solid grey;
    border-radius: 5px;
    width: 100%;
}

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

.hidden {
    display: none;
}

@media (max-width: 600px) {
    .container {
        max-width: 300px;
    }

    .players {
        align-items: center;
        gap: 10px;
    }

    .player {
        max-width: 100%;
        margin: 5px 0;
    }

    .board {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
        width: 100%;
    }

    .cell {
        font-size: 4em;
    }
}
