@font-face {
  font-family: "Bagel Fat One";
  src: url("/fonts/bagel-fat-one-latin-400.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #fff4dc;
  --dot: #f2dfb4;
  --sheet: #fffdf7;
  --ink: #241340;
  --muted: #54436d;
  --line: #241340;
  --shadow: #241340;
  --focus: #1650e0;
  --gold: #ffc52e;
  --plum: #241340;
  --star-shape: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  --display: "Bagel Fat One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --spring: cubic-bezier(0.3, 1.6, 0.5, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #150d28;
    --dot: #2a1c4a;
    --sheet: #1f1538;
    --ink: #fff4dc;
    --muted: #cfc3e0;
    --line: #fff4dc;
    --shadow: #5a45a0;
    --focus: #ffc52e;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  font-synthesis: none;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 2px, transparent 2.5px);
  background-size: 24px 24px;
  color: var(--ink);
  font: 400 1.125rem/1.55 var(--body);
}

main {
  flex: 1;
  width: min(68rem, 100%);
  margin-inline: auto;
  padding-inline: 1rem;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-underline-offset: 0.16em;
}

:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  border: 3px solid var(--plum);
  border-radius: 12px;
  background: var(--gold);
  color: var(--plum);
  font-weight: 700;
  translate: 0 -200%;
}

.skip:focus {
  translate: 0;
}

.a-gold {
  --a: #ffc52e;
  --on: #241340;
}

/* Stars */

.star {
  display: block;
  width: 62%;
  aspect-ratio: 1;
  margin: auto;
  background: var(--plum);
  clip-path: var(--star-shape);
}

.star--lit {
  position: absolute;
  top: -17%;
  right: -17%;
  z-index: 2;
  width: 62%;
  margin: 0;
  background: none;
  clip-path: none;
  pointer-events: none;
}

.star--lit::before,
.star--lit::after {
  content: "";
  position: absolute;
  clip-path: var(--star-shape);
}

.star--lit::before {
  inset: 0;
  background: var(--plum);
}

.star--lit::after {
  inset: 14%;
  background: var(--gold);
}

/* Tiles */

.board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(0.4rem, 2.2vw, 0.75rem);
  width: min(100%, 30rem);
  margin-inline: auto;
  padding-block: 0.5rem 0.625rem;
  container-type: inline-size;
}

.tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 18%;
  background: none;
  color: inherit;
  font: inherit;
  perspective: 40rem;
  transition: translate 0.15s var(--spring);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.tile.is-lit {
  z-index: 1;
  cursor: pointer;
}

.tile__in {
  display: grid;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.45s var(--spring);
}

.tile__f,
.tile__b {
  grid-area: 1 / 1;
  display: grid;
  place-items: center;
  border: 3px solid var(--line);
  border-radius: 18%;
  background: var(--a);
  color: var(--on);
  box-shadow: 0 5px 0 var(--shadow);
  font-family: var(--display);
  font-size: 2.4rem;
  font-size: 13cqi;
  line-height: 1;
  backface-visibility: hidden;
}

.tile__b {
  transform: rotateX(180deg);
  font-size: 2rem;
  font-size: 10cqi;
}

.tile.is-flipped .tile__in {
  transform: rotateX(180deg);
}

/* Hero */

.hero {
  display: grid;
  gap: 1.75rem;
  padding-block: 2.25rem 2.5rem;
}

.hero__copy {
  text-align: center;
}

.hero__line {
  font-family: var(--display);
  font-size: clamp(2rem, 9.5vw, 3.5rem);
  line-height: 1.16;
}

.hero__line em {
  display: inline-block;
  margin-top: 0.12em;
  padding: 0.02em 0.28em 0.08em;
  border-radius: 0.24em;
  background: var(--gold);
  color: var(--plum);
  font-style: normal;
  rotate: -1.5deg;
}

.hero__sub {
  max-width: 28rem;
  margin: 1rem auto 0;
  color: var(--muted);
}

