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

:root {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Open Sans",
    "Helvetica Neue",
    sans-serif;
  font-size: 16px;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  min-height: 100vh;
  text-align: center;
  gap: 2rem;
}

header {
  padding: 1.5rem 0;
}

main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-size: 1.3rem;
  font-weight: 500;
  text-align: left;
  background-color: whitesmoke;
  padding: 1.5rem 2.5rem;
  border: 1px solid lightgray;
  border-radius: 6px;
  box-shadow: 1px 1px 5px silver;
}

dialog::backdrop {
  background-color: black;
  opacity: 0.5;
}

dialog {
  top: calc(50vh - (17.5rem / 2));
  left: calc(50vw - (17.5rem / 2));
  height: 17.5rem;
  width: 17.5rem;
  background-color: whitesmoke;
  color: black;
  border: 1px solid gray;
  border-radius: 6px;
  box-shadow: 1px 1px 5px grey;
  z-index: -1;
}

dialog .modal-view {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  height: 100%;
  text-align: center;
}

dialog form {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: stretch;
  align-content: stretch;
  text-align: left;
  padding: 0 2rem;
}

dialog label {
  font-size: 1.125rem;
  color: black;
  opacity: 0.8;
}

dialog input {
  width: 100%;
  font-size: 1.125rem;
  padding: 0.2rem 0.5rem;
  margin-top: 0.5rem;
  border: 1px solid gray;
  border-radius: 4px;
}

dialog input:placeholder-shown {
  font-style: italic;
}

dialog form p.info {
  font-size: 1.1rem;
  font-weight: bold;
  word-spacing: normal;
  text-align: center;
  color: firebrick;
  line-height: 1.3;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid;
}

dialog p {
  font-size: 2.25rem;
  word-spacing: 0.75rem;
}

dialog #winner {
  display: inline-block;
  color: firebrick;
  font-size: 2rem;
  font-weight: bold;
}

.active-player {
  display: flex;
  align-items: center;
}

.active-player > span {
  font-size: 1.5rem;
  font-weight: 600;
  color: firebrick;
  opacity: 0.8;
  padding-left: 0.5rem;
}

#board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  background-color: black;
  max-width: 306px;
  margin: 0 auto;
  border: 5px solid;
  border-radius: 6px;
}

.tile {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 6rem;
  width: 6rem;
  font-size: 3rem;
  font-weight: 500;
  background-color: white;
  border-radius: 3px;
}

.tile:hover {
  background-color: whitesmoke;
  cursor: pointer;
}

.tile:active {
  background-color: white;
}

.buttons-wrapper {
  display: flex;
  justify-content: space-around;
}

button {
  color: black;
  background-color: aliceblue;
  font-size: 1.1rem;
  font-weight: 600;
  align-self: center;
  text-transform: uppercase;
  padding: 0.6rem 1rem;
  background-color: white;
  color: firebrick;
  border: none;
  border-radius: 4px;
  box-shadow: 1px 2px 3px silver;
  transition: all 0.2s ease;
  margin-bottom: 0.5rem;
}

button:hover {
  background-color: white;
  box-shadow: 1px 2px 6px 1px silver;
  color: crimson;
}

button:active {
  box-shadow: 1px 2px 4px 1px silver inset;
  scale: 0.99;
}

footer {
  font-size: 0.8rem;
  padding: 1rem 0;
}
