* {
  box-sizing: border-box;
}

body {
  height: 100vh;
  width: 100vw;
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4 {
  font-weight: 600;
}

header {
  width: 100%;
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #282c34;
  color: white;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  padding: 10px;
}

button {
  all: unset;
  cursor: pointer;
  width: fix-content;
  padding-inline: 1rem;
  height: 80px;
  text-align: center;
  font-size: 2rem;
  border-radius: .5rem;
  background-color: #e0e0e0;
  border: 3px solid transparent;
  transition: border-color 0.3s ease;

  &:hover {
    border-color: #282c34;
  }
}

content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: calc(100dvh - 80px - 120px);

  &[data-content="choose-opponent"] #choose-opponent {
      display: flex;
  }

  &[data-content="choose-symbol"] #choose-symbol {
      display: flex;
  }

  &[data-content="game-board"] #game-board {
      display: grid;
  }
  
  #game-message {
    height: 40px;
    display: flex;
    font-size: clamp(24px, 3vh, 36px);
  }

  #choose-opponent {
    display: none;
    flex-direction: column;
  }

  #choose-symbol {
    display: none;
    flex-direction: column;

    h3 {margin-bottom: .25rem; font-weight: 600;}
    h4 {margin-top: 0; font-weight: 400;}

    button {
      aspect-ratio: 1;
      font-size: 36px;
    }
  }
  
  #game-board {
    list-style: none;
    display: none;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    padding: 0;
    margin: 0;
    
    .cell {
      min-width: 100px;
      width: min(12vw, 12vh);
      max-width: 180px;
      aspect-ratio: 1;
      border-radius: 5%;
      background-color: #f0f0f0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: clamp(1rem, 8vh, 4rem);
      font-weight: 200;
      cursor: pointer;
      color: transparent;
      transition: background-color 0.3s ease, color 0.3s ease;

      &:hover {
        background-color: #e0e0e0;
        color: rgba(0, 0, 0, 0.33);
      }

      &[data-cell=""] {
        color: transparent;
      }
      
      &[data-cell=""]:hover {
        background-color: #d0d0d0;
        color: rgba(0, 0, 0, 0.33);
      }
      
      &[data-cell="X"] {
        color: orangered;
        background-color: color-mix(in srgb, orangered 10%, transparent);
        pointer-events: none;
      }
      
      &[data-cell="O"] {
        color: slateblue;
        background-color: color-mix(in srgb, slateblue 10%, transparent);
        pointer-events: none;
      }

      &.muted {
        filter: saturate(0) opacity(0.5);
      }
    }

    &.game-over li.cell,
    &.computer-busy li.cell {
      pointer-events: none !important;
    }

  }
}

footer {
  width: 100%;
  height: 120px;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #282c34;
 
  #restart-button {
    all: unset;
    cursor: pointer;
    width: 320px;
    height: 80px;
    text-align: center;;
    font-size: 36px;;
    border-radius: 15px;
    background-color: lightgreen;
    transition: filter 0.3s ease;

    &:hover {
      filter: hue-rotate(-45deg);
    }

    &:active {
      filter: hue-rotate(-120deg);
    }
  }

}
