/* Title, vs and results screens. Same candy-cloud vocabulary as the select screen:
   thick --foreground outlines, pastel fills, hard drop shadows, 135deg candy stripes. */

/* big sticker lettering: pink fill, dark outline, dark 3D extrusion */
.gf-sticker-text {
  color: var(--primary);
  font-family: var(--font-display);
  font-weight: 700;
  -webkit-text-stroke: .1em var(--foreground);
  paint-order: stroke fill;
  text-shadow: 0 .06em 0 var(--foreground), 0 .1em 0 var(--foreground), 0 .16em .2em color-mix(in oklab, var(--foreground) 28%, transparent);
}

/* ================================================================== title */

.gf-title {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 100dvh;
  overflow: hidden;
}

/* the tilted Family Portrait, scrolling away from the camera (after phobia_sheet.png) */
.gf-mosaic {
  position: absolute;
  inset: 0;
  overflow: hidden;
  perspective: 1500px;
  perspective-origin: 70% 20%;
  pointer-events: none;
}
.gf-mosaic-frame {
  position: absolute;
  top: 2%;
  left: 36%;
  width: 1840px;
  border: 5px solid var(--foreground);
  border-radius: 8px;
  background: var(--foreground);
  box-shadow: 0 0 0 7px var(--lemon-soft), 0 0 0 10px var(--foreground);
  transform-origin: 0 0;
  transform: rotateX(46deg) rotateZ(-9deg);
}
.gf-mosaic-band {
  height: 56px;
  border-bottom: 3px solid var(--foreground);
  background: repeating-linear-gradient(135deg, oklch(90% .08 228) 0 18px, var(--card-solid) 18px 36px);
}
.gf-mosaic-window { height: 1500px; overflow: hidden; padding: 0 12px; }
.gf-mosaic-plane { animation: gf-mosaic-scroll 70s linear infinite; will-change: transform; }
.gf-mosaic-block {
  display: grid;
  grid-template-columns: repeat(var(--mosaic-cols, 22), 1fr);
  gap: 8px;
  padding-top: 8px;
}
.gf-mosaic-tile { position: relative; display: block; aspect-ratio: 1; border-radius: 3px; background: var(--sky-soft); }
.gf-mosaic-tile:nth-child(9n+2) { background: var(--pink-soft); }
.gf-mosaic-tile:nth-child(9n+4) { background: var(--lemon-soft); }
.gf-mosaic-tile:nth-child(9n+7) { background: var(--mint-soft); }
.gf-mosaic-tile img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
@keyframes gf-mosaic-scroll { to { transform: translateY(-50%); } }

/* soft light wash so the menu reads, plus depth-of-field blur on the far rows */
.gf-title-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--background) 96%, transparent) 0%, color-mix(in oklab, var(--background) 88%, transparent) 30%, color-mix(in oklab, var(--background) 10%, transparent) 52%, transparent 70%),
    linear-gradient(180deg, color-mix(in oklab, var(--background) 70%, transparent) 0%, transparent 22%);
  backdrop-filter: blur(3px);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgb(0 0 0 / .5) 28%, transparent 45%);
  mask-image: linear-gradient(180deg, #000 0%, rgb(0 0 0 / .5) 28%, transparent 45%);
}
.gf-title::before {
  /* the left-side wash without the blur mask */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(90deg, color-mix(in oklab, var(--background) 97%, transparent) 0%, color-mix(in oklab, var(--background) 90%, transparent) 30%, color-mix(in oklab, var(--background) 25%, transparent) 50%, transparent 64%);
}
.gf-mosaic { z-index: 0; }
.gf-title::before { z-index: 1; }
.gf-title-wash { z-index: 1; }

.gf-title-main {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  width: min(100%, 560px);
  padding: max(32px, env(safe-area-inset-top)) 24px 16px max(clamp(24px, 6vw, 96px), env(safe-area-inset-left));
}
.gf-title-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.gf-kicker { margin: 0; color: var(--primary); font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

.gf-wordmark {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(64px, min(8.6vw, 15.5dvh), 138px);
  font-weight: 700;
  line-height: .84;
  letter-spacing: .01em;
}
.gf-word {
  position: relative;
  display: block;
  width: max-content;
  color: var(--primary);
  -webkit-text-stroke: .11em var(--foreground);
  paint-order: stroke fill;
  text-shadow: 0 .045em 0 var(--foreground), 0 .09em 0 var(--foreground), 0 .2em .24em color-mix(in oklab, var(--foreground) 30%, transparent);
}
.gf-word-a { color: var(--card-solid); transform: rotate(-3deg); transform-origin: 0 100%; }
.gf-word-b { margin-left: .18em; transform: rotate(-3deg); transform-origin: 0 100%; }
/* candy stripes laid over the fill (a separate layer: text-shadow would bleed through a clipped background) */
.gf-word-b::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: transparent;
  -webkit-text-stroke: 0;
  text-shadow: none;
  background: repeating-linear-gradient(135deg, transparent 0 .09em, color-mix(in oklab, var(--card-solid) 38%, transparent) .09em .18em);
  -webkit-background-clip: text;
  background-clip: text;
}
.gf-word-star {
  position: absolute;
  top: -.02em;
  left: 5.75em;
  color: var(--lemon-soft);
  font-size: .42em;
  -webkit-text-stroke: .1em var(--foreground);
  paint-order: stroke fill;
  text-shadow: 0 .08em 0 var(--foreground);
  animation: gf-spin-bob 5s ease-in-out infinite;
}
@keyframes gf-spin-bob { 50% { transform: translateY(-8px) rotate(20deg) scale(1.1); } }

.gf-title-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; }

