/* nes.css does most of the heavy lifting, this just tunes the layout */

body {
  font-family: "Press Start 2P", cursive;
  background-color: #e8e8e8;
  padding: 30px 20px;
  max-width: 600px;
  margin: 0 auto;
}

h1 {
  margin-bottom: 20px;
  font-size: 18px;
  text-align: center;
}

/* scoreboard */

.scoreboard {
  margin-bottom: 20px;
}

.score-row {
  display: flex;
  justify-content: space-around;
  gap: 10px;
  text-align: center;
}

.score-cell {
  flex: 1;
  min-width: 0;
}

.score-label {
  font-size: 9px;
  margin-bottom: 8px;
  word-wrap: break-word;
  line-height: 1.4;
}

.score-value {
  font-size: 16px;
  margin: 0;
}

/* turn message */

.turn-box {
  margin-bottom: 40px;
  text-align: center;
}

#turn-message {
  font-size: 11px;
  margin: 0;
}

#turn-message.win {
  color: #92cc41;
}

#turn-message.tie {
  color: #e76e55;
}

/* board */

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 420px;
  margin: 60px auto 20px auto;
}

.square {
  aspect-ratio: 1;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  user-select: none;
  padding: 0 !important;
  background-color: #000 !important;
  color: #fff;
  box-shadow: 0 0 0 4px #fff inset, 0 0 0 8px #000 inset !important;
}

.square.taken {
  cursor: not-allowed;
}

.square.x {
  color: #ff6677;
}

.square.o {
  color: #66ccff;
}

.square.win {
  background-color: #2a4a2a !important;
}

/* play again */

.play-again-wrap {
  text-align: center;
  margin-bottom: 20px;
}

/* responsive */

@media (max-width: 480px) {
  h1 { font-size: 14px; }
  .square { font-size: 24px; }
  .score-value { font-size: 12px; }
  .score-label { font-size: 8px; }
  #turn-message { font-size: 10px; }
}
