/* The hero showcase: one phone with pages (Glee Pop, the Glee Meter, Your game).
   glee-play.js sets --rise (0 tilted back, 1 upright,
   from scroll), --mx/--my (mouse, -1 to 1) and data-app ("pop", "meter" or "yours"). */
:root {
  --gh-accent: var(--accent);
  --gh-page: var(--page);
  --gh-ink: var(--ink);
  --gh-soft-ink: var(--soft-ink);
  --gh-logo-1: var(--logo-1);
  --gh-logo-2: var(--logo-2);
  --gh-logo-3: var(--logo-3);
  --gh-font: var(--font);
  --gh-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gh-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gh-show {
  --rise: 1;
  --mx: 0;
  --my: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin-top: 40px;
  padding-bottom: 8px;
}

/* ---------- Phone ---------- */

.gh-stage {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  perspective: 1400px;
}

/* The phone is an iPhone 14 Pro (from devices.css, MIT; see LICENSES.md), built at its real
   size, 428 x 868 with a 390 x 830 screen, and shrunk to fit. glee-play.js sets --k
   (width / 428) on each box that holds one, so the demos inside see a real phone screen. */
.gh-device {
  position: relative;
  z-index: 1;
  width: min(290px, calc((100dvh - 140px) * 428 / 868));
  aspect-ratio: 428 / 868;
  transform-origin: 50% 85%;
  transform:
    translateY(calc((1 - var(--rise)) * -56px))
    rotateX(calc((1 - var(--rise)) * 20deg + var(--my) * -2deg))
    rotateY(calc(var(--mx) * 3deg))
    scale(calc(0.9 + var(--rise) * 0.1));
}

.gh-iphone {
  position: absolute;
  top: 0;
  left: 0;
  width: 428px;
  height: 868px;
  transform-origin: 0 0;
  scale: var(--k, 0.6);
}

.gh-iphone__frame {
  box-sizing: border-box;
  width: 428px;
  height: 868px;
  padding: 19px;
  border: 1px solid #1c1822;
  border-radius: 68px;
  background: #010101;
  box-shadow:
    inset 0 0 4px 2px #c0b8ca,
    inset 0 0 0 6px #342c3f,
    0 60px 110px -40px #3d35e8a6,
    0 30px 60px -30px color-mix(in srgb, var(--gh-ink) 60%, transparent);
}

/* Antenna lines across the frame */
.gh-iphone__stripe::before,
.gh-iphone__stripe::after {
  content: "";
  position: absolute;
  left: 0;
  z-index: 9;
  box-sizing: border-box;
  width: 100%;
  height: 7px;
  border: solid #01010140;
  border-width: 0 7px;
}

.gh-iphone__stripe::after { top: 85px; }
.gh-iphone__stripe::before { bottom: 85px; }

.gh-iphone__home::before,
.gh-iphone__home::after {
  content: "";
  position: absolute;
  z-index: 9;
  box-sizing: border-box;
  width: 6px;
  height: 6px;
  border: solid #01010140;
  border-width: 6px 0;
}

.gh-iphone__home::after { top: 0; right: 86px; }
.gh-iphone__home::before { bottom: 0; left: 86px; }

/* Dynamic Island, with its sensor and camera */
.gh-iphone__header {
  position: absolute;
  top: 29px;
  left: 50%;
  z-index: 10;
  width: 120px;
  height: 35px;
  margin-left: -60px;
  border-radius: 20px;
  background: #010101;
}

.gh-iphone__sensors::before,
.gh-iphone__sensors::after {
  content: "";
  position: absolute;
  z-index: 10;
}

.gh-iphone__sensors::after {
  top: 30px;
  left: 50%;
  width: 74px;
  height: 33px;
  margin-left: -60px;
  border-radius: 17px;
  background: #010101;
}

.gh-iphone__sensors::before {
  top: 42px;
  left: 50%;
  z-index: 11;
  width: 9px;
  height: 9px;
  margin-left: 36px;
  border-radius: 50%;
  background:
    radial-gradient(farthest-corner at 20% 20%, #6074bf 0, transparent 40%),
    radial-gradient(farthest-corner at 80% 80%, #513785 0, #24555e 20%, transparent 50%);
  box-shadow: 0 0 1px 1px #ffffff0d;
}

/* Volume and action buttons on the left, power on the right */
.gh-iphone__btns,
.gh-iphone__btns::before,
.gh-iphone__btns::after,
.gh-iphone__power {
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: #1c1822;
}

.gh-iphone__btns { top: 115px; left: -2px; height: 32px; }
.gh-iphone__btns::before,
.gh-iphone__btns::after { content: ""; left: 0; height: 62px; }
.gh-iphone__btns::after { top: 60px; }
.gh-iphone__btns::before { top: 140px; }
.gh-iphone__power { top: 200px; right: -2px; height: 100px; }

.gh-screen {
  position: relative;
  overflow: hidden;
  width: 390px;
  height: 830px;
  border-radius: 49px;
  background: var(--gh-page);
  isolation: isolate;
}

/* A faint reflection across the glass */
.gh-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  background: linear-gradient(118deg, #ffffff26 0%, #ffffff08 26%, transparent 42%);
  pointer-events: none;
}

/* The screens go round like pages on a phone: each sits a screen to the left, in view or to the
   right (--o, set by glee-play.js) and they all follow a drag (--drag) */
.gh-track {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

/* Following a finger or the mouse: no easing until it's let go */
.gh-track.is-dragging {
  cursor: grabbing;
}

.gh-track.is-dragging .gh-app {
  transition: none;
}

.gh-track img,
.gh-track video {
  -webkit-user-drag: none;
}

.gh-app {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform: translateX(calc(var(--o, 0) * 100% + var(--drag, 0px)));
  transition: transform 0.75s var(--gh-ease);
}

/* Page dots, as on a phone's home screen, just above the home bar */
.gh-dots {
  position: absolute;
  left: 50%;
  bottom: 26px;
  z-index: 5;
  translate: -50% 0;
  display: flex;
  gap: 2px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #17142b4d;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.gh-dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: none;
  cursor: var(--cursor-link);
}

.gh-dot::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ffffff66;
  transition: background-color 0.3s, scale 0.3s;
}

.gh-dot[aria-selected="true"]::before {
  background: #fff;
  scale: 1.1;
}

.gh-dot:hover::before {
  background: #ffffffb3;
}

.gh-dot:focus:not(:focus-visible) {
  outline: none;
}

.gh-dot:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -3px;
  border-radius: 50%;
}

/* ---------- "Your game": other formats as mini previews, in a phone browser ---------- */

/* Laid out like the Glee Meter screen: light up top, a dark fade under the title */
.gh-app--yours {
  background: linear-gradient(#e9e4fb, #f7eff6);
  color: #fff;
}

.gh-app--yours::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #17142bf2 0%, #17142bcc 30%, #17142b00 46%);
  pointer-events: none;
}

/* Four wordless mini previews as sticker cards, like the cards round the game */
.gh-minis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 18px;
  margin: 0;
  padding: 92px 34px 0;
  list-style: none;
}

.gh-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 140px;
  padding: 14px;
  border: 3px solid var(--gh-ink);
  border-radius: 22px;
  background: #fff;
  box-shadow: 5px 5px 0 var(--gh-ink);
  color: var(--gh-ink);
  rotate: -4deg;
}