.gf-menu { display: flex; flex-direction: column; gap: 10px; width: min(100%, 420px); }
.gf-menu-btn {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  width: 100%;
  padding: 9px 18px 10px;
  border: 3px solid var(--foreground);
  border-radius: 18px;
  background: var(--card-solid);
  color: var(--foreground);
  box-shadow: 0 5px 0 var(--foreground);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s cubic-bezier(.2, 1.4, .35, 1), background-color .12s, box-shadow .16s;
}
.gf-menu-btn:nth-child(2) { --menu-tint: var(--sky-soft); }
.gf-menu-btn:nth-child(3) { --menu-tint: var(--lemon-soft); }
.gf-menu-btn:nth-child(4) { --menu-tint: var(--mint-soft); }
.gf-menu-btn:nth-child(5) { --menu-tint: var(--violet-soft); }
.gf-menu-label { grid-column: 1; font-family: var(--font-display); font-size: 22px; font-weight: 700; line-height: 1.1; }
.gf-menu-sub { grid-column: 1; color: var(--muted-foreground); font-size: 12.5px; font-weight: 800; line-height: 1.25; }
.gf-menu-arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--lemon-soft);
  font-size: 24px;
  -webkit-text-stroke: 1.5px var(--foreground);
  paint-order: stroke fill;
  opacity: 0;
  transform: scale(.4) rotate(-40deg);
  transition: opacity .16s, transform .22s cubic-bezier(.2, 1.6, .35, 1);
}
.gf-menu-btn:active { transform: translateY(3px) scale(.98); box-shadow: 0 2px 0 var(--foreground); }
.gf-menu-btn.is-current {
  background: var(--primary);
  color: var(--primary-foreground);
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 0 8px 0 var(--foreground), 0 0 0 6px color-mix(in oklab, var(--primary) 28%, transparent);
}
.gf-menu-btn.is-current .gf-menu-label { text-shadow: 0 2px 0 var(--primary-border); }
.gf-menu-btn.is-current .gf-menu-sub { color: color-mix(in oklab, var(--primary-foreground) 92%, transparent); }
.gf-menu-btn.is-current .gf-menu-arrow { opacity: 1; transform: none; }
@media (hover: hover) {
  .gf-menu-btn:not(.is-current):hover { background: var(--menu-tint, var(--pink-soft)); }
}
.gf-menu-btn:focus-visible { outline: 4px solid color-mix(in oklab, var(--primary) 45%, transparent); outline-offset: 3px; }

.gf-title-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 6px; }
.gf-title-keys { color: var(--muted-foreground); font-family: var(--font-display); font-size: 12px; font-weight: 600; }

.gf-title-foot {
  position: relative;
  z-index: 2;
  justify-self: center;
  max-width: calc(100% - 32px);
  margin: 0 16px max(14px, env(safe-area-inset-bottom));
  padding: 6px 14px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: color-mix(in oklab, var(--card-solid) 88%, transparent);
  color: var(--muted-foreground);
  box-shadow: var(--shadow-cloud);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}
.gf-title-foot a { color: var(--primary-border); text-decoration-thickness: 2px; text-underline-offset: 2px; }

/* how to play */
.gf-howto { max-width: 720px; }
.gf-sheet-title { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 700; }
.gf-sheet-lead { margin: 4px 0 12px; color: var(--muted-foreground); font-size: 14px; }
.gf-sheet-sub { margin: 14px 0 6px; font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.gf-sheet-note { margin: 10px 0 0; color: var(--muted-foreground); font-size: 13px; }
.gf-howto-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.gf-keys { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.gf-keys th, .gf-keys td { padding: 6px 8px; border-bottom: 2px dashed var(--border); text-align: left; vertical-align: middle; white-space: nowrap; }
.gf-keys thead th { font-family: var(--font-display); font-size: 13px; border-bottom: 3px solid var(--foreground); }
.gf-keys tbody th { font-family: var(--font-display); font-weight: 700; }
.gf-keys tbody th b { color: var(--primary); }
.gf-keys tr:last-child th, .gf-keys tr:last-child td { border-bottom: 0; }
kbd {
  display: inline-block;
  min-width: 22px;
  margin: 1px 1px;
  padding: 1px 6px;
  border: 1.5px solid var(--foreground);
  border-radius: 6px;
  background: var(--card-solid);
  box-shadow: 0 2px 0 var(--foreground);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}
.gf-movelist { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.gf-movelist li { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 10px; padding: 5px 8px; border-radius: 10px; }
.gf-movelist li:nth-child(odd) { background: color-mix(in oklab, var(--pink-soft) 45%, transparent); }
.gf-inputs { font-family: var(--font-display); font-weight: 700; font-size: 12px; white-space: nowrap; }
.gf-sheet-actions { display: flex; justify-content: flex-end; margin-top: 16px; }

/* touch devices: the pad comes first, and "Got it" stays in reach while the sheet scrolls */
.gf-sheet-sub-first { margin-top: 6px; }
.gf-howto.is-touch { padding-bottom: 0; }
.gf-howto.is-touch .gf-sheet-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 14px -22px 0;
  padding: 14px 22px max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, color-mix(in oklab, var(--card-solid) 0%, transparent), var(--card-solid) 38%);
}
.gf-howto.is-touch .gf-sheet-actions .btn { width: 100%; min-height: 54px; font-size: 18px; }

/* a small picture of the touch pad (the real one lives in css/fight.css) */
.gf-pad-demo {
  position: relative;
  height: 128px;
  margin: 0 0 12px;
  overflow: hidden;
  border: 3px solid var(--foreground);
  border-radius: 20px;
  background: repeating-linear-gradient(135deg, var(--sky-soft) 0 14px, var(--card-solid) 14px 28px);
  box-shadow: 0 4px 0 var(--foreground);
}
.gf-pad-stage {
  position: absolute;
  top: 10px;
  left: 29%;
  width: 27%;
  height: 46%;
  border: 2.5px solid var(--foreground);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--sky-soft) 0 70%, var(--mint-soft) 70%);
  translate: -50% 0;
}
.gf-pad-stick {
  position: absolute;
  left: 8%;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border: 3px solid var(--foreground);
  border-radius: 50%;
  background: color-mix(in oklab, var(--card-solid) 88%, transparent);
  box-shadow: 0 3px 0 var(--foreground);
}
.gf-pad-stick i { width: 34px; height: 34px; border: 3px solid var(--foreground); border-radius: 50%; background: var(--lemon-soft); translate: 8px -6px; }
.gf-pad-btn, .gf-pad-pill, .gf-pad-pause {
  position: absolute;
  display: grid;
  place-items: center;
  border: 2.5px solid var(--foreground);
  background: var(--c, var(--card-solid));
  box-shadow: 0 3px 0 var(--foreground);
  color: var(--foreground);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
}
.gf-pad-btn { width: 40px; height: 40px; border-radius: 50%; font-size: 17px; }
.gf-pad-p { --c: var(--pink-soft); right: calc(8% + 88px); bottom: 12px; }
.gf-pad-k { --c: var(--sky-soft); right: calc(8% + 42px); bottom: 26px; }
.gf-pad-s { --c: var(--lemon-soft); right: 8%; bottom: 52px; }
.gf-pad-pill { height: 24px; padding: 0 9px; border-radius: 999px; font-size: 11px; }
.gf-pad-super { --c: var(--violet-soft); right: calc(8% + 30px); top: 12px; }
.gf-pad-toss { --c: var(--mint-soft); right: calc(8% + 96px); top: 12px; }
.gf-pad-pause { top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; font-size: 11px; letter-spacing: -.06em; }
.gf-touchlist { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 1.35; }
.gf-touchlist li { padding: 7px 10px; border-radius: 12px; background: color-mix(in oklab, var(--sky-soft) 40%, transparent); }
.gf-touchlist li:nth-child(even) { background: color-mix(in oklab, var(--pink-soft) 45%, transparent); }
.gf-touchlist b { font-family: var(--font-display); font-weight: 700; }

