/* Shared styles for the unlisted games hub (/games) and its games.
   See docs/games.md. */
.games-body {
  min-height: 100vh;
  margin: 0;
  background: var(--base-background);
  color: var(--text-on-base);
  font-family: var(--font-body);
  font-weight: var(--body-normal-weight);
}

.games-shell {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: var(--headline-main-size) 0 calc(var(--headline-main-size) + var(--number) * 4);
}

.games-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
}

.games-top a {
  display: inline-flex;
  align-items: center;
  gap: var(--corner-small);
  color: var(--text-warm);
  font-size: var(--body-small-size);
  text-decoration: none;
}

.games-top a:hover,
.games-top a:focus-visible {
  color: var(--primary-pink);
  text-decoration: underline;
}

.games-head h1 {
  margin: 0 0 var(--corner-small);
  font-family: var(--font-headline);
  font-size: var(--headline-main-size);
  font-weight: var(--headline-main-weight);
  line-height: var(--headline-main-line);
  letter-spacing: var(--headline-main-spacing);
}

.games-head p {
  margin: 0 0 var(--headline-main-size);
  color: var(--text-warm);
  font-size: var(--body-normal-size);
  line-height: var(--body-normal-line);
  letter-spacing: var(--body-normal-spacing);
}

.games-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--corner-large);
}

.games-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--fade-10);
  border-radius: var(--corner-large);
  color: inherit;
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.games-card:hover,
.games-card:focus-visible {
  border-color: var(--primary-pink);
  transform: translateY(-2px);
}

.games-card-art {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  border-radius: var(--corner-medium);
  background: var(--alpha-start);
  overflow: hidden;
}

.games-card h2 {
  margin: 0;
  font-family: var(--font-headline);
  font-size: var(--headline-small-size);
  font-weight: var(--headline-small-weight);
  line-height: var(--headline-small-line);
}

.games-card p {
  margin: 0;
  color: var(--text-warm);
  font-size: var(--body-small-size);
  line-height: 1.5;
}

.games-card-play {
  color: var(--primary-pink);
  font-size: var(--body-small-size);
  font-weight: var(--body-small-bold-weight);
}

/* Spot the diff thumbnail: two tiny pages, one slightly off. */
.gc-diff {
  display: flex;
  gap: var(--body-small-size);
}

.gc-page {
  width: 96px;
  height: 120px;
  padding: var(--corner-medium);
  box-sizing: border-box;
  border-radius: var(--corner-small);
  background: var(--background);
}

.gc-page i {
  display: block;
  height: 6px;
  margin-bottom: var(--number);
  border-radius: var(--corner-full);
  background: var(--dark);
}

.gc-page b {
  display: block;
  width: 46px;
  height: 16px;
  margin-top: var(--headline-small-size);
  border-radius: var(--number);
  background: var(--primary-pink);
}

.gc-page.is-off {
  background: var(--primary-light);
}

.gc-page.is-off b {
  border-radius: 0;
  background: var(--variant-base);
}

/* Whack-a-mole thumbnail and game share the mole drawing below. */
.gc-mole-row {
  display: flex;
  gap: var(--body-large-size);
  align-items: flex-end;
}

/* ---------- Mole drawing (hub thumbnail + game) ---------- */
.wm-hole {
  position: relative;
  height: 132px;
  overflow: hidden;
}

.wm-pit {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 6px;
  height: 24px;
  border-radius: 50%;
  background: var(--code-background);
}

.wm-lip {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 0;
  height: 16px;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background: var(--code-border);
  z-index: 3;
}

.wm-mole {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 84%;
  height: 118px;
  transform: translate(-50%, 120%);
  transition: transform 0.2s cubic-bezier(0.22, 0.7, 0.2, 1);
  z-index: 1;
}

.wm-mole.up {
  transform: translate(-50%, 0);
}

.wm-mole.hit {
  transform: translate(-50%, 120%) scaleY(0.55);
  transition: transform 0.16s ease-in;
}

.wm-card {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 50px;
  border: 2px solid var(--primary-pink);
  border-radius: var(--corner-small);
  box-sizing: border-box;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-3deg);
  z-index: 2;
}

.wm-card .dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--error-base);
}

.wm-head {
  position: absolute;
  left: 21%;
  right: 21%;
  top: 38px;
  height: 84px;
  border-radius: 50% 50% 36% 36% / 60% 60% 40% 40%;
  background: color-mix(in srgb, var(--text-warm) 50%, var(--alpha-end));
}

.wm-eye {
  position: absolute;
  top: 24px;
  width: 7px;
  height: 9px;
  border-radius: 50%;
  background: var(--code-background);
}

.wm-eye::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--white);
}

.wm-snout {
  position: absolute;
  left: 50%;
  top: 36px;
  width: 30px;
  height: 20px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--text-warm);
}

.wm-nose {
  position: absolute;
  left: 50%;
  top: -3px;
  width: 12px;
  height: 9px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--primary-pink);
}

.wm-cheek {
  position: absolute;
  top: 38px;
  width: 9px;
  height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary-pink) 33%, transparent);
}

.wm-paw {
  position: absolute;
  top: 40px;
  width: 20px;
  height: 15px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text-warm) 40%, var(--alpha-end));
  z-index: 3;
}

.wm-paw::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 3px;
  height: 2px;
  border-top: 2px dotted var(--alpha-start);
}

.wm-card-mark {
  width: 60%;
  height: 18px;
  border-radius: var(--corner-full);
  background: var(--variant-base);
}

.wm-mole.hit .wm-eye {
  top: 28px;
  height: 2px;
  border-radius: var(--xsmall);
}

.wm-mole.hit .wm-eye::after {
  display: none;
}