.gh-mini:nth-child(2) { rotate: 3deg; translate: 0 10px; }
.gh-mini:nth-child(3) { rotate: 2.5deg; }
.gh-mini:nth-child(4) { rotate: -3deg; translate: 0 10px; }

.gh-mini--spin { position: relative; }
.gh-mini__wheel { width: 100px; height: 100px; }
.gh-mini__pin { position: absolute; top: 6px; left: 50%; width: 18px; translate: -50% 0; }
.gh-spin { transform-origin: 30px 30px; animation: gh-wheel 16s linear infinite; }

@keyframes gh-wheel {
  to { rotate: 360deg; }
}

.gh-mini__scratch { width: 126px; height: auto; }

/* Quiz: a question mark and three answers, one picked */
.gh-mini__qmark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gh-logo-3);
  color: #fff;
  font: 900 19px / 1 var(--gh-font);
}

.gh-mini__a {
  display: grid;
  place-items: center end;
  width: 100%;
  height: 19px;
  padding: 0 4px;
  border: 2.5px solid var(--gh-ink);
  border-radius: 999px;
}

.gh-mini__a.is-on {
  background: var(--gh-logo-2);
}

.gh-mini__a svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: #fff;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Leaderboard: a cup and three ranked bars */
.gh-mini__cup {
  width: 30px;
  height: 30px;
  fill: #ffd2e2;
  stroke: var(--gh-ink);
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.gh-mini__row {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
}

.gh-mini__row i {
  display: grid;
  flex: none;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #ece8fb;
  font: 800 11px / 1 var(--gh-font);
  font-style: normal;
}

.gh-mini__row s {
  width: var(--w);
  height: 10px;
  border-radius: 999px;
  background: #ddd6f7;
}

.gh-mini__row.is-top i {
  background: var(--gh-logo-3);
  color: #fff;
}

.gh-mini__row.is-top s {
  background: var(--gh-logo-3);
}

.gh-yours-cta .gh-poster-btn {
  text-decoration: none;
}

.gh-yours-cta .gh-poster-btn:hover {
  box-shadow: 0 0 0 4px #ffffff4d, 0 10px 24px -8px color-mix(in srgb, var(--gh-ink) 60%, transparent);
}

.gh-app iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Glee Meter screen ---------- */

.gh-app--meter {
  display: block;
  background: linear-gradient(#e9e4fb, #f7eff6);
  color: inherit;
  text-decoration: none;
}

.gh-meter-frame,
.gh-meter-frame iframe {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Laid out like the Glee Pop poster: the preview up top, a dark fade, title, line and Play */
.gh-app--meter::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #17142bf2 0%, #17142bcc 30%, #17142b00 58%);
  pointer-events: none;
}

.gh-meter-cta {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 36px 36px 92px;
  color: #fff;
  text-align: center;
}

.gh-app--meter:hover .gh-poster-btn {
  box-shadow: 0 0 0 4px #ffffff4d, 0 10px 24px -8px color-mix(in srgb, var(--gh-ink) 60%, transparent);
}

.gh-app--meter:focus-visible {
  outline: 3px solid var(--gh-accent);
  outline-offset: -8px;
}

/* ---------- Glee Pop poster ---------- */

.gh-poster {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  width: 100%;
  padding: 36px 36px 92px;
  border: 0;
  background: #2c23c9; /* the game's own top colour, so the status bar blends in */
  overflow: hidden;
  color: #fff;
  text-align: center;
  cursor: var(--cursor-link);
  touch-action: manipulation;
}

.gh-poster-shot {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

/* Darkens the bottom of the still so the title and button read clearly */
.gh-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #17142bf2 0%, #17142bcc 30%, #17142b00 62%);
}

.gh-poster > span {
  z-index: 1;
}

.gh-poster:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -8px;
}

.gh-poster-title {
  position: relative;
  font: 800 62px / 1 var(--gh-font);
  letter-spacing: -0.04em;
}

.gh-poster-line {
  position: relative;
  max-width: 300px;
  font: 500 21px / 1.35 var(--gh-font);
  opacity: 0.9;
}

.gh-poster-btn {
  position: relative;
  margin-top: 18px;
  padding: 20px 52px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--gh-ink) 60%, transparent);
  color: var(--gh-ink);
  font: 700 23px / 1 var(--gh-font);
  transition: box-shadow 0.2s;
}

