/* THE EMBEDDED BANNER. One page, two shapes, chosen by the frame it is given:
   a strip (wider than four times its height, drawn for 1168 x 128) and a
   card (anything squarer, drawn for a phone-wide 180 px slot). Every length
   is the reference design's own pixels; embed.js zooms the page when a frame
   is a different height, so nothing here needs a scale variable.

   The face is the game on screen: the launcher tile's own three-stop ramp
   (src/styles/base.scss .g-<key>), handed over by embed.js as custom
   properties and eased from game to game. Registered with @property so the
   gradient can be interpolated; a browser without @property simply changes
   colour in one step. */

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/poppins-600-latin-ext.woff2?v=72efc6a32c') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/poppins-600-latin.woff2?v=872e862918') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/poppins-800-latin-ext.woff2?v=db859b9cbc') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/poppins-800-latin.woff2?v=4ef5511d8e') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@property --t1 { syntax: '<color>'; inherits: true; initial-value: #aaa2f8; }
@property --t2 { syntax: '<color>'; inherits: true; initial-value: #806ed8; }
@property --t3 { syntax: '<color>'; inherits: true; initial-value: #6856b4; }
@property --deep { syntax: '<color>'; inherits: true; initial-value: #33206e; }
@property --glow { syntax: '<color>'; inherits: true; initial-value: #f8b56b; }

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

:root {
  color-scheme: light;
  /* The card's left column, where the figure stands: about two fifths of
     the card, never under 128 px. Resolved where it is used, against the
     strip's own width (cqw). */
  --col: clamp(128px, 41cqw, 176px);
  --ease-pop: cubic-bezier(0.2, 0.9, 0.25, 1.25);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --face: 0.9s;
  --slide: 4.5s;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: transparent;
}

body {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

img {
  display: block;
  -webkit-user-drag: none;
}

p,
ul,
figure {
  margin: 0;
  padding: 0;
}

/* THE FACE. A sheen pooling at the top left and a shade of the game's deep
   colour at the foot, like the launcher tile it is copied from. */
.strip {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  isolation: isolate;
  border-radius: 16px;
  background:
    radial-gradient(ellipse 46% 150% at 0% -10%, rgba(255, 255, 255, 0.26), transparent 62%),
    radial-gradient(ellipse 70% 120% at 100% 120%, color-mix(in srgb, var(--deep) 42%, transparent), transparent 70%),
    linear-gradient(112deg, var(--t1) 0%, var(--t2) 50%, var(--t3) 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.28),
    inset 0 -14px 26px color-mix(in srgb, var(--deep) 26%, transparent);
  transition: --t1 var(--face) ease, --t2 var(--face) ease, --t3 var(--face) ease, --deep var(--face) ease, --glow var(--face) ease;
  container: strip / size;
}

/* A frame of another height gets the reference design scaled (embed.js
   sets --k); the width rules below then read the scaled box, which is why
   they are container queries and the lengths inside are cqw, not vw. */
.strip.is-scaled {
  width: calc(100vw / var(--k));
  height: calc(100vh / var(--k));
  transform: scale(var(--k));
  transform-origin: 0 0;
}

/* The whole banner answers a tap (embed.js points it at the store on a
   phone and at the game's page on a computer); the badges, the dock and the
   QR stand above it with targets of their own. */
.hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  cursor: pointer;
}

.hit:focus-visible,
.store:focus-visible,
.dock-tile:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -3px;
}

.brand,
.pitch,
.slides,
.cta,
.glow,
.sparks {
  position: absolute;
  pointer-events: none;
}

/* BRAND: the boxed cat and the wordmark, the lockup of landing/src/content/brand.js. */
.brand {
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
}

.brand-badge {
  width: 63px;
  height: 60px;
  filter: drop-shadow(0 5px 8px color-mix(in srgb, var(--deep) 45%, transparent));
}

.brand-word {
  width: 124px;
  height: auto;
  filter: drop-shadow(0 2px 3px color-mix(in srgb, var(--deep) 50%, transparent));
}

/* PITCH: two short lines and the dock of games under them. */
.pitch {
  z-index: 2;
  left: 245px;
  top: 50%;
  width: 236px;
  transform: translateY(-50%);
}

.pitch-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.012em;
  text-wrap: balance;
  text-shadow: 0 2px 8px color-mix(in srgb, var(--deep) 55%, transparent);
}

.dock {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  list-style: none;
  pointer-events: auto;
}

/* A dock tile is the launcher's clay tile in miniature: the game's own ramp,
   light pooling on top, the icon standing on it. */
.dock-tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  background:
    radial-gradient(circle at 22% 0%, rgba(255, 255, 255, 0.42), transparent 55%),
    linear-gradient(145deg, var(--d1) 0%, var(--d2) 54%, var(--d3) 100%);
  box-shadow:
    0 4px 8px color-mix(in srgb, var(--dd) 40%, transparent),
    inset 0 2px 3px rgba(255, 255, 255, 0.35),
    inset 0 -3px 5px color-mix(in srgb, var(--dd) 30%, transparent),
    0 0 0 1.5px rgba(255, 255, 255, 0.18);
  opacity: 0.86;
  transition: transform 0.35s var(--ease-pop), opacity 0.35s ease, box-shadow 0.35s ease;
}

.dock-tile img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.25));
}