.toy-status {
  min-height: 1.55em;
  margin-top: 0.75rem;
  font-weight: 700;
}

@media (min-width: 56rem) {
  .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    gap: 3.5rem;
    padding-block: 4rem 3.5rem;
  }

  .hero__copy {
    text-align: left;
  }

  .hero__line {
    font-size: clamp(2.25rem, 4.3vw, 3.5rem);
  }

  .hero__sub {
    margin-inline: 0;
  }
}

/* Game cards */

.games {
  padding-bottom: 3rem;
}

.games h2 {
  margin-bottom: 1.25rem;
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  text-align: center;
}

.cards {
  display: grid;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 44rem) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

.card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  padding: 1.125rem;
  border: 3px solid var(--line);
  border-radius: 24px;
  background: var(--a);
  color: var(--on);
  box-shadow: 0 7px 0 var(--shadow);
  rotate: -0.7deg;
  transition:
    translate 0.18s var(--spring),
    rotate 0.18s var(--spring),
    box-shadow 0.18s ease-out;
}

.card:nth-child(even) {
  rotate: 0.7deg;
}

.card__sheen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 20px;
  pointer-events: none;
}

.card__sheen::before {
  content: "";
  position: absolute;
  inset: -20% auto -20% -45%;
  width: 34%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.4), transparent);
  transform: skewX(-20deg);
}

.card__emoji {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(4.5rem, 22vw, 6rem);
  aspect-ratio: 1;
  align-self: center;
  border: 3px solid var(--plum);
  border-radius: 20px;
  background: #fffdf7;
  font-size: clamp(2.5rem, 12vw, 3.25rem);
  line-height: 1;
}

.card__emoji span {
  display: block;
}

.card__text {
  display: grid;
  gap: 0.25rem;
  align-content: center;
}

.card__name {
  font-size: clamp(1.5rem, 6vw, 1.875rem);
}

.card__name a {
  color: inherit;
  text-decoration: none;
}

/* The heading link covers the whole card. */
.card__name a::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 24px;
}

.card__name a:focus-visible {
  outline: none;
}

.card__name a:focus-visible::after {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

.card__pitch {
  line-height: 1.35;
}

.card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  margin-top: 0.375rem;
  font-size: 1rem;
}

.card__play {
  padding: 0.05rem 0.75rem 0.15rem;
  border-radius: 999px;
  background: var(--on);
  color: var(--a);
  font-family: var(--display);
}

.card__host {
  overflow-wrap: anywhere;
}

@media (hover: hover) {
  .card:hover {
    translate: 0 -4px;
    rotate: 0deg;
    box-shadow: 0 11px 0 var(--shadow);
  }
}

.card:focus-within {
  translate: 0 -4px;
  rotate: 0deg;
  box-shadow: 0 11px 0 var(--shadow);
}

.card:active {
  translate: 0 5px;
  box-shadow: 0 2px 0 var(--shadow);
}

/* Legal pages */

.top {
  width: min(44rem, 100%);
  margin-inline: auto;
  padding: 1.25rem 1rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 44px;
  font-family: var(--display);
  font-size: 1.375rem;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid var(--line);
  border-radius: 10px;
  background: var(--plum);
  box-shadow: 0 3px 0 var(--shadow);
  rotate: -6deg;
}

.brand__mark .star {
  background: var(--gold);
  width: 72%;
}

.prose {
  width: min(44rem, calc(100% - 2rem));
  margin-block: 1rem 3rem;
  padding: 1.5rem 1.25rem 2rem;
  border: 3px solid var(--line);
  border-radius: 24px;
  background: var(--sheet);
  box-shadow: 0 7px 0 var(--shadow);
}

@media (min-width: 40rem) {
  .prose {
    padding: 2.5rem 3rem 3rem;
  }
}

.prose__kicker {
  color: var(--muted);
  font-weight: 700;
}

.prose h1 {
  margin-top: 0.125rem;
  font-size: clamp(2.25rem, 9vw, 3.25rem);
}

