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

:root {
  --border-thickness: 6px;
  --bg-color: hsl(0, 0%, 7%); /* background-color body */
  --col-text-score: hsl(214, 32%, 91%); /* .score, .score-win-label-input */
  --col-header-game: hsl(210, 40%, 98%);
}

body {
  background-color: var(--bg-color);
  min-height: 100vh;
  border-left: var(--border-thickness) solid transparent;
  border-right: var(--border-thickness) solid transparent;
  transition: 0.4s ease;
}

.container {
  display: grid;
  grid-template-areas:
    "header header header"
    "controls controls controls"
    "scoreboard scoreboard scoreboard"
    "round round round"
    "win-condition win-condition win-condition"
    "player1 board player2"
    "info info info";

  min-height: 100vh;
  gap: 1rem;
  padding: 1rem;

  align-items: center;
  justify-items: center;

  max-width: 1200px;
  margin: 0 auto;

  box-shadow: 0 0 20px hsla(0, 0%, 0%, 0.2);
  border-radius: 8px;
}

.header {
  grid-area: header;
}

.header h1 {
  text-shadow: 0 0 8px hsla(0, 0%, 100%, 0.1);
  color: var(--col-header-game);
}

.scoreboard {
  grid-area: scoreboard;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;

  padding: 0.5rem 0;
  border-radius: 6px;
  backdrop-filter: blur(4px);
  background: hsla(0, 0%, 0%, 0.2);
}

.score-column {
  display: grid;
  justify-items: center;
  min-width: 50px;
}

.score-label {
  font-size: 0.8rem;
}

.score-label-player-1 {
  color: hsl(213, 94%, 50%);
}

.score-label-draw {
  color: hsl(218, 11%, 50%);
}

.score-label-player-2 {
  color: hsl(157, 72%, 50%);
}

.score {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--col-text-score);
}

.round-counter {
  grid-area: round;
  text-align: center;
  font-size: 0.9rem;
  color: hsl(218, 11%, 65%);
}

.game-controls {
  grid-area: controls;
  min-height: 40px;
}

.win-condition {
  grid-area: win-condition;

  display: flex;
  column-gap: 1rem;
}

.score-win-label-input {
  color: var(--col-text-score);
}

.score-input {
  width: 30px;
}

.player-form-1 {
  grid-area: player1;

  display: grid;
  grid-template-columns: 1fr 5fr;
}

.player-form-header {
  grid-column: 2 / 3;

  font-size: 1.1rem;
  font-weight: 600;
  transition: 0.3s ease;
  color: hsl(0, 0%, 50%);
}

.player-form-input {
  grid-column: 2 / 3;
  padding: 0.2rem 0.4rem;
}

.game-board {
  grid-area: board;

  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  width: min(100%, 400px);
  height: min(100%, 400px);
  min-width: 300px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 10px hsla(0, 0%, 0%, 0.1);
  border: 2px solid hsl(204, 100%, 40%);
}

.cell {
  display: grid;
  align-items: center;
  justify-items: center;

  aspect-ratio: 1 / 1;
  font-size: 2rem;
  background: hsl(0, 0%, 100%);
  border: 1px solid hsl(0, 0%, 20%);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.cell:hover {
  transform: scale(0.95);
  background: hsl(0, 0%, 94%);
}

.player-form-2 {
  grid-area: player2;

  display: grid;
  grid-template-columns: 1fr 5fr;
  column-gap: 10px;
}

.game-info {
  grid-area: info;
}

.game-info {
  font-size: 1.2rem;
  color: var(--col-header-game);
}

.hidden {
  display: none;
}

.btn {
  min-width: 80px;

  border: none;
  border-radius: 2px;
  padding: 0.5rem 0.4rem;
}

.btn:hover {
  cursor: pointer;
  background-color: hsl(0, 0%, 88%);
}

.highlight {
  background-color: hsl(204, 100%, 40%);
}

@keyframes shake {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(10deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

.animation-shake {
  animation: shake 0.3s ease;
}

.active {
  color: hsl(0, 0%, 100%);
}

.active-border-left {
  border-left: var(--border-thickness) solid hsl(0, 0%, 100%);
}

.active-border-right {
  border-right: var(--border-thickness) solid hsl(0, 0%, 100%);
}

.player-marker {
  justify-self: center;
  align-self: center;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background-color: transparent;
  transition: 0.5s ease;
}

.player-form-1.active .player-marker,
.player-form-2.active .player-marker {
  background: white;
  box-shadow: 0px 0px 1px 1px hsla(0, 0%, 100%, 0.9),
    0px 0px 3px 3px hsla(0, 0%, 100%, 0.5),
    0px 0px 5px 5px hsla(0, 0%, 100%, 0.4);
}
