/* The ten hand shapes, each with its number, a tick once counted and a badge
   with how many times it was held. */

.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Each shape sits on a tile: purple once counted, blue while it is being read. */
.shape {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: var(--su-radius);
  transition: background-color 0.25s, border-color 0.25s;
}

.shape.counted {
  border-color: color-mix(in srgb, var(--brand) 30%, transparent);
  background: color-mix(in srgb, var(--brand) 8%, transparent);
}

.shape.current {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* The hands are drawn with a near-black fill for the video; screen drops the
   fill so only the outlines show on the page background. */
.shape img {
  width: 100%;
  max-width: 64px;
  aspect-ratio: 100 / 130;
  mix-blend-mode: screen;
}

.shape .label {
  position: relative;
  font-size: 17px;
  font-weight: 500;
  color: var(--dim);
}

.shape.counted .label {
  color: var(--text);
}

/* 6 to 10 have their own Chinese shapes: their numbers are in blue. */
.shape:nth-child(n + 6) .label {
  color: color-mix(in srgb, var(--accent) 60%, transparent);
}

.shape.counted:nth-child(n + 6) .label {
  color: var(--accent);
}

.shape.current .label {
  color: var(--accent);
}

.shape .tick {
  position: absolute;
  left: 100%;
  margin-left: 4px;
  color: var(--brand);
  font-size: 15px;
  visibility: hidden;
}

.shape.counted .tick {
  visibility: visible;
}

.badge {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  border: 2px solid var(--track);
  background: transparent; /* the kit has its own .badge */
  color: var(--dim);
  font-size: 13px;
  font-weight: 700;
}

.badge.on {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.badge.bump {
  animation: bump 0.35s ease-out;
}

@keyframes bump {
  40% {
    transform: scale(1.35);
  }
}

@media (max-width: 860px) {
  .grid {
    gap: 8px 4px;
  }

  .shape {
    gap: 3px;
    padding: 4px 2px;
  }

  .shape img {
    max-width: 38px;
  }

  .shape .label {
    font-size: 13px;
  }

  .shape .tick {
    font-size: 12px;
  }

  .badge {
    min-width: 20px;
    height: 20px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .badge.bump {
    animation-duration: 0.01s;
  }
}

/* The drawings are made for a dark background; in light mode they are inverted
   (and the hue turned back) so they read as line drawings on the page. */
html[data-theme="light"] .shape img {
  mix-blend-mode: multiply;
  filter: invert(1) hue-rotate(180deg);
}