/* phones and tablets: half the mosaic tiles (bigger, on a smaller wall), glows held still */
.gf-title.is-lite .gf-mosaic-frame { width: 1180px; }
.gf-title.is-lite .gf-mosaic-block { gap: 7px; padding-top: 7px; }
.gf-title.is-lite .gf-mosaic-window { height: 1160px; }
.gf-title.is-lite .gf-mosaic .family-featured { --feature-hue: var(--feature-hue-base, 0); animation: none; }
.gf-title.is-lite .gf-mosaic .family-featured img { animation: none; }
.gf-title.is-lite .gf-title-wash { backdrop-filter: none; }
@media (pointer: coarse) {
  .gf-title .gf-mute { min-height: 48px; padding: 8px 18px; font-size: 14px; }
}

@media (max-height: 800px) and (min-width: 700px) {
  .gf-title-main, .gf-title-brand { gap: 10px; }
  .gf-title-main { padding-top: max(18px, env(safe-area-inset-top)); }
  .gf-menu { gap: 8px; }
  .gf-menu-btn { padding: 6px 16px 7px; }
  .gf-menu-label { font-size: 19px; }
  .gf-menu-sub { font-size: 11.5px; }
  .gf-kicker { font-size: 13px; }
}

/* tablets held upright: a bigger wordmark and menu for the tall screen */
@media (min-width: 700px) and (min-height: 900px) and (orientation: portrait) {
  .gf-title-main { width: min(100%, 660px); gap: 18px; }
  .gf-title-brand { gap: 16px; }
  .gf-wordmark { font-size: clamp(64px, 14vw, 138px); }
  .gf-kicker { font-size: 17px; }
  .gf-menu { width: min(100%, 500px); gap: 12px; }
  .gf-menu-btn { padding: 12px 22px 13px; border-radius: 20px; }
  .gf-menu-label { font-size: 26px; }
  .gf-menu-sub { font-size: 14px; }
}

/* short phones (SE): a tighter stack so the whole menu fits the first screen */
@media (max-width: 699px) and (max-height: 700px) {
  .gf-title-main, .gf-title-brand { gap: 10px; }
  .gf-title-main { padding-top: max(18px, env(safe-area-inset-top)); }
  .gf-wordmark { font-size: min(19vw, 11.5dvh); margin-bottom: 2px; }
  .gf-menu { gap: 8px; }
  .gf-menu-btn { padding: 6px 16px 7px; }
  .gf-menu-label { font-size: 20px; }
}

/* the how-to on a phone on its side: a slimmer "Got it" bar */
@media (orientation: landscape) and (max-height: 520px) {
  .gf-howto.is-touch .gf-sheet-actions { padding-top: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .gf-howto.is-touch .gf-sheet-actions .btn { min-height: 48px; font-size: 16px; }
}

@media (max-width: 559px) {
  /* phones: keep the action, 1P and touch columns */
  .gf-keys th:nth-child(3), .gf-keys td:nth-child(3), .gf-keys th:nth-child(4), .gf-keys td:nth-child(4) { display: none; }
}

@media (max-width: 699px) {
  .gf-title-main { width: 100%; align-items: stretch; padding: max(28px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left)); }
  .gf-wordmark { font-size: clamp(56px, 19vw, 96px); align-self: flex-start; }
  .gf-menu { width: 100%; }
  .gf-mosaic-frame { top: -4%; left: -30%; width: 1500px; transform: rotateX(50deg) rotateZ(-10deg); }
  .gf-title.is-lite .gf-mosaic-frame { width: 1000px; }
  .gf-title.is-lite .gf-mosaic-window { height: 980px; }
  .gf-kicker { font-size: clamp(12px, 3.6vw, 15px); }
  .gf-title::before { background: color-mix(in oklab, var(--background) 78%, transparent); }
  .gf-title-wash { display: none; }
  .gf-title-keys { display: none; }
  .gf-movelist li { grid-template-columns: 1fr; gap: 2px; }
  .sheet { padding: 16px; }
}