.dock-tile.is-on {
  opacity: 1;
  transform: translateY(-2px) scale(1.08);
  box-shadow:
    0 6px 12px color-mix(in srgb, var(--dd) 45%, transparent),
    inset 0 2px 3px rgba(255, 255, 255, 0.4),
    inset 0 -3px 5px color-mix(in srgb, var(--dd) 30%, transparent),
    0 0 0 2px #fff;
}

/* The turn's timer: a hairline under the tile on screen, filling once. */
.dock-tile::after {
  content: '';
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: -7px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.9);
  transform: scaleX(0);
  transform-origin: 0 50%;
  opacity: 0;
}

.strip.is-turning .dock-tile.is-on::after {
  opacity: 1;
  animation: timer var(--slide) linear forwards;
}

.strip.is-held .dock-tile.is-on::after {
  animation-play-state: paused;
}

@keyframes timer {
  to { transform: scaleX(1); }
}

/* SLIDES: one per game, stacked; the one on screen is .is-on. */
.slides {
  inset: 0;
  z-index: 2;
}

.slide {
  position: absolute;
  inset: 0;
  visibility: hidden;
}

.slide.is-on,
.slide.is-leaving {
  visibility: visible;
}

.slide-art {
  position: absolute;
  left: 506px;
  top: -2px;
  width: 146px;
  height: 140px;
  object-fit: contain;
  object-position: 50% 100%;
  filter: drop-shadow(0 8px 10px color-mix(in srgb, var(--deep) 45%, transparent));
  opacity: 0;
  transform: translateY(18px) scale(0.86) rotate(-5deg);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.slide-copy {
  position: absolute;
  left: 662px;
  top: 50%;
  width: 214px;
  transform: translateY(-50%);
}

.slide-logo {
  width: auto;
  height: auto;
  max-width: 200px;
  max-height: 66px;
  filter: drop-shadow(0 4px 6px color-mix(in srgb, var(--deep) 45%, transparent));
  opacity: 0;
  transform: translateX(14px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.slide-line {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.005em;
  text-shadow: 0 1px 5px color-mix(in srgb, var(--deep) 60%, transparent);
  text-wrap: balance;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.slide.is-on .slide-art {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s ease, transform 0.75s var(--ease-pop);
}

.slide.is-on .slide-logo {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s ease 0.08s, transform 0.6s var(--ease-out) 0.08s;
}

.slide.is-on .slide-line {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s ease 0.16s, transform 0.6s var(--ease-out) 0.16s;
}

.slide.is-leaving .slide-art {
  transform: translateY(-10px) scale(0.94);
}

.slide.is-leaving .slide-logo {
  transform: translateX(-10px);
}

/* The figure breathes while the banner turns, and only then. */
.strip.is-turning .slide.is-on .slide-art {
  animation: breathe 3.2s ease-in-out 0.8s infinite;
}

.strip.is-held .slide.is-on .slide-art {
  animation-play-state: paused;
}

@keyframes breathe {
  0%,
  100% { translate: 0 0; }
  50% { translate: 0 -3px; }
}

/* THE STAGE BEHIND THE FIGURE: a slow sunburst of soft white rays, a pool
   of the game's glow, and a few sparks. All three are centred on the
   figure (x 579, y 68 in the strip); the rays turn only while the banner
   turns. */
.rays,
.glow {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  border-radius: 50%;
}

.rays {
  left: 434px;
  top: -77px;
  width: 290px;
  height: 290px;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.2) 0deg 8deg, rgba(255, 255, 255, 0) 8deg 22.5deg);
  -webkit-mask: radial-gradient(closest-side, #000 18%, rgba(0, 0, 0, 0.55) 52%, transparent 100%);
  mask: radial-gradient(closest-side, #000 18%, rgba(0, 0, 0, 0.55) 52%, transparent 100%);
}

.strip.is-turning .rays {
  animation: spin 48s linear infinite;
}

.strip.is-held .rays {
  animation-play-state: paused;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.glow {
  left: 474px;
  top: -37px;
  width: 210px;
  height: 210px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--glow) 78%, transparent), color-mix(in srgb, var(--glow) 22%, transparent) 62%, transparent);
}

.sparks {
  z-index: 2;
  left: 496px;
  top: 4px;
  width: 166px;
  height: 120px;
}

.spark {
  position: absolute;
  width: 14px;
  height: 14px;
  opacity: 0;
}

.spark:nth-child(1) { left: 0; top: 18px; }
.spark:nth-child(2) { left: 146px; top: 0; width: 11px; height: 11px; }
.spark:nth-child(3) { left: 8px; top: 92px; width: 10px; height: 10px; }

.strip.is-turning .spark {
  animation: twinkle 2.6s ease-in-out infinite;
}

.strip.is-turning .spark:nth-child(2) { animation-delay: 0.9s; }
.strip.is-turning .spark:nth-child(3) { animation-delay: 1.7s; }

.strip.is-held .spark {
  animation-play-state: paused;
}

@keyframes twinkle {
  0%,
  100% { opacity: 0; transform: scale(0.4) rotate(0deg); }
  50% { opacity: 0.95; transform: scale(1) rotate(45deg); }
}

/* CTA: the stores' own badges, unmodified, at one height, App Store first
   (Apple's rule whenever another store's badge stands beside it). Never
   animated, never tinted (both stores' guidelines). On a phone only that
   phone's store is shown. */
.cta {
  z-index: 3;
  right: 22px;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 16px;
  transform: translateY(-50%);
}

.stores {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.store {
  display: block;
  border-radius: 8px;
  pointer-events: auto;
}

.store[hidden] {
  display: none;
}

.store img {
  height: 40px;
  width: auto;
}

.free {
  display: none;
}

/* THE QR, for a computer: a phone camera opens /embed/go/, which sends the
   phone to its own store with the same tag. */
.qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 92px;
  padding: 7px 7px 5px;
  border-radius: 14px;
  background: #fff;
  color: #2c0066;
  box-shadow:
    0 8px 18px color-mix(in srgb, var(--deep) 40%, transparent),
    inset 0 -2px 0 rgba(44, 0, 102, 0.08);
}

.qr[hidden] {
  display: none;
}

.qr svg {
  display: block;
  width: 78px;
  height: 78px;
}

.qr p {
  margin-top: 3px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
}

/* A narrower strip keeps the game and the store and lets the rest go, in
   steps measured against the badges: first the QR (and the left half
   tightens), then the headline and the dock, then the wordmark. The copy
   column always stops 14 px short of the badges (22 + 136 from the edge). */
@container strip (min-aspect-ratio: 4001/1000) and (max-width: 1100px) {
  .qr { display: none; }
  .brand { left: 20px; gap: 8px; }
  .brand-badge { width: 57px; height: 54px; }
  .brand-word { width: 110px; }
  .pitch { left: 214px; width: 205px; }
  .pitch-title { font-size: 19px; }
  .dock { gap: 5px; margin-top: 9px; }
  .dock-tile { width: 30px; height: 30px; border-radius: 9px; }
  .dock-tile img { width: 25px; height: 25px; }
  .slide-art { left: 436px; width: 140px; height: 134px; }
  .rays { left: 361px; }
  .glow { left: 401px; }
  .sparks { left: 426px; }
  .slide-copy { left: 588px; width: min(230px, calc(100cqw - 588px - 172px)); }
}

@container strip (min-aspect-ratio: 4001/1000) and (max-width: 990px) {
  .pitch { display: none; }
  .slide-art { left: 250px; }
  .rays { left: 178px; }
  .glow { left: 218px; }
  .sparks { left: 240px; }
  .slide-copy { left: 404px; width: min(260px, calc(100cqw - 404px - 172px)); }
}

@container strip (min-aspect-ratio: 4001/1000) and (max-width: 800px) {
  .brand-word { display: none; }
  .slide-art { left: 98px; }
  .rays { left: 26px; }
  .glow { left: 66px; }
  .sparks { left: 88px; }
  .slide-copy { left: 252px; width: calc(100cqw - 252px - 172px); }
}

/* THE CARD: a phone-wide slot about 180 px tall. The figure stands at the
   left, big and cropped by the foot of the card; the brand, the game's logo,
   its line and the store button stack down the right. */
@media (max-aspect-ratio: 4/1) {
  .strip {
    border-radius: 18px;
    background:
      radial-gradient(ellipse 80% 90% at 0% -10%, rgba(255, 255, 255, 0.28), transparent 62%),
      radial-gradient(ellipse 90% 90% at 100% 120%, color-mix(in srgb, var(--deep) 40%, transparent), transparent 70%),
      linear-gradient(135deg, var(--t1) 0%, var(--t2) 52%, var(--t3) 100%);
  }

  .pitch,
  .qr {
    display: none;
  }

  .brand {
    left: var(--col);
    top: 12px;
    width: calc(100cqw - var(--col) - 14px);
    gap: 7px;
    transform: none;
  }

  .brand-badge {
    width: 25px;
    height: 24px;
  }

  .brand-word {
    display: block;
    width: 82px;
  }

  .slide-art {
    left: 2px;
    top: auto;
    bottom: -10px;
    width: calc(var(--col) - 4px);
    height: 172px;
    object-position: 50% 100%;
  }

  .glow {
    left: -26px;
    top: 0;
    width: calc(var(--col) + 52px);
    height: 210px;
  }

  .rays {
    left: calc(var(--col) / 2 - 150px);
    top: -46px;
    width: 300px;
    height: 300px;
  }

  .sparks {
    left: 8px;
    top: 10px;
    width: calc(var(--col) - 16px);
    height: 130px;
  }

  .spark:nth-child(2) { left: auto; right: 0; }
  .spark:nth-child(3) { left: auto; right: 6px; top: 96px; }

  /* Centred in the gap between the brand row (to y 36) and the store
     button (from y 127), whatever height this game's logo and line take. */
  .slide-copy {
    left: var(--col);
    top: 81px;
    width: calc(100cqw - var(--col) - 14px);
  }

  .slide-logo {
    max-width: min(200px, 100%);
    max-height: 46px;
  }

  .slide-line {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.2;
  }

  .cta {
    left: var(--col);
    right: auto;
    top: auto;
    bottom: 13px;
    gap: 10px;
    transform: none;
  }

  .stores {
    flex-direction: row;
    gap: 8px;
  }

  .store img {
    height: 40px;
  }

  /* Free, said at the top of the column, level with the brand, since the
     card has no room for the strip's headline. */
  .free {
    display: block;
    margin-left: auto;
    padding: 5px 9px 5px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--deep) 36%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
  }

  /* A computer showing the card has both stores to offer, side by side and
     a size smaller. */
  .strip.is-desktop .store img {
    height: 30px;
  }
}

@container strip (max-aspect-ratio: 4/1) and (max-width: 340px) {
  .slide-line {
    font-size: 11.5px;
  }

  .free {
    display: none;
  }
}

/* LESS MOTION, ASKED FOR. Games still change, by a plain cross-fade, and
   nothing breathes, twinkles or springs. */
@media (prefers-reduced-motion: reduce) {
  .strip {
    transition-duration: 0.01s;
  }

  .slide-art,
  .slide-logo,
  .slide-line,
  .slide.is-on .slide-art,
  .slide.is-on .slide-logo,
  .slide.is-on .slide-line,
  .slide.is-leaving .slide-art,
  .slide.is-leaving .slide-logo {
    transform: none;
    transition: opacity 0.4s ease;
  }

  .strip.is-turning .slide.is-on .slide-art,
  .strip.is-turning .rays,
  .strip.is-turning .spark,
  .strip.is-turning .dock-tile.is-on::after {
    animation: none;
  }

  .dock-tile {
    transition: none;
  }
}