.prose__updated {
  margin-top: 0.5rem;
  color: var(--muted);
}

.prose__intro {
  margin-top: 1.25rem;
  font-size: 1.25rem;
  line-height: 1.45;
}

.prose h2 {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 2rem;
  font-size: 1.5rem;
}

.prose h2::before {
  content: "";
  flex: none;
  width: 0.72em;
  height: 0.72em;
  background: #e8a800;
  clip-path: var(--star-shape);
}

.prose p,
.prose ul {
  margin-block: 0.75rem 0;
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.375rem;
}

.prose .game-links {
  display: grid;
  gap: 0.75rem;
  padding: 0;
  list-style: none;
}

@media (min-width: 34rem) {
  .prose .game-links {
    grid-template-columns: repeat(2, 1fr);
  }
}

.prose .game-links li {
  margin: 0;
}

.game-links a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  height: 100%;
  padding: 0.375rem 0.75rem;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: var(--a);
  color: var(--on);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.game-links__emoji {
  display: grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: #fffdf7;
  font-size: 1.25rem;
}

/* 404 */

.lost {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1rem;
  padding-block: 2.5rem 4rem;
  text-align: center;
}

.lost__tiles {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.tile--still {
  width: clamp(4.5rem, 24vw, 6.5rem);
  container-type: inline-size;
}

.tile--still .tile__in {
  transform-style: flat;
}

.tile--still .tile__f {
  font-size: 58cqi;
}

.tile--hole .tile__f {
  font-size: 48cqi;
}

.lost h1 {
  font-size: clamp(2.25rem, 9vw, 3.25rem);
}

.button {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.5rem 1.5rem 0.625rem;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 5px 0 var(--shadow);
  color: var(--plum);
  font-family: var(--display);
  font-size: 1.25rem;
  text-decoration: none;
  transition:
    translate 0.15s var(--spring),
    box-shadow 0.15s ease-out;
}

.button:active {
  translate: 0 4px;
  box-shadow: 0 1px 0 var(--shadow);
}

/* Footer */

.foot {
  padding: 1rem 1rem 2rem;
  color: var(--muted);
  font-size: 1rem;
  text-align: center;
}

.foot ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot a {
  display: inline-block;
  padding-block: 0.625rem;
  color: var(--ink);
}

/* Motion is opt-in: everything below only runs for people who haven't asked for less. */

@media (prefers-reduced-motion: reduce) {
  .tile,
  .tile__in,
  .card,
  .button {
    transition: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .tile__in {
    animation: tile-in 0.6s var(--spring) backwards;
  }

  .tile:nth-child(1) .tile__in { animation-delay: 0.04s; }
  .tile:nth-child(2) .tile__in { animation-delay: 0.1s; }
  .tile:nth-child(3) .tile__in { animation-delay: 0.16s; }
  .tile:nth-child(4) .tile__in { animation-delay: 0.22s; }
  .tile:nth-child(5) .tile__in { animation-delay: 0.28s; }
  .tile:nth-child(6) .tile__in { animation-delay: 0.34s; }
  .tile:nth-child(7) .tile__in { animation-delay: 0.4s; }
  .tile:nth-child(8) .tile__in { animation-delay: 0.46s; }
  .tile:nth-child(9) .tile__in { animation-delay: 0.52s; }
  .tile:nth-child(10) .tile__in { animation-delay: 0.58s; }

  .tile--still .tile__in {
    animation-name: tile-drop;
  }

  .tile--hole .tile__f {
    animation: hole-wobble 0.7s 0.5s ease-in-out 2;
  }

  /* The star pops in wherever it lands, then twinkles a few times and rests. */
  .star--lit {
    animation:
      star-pop 0.3s var(--spring) backwards,
      star-twinkle 1.1s 0.3s ease-in-out 4;
  }

  @media (hover: hover) {
    .tile.is-lit:hover {
      translate: 0 -3px;
    }
  }

  .tile.is-lit:active {
    translate: 0 3px;
  }

  .tile.is-nope {
    animation: tile-nope 0.3s ease-in-out;
  }

  .sparks {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
  }

  .sparks i {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30%;
    aspect-ratio: 1;
    margin: -15% 0 0 -15%;
    background: var(--gold);
    clip-path: var(--star-shape);
    animation: spark 0.6s ease-out both;
  }

  .sparks i:nth-child(1) { --x: 0; --y: -220%; }
  .sparks i:nth-child(2) { --x: 200%; --y: -110%; }
  .sparks i:nth-child(3) { --x: 200%; --y: 110%; }
  .sparks i:nth-child(4) { --x: 0; --y: 220%; }
  .sparks i:nth-child(5) { --x: -200%; --y: 110%; }
  .sparks i:nth-child(6) { --x: -200%; --y: -110%; }

  .card:hover .card__sheen::before,
  .card:focus-within .card__sheen::before {
    animation: sheen 0.75s ease-out;
  }

  .m-climb.is-seen .card__emoji span,
  .m-climb:hover .card__emoji span,
  .m-climb:focus-within .card__emoji span {
    animation: climb 0.8s ease-in-out;
  }

  .m-swing .card__emoji {
    perspective: 12rem;
  }

  .m-swing .card__emoji span {
    transform-origin: 18% 50%;
  }

  .m-swing.is-seen .card__emoji span,
  .m-swing:hover .card__emoji span,
  .m-swing:focus-within .card__emoji span {
    animation: swing 0.9s ease-in-out;
  }

  .m-shrug.is-seen .card__emoji span,
  .m-shrug:hover .card__emoji span,
  .m-shrug:focus-within .card__emoji span {
    animation: shrug 0.8s ease-in-out;
  }

  .m-sink.is-seen .card__emoji span,
  .m-sink:hover .card__emoji span,
  .m-sink:focus-within .card__emoji span {
    animation: sink 0.9s ease-in-out;
  }
}

@keyframes tile-in {
  from {
    transform: rotateX(-110deg) translateY(-30%);
    opacity: 0;
  }
}

@keyframes tile-drop {
  from {
    transform: translateY(-140%) rotate(-12deg);
    opacity: 0;
  }
}

@keyframes hole-wobble {
  50% {
    transform: rotate(8deg) scale(1.06);
  }
}

@keyframes star-pop {
  from {
    transform: scale(0) rotate(-90deg);
  }
}

@keyframes star-twinkle {
  50% {
    transform: scale(1.22) rotate(45deg);
  }
}

@keyframes tile-nope {
  25% {
    transform: translateX(-4%) rotate(-3deg);
  }
  75% {
    transform: translateX(4%) rotate(3deg);
  }
}

@keyframes spark {
  from {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  to {
    transform: translate(var(--x), var(--y)) scale(0.2) rotate(120deg);
    opacity: 0;
  }
}

@keyframes sheen {
  to {
    transform: skewX(-20deg) translateX(520%);
  }
}

@keyframes climb {
  20%,
  60% {
    transform: translateY(-16%);
  }
  40%,
  80% {
    transform: translateY(-8%);
  }
}

@keyframes swing {
  40% {
    transform: rotateY(-62deg);
  }
  70% {
    transform: rotateY(-48deg);
  }
}

@keyframes shrug {
  25% {
    transform: translateY(-12%) rotate(-9deg);
  }
  75% {
    transform: translateY(-12%) rotate(9deg);
  }
}

@keyframes sink {
  50% {
    transform: scale(0.15) rotate(200deg);
  }
  65% {
    transform: scale(0.15) rotate(260deg);
  }
}

.a-vibe-ladder{--a:#c2410c;--on:#ffffff}
.a-the-bouncer{--a:#ff4fc3;--on:#1c1917}
.a-yesnoshrug{--a:#2f45c9;--on:#ffffff}
.a-loophole{--a:#1c1917;--on:#ffffff}
