* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

:root {
  background-color: #023602;
  background: fixed radial-gradient(#069415aa 10%, #004e00aa 90%, #023602aa),
    /* https://img.freepik.com/premium-photo/poker-table-felt-background-green-color-seamless-square-texture-tile-ready_463999-6175.jpg?w=360 */
      url("./felt.avif");
  color: white;
  color-scheme: dark;
  font-family: sans-serif;
}

@media (pointer: fine) {
  :root {
    --cursor-pointer: pointer;
  }
}

body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0;
  padding-top: 30px;
  padding-bottom: 20px;
  padding-inline: 30px;
  overscroll-behavior: none;
  min-height: 100vh;
  &.initializing > * {
    display: none;
  }
}

h3 {
  color: #fffe;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 5px;
  margin: 0 0 10px;
}

.card {
  align-items: center;
  background-color: white;
  border-radius: 100vh;
  box-shadow: 0 1px 0 1px #0003;
  color: black;
  cursor: var(--cursor-pointer);
  display: flex;
  font-weight: 300;
  height: 31px;
  justify-content: center;
  padding: 5px;
  position: relative;
  &:active {
    box-shadow: 0 1px 2px 1px #0008 inset;
  }
  > select {
    height: 31px;
    left: 0;
    min-height: 31px;
    opacity: 0;
    position: absolute;
    scale: 1.2;
    top: 0;
    width: 100%;
  }
  &.missing {
    align-items: center;
    background-color: #00240088;
    color: transparent;
    display: flex;
    font-size: 0;
    justify-content: center;
    pointer-events: none;
    width: calc(1.4 * 31px);
  }
}

#board {
  > div {
    display: flex;
    gap: 6px;
  }
}

#players {
  > h3 {
    display: flex;
    justify-content: space-between;
    > button {
      all: revert;
      appearance: none;
      background-color: transparent;
      border-radius: 100vh;
      border: 1px solid #fffb;
      box-sizing: border-box;
      color: #fffb;
      cursor: var(--cursor-pointer);
      display: flex;
      font-size: 0;
      height: 23px;
      margin-right: 6px;
      outline: none;
      position: relative;
      width: 23px;
      &::before,
      &::after {
        background-color: currentColor;
        content: "";
        left: 50%;
        position: absolute;
        top: 50%;
        translate: -50% -50%;
      }
      &::before {
        height: 1.25px;
        width: 10px;
      }
      &::after {
        width: 1.25px;
        height: 10px;
      }
    }
  }
  > div {
    align-items: center;
    background-color: #00240088;
    border-radius: 100vh;
    display: flex;
    gap: 6px;
    height: 38.5px;
    padding: 3.75px 6px 3.75px 10px;
    &:not(:last-child) {
      margin-bottom: 10px;
    }
    > :first-child {
      align-items: center;
      border-radius: 100vh;
      border: 1px solid #fffb;
      color: #fffb;
      display: flex;
      flex-shrink: 0;
      font-size: 12px;
      height: 17px;
      justify-content: center;
      margin-right: auto;
      width: 17px;
    }
  }
}

#spread {
  > canvas {
    border-radius: 15px;
    height: 20vh;
    width: 100%;
    box-shadow: 0 1px 0 1px #0003 inset;
    margin-bottom: 10px;
  }

  > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    > button {
      appearance: none;
      backdrop-filter: saturate(180%) blur(1px) opacity(0.9);
      background: linear-gradient(#0003, transparent);
      border: 0.5px solid #fff1;
      border-left-width: 1px;
      border-radius: 100vh;
      border-right: none;
      border-top: none;
      box-shadow: 0 1px 0 1px #0003;
      color: inherit;
      cursor: var(--cursor-pointer);
      font-family: inherit;
      font-size: 13px;
      letter-spacing: 0.5px;
      outline: none;
      padding: 5px 7px;
      white-space: nowrap;

      &:active {
        background-color: #00240088;
        box-shadow: 0 1px 0 1px #0003 inset;
      }
      &::before {
        background-color: var(--color);
        border-radius: 1ch;
        content: "";
        display: inline-block;
        height: 0.4ch;
        margin-right: 0.7ch;
        scale: 1.7;
        translate: 0 -0.3ch;
        width: 0.4ch;
      }
    }
  }
}

#stats {
  > div {
    display: grid;
    grid-template-columns: 1fr max-content;
    > div {
      align-items: center;
      display: flex;
      padding: 10px;
      padding-left: 15px;
    }
    > :nth-child(2n + 1) {
      color: #fffb;
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    > :nth-child(4n + 1) {
      border-bottom-left-radius: 100vh;
      border-top-left-radius: 100vh;
    }
    > :nth-child(4n + 2) {
      border-bottom-right-radius: 100vh;
      border-top-right-radius: 100vh;
    }
    > :nth-child(4n + 1),
    > :nth-child(4n + 2) {
      background-color: #00240088;
    }
    > :nth-child(2n) {
      color: #fffd;
      font-family: Courier, monospace;
      justify-content: right;
      user-select: all;
      -webkit-user-select: all;
    }
  }
}

#phase {
  backdrop-filter: saturate(180%) blur(4px);
  background: linear-gradient(#0002, transparent), linear-gradient(to left, #0004 30%, transparent);
  border: 1px solid #fff2;
  border-left-width: 2px;
  border-top-width: 0.5px;
  border-right-width: 0.5px;
  border-right-color: #fff1;
  border-radius: 70px;
  bottom: 20px;
  box-shadow: 0 0 10px #0004, 0 5px 5px 10px #0001;
  cursor: var(--cursor-pointer);
  display: flex;
  margin-inline: auto;
  margin-top: auto;
  max-width: 500px;
  overflow-x: auto;
  padding-block: 5px;
  padding-inline: 30px;
  position: sticky;
  scroll-snap-stop: always;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  width: 100%;

  > h2 {
    display: block;
    flex-shrink: 0;
    font-size: 60px;
    margin: 0;
    scroll-snap-align: center;
    text-align: center;
    width: calc(100% + 2 * 30px);
    > i {
      display: inline-block;
      font-style: normal;
      translate: 0 -10%;
    }
  }

  &:active {
    background-color: #00240088;
    box-shadow: 0 1px 0 1px #0003 inset, 0 0 10px #0004, 0 5px 5px 10px #0001;
  }
}