/* Hover only lifts the button's shadow; nothing on the screen moves */
.gh-poster:hover .gh-poster-btn {
  box-shadow: 0 0 0 4px #ffffff4d, 0 10px 24px -8px color-mix(in srgb, var(--gh-ink) 60%, transparent);
}

/* Bubbles drift up behind the poster text */
.gh-bubbles i {
  position: absolute;
  bottom: -60px;
  width: var(--s, 40px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #ffffffb3 0 14%, #ffffff33 15% 100%);
  animation: gh-rise var(--t, 9s) linear infinite;
  animation-delay: var(--d, 0s);
}

.gh-bubbles i:nth-child(1) { left: 8%; --s: 46px; --t: 9s; }
.gh-bubbles i:nth-child(2) { left: 30%; --s: 26px; --t: 7s; --d: -3s; }
.gh-bubbles i:nth-child(3) { left: 52%; --s: 58px; --t: 11s; --d: -6s; }
.gh-bubbles i:nth-child(4) { left: 74%; --s: 34px; --t: 8s; --d: -1s; }
.gh-bubbles i:nth-child(5) { left: 86%; --s: 22px; --t: 6s; --d: -4s; }
.gh-bubbles i:nth-child(6) { left: 18%; --s: 30px; --t: 10s; --d: -8s; }
.gh-bubbles i:nth-child(7) { left: 62%; --s: 40px; --t: 12s; --d: -2s; }

@keyframes gh-rise {
  to { transform: translateY(-720px); }
}

.gh-caption {
  max-width: 340px;
  margin: 0;
  color: var(--gh-soft-ink);
  font: 500 15px / 1.35 var(--gh-font);
  text-align: center;
  text-wrap: balance;
}

/* ---------- Glee Pop, playing: large and over the page ---------- */

.gh-game {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 24px;
  border: 0;
  background: transparent;
}

.gh-game[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
}

.gh-game::backdrop {
  background: transparent;
}

/* The page clears to its own light colour, with soft bubbles drifting up behind the phone */
.gh-game__bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(45% 50% at 50% 55%, #e6dffb, transparent 75%),
    var(--gh-page);
}

.gh-game__bg i {
  position: absolute;
  bottom: -80px;
  width: var(--s, 40px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #ffffffe6 0 12%, #b39bfa40 13% 100%);
  box-shadow: inset 0 0 0 1px #b39bfa55;
  animation: gh-drift var(--t, 14s) linear infinite;
  animation-delay: var(--d, 0s);
}

.gh-game__bg i:nth-child(1) { left: 4%; --s: 70px; --t: 16s; }
.gh-game__bg i:nth-child(2) { left: 14%; --s: 28px; --t: 11s; --d: -4s; }
.gh-game__bg i:nth-child(3) { left: 24%; --s: 46px; --t: 14s; --d: -9s; }
.gh-game__bg i:nth-child(4) { left: 33%; --s: 20px; --t: 9s; --d: -2s; }
.gh-game__bg i:nth-child(5) { left: 64%; --s: 36px; --t: 12s; --d: -6s; }
.gh-game__bg i:nth-child(6) { left: 72%; --s: 84px; --t: 18s; --d: -11s; }
.gh-game__bg i:nth-child(7) { left: 82%; --s: 24px; --t: 10s; --d: -3s; }
.gh-game__bg i:nth-child(8) { left: 90%; --s: 52px; --t: 15s; --d: -7s; }
.gh-game__bg i:nth-child(9) { left: 46%; --s: 18px; --t: 13s; --d: -5s; }
.gh-game__bg i:nth-child(10) { left: 56%; --s: 30px; --t: 17s; --d: -13s; }

@keyframes gh-drift {
  to { transform: translateY(calc(-100vh - 160px)) translateX(30px); }
}

/* ---------- Either side of the phone while playing ---------- */

.gh-side {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 300px;
  color: var(--gh-ink);
  font-family: var(--gh-font);
}

.gh-side--score {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
}

.gh-side--pitch {
  grid-column: 3;
  grid-row: 1;
  justify-self: start;
}

.gh-score {
  margin: 0;
}

/* The scorecard: a chunky sticker in the game's own style, popping in when the round starts */
.gh-card {
  position: relative;
  min-width: 210px;
  padding: 30px 26px 22px;
  border: 3px solid var(--gh-ink);
  border-radius: 26px;
  background: #fff;
  box-shadow: 7px 7px 0 var(--gh-ink);
  text-align: center;
  rotate: -3deg;
  transition: opacity 0.25s, scale 0.55s var(--gh-pop);
}

.gh-side--score {
  display: grid;
}

.gh-side--score .gh-card {
  grid-area: 1 / 1;
  align-self: center;
}

/* How to play shows first; the scorecard pops in when the round starts */
.gh-card--score,
.gh-live .gh-card--howto {
  opacity: 0;
  scale: 0.5;
  pointer-events: none;
}

.gh-live .gh-card--score {
  opacity: 1;
  scale: 1;
}

.gh-card--howto {
  width: 280px;
  padding: 34px 24px 22px;
  text-align: left;
  rotate: -2deg;
}

.gh-card__tab--ink {
  background: var(--gh-ink);
}

.gh-howto {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gh-howto li {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 700 16px / 1.3 var(--gh-font);
}

.gh-howto b {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--gh-ink);
  border-radius: 50%;
  background: #ece6fd;
  font-weight: 800;
}

.gh-howto li:nth-child(2) b { background: #ffd0e1; }
.gh-howto li:nth-child(3) b { background: #c8f0e2; }

.gh-howto__time {
  margin: 16px 0 0;
  color: var(--gh-soft-ink);
  font: 600 14px / 1.4 var(--gh-font);
}

.gh-card__tab {
  position: absolute;
  white-space: nowrap;
  top: -18px;
  left: 50%;
  padding: 8px 16px;
  border: 3px solid var(--gh-ink);
  border-radius: 999px;
  background: var(--gh-logo-3);
  color: #fff;
  font: 800 14px / 1 var(--gh-font);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  translate: -50% 0;
  rotate: 4deg;
}

.gh-score__num {
  display: block;
  font: 800 clamp(60px, 6vw, 86px) / 1 var(--gh-font);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.gh-score.gh-bump .gh-score__num {
  animation: gh-bump 0.35s var(--gh-pop);
}

@keyframes gh-bump {
  40% { scale: 1.12; color: var(--gh-logo-3); }
}

.gh-side__line {
  margin: 4px 0 14px;
  color: var(--gh-ink);
  font: 700 16px / 1.3 var(--gh-font);
}

.gh-best {
  display: inline-block;
  margin: 0;
  padding: 7px 14px;
  border: 2px solid var(--gh-ink);
  border-radius: 999px;
  background: #ece6fd;
  font: 700 14px / 1 var(--gh-font);
}

.gh-ended .gh-card--score {
  animation: gh-cheer 0.7s var(--gh-pop);
}

@keyframes gh-cheer {
  40% { scale: 1.12; rotate: 3deg; }
}

/* The pitch, in the same sticker style as the card on the left */
.gh-card--pitch {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 300px;
  padding: 36px 26px 26px;
  text-align: left;
  rotate: 2deg;
}

.gh-side__title {
  margin: 0;
  font: 800 27px / 1.1 var(--gh-font);
  letter-spacing: -0.03em;
}

.gh-side__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gh-side__list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 15px / 1.3 var(--gh-font);
}

/* Bullets are Glee Pop's own smile bubbles */
.gh-side__list li::before {
  content: "";
  flex: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--gh-ink);
  border-radius: 50%;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 34% 28%, #ffffffcc 0 14%, transparent 16%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='7' cy='9' r='1.4' fill='%23fff'/%3E%3Ccircle cx='13' cy='9' r='1.4' fill='%23fff'/%3E%3Cpath d='M6.5 12.2q3.5 3 7 0' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% no-repeat,
    var(--dot, #ff3d81);
}

.gh-side__list li:nth-child(2)::before { --dot: #3fa2ff; }
.gh-side__list li:nth-child(3)::before { --dot: #17c08d; }

.gh-side__cta {
  align-self: flex-start;
  margin-top: 6px;
  padding: 15px 26px;
  border-radius: 999px;
  border: 3px solid var(--gh-ink);
  background: var(--gh-logo-3);
  box-shadow: 4px 4px 0 var(--gh-ink);
  color: #fff;
  font: 800 16px / 1 var(--gh-font);
  text-decoration: none;
  transition: transform 0.2s var(--gh-pop);
}

.gh-side__cta:hover {
  transform: translateY(-2px) scale(1.04);
}

.gh-side__cta:focus-visible {
  outline: 3px solid var(--gh-logo-3);
  outline-offset: 3px;
}

/* When the round ends the pitch gets a nudge */
.gh-ended .gh-side__cta {
  animation: gh-nudge 1.2s var(--gh-pop) 0.4s 2;
}

@keyframes gh-nudge {
  30% { transform: scale(1.1) rotate(-3deg); }
  60% { transform: scale(1.04) rotate(2deg); }
}

/* Confetti and combo stickers sit over everything, past the phone's edges */
.gh-fx {
  position: fixed;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.gh-fx-st {
  position: fixed;
  z-index: 6;
  padding: 12px 20px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 0 #17142b, 0 20px 40px -16px #17142b;
  color: var(--gh-ink);
  font: 800 30px / 1 var(--gh-font);
  letter-spacing: -0.02em;
  white-space: nowrap;
  pointer-events: none;
}

.gh-fx-st:nth-of-type(odd) {
  background: #ff3d81;
  color: #fff;
}

/* On phones the round's end offers the pitch in the top bar */
.gh-endbar {
  display: none;
}

/* The same phone as in the hero, just bigger */
.gh-game__frame {
  position: relative;
  z-index: 2;
  grid-column: 2;
  grid-row: 1;
  width: min(440px, calc((100dvh - 48px) * 428 / 868));
  aspect-ratio: 428 / 868;
  transform-origin: 50% 50%;
}

.gh-game__screen {
  position: relative;
  overflow: hidden;
  width: 390px;
  height: 830px;
  border-radius: 49px;
  background: #2c23c9;
}

/* Like a real game, it runs full screen, around the Dynamic Island */
.gh-game__screen iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Back to the site: a small sticker chip, top left, in the same style as the cards */
.gh-back {
  position: fixed;
  top: 28px;
  left: 32px;
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px 11px 14px;
  border: 3px solid var(--gh-ink);
  border-radius: 999px;
  background: #fff;
  box-shadow: 4px 4px 0 var(--gh-ink);
  color: var(--gh-ink);
  font: 800 16px / 1 var(--gh-font);
  rotate: -2deg;
  cursor: var(--cursor-link);
  transition: translate 0.15s, box-shadow 0.15s;
}

.gh-back span {
  font-size: 18px;
}

/* Pressing it squashes the shadow, like a real button */
.gh-back:hover {
  translate: 1px 1px;
  box-shadow: 3px 3px 0 var(--gh-ink);
}

.gh-back:active {
  translate: 4px 4px;
  box-shadow: 0 0 0 var(--gh-ink);
}

.gh-back:focus-visible {
  outline: 3px solid var(--gh-accent);
  outline-offset: 4px;
}

.gh-game__close {
  display: none;
  position: absolute;
  top: -22px;
  right: -22px;
  z-index: 12;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--gh-ink) 35%, transparent);
  color: var(--gh-ink);
  font: 500 26px / 1 var(--gh-font);
  cursor: var(--cursor-link);
}

.gh-game__close:focus-visible,
.gh-intro__go:focus-visible {
  outline: 3px solid var(--gh-logo-3);
  outline-offset: 3px;
}

.gh-intro {
  position: relative;
  height: 100%;
  background: #2c23c9;
  color: #fff;
  text-align: center;
}

/* The game stays in view, dimmed, behind the Start button */
.gh-intro__shot {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.gh-intro::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #17142bf2 0%, #17142bb3 38%, #17142b33 75%);
}

.gh-intro__body {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 0 32px 76px;
}

.gh-intro__title {
  margin: 0;
  font: 800 56px / 1 var(--gh-font);
  letter-spacing: -0.03em;
}

/* The steps live in the left card on wide screens, so the phone just says Ready */
.gh-intro__steps,
.gh-intro__time {
  display: none;
}

.gh-intro__steps {
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.gh-intro__steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #ffffff26;
  font: 600 17px / 1.3 var(--gh-font);
}

.gh-intro__steps b {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  color: var(--gh-ink);
  font-weight: 800;
}

.gh-intro__time {
  max-width: 300px;
  margin: 0;
  font: 500 16px / 1.4 var(--gh-font);
  opacity: 0.9;
}

.gh-intro__go {
  margin-top: 4px;
  padding: 20px 60px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 6px #ffffff33, 0 14px 30px -10px #000;
  color: var(--gh-ink);
  font: 800 24px / 1 var(--gh-font);
  cursor: var(--cursor-link);
}

/* On phones the game takes the whole screen, with a slim bar for closing it */
@media (max-width: 809.98px) {
  .gh-game {
    padding: 0;
  }

  .gh-game[open] {
    display: block;
  }

  .gh-side {
    display: none;
  }

  .gh-endbar {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 8px);
    left: 12px;
    right: 60px;
    z-index: 3;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: #fff;
    color: var(--gh-ink);
    font: 600 13px / 1 var(--gh-font);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
  }

  .gh-endbar b {
    margin-left: 4px;
    color: var(--gh-logo-2);
  }

  .gh-ended .gh-endbar {
    display: flex;
    animation: gh-drop 0.5s var(--gh-pop);
  }

  @keyframes gh-drop {
    from { translate: 0 -60px; }
  }

  .gh-game__frame {
    width: 100vw;
    height: 100dvh;
    aspect-ratio: auto;
  }

  /* No phone drawing here: the real phone is the frame */
  .gh-game .gh-iphone {
    position: static;
    width: 100%;
    height: 100%;
    scale: none;
  }

  .gh-game .gh-iphone__frame {
    width: 100%;
    height: 100%;
    padding: calc(env(safe-area-inset-top) + 52px) 0 0;
    border: 0;
    border-radius: 0;
    background: var(--gh-ink);
    box-shadow: none;
  }

  .gh-game .gh-iphone > i {
    display: none;
  }

  .gh-game__screen {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .gh-back {
    display: none;
  }

  .gh-intro__steps {
    display: grid;
  }

  .gh-intro__time {
    display: block;
  }

  .gh-intro__title {
    font-size: 40px;
  }

  .gh-intro__body {
    padding-bottom: 56px;
  }

  .gh-game__close {
    display: block;
    top: calc(env(safe-area-inset-top) + 6px);
    right: 10px;
    width: 40px;
    height: 40px;
    background: #ffffff1f;
    box-shadow: none;
    color: #fff;
  }
}

/* ---------- Wide screens: copy on the left, phone on the right, all in the first screen ---------- */

@media (min-width: 1000px) {
  .hero--split {
    display: flex;
    align-items: center;
    min-height: 100svh; /* the whole first screen: the next section waits until you scroll */
    padding: 110px 0 40px;
  }

  .hero--split .hero__content {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    grid-template-rows: auto auto;
    column-gap: 32px;
    row-gap: 32px;
    align-items: center;
  }

  .hero--split .hero__content > :is(.hero__text, .hero__buttons, .gh-show) {
    width: 100%;
  }

  .hero--split .hero__text {
    grid-column: 1;
    align-self: end;
    align-items: flex-start;
    text-align: left;
  }

  .hero--split .hero__title {
    font-size: clamp(52px, 5.4vw, 76px);
  }

  /* Left-aligned, so line the big letters up with the text around them (their own side space
     makes them look indented) and give the eyebrow a little more room */
  .hero--split .hero__title-wrap {
    margin-left: -0.06em;
    font-size: clamp(52px, 5.4vw, 76px);
  }

  .hero--split .hero__eyebrow {
    margin-bottom: 6px;
  }

  .hero--split .hero__sub--narrow {
    max-width: 470px;
  }

  .hero--split .hero__buttons {
    grid-column: 1;
    align-self: start;
    justify-content: flex-start;
  }

  .hero--split .gh-show {
    gap: 16px;
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 0;
  }

  /* Phone and caption fit in the first screen */
  .hero--split .gh-device {
    width: clamp(210px, calc((100dvh - 300px) * 0.47), 310px);
  }
}

/* ---------- Tablet and phone ---------- */

/* ---------- Phones: no phone frame; the demos become cards in a row you swipe sideways ----------
   Each card is laid out at the phone screen's own width (390px) and shrunk with zoom (--cz, set by
   glee-play.js), so the game, the Glee Meter and the mini games look as they do in the phone. */
@media (max-width: 809.98px) {
  .gh-show {
    gap: 8px;
    margin-top: 0;
    padding-bottom: 0;
  }

  .gh-stage { perspective: none; }

  .gh-device {
    width: 100%;
    aspect-ratio: auto;
    transform: none;
  }

  .gh-iphone {
    position: static;
    width: auto;
    height: auto;
    scale: none;
  }

  .gh-iphone > i,
  .gh-screen::after { display: none; }

  .gh-iphone__frame {
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .gh-screen {
    width: auto;
    height: auto;
    overflow: visible;
    border-radius: 0;
    background: none;
    isolation: auto;
  }

  /* Phones: the demos are a small deck of cards in a tilted pile. The front card is the one on
     show (looking like the desktop phone's screen); the next sits just behind, tilted one way, and
     the third further back, tilted the other. Swipe the front card and it flies off and tucks in at
     the back. Cards are built at 390x520 and zoomed to fit (--cz, glee-play.js). */
  .gh-track {
    position: relative;
    width: calc(390px * var(--cz, 0.72));
    height: calc(520px * var(--cz, 0.72));
    margin: 4px auto 34px;
    overflow: visible;
    touch-action: pan-y;
  }

  .gh-app {
    position: absolute;
    inset: auto;
    top: 0;
    left: 0;
    width: 390px;
    height: 520px;
    zoom: var(--cz, 0.72);
    border: 3px solid var(--gh-ink);
    border-radius: 34px;
    box-shadow: 6px 7px 0 var(--gh-ink);
    transform-origin: 50% 60%;
    transition: transform 0.55s var(--gh-ease);
  }

  .gh-app[data-o="0"] {
    z-index: 3;
    /* follows a finger while dragged (the drag is in screen px, so it's undone from the zoom) */
    transform: translateX(calc(var(--drag, 0px) / var(--cz, 0.72))) rotate(var(--drag-r, 0deg));
  }
  .gh-app[data-o="1"] { z-index: 2; transform: translate(20px, 12px) rotate(5deg) scale(0.94); }
  .gh-app[data-o="-1"] { z-index: 1; transform: translate(-18px, 22px) rotate(-5deg) scale(0.88); }

  /* The poster and the other cards' text: as on the desktop phone, with the dots outside the card */
  .gh-poster,
  .gh-meter-cta { padding: 36px 30px 40px; }
  .gh-poster-title { font-size: 58px; }
  .gh-poster-btn { margin-top: 10px; }
  .gh-bubbles { display: none; }
  .gh-minis { padding-top: 40px; }

  /* Dots sit under the row, dark on the light page */
  .gh-dots {
    position: static;
    width: fit-content;
    margin: 0 auto;
    padding: 0;
    translate: none;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .gh-dot::before { background: color-mix(in srgb, var(--gh-ink) 20%, transparent); }
  .gh-dot[aria-selected="true"]::before { background: var(--gh-ink); }
  .gh-dot:hover::before { background: color-mix(in srgb, var(--gh-ink) 45%, transparent); }
  .gh-dot:focus-visible { outline-color: var(--gh-accent); }
}

@media (prefers-reduced-motion: reduce) {
  .gh-bubbles i, .gh-game__bg i { display: none; }
  .gh-app { transition: none; }
  .gh-spin { animation: none; }
  .gh-device { transform: none; }
}