/* phones on their side: the wordmark on the left, the whole menu on the right, one screen */
@media (orientation: landscape) and (max-height: 520px) {
  .gf-title-main {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 1fr);
    grid-template-areas: "brand menu" "tools menu";
    align-content: center;
    align-items: center;
    gap: 10px clamp(20px, 5vw, 56px);
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    padding: max(12px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 8px max(24px, env(safe-area-inset-left));
  }
  .gf-title-brand { grid-area: brand; gap: 8px; align-self: end; }
  .gf-title-tools { grid-area: tools; align-self: start; margin-top: 0; }
  .gf-kicker { font-size: 11.5px; }
  .gf-wordmark { margin: 0; font-size: clamp(46px, 19dvh, 84px); }
  .gf-title-pills { margin: 0; }
  .gf-title-pills .pill { font-size: 11px; }
  .gf-menu { grid-area: menu; width: 100%; gap: 7px; }
  .gf-menu-btn { padding: 5px 16px 6px; border-radius: 16px; }
  .gf-menu-label { font-size: 18px; }
  .gf-menu-sub { font-size: 11px; }
  .gf-title-foot { margin-bottom: max(8px, env(safe-area-inset-bottom)); padding: 4px 12px; font-size: 10.5px; }
  .gf-title::before { background: linear-gradient(90deg, color-mix(in oklab, var(--background) 92%, transparent) 0%, color-mix(in oklab, var(--background) 70%, transparent) 45%, color-mix(in oklab, var(--background) 45%, transparent) 100%); }
  .gf-title-wash { display: none; }
  .gf-title-keys { display: none; }
}

/* ================================================================== vs */

.gf-vs {
  position: relative;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
  background: var(--foreground);
  cursor: pointer;
}
.gf-vs-side { position: absolute; inset: 0; }
.gf-vs-p1 {
  clip-path: polygon(0 0, 57% 0, 43% 100%, 0 100%);
  background: repeating-linear-gradient(135deg, var(--pink-soft) 0 34px, var(--card-solid) 34px 68px);
  background-size: 96.17px 96.17px;
  animation: gf-vs-in-left .52s cubic-bezier(.2, 1.15, .35, 1) both, gf-stripes-slide 2.4s linear infinite;
}
.gf-vs-p2 {
  clip-path: polygon(57% 0, 100% 0, 100% 100%, 43% 100%);
  background: repeating-linear-gradient(135deg, var(--pink-soft) 0 34px, var(--card-solid) 34px 68px);
  background-size: 96.17px 96.17px;
  animation: gf-vs-in-right .52s cubic-bezier(.2, 1.15, .35, 1) both, gf-stripes-slide-r 2.4s linear infinite;
}
@keyframes gf-vs-in-left { from { transform: translateX(-100%); } }
@keyframes gf-vs-in-right { from { transform: translateX(100%); } }
@keyframes gf-stripes-slide { to { background-position: 96.17px 0; } }
@keyframes gf-stripes-slide-r { to { background-position: -96.17px 0; } }

/* the diagonal seam: lemon candy line with dark outlines */
.gf-vs-seam { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; animation: sheet-fade .3s .35s both; }

.gf-vs-fighter {
  position: absolute;
  z-index: 3;
  top: 50%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(40vw, 470px);
}
.gf-vs-p1 .gf-vs-fighter { left: 6vw; transform: translateY(-54%); align-items: flex-start; }
.gf-vs-p2 .gf-vs-fighter { right: 6vw; transform: translateY(-54%); align-items: flex-end; text-align: right; }

