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

.header {
    display:flex;
    justify-content: space-between;
    padding: 10px;
    margin-bottom: 50px;
}

.buttons {
    display: flex;
    align-items: center; 
    gap: 10px;   
}


.headbtn {
    background-color: black;
    color: white;
    padding: 10px;
    font-weight: 700;
    border: none;
    border-radius: 15px;
    transition: transform 0.15s ease;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: calc(100vh - 150px);
}

.active-player {
    padding: 5px;
    font-size: 30px;
}

.gameboard {
    gap: 10px;
    width: min(620px, calc(100% - 32px));
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.square {
    width: 100%;
    border: 2px solid black;
    border-radius: 15px;
    color: white;
    font-size: clamp(50px, 12vw, 100px);
    background-color: black;
    aspect-ratio: 1 / 1;
    transition: transform 0.15s ease;
}

.square:hover,
.square:focus,
.headbtn:hover,
.headbtn:focus,
.dialog-button:hover,
.dialog-button:focus {
    transform: translateY(-3px) translateX(-3px);
}

.winner-box[open],
.player-setup[open] {
    display: grid;
    margin: auto;
    gap: 15px;
    background-color: white;
    color: black;
    border: none;
    border-radius: 15px;
    padding: 15px;
    place-items: center;
    height: 300px;
    width: 300px;
}

.player-form input {
    padding: 10px;
    background-color: white;
    color: black;
    caret-color: black;
    border: 1px solid black;
    border-radius: 8px;
}

.winner-box h2 {
    font-size: 50px;
}

.winner-box p {
    font-size: 32px;
    text-align: center;
}

.player-form {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 10px;
    height: 100%;
}

.dialog-button {
    background-color: black;
    color: white;
    padding: 10px;
    font-weight: 700;
    border: none;
    border-radius: 15px;
    transition: transform 0.15s ease;
}

@media (max-width: 600px) {
  .header {
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    text-align: center;
  }

  .buttons {
    justify-content: center;
    flex-wrap: wrap;
  }

  main {
    height: auto;
    min-height: calc(100vh - 120px);
  }
}