/* 1. Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Add accessible line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input,
button,
textarea,
select {
  font: inherit;
}

/* 8. Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root,
#__next {
  isolation: isolate;
}

/* CUSTOM STYLES */

:root {
  --title-font: "Patrick Hand SC", cursive;
  --body-font: "Neucha", cursive;
  --hover-color: gray;

  --p1-color: "blue";
  --p2-color: "red";
}

/* Desktop/mouse only */
@media (hover: hover) and (pointer: fine) {
  .game-board [data-row][data-col][data-empty="true"] {
    transition: background-color 120ms ease, outline-color 120ms ease;
  }

  .game-board [data-row][data-col][data-empty="true"]:hover {
    /* light hint using current player's color */
    background-color: color-mix(in oklab, var(--hover-color) 18%, white);
    cursor: pointer;
  }
}

/* Optional: tactile tap feedback on touch devices */
@media (hover: none) {
  .game-board [data-row][data-col]:active {
    transform: scale(0.98);
  }
}

html,
body {
  height: 100dvh;
}

.header {
  display: flex;
  justify-content: center;
}

.game-status {
  display: flex;
  justify-content: center;
}

h1 {
  margin: 0 0;
  font-size: 4em;
}

/* Class for disabling game input when it's not valid */
.disabled {
  pointer-events: none;
}

.hidden {
  display: none;
}

.game-wrapper {
  display: flex;
  justify-content: center;
  padding: 1rem;
  padding-top: 0;
}
.game-board {
  align-items: center;
  width: min-content;
  display: grid;
  grid-template-rows: 1fr 1fr 1fr;
  grid-template-columns: auto auto auto;
  gap: 0px;
  padding: 0;
}

.game-board [data-owner="p1"] {
  background-color: var(--p1-color);
}
.game-board [data-owner="p2"] {
  background-color: var(--p2-color);
}

.game-board > div {
  min-width: 6rem;
  min-height: 6rem;
  border: 1px solid black;
  display: flex;
  justify-content: center;
  align-items: center;

  font-size: 2rem;
  color: aliceblue;
}

/* .game-board > div:hover {
  background-color: lightgray !important;
} */

/* Format the lines of the Tic-tac-toe board */
div[data-row="1"] {
  border-top: none;
}

div[data-row="3"] {
  border-bottom: none;
}

div[data-col="1"] {
  border-left: none;
}

div[data-col="3"] {
  border-right: none;
}

#newGame {
  max-width: 30%;
  justify-self: center;
}

input[type="color"] {
  padding: 0;
}

input[type="text"] {
  padding: 5px;
}

.color-select {
  padding-top: 0.7rem;
}

#submit-btn {
  justify-self: center;
}

.info .form-group {
  padding: 0.5rem;
}

.player-1 {
  color: blue;
}

.player-2 {
  color: red;
}

.row,
.form-group {
  margin-bottom: 0.4rem;
}