.gf-vs-art {
  position: relative;
  width: min(34vw, 56dvh, 400px);
  aspect-ratio: 1;
  border: 5px solid var(--foreground);
  border-radius: 26px;
  background: var(--pink-soft);
  box-shadow: 0 0 0 7px var(--card-solid), 0 0 0 10px var(--foreground), 0 18px 0 -2px var(--primary), 0 30px 40px color-mix(in oklab, var(--foreground) 30%, transparent);
}
.gf-vs-art img { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
/* featured tiers keep the sticker ring and add the site's hue-spinning glow around it */
.gf-vs-art.family-featured {
  box-shadow: 0 0 0 7px var(--card-solid), 0 0 0 10px var(--foreground), 0 18px 0 -2px var(--primary),
    0 0 46px 16px color-mix(in oklab, var(--family-feature-color) 55%, transparent);
}
.gf-vs-art.family-featured img { border: 0; box-shadow: none; animation: none; }
.gf-vs-p1 .gf-vs-art { transform: rotate(-4deg); animation: gf-vs-art-in .6s .15s cubic-bezier(.2, 1.5, .35, 1) both; }
.gf-vs-p2 .gf-vs-art { transform: rotate(4deg); animation: gf-vs-art-in .6s .2s cubic-bezier(.2, 1.5, .35, 1) both; }
.gf-vs-p1 .gf-vs-art.family-featured { animation: gf-vs-art-in .6s .15s cubic-bezier(.2, 1.5, .35, 1) both, family-hue-spin var(--feature-hue-speed, 10s) linear infinite; }
.gf-vs-p2 .gf-vs-art.family-featured { animation: gf-vs-art-in .6s .2s cubic-bezier(.2, 1.5, .35, 1) both, family-hue-spin var(--feature-hue-speed, 10s) linear infinite; }
@keyframes gf-vs-art-in { from { opacity: 0; transform: scale(.6) rotate(-14deg); } }

.gf-vs-tag { position: absolute; top: -18px; z-index: 2; font-size: 16px; padding: 4px 14px; }
.gf-vs-p1 .gf-vs-tag { left: 18px; transform: rotate(-6deg); }
.gf-vs-p2 .gf-vs-tag { right: 18px; transform: rotate(6deg); }

.gf-vs-name {
  margin: 8px 0 0;
  max-width: 100%;
  overflow: hidden;
  padding: 0 4px 6px;
  color: var(--foreground);
  font-family: var(--font-display);
  font-size: clamp(26px, 3.3vw, 48px);
  font-weight: 700;
  line-height: 1.05;
  white-space: nowrap;
  text-overflow: ellipsis;
  -webkit-text-stroke: 7px var(--card-solid);
  paint-order: stroke fill;
}
.gf-vs-name .gf-handle { font-size: inherit; overflow: visible; }
.gf-vs-name .gf-x { font-size: .5em; vertical-align: .32em; box-shadow: 0 0 0 3px var(--card-solid); }
.gf-vs-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.gf-vs-p2 .gf-vs-pills { justify-content: flex-end; }
.gf-vs-pills .pill { font-size: 13px; padding: 4px 12px; }
.gf-vs-info { display: flex; flex-direction: column; gap: 8px; max-width: 100%; animation: sheet-pop .4s .35s both; }
.gf-vs-p2 .gf-vs-info { align-items: flex-end; }
/* the skill: its prop sticker breaking out of a pill in the skill's colour */
.gf-vs-pills .gf-vs-skill {
  --skill: var(--primary);
  gap: 7px;
  padding: 3px 12px 3px 36px;
  position: relative;
  background: color-mix(in oklab, var(--skill) 24%, var(--card-solid));
}
.gf-vs-skill b { font-weight: 700; }
.gf-vs-prop { position: absolute; left: -6px; top: 50%; width: 36px; height: 36px; translate: 0 -50%; rotate: -10deg; }
.gf-vs-desc {
  max-width: min(100%, 360px);
  margin: 0;
  padding: 4px 11px 5px;
  border: 2px solid var(--foreground);
  border-radius: 12px;
  background: color-mix(in oklab, var(--card-solid) 92%, transparent);
  box-shadow: 0 3px 0 var(--foreground);
  color: var(--foreground);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}
.gf-vs-desc kbd { margin: 0 3px 0 0; font-size: 11px; }

.gf-vs-badge {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: clamp(112px, 13vw, 172px);
  aspect-ratio: 1;
  border: 5px solid var(--foreground);
  border-radius: 50%;
  background: var(--lemon-soft);
  box-shadow: 0 0 0 7px var(--card-solid), 0 0 0 10px var(--foreground), 0 12px 0 2px var(--foreground);
  translate: -50% -50%;
  animation: gf-vs-badge-in .55s .3s cubic-bezier(.2, 1.7, .35, 1) both, gf-vs-bob 1.6s .9s ease-in-out infinite;
}
.gf-vs-badge span {
  color: var(--primary);
  font-family: var(--font-display);
  font-size: clamp(48px, 6vw, 80px);
  font-weight: 700;
  line-height: 1;
  -webkit-text-stroke: 8px var(--foreground);
  paint-order: stroke fill;
  text-shadow: 0 5px 0 var(--foreground);
  transform: rotate(-8deg);
}
@keyframes gf-vs-badge-in { from { opacity: 0; transform: scale(0) rotate(-120deg); } }
@keyframes gf-vs-bob { 50% { transform: translateY(-8px) rotate(4deg) scale(1.04); } }

.gf-vs-foot {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100% - 32px);
  translate: -50% 0;
  animation: sheet-pop .4s .5s both;
}
.gf-vs-foot .pill { font-size: 13px; padding: 5px 12px; }
.gf-vs-pips { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 2px solid var(--foreground); border-radius: 999px; background: var(--card-solid); box-shadow: var(--shadow-cloud); }
.gf-vs-pips i {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--foreground);
  border-radius: 50%;
  background: var(--card-solid);
  font-family: var(--font-display);
  font-size: 11px;
  font-style: normal;
  line-height: 1;
}
.gf-vs-pips i.done { background: var(--mint-soft); }
.gf-vs-pips i.now { background: var(--primary); color: #fff; box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 30%, transparent); animation: gf-pip 1s ease-in-out infinite; }
.gf-vs-pips i.boss { background: var(--foreground); color: var(--lemon-soft); }
.gf-vs-pips i.boss.now { background: var(--primary); color: #fff; }
@keyframes gf-pip { 50% { transform: scale(1.18); } }
.gf-vs-foot .gf-vs-skip { box-shadow: none; }
.gf-vs-top {
  position: absolute;
  z-index: 6;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  translate: -50% 0;
  animation: sheet-pop .4s .45s both;
}

/* the stacked split (js/screens/vs.js matches the same query for its seam) */
@media (orientation: portrait), (max-width: 560px) {
  .gf-vs-p1 { clip-path: polygon(0 0, 100% 0, 100% 44%, 0 54%); }
  .gf-vs-p2 { clip-path: polygon(0 54%, 100% 44%, 100% 100%, 0 100%); }
  @keyframes gf-vs-in-left { from { transform: translateY(-100%); } }
  @keyframes gf-vs-in-right { from { transform: translateY(100%); } }
  .gf-vs-fighter { width: calc(100% - 32px); flex-direction: row; align-items: center; gap: 16px; }
  .gf-vs-p1 .gf-vs-fighter { top: 11%; left: max(20px, env(safe-area-inset-left)); transform: none; align-items: center; }
  .gf-vs-p2 .gf-vs-fighter { top: auto; bottom: 12%; right: max(20px, env(safe-area-inset-right)); transform: none; flex-direction: row-reverse; align-items: center; }
  .gf-vs-art { width: min(42vw, 27dvh); flex: none; border-width: 4px; border-radius: 20px; box-shadow: 0 0 0 5px var(--card-solid), 0 0 0 8px var(--foreground), 0 12px 0 -2px var(--primary); }
  .gf-vs-info { min-width: 0; flex: 1; }
  /* long handles wrap to a second line instead of losing their end */
  .gf-vs-name {
    display: -webkit-box;
    font-size: clamp(20px, 6vw, 34px);
    line-height: 1.08;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    -webkit-text-stroke: 6px var(--card-solid);
  }
  .gf-vs-name .gf-x { vertical-align: .22em; }
  .gf-vs-pills { gap: 6px; }
  .gf-vs-pills .pill { font-size: 11px; padding: 3px 9px; }
  .gf-vs-pills .gf-vs-skill { padding: 2px 9px 2px 29px; }
  .gf-vs-prop { width: 30px; height: 30px; left: -5px; }
  .gf-vs-desc { padding: 3px 9px 4px; font-size: 11.5px; box-shadow: 0 2px 0 var(--foreground); }
  .gf-vs-tag { font-size: 13px; top: -14px; }
  .gf-vs-badge { width: 104px; top: 49%; }
  .gf-vs-badge span { font-size: 46px; -webkit-text-stroke: 6px var(--foreground); }
  .gf-vs-foot { bottom: max(14px, env(safe-area-inset-bottom)); }
  .gf-vs-top { top: max(12px, env(safe-area-inset-top)); }
}
@media (orientation: portrait) and (max-width: 420px) {
  .gf-vs-fighter { gap: 12px; }
  .gf-vs-name { font-size: clamp(19px, 5.6vw, 26px); }
}

/* phones on their side: the same diagonal split, sized to a short screen */
@media (orientation: landscape) and (max-height: 520px) and (min-width: 561px) {
  .gf-vs-fighter { top: 52%; gap: 10px; width: min(40vw, 400px); }
  .gf-vs-p1 .gf-vs-fighter { left: max(5vw, env(safe-area-inset-left)); transform: translateY(-50%); }
  .gf-vs-p2 .gf-vs-fighter { right: max(5vw, env(safe-area-inset-right)); transform: translateY(-50%); }
  .gf-vs-art { width: min(26vw, 44dvh); border-width: 4px; border-radius: 20px; box-shadow: 0 0 0 5px var(--card-solid), 0 0 0 8px var(--foreground), 0 12px 0 -2px var(--primary); }
  .gf-vs-art img { border-radius: 16px; }
  .gf-vs-tag { font-size: 13px; top: -14px; }
  .gf-vs-name { margin-top: 4px; padding-bottom: 2px; font-size: clamp(18px, 3.2vw, 30px); -webkit-text-stroke: 6px var(--card-solid); }
  .gf-vs-info { gap: 5px; }
  .gf-vs-pills { gap: 6px; }
  .gf-vs-pills .pill { font-size: 11px; padding: 3px 9px; }
  .gf-vs-pills .gf-vs-skill { padding: 2px 9px 2px 29px; }
  .gf-vs-prop { width: 30px; height: 30px; left: -5px; }
  .gf-vs-desc { padding: 3px 9px 4px; font-size: 11.5px; box-shadow: 0 2px 0 var(--foreground); }
  .gf-vs-badge { width: 92px; }
  .gf-vs-badge span { font-size: 40px; -webkit-text-stroke: 6px var(--foreground); }
  .gf-vs-top { top: max(8px, env(safe-area-inset-top)); }
  .gf-vs-foot { bottom: max(8px, env(safe-area-inset-bottom)); }
  .gf-vs-foot .pill { font-size: 11.5px; padding: 3px 10px; }
}

/* ================================================================== results */

.gf-results { display: grid; place-items: center; padding: max(40px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); overflow-x: clip; }
.gf-res-main { display: flex; flex-direction: column; align-items: center; gap: 22px; width: min(100%, 780px); }

.gf-res-head { margin: 0; text-align: center; font-family: var(--font-display); font-size: clamp(34px, 5vw, 60px); font-weight: 700; line-height: .95; }
.gf-res-head span { display: inline-block; }
.gf-res-sub { margin: -10px 0 0; color: var(--muted-foreground); font-family: var(--font-display); font-size: 15px; font-weight: 600; text-align: center; }

.family-spotlight {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 22px;
  width: 100%;
  padding: 26px 24px 22px;
  border: 4px solid var(--foreground);
  border-radius: 2rem;
  background: linear-gradient(120deg, var(--lemon-soft), var(--pink-soft) 55%, var(--mint-soft));
  animation: family-spotlight-breathe 4s ease-in-out infinite;
}
@keyframes family-spotlight-breathe {
  0%, to { box-shadow: 0 6px 0 var(--primary-border), 0 0 0 0 color-mix(in oklab, var(--primary) 35%, transparent); }
  50% { box-shadow: 0 6px 0 var(--primary-border), 0 0 34px 6px color-mix(in oklab, var(--primary) 30%, transparent); }
}
.gf-spot-ribbon { position: absolute; top: -16px; left: 24px; font-size: 14px; padding: 4px 14px; }
.gf-spot-ribbon span { font-size: 18px; line-height: 1; }
.gf-spot-face { position: relative; flex: none; }
.gf-spot-face img {
  width: 150px;
  height: 150px;
  border: 4px solid var(--foreground);
  border-radius: 1rem;
  object-fit: cover;
  background: var(--pink-soft);
  box-shadow: var(--shadow-cloud);
  transform: rotate(-3deg);
}
.gf-spot-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--foreground);
  border-radius: 50%;
  background: var(--mint-soft);
  box-shadow: var(--shadow-cloud);
  font-family: var(--font-display);
  font-size: 15px;
}
.gf-spot-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1 1 280px; }
.gf-spot-kicker { margin: 0; color: var(--primary); font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.gf-spot-handle { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; font-family: var(--font-display); font-size: clamp(24px, 3.4vw, 34px); font-weight: 700; line-height: 1.1; }
.gf-spot-handle .gf-handle { font-size: inherit; overflow-wrap: anywhere; white-space: normal; }
.gf-spot-handle .gf-x { font-size: .6em; }
.gf-spot-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.gf-beat { gap: 6px; padding-left: 4px; }
.gf-beat img { width: 20px; height: 20px; border: 1.5px solid var(--foreground); border-radius: 50%; object-fit: cover; }
.gf-spot-quote { margin: 0; color: var(--primary-border); font-family: var(--font-display); font-size: 15px; font-weight: 700; line-height: 1.3; }
.gf-spot-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.gf-round { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border: 2px solid var(--foreground); border-radius: 999px; font-family: var(--font-display); font-size: 12.5px; font-weight: 700; box-shadow: 1px 2px 0 var(--foreground); }
.gf-round.w0 { background: color-mix(in oklab, var(--p1) 30%, white); }
.gf-round.w1 { background: color-mix(in oklab, var(--p2) 30%, white); }
.gf-round.draw { background: var(--muted); }
.gf-round b { font-weight: 700; color: var(--foreground); }
.gf-round em { font-style: normal; padding: 0 5px; border-radius: 999px; background: var(--lemon-soft); border: 1px solid var(--foreground); font-size: 10.5px; }
.gf-stat { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 10px; border: 2px solid var(--foreground); border-radius: 999px; background: var(--card-solid); font-family: var(--font-display); font-size: 12.5px; font-weight: 600; box-shadow: 1px 2px 0 var(--foreground); }
.gf-stat b { font-size: 15px; font-weight: 700; }
.gf-stat-skill { position: relative; align-items: center; padding-left: 30px; background: color-mix(in oklab, var(--skill, var(--primary)) 22%, var(--card-solid)); }
.gf-stat-prop { --ring: 1.5px; --ink: 1.2px; --drop: 1.2px; position: absolute; left: -4px; top: 50%; width: 28px; height: 28px; translate: 0 -50%; rotate: -10deg; }

.gf-res-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.gf-res-actions .btn { min-width: 150px; }
.gf-res-note { margin: -8px 0 0; color: var(--muted-foreground); font-family: var(--font-display); font-size: 13px; font-weight: 600; text-align: center; }

.gf-next {
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(100%, 520px);
  padding: 20px 20px 16px;
  border-radius: 22px;
}
.gf-next-ribbon { position: absolute; top: -15px; left: 20px; }
.gf-next-face { position: relative; flex: none; width: 84px; height: 84px; border: 3px solid var(--foreground); border-radius: 14px; overflow: hidden; background: var(--sky-soft); box-shadow: 2px 3px 0 var(--foreground); transform: rotate(3deg); }
.gf-next-face img { width: 100%; height: 100%; object-fit: cover; }
.gf-next-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gf-next-step { margin: 0; color: var(--muted-foreground); font-family: var(--font-display); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.gf-next-handle { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; }

.gf-ending {
  position: relative;
  width: 100%;
  padding: 26px 24px 22px;
  border-radius: 2rem;
  text-align: center;
  background: repeating-linear-gradient(135deg, var(--lemon-soft) 0 18px, var(--card-solid) 18px 36px);
}
.gf-ending h2 { margin: 0; font-size: clamp(34px, 5.4vw, 64px); line-height: 1; }
.gf-ending p { margin: 10px auto 0; max-width: 460px; color: var(--muted-foreground); font-size: 15px; }
.gf-confetti { position: absolute; inset: -14px 0; pointer-events: none; }
.gf-confetti i {
  position: absolute;
  font-style: normal;
  font-family: var(--font-display);
  font-size: 26px;
  -webkit-text-stroke: 1.5px var(--foreground);
  paint-order: stroke fill;
  animation: confetti-twinkle 2.2s ease-in-out infinite;
}
@keyframes confetti-twinkle { 0%, to { opacity: .85; transform: scale(1) rotate(0); } 50% { opacity: 1; transform: scale(1.35) rotate(22deg); } }

.gf-continue { font-size: clamp(40px, 7vw, 76px); margin: 0; line-height: 1; animation: gf-blink 1.1s steps(2, jump-none) infinite; }
@keyframes gf-blink { 50% { opacity: .55; } }

@media (max-width: 639px) {
  .gf-results { padding: max(28px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
  .gf-res-main { gap: 18px; }
  .family-spotlight { gap: 12px 18px; padding: 24px 16px 16px; justify-content: center; text-align: center; }
  .gf-spot-body { align-items: center; gap: 6px; }
  .gf-spot-pills, .gf-spot-stats { justify-content: center; }
  .gf-spot-handle { justify-content: center; }
  .gf-spot-face img { width: 112px; height: 112px; }
  .gf-spot-quote { display: -webkit-box; overflow: hidden; font-size: 14px; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
  .gf-spot-ribbon { left: 50%; translate: -50% 0; font-size: 11px; }
  .family-share-button { width: 100%; font-size: 15px; }
}

/* Phones: what to do next stays in reach. The buttons ride a bar pinned to the bottom of
   the screen while the card scrolls; posting the win sits right under the card. */
@media (max-width: 639px), (orientation: landscape) and (max-height: 520px) {
  .gf-res-main > * { flex: none; }
  .gf-res-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    order: 10;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: calc(100% + 32px);
    margin: -6px -16px 0;
    padding: 18px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: linear-gradient(180deg, color-mix(in oklab, var(--background) 0%, transparent), var(--background) 14px);
  }
  .gf-res-actions .btn { min-width: 0; width: 100%; }
  .gf-res-actions .btn:first-child { grid-column: 1 / -1; min-height: 56px; }
  .gf-res-actions .btn:not(:first-child) { min-height: 50px; padding: 10px 14px; font-size: 17px; }
  .gf-res-actions:has(> .btn:nth-child(2):last-child) .btn:first-child { grid-column: auto; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .gf-results { padding: max(22px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left)); }
  .gf-res-main { width: min(100%, 760px); gap: 14px; }
  .family-spotlight { flex-wrap: nowrap; gap: 18px; padding: 22px 20px 16px; }
  .gf-spot-face img { width: 104px; height: 104px; }
  .gf-spot-body { gap: 6px; }
  .gf-spot-handle { font-size: 24px; }
  .gf-spot-quote { display: -webkit-box; overflow: hidden; font-size: 13.5px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .gf-res-head { font-size: 34px; }
  .gf-ending { padding: 20px 20px 16px; }
  .gf-res-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); width: calc(100% + 48px); margin: -4px -24px 0; padding: 12px max(24px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
  .gf-res-actions .btn:first-child { grid-column: auto; }
  /* two buttons (arcade: NEXT + QUIT RUN) share the bar instead of leaving a third slot empty */
  .gf-res-actions:has(> .btn:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gf-res-actions .btn, .gf-res-actions .btn:not(:first-child) { min-height: 50px; padding: 8px 14px; font-size: 17px; }
  .family-share-button { width: min(100%, 420px); min-height: 56px; }
}
@media (orientation: landscape) and (max-height: 400px) {
  .gf-spot-quote { -webkit-line-clamp: 1; }
  .gf-spot-face img { width: 92px; height: 92px; }
  .family-spotlight { padding-top: 20px; padding-bottom: 14px; }
}

/* ================================================================== motion */

@media (prefers-reduced-motion: reduce) {
  .gf-mosaic-plane, .gf-word-star, .gf-vs-p1, .gf-vs-p2, .gf-vs-seam, .gf-vs-art, .gf-vs-info, .gf-vs-badge, .gf-vs-foot, .gf-vs-top,
  .gf-vs-pips i, .family-spotlight, .gf-confetti i, .gf-continue { animation: none !important; }
  .gf-menu-btn, .gf-menu-arrow { transition: none; }
}

/* ---------- loading: the first screen (js/screens/loading.js) -----------------------------
   The wordmark, a candy progress bar with a fighter riding its edge, then TAP TO START.
   --p (0..1) is the progress; the bar scales on the compositor, the rider rides a translate. */
.gf-loading {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) 20px max(56px, env(safe-area-inset-bottom));
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.gf-loading-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(18px, 3.4dvh, 30px);
  width: min(100%, 560px);
}
.gf-loading .gf-wordmark {
  align-self: center;
  width: max-content;
  max-width: 100%;
  margin: 0;
  font-size: clamp(76px, min(15vw, 19dvh), 176px);
  opacity: 0;
  transform: translateY(10px) scale(.96);
  transition: opacity .35s ease-out, transform .5s cubic-bezier(.2, 1.4, .35, 1);
}
.gf-loading.is-fonts .gf-wordmark { opacity: 1; transform: none; }

.gf-load { position: relative; width: min(78vw, 440px); padding-top: 46px; }
.gf-load-bar {
  position: relative;
  height: 26px;
  border: 3px solid var(--foreground);
  border-radius: 999px;
  background: var(--card-solid);
  box-shadow: 0 5px 0 var(--foreground);
  overflow: hidden;
}
.gf-load-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    repeating-linear-gradient(135deg, transparent 0 12px, color-mix(in oklab, var(--card-solid) 45%, transparent) 12px 24px),
    linear-gradient(90deg, var(--lemon-soft), var(--primary));
  background-size: 34px 34px, 100% 100%;
  transform: scaleX(var(--p));
  transform-origin: 0 50%;
  transition: transform .28s ease-out;
  animation: gf-load-stripes .9s linear infinite;
}
@keyframes gf-load-stripes { to { background-position: 34px 0, 0 0; } }
/* the rider: a grokified head as a sticker, bobbing along the fill's edge */
.gf-load-rider {
  position: absolute;
  top: 0;
  left: 0;
  width: 54px;
  height: 54px;
  object-fit: contain;
  object-position: 50% 100%;
  translate: calc(var(--p) * (min(78vw, 440px) - 12px) - 27px) 0;
  transition: translate .28s ease-out;
  filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff)
    drop-shadow(1.5px 0 0 var(--foreground)) drop-shadow(-1.5px 0 0 var(--foreground)) drop-shadow(0 1.5px 0 var(--foreground)) drop-shadow(0 -1.5px 0 var(--foreground));
  animation: gf-load-bob .5s ease-in-out infinite alternate;
}
@keyframes gf-load-bob { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-7px) rotate(4deg); } }
.gf-loading[data-state="ready"] .gf-load-rider, .gf-loading[data-state="leaving"] .gf-load-rider { animation: gf-load-cheer .42s cubic-bezier(.2, 1.4, .35, 1) 2; }
@keyframes gf-load-cheer { 50% { transform: translateY(-16px) rotate(-8deg) scale(1.12); } }

.gf-load-note {
  margin: -6px 0 0;
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  min-height: 1.4em;
}
.gf-loading.is-queued:not([data-state="ready"]):not([data-state="leaving"]) .gf-load-note::after { content: " · starting as soon as it's in ♪"; color: var(--primary); }

.gf-start {
  min-width: min(78vw, 320px);
  min-height: 58px;
  padding: 12px 28px 13px;
  border: 3px solid var(--foreground);
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 6px 0 var(--foreground), 0 0 0 0 color-mix(in oklab, var(--primary) 40%, transparent);
  font-family: var(--font-display);
  font-size: clamp(20px, 3.2vw, 26px);
  font-weight: 700;
  letter-spacing: .03em;
  -webkit-text-stroke: 1.5px var(--foreground);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--foreground);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: gf-start-in .38s cubic-bezier(.2, 1.5, .35, 1) both, gf-start-pulse 1.8s ease-in-out .4s infinite;
}
.gf-start[hidden] { display: none; }
.gf-start span { color: var(--lemon-soft); }
@keyframes gf-start-in { from { opacity: 0; transform: translateY(12px) scale(.9); } }
@keyframes gf-start-pulse {
  50% { transform: scale(1.04); box-shadow: 0 6px 0 var(--foreground), 0 0 0 10px color-mix(in oklab, var(--primary) 16%, transparent); }
}
@media (hover: hover) and (pointer: fine) {
  .gf-start:hover { background: var(--primary-border); }
}
.gf-start:active { transform: translateY(3px) scale(.97); box-shadow: 0 3px 0 var(--foreground); }

.gf-loading-foot {
  position: absolute;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 16px;
  right: 16px;
  margin: 0;
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}
.gf-loading-foot a { color: var(--primary-border); }

/* leaving: the stack pops forward and fades, the title takes over */
.gf-loading[data-state="leaving"] .gf-loading-main { animation: gf-load-leave .42s cubic-bezier(.5, 0, .75, 0) both; }
@keyframes gf-load-leave { to { opacity: 0; transform: scale(1.08); } }
.gf-loading[data-state="error"] .gf-load { display: none; }

/* a phone on its side: less height, so a smaller wordmark and tighter gaps */
@media (orientation: landscape) and (max-height: 520px) {
  .gf-loading-main { gap: 12px; }
  .gf-loading .gf-wordmark { font-size: clamp(56px, 17dvh, 96px); }
  .gf-load { padding-top: 40px; }
  .gf-start { min-height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .gf-load-fill, .gf-load-rider, .gf-start, .gf-loading[data-state="leaving"] .gf-loading-main { animation: none !important; }
  .gf-loading .gf-wordmark { transition: opacity .2s; transform: none; }
}
