/* ==========================================================================
   Home v2 — the pocket arcade
   One flat page colour, then all the energy lives inside the games. The hero
   six is built from six pieces, so the identity is the collection itself.
   ========================================================================== */

:root {
  --home-rule: color-mix(in srgb, var(--ink) 17%, transparent);
  --home-faint: color-mix(in srgb, var(--ink) 6%, transparent);
  --home-stage: color-mix(in srgb, var(--page) 82%, var(--t2));
  --home-accent-ink: #211d18;
  --home-hard: rgba(59, 56, 51, 0.15);
}

html[data-theme="dark"] {
  --home-rule: color-mix(in srgb, var(--ink) 16%, transparent);
  --home-faint: color-mix(in srgb, var(--ink) 9%, transparent);
  --home-hard: rgba(0, 0, 0, 0.55);
}

.hub {
  background: var(--page);
}

.hub-shell {
  width: min(100%, 1000px);
  padding-top: max(var(--pb-gutter-top), calc(var(--sa-top) + clamp(18px, 3.6vw, 30px)));
  padding-right: calc(var(--sa-right) + clamp(16px, 3.8vw, 36px));
  padding-bottom: calc(var(--sa-bottom) + 22px);
  padding-left: calc(var(--sa-left) + clamp(16px, 3.8vw, 36px));
}

/* ---------- masthead ---------- */

.hub-top {
  align-items: center;
  gap: 14px;
}

.hub-brand {
  min-width: 0;
}

.hub-word {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.hub-actions {
  gap: 7px;
}

.hub-share {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--home-rule);
  background: transparent;
  box-shadow: none;
  color: var(--ink);
}

.hub-share:hover {
  transform: none;
  border-color: var(--ink);
  background: var(--home-faint);
}

.hub-share:active { transform: scale(0.95); }

.hub-focus {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--home-rule);
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}

.hub-focus[hidden] { display: none; }

.hub-focus svg {
  width: 18px;
  height: 18px;
  display: block;
}

.hub-focus .focus-exit { display: none; }
.hub-focus[aria-pressed="true"] .focus-enter { display: none; }
.hub-focus[aria-pressed="true"] .focus-exit { display: block; }

.hub-focus:hover {
  transform: none;
  border-color: var(--ink);
  background: var(--home-faint);
}

.hub-focus:active { transform: scale(0.95); }

.hub-share:focus-visible,
.hub-focus:focus-visible,
.hub-look:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.hub-look {
  min-height: 38px;
  gap: 7px;
  padding: 0 9px 0 8px;
  border: 1px solid var(--home-rule);
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}

.hub-look:hover {
  transform: none;
  border-color: var(--ink);
  background: var(--home-faint);
}

.hub-look:active { transform: scale(0.98); }

.hub-look-dots {
  display: flex;
  align-items: center;
  flex: none;
  padding-left: 2px;
}

.hub-look-dots i {
  display: block;
  width: 9px;
  height: 9px;
  margin-left: -3px;
  border-radius: 50%;
}

.hub-look-dots i:first-child { margin-left: 0; background: var(--t8); }
.hub-look-dots i:nth-child(2) { background: var(--t32); }
.hub-look-dots i:nth-child(3) { background: var(--t64); }

.hub-look-copy {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 1px;
}

.hub-look-copy span {
  display: block;
  font-family: var(--font-ui);
  font-size: 6.5px;
  line-height: 1.2;
  letter-spacing: 0.12em;
}

.hub-look-copy strong {
  display: block;
  max-width: 12ch;
  overflow: visible;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}

.hub-look-chevron {
  display: block;
  margin: 0;
  font-size: 13px;
}

/* ---------- hero ---------- */

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(96px, 28vw, 124px);
  grid-template-areas:
    "head head"
    "body art";
  column-gap: 16px;
  row-gap: 18px;
  align-items: end;
  margin-top: clamp(28px, 5.6vh, 54px);
}

.home-head { grid-area: head; min-width: 0; }
.home-body { grid-area: body; min-width: 0; }
.home-hero-art { grid-area: art; align-self: end; justify-self: end; width: 100%; min-width: 0; }

.home-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 clamp(12px, 2vh, 18px);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
}

.home-kicker-pip {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 2px;
  background: var(--t64);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--t64) 20%, transparent);
}

.home-hero h1 {
  margin: 0;
  max-width: none;
  color: var(--ink);
  font-size: clamp(40px, 12.5vw, 76px);
  font-weight: 700;
  letter-spacing: -0.067em;
  /* The two lines are deliberately tight, but 0.86 put the next line's box on
     top of the descender of the g in “Games”. A little breathing room keeps
     the display treatment without clipping a letter. */
  line-height: 0.94;
  text-transform: none;
  text-wrap: balance;
}

.home-hero h1 > span { display: block; }

.home-hero h1 > span:first-child { padding-bottom: 0.035em; }

.home-hero h1 .home-title-mark {
  display: table;
  width: fit-content;
  max-width: 100%;
  margin-top: 0.07em;
  padding: 0.015em 0.12em 0.07em;
  border-radius: 0.08em;
  background: var(--t256);
  color: var(--home-accent-ink);
  letter-spacing: -0.075em;
  transform: rotate(-1.4deg);
  transform-origin: left center;
}

.home-sub {
  max-width: 43ch;
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.home-ctas {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 19px;
}

.home-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 45px;
  padding: 0 14px;
  border: 1px solid var(--home-accent-ink);
  border-radius: 10px;
  background: var(--t64);
  box-shadow: 0 3px 0 rgba(33, 29, 24, 0.18);
  color: var(--home-accent-ink);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  white-space: nowrap;
  flex: none;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition: transform 150ms var(--ease-out);
}

.home-cta span {
  font-size: 17px;
  font-weight: 500;
  line-height: 0.7;
}

.home-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 0 rgba(33, 29, 24, 0.18);
}

.home-cta:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 rgba(33, 29, 24, 0.18);
}

.home-cta:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.home-surprise {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 45px;
  min-height: 45px;
  padding: 0 12px;
  border: 1px solid var(--home-rule);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 150ms var(--ease-out), transform 150ms var(--ease-out);
}

.home-surprise svg {
  display: block;
  width: 18px;
  height: 18px;
  flex: none;
}

.home-surprise:hover {
  border-color: var(--ink);
  background: var(--home-faint);
}

.home-surprise:active { transform: scale(0.97); }

.home-surprise:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* Surprise me: the die rolls, then the card it landed on lifts before the game
   opens, so the pick is something the reader sees rather than a jump. */
.home-game.is-picked {
  border-color: var(--game-accent);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--game-accent) 34%, transparent),
    0 3px 0 var(--home-hard);
}

.home-game:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--home-hard);
}

@keyframes diceRoll {
  0% { transform: rotate(0) scale(1); }
  30% { transform: rotate(-20deg) scale(1.12); }
  55% { transform: rotate(16deg) scale(1.08); }
  78% { transform: rotate(-7deg) scale(1.03); }
  100% { transform: rotate(0) scale(1); }
}

@keyframes cardPicked {
  0% { transform: none; }
  45% { transform: translateY(-3px) scale(1.012); }
  100% { transform: none; }
}

html[data-motion="full"] .home-surprise.is-rolling svg { animation: diceRoll 430ms cubic-bezier(0.3, 0.9, 0.3, 1); }

html[data-motion="full"] .home-game.is-picked { animation: cardPicked 430ms cubic-bezier(0.22, 1, 0.36, 1); }

.home-promises {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 16px 0 0;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.5;
  text-transform: uppercase;
}

.home-promises span {
  white-space: nowrap;
}

.home-promises span + span::before {
  content: "·";
  margin-right: 10px;
  color: var(--home-rule);
}

/* The six is made of exactly six pieces. It is the cover, not a sixth card. */
.home-hero-art {
  padding-top: 2px;
}

.home-six {
  display: grid;
  width: 100%;
  aspect-ratio: 3 / 5;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 5px;
  transform: rotate(-3deg);
  transform-origin: center;
}

.home-six-piece {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0 7px 6px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms var(--ease-out);
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  box-shadow: inset 0 -4px 0 rgba(33, 29, 24, 0.12);
  color: var(--home-accent-ink);
  font-family: var(--font-ui);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  animation-duration: 360ms;
  animation-timing-function: var(--ease-out);
  /* Backwards fill covers the stagger delay; forwards fill would leave the
     final keyframe overriding the hover and press transforms forever. */
  animation-fill-mode: backwards;
}

.six-1 { grid-area: 1 / 1 / 2 / 4; --six-x: -10px; --six-y: -12px; --six-r: -4deg; background: var(--six-1); animation-delay: 400ms; }
.six-2 { grid-area: 2 / 1 / 3 / 2; --six-x: -12px; --six-y: 0px; --six-r: 2deg; background: var(--six-2); animation-delay: 460ms; }
.six-3 { grid-area: 3 / 1 / 4 / 4; --six-x: 0px; --six-y: 8px; --six-r: 1deg; background: var(--six-3); animation-delay: 520ms; }
.six-4 { grid-area: 4 / 1 / 5 / 2; --six-x: -12px; --six-y: 0px; --six-r: -2deg; background: var(--six-4); animation-delay: 580ms; }
.six-5 { grid-area: 4 / 3 / 5 / 4; --six-x: 12px; --six-y: 0px; --six-r: 2deg; background: var(--six-5); animation-delay: 640ms; }
.six-6 { grid-area: 5 / 1 / 6 / 4; --six-x: 0px; --six-y: 14px; --six-r: -1deg; background: var(--six-6); animation-delay: 700ms; }

.home-six-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 1px 0;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

/* home-build is set at app-ready only when the launch resolves to Full, and
   hub-settled is set the first time the reader leaves the collection. Together
   they make the build a launch moment: the hub is display:none behind a game,
   and without the second guard the browser would restart this animation every
   time the collection came back. A switch to Reduced still drops home-build,
   so choosing Full later does not replay a build the player already saw. */
html.home-build:not(.hub-settled) .home-six-piece { animation-name: sixBuild; }

html.home-build:not(.hub-settled) .home-six-caption {
  animation: sixCaptionIn 360ms var(--ease-out) 340ms both;
}

@keyframes sixBuild {
  0% { opacity: 0; transform: translate(var(--six-x, 0), var(--six-y, 0)) scale(0.84) rotate(var(--six-r, 0deg)); }
  64% { opacity: 1; transform: translate(0, 0) scale(1.02) rotate(0deg); }
  82% { transform: translate(0, 0) scale(0.99) rotate(0deg); }
  100% { opacity: 1; transform: none; }
}

@keyframes sixCaptionIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ---------- running collection strip ---------- */

.home-ticker {
  position: relative;
  width: 100%;
  height: 37px;
  margin-top: clamp(27px, 4.8vw, 42px);
  overflow: hidden;
  border-radius: 8px;
  background: var(--ink);
  color: var(--page);
}

.home-ticker::before,
.home-ticker::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: clamp(14px, 1.8vw, 20px);
  pointer-events: none;
  background: linear-gradient(90deg, var(--ink), color-mix(in srgb, var(--ink) 0%, transparent));
}

.home-ticker::before { left: 0; }
.home-ticker::after { right: 0; transform: scaleX(-1); }

.home-ticker-track {
  display: flex;
  width: max-content;
  height: 100%;
  animation: tickerRun 42s linear infinite;
}

/* The tape is the one thing on the hub that never stops. Pause it with the
   window, and start it from the beginning (instead of mid-word) on a phone
   that asked for less motion or cannot afford the frames. */
html.is-app-hidden .home-ticker-track { animation-play-state: paused; }
html.perf-lite .home-ticker-track { animation: none; transform: none; }

.home-ticker-group {
  display: flex;
  align-items: center;
  flex: none;
  height: 100%;
  padding-left: 19px;
}

.home-ticker-group span {
  position: relative;
  padding-right: 23px;
  color: var(--page);
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.home-ticker-group span::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 9px;
  width: 4px;
  height: 4px;
  border-radius: 1px;
  background: var(--six-1);
  transform: translateY(-50%) rotate(45deg);
}

.home-ticker-group span:nth-child(6n + 2)::after { background: var(--six-2); }
.home-ticker-group span:nth-child(6n + 3)::after { background: var(--six-3); }
.home-ticker-group span:nth-child(6n + 4)::after { background: var(--six-4); }
.home-ticker-group span:nth-child(6n + 5)::after { background: var(--six-5); }
.home-ticker-group span:nth-child(6n + 6)::after { background: var(--six-6); }

@keyframes tickerRun {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- collection ---------- */

.home-collection {
  margin-top: clamp(34px, 5.6vh, 56px);
  scroll-margin-top: 22px;
}

.home-collection-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--ink);
}

.home-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
}

.home-label::before {
  content: "";
  width: 14px;
  height: 2px;
  background: var(--t64);
}

.home-collection h2 {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: clamp(28px, 6.4vw, 37px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.home-collection h2 span {
  color: var(--t64);
}

.home-collection-note {
  max-width: 23ch;
  margin: 0 0 1px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
  text-align: right;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 13px;
  margin-top: 16px;
}

.home-game {
  --game-accent: var(--six-1);
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--home-rule);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 86%, var(--page));
  box-shadow: 0 3px 0 var(--home-hard);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 160ms var(--ease-out);
}

.home-game--merge { --game-accent: var(--six-1); }
.home-game--sudoku { --game-accent: var(--six-2); }
.home-game--ttt { --game-accent: var(--six-3); }
.home-game--mines { --game-accent: var(--six-4); }
.home-game--water { --game-accent: var(--six-5); }
.home-game--fruit { --game-accent: var(--six-6); }

.home-game:hover {
  transform: translateY(-3px);
  border-color: var(--ink);
  box-shadow: 0 6px 0 var(--home-hard);
}

.home-game:active {
  transform: translateY(0);
  box-shadow: 0 2px 0 var(--home-hard);
}

.home-game:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.home-game-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  flex: none;
  padding: 0 11px;
  border-bottom: 1px solid color-mix(in srgb, var(--home-accent-ink) 18%, transparent);
  background: var(--game-accent);
  color: var(--home-accent-ink);
}

.home-game-num {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.home-game-kind {
  font-family: var(--font-ui);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.home-game-arrow {
  margin-left: auto;
  font-size: 15px;
  font-weight: 500;
  line-height: 0.8;
  transition: transform 160ms var(--ease-out);
}

.home-game:hover .home-game-arrow { transform: translate(2px, -2px); }

.home-game-art {
  display: block;
  flex: none;
  padding: 8px;
  background: var(--game-accent);
}

.home-game-stage {
  display: grid;
  position: relative;
  place-items: center;
  height: clamp(120px, 25vw, 160px);
  overflow: hidden;
  border-radius: 7px;
  background-color: var(--home-stage);
  background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 12%, transparent) 0.9px, transparent 1.1px);
  background-size: 8px 8px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent);
}

.home-game-stage .mini-merge {
  width: 102px;
  gap: 7px;
}

.home-game-stage .mini-tile {
  border-radius: 9px;
  font-size: 15px;
}

.home-game-stage .mini-water {
  transform: scale(0.82);
  transform-origin: center;
}

.home-game-stage .mini-sudoku {
  width: 98px;
  height: 98px;
  opacity: 0.9;
}

.home-game-stage .mini-cluster { transform: scale(0.78); }

.home-game-stage .mini-ttt {
  width: 96px;
  height: 96px;
  gap: 4px;
}

.home-game-stage .mini-mines {
  width: 98px;
  height: 98px;
  gap: 4px;
}

.home-game-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  padding: 12px 12px 11px;
}

.home-game-title {
  display: block;
  color: var(--ink);
  font-size: clamp(23px, 5.5vw, 28px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.home-game-desc {
  display: block;
  max-width: 31ch;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.home-game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.home-game-meta > span:first-child {
  min-width: 0;
  /* Localized metadata can be longer than an English card. Wrap it rather
     than hiding the end behind an ellipsis on narrower cards. */
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.home-game-play {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 4px;
  color: var(--ink);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.home-game-play::after {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  /* One vector chevron for every card. A rotated 5px border square rendered
     as a box or an L on some densities, which made one card's arrow differ. */
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M2.2 1 5.8 4 2.2 7' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M2.2 1 5.8 4 2.2 7' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 160ms var(--ease-out);
}

.home-game:hover .home-game-play::after { transform: translateX(2px); }

html[dir="rtl"] .home-game-play::after { transform: scaleX(-1); }
html[dir="rtl"] .home-game:hover .home-game-play::after { transform: translateX(-2px) scaleX(-1); }

/* ---------- install notice ---------- */

.install-fix {
  margin-top: 20px;
  padding: 12px;
  border: 1px solid var(--home-rule);
  border-radius: 11px;
  background: color-mix(in srgb, var(--card) 72%, var(--page));
  box-shadow: none;
}

.install-fix {
  border-color: color-mix(in srgb, var(--warn) 34%, var(--home-rule));
}

/* ---------- footer ---------- */

.hub-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 9px 14px;
  margin-top: clamp(30px, 5vw, 46px);
  padding: 15px 0 0;
  border-top: 1px solid var(--home-rule);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.2;
  text-transform: uppercase;
}

.hub-foot span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.hub-foot span::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--six-1);
}

.hub-foot span:nth-child(2)::before { background: var(--six-2); }
.hub-foot span:nth-child(3)::before { background: var(--six-3); }

.hub-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 9px;
}

.hub-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin: 0 0 0 -4px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-family: var(--font-ui);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
}

.hub-link:hover { color: var(--ink); }

.hub-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.hub-link-icon {
  width: 13px;
  height: 13px;
  flex: none;
}

.hub-link-chevron {
  color: var(--muted);
  font-size: 12px;
}

.hub-meta .hub-version {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- responsive ---------- */

@media (min-width: 360px) {
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 720px) {
  .home-hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(206px, 0.62fr);
    grid-template-areas:
      "head art"
      "body art";
    column-gap: clamp(34px, 6vw, 72px);
    row-gap: 0;
    align-items: center;
  }

  .home-head { align-self: end; }
  .home-body { align-self: start; }

  .home-hero h1 { font-size: clamp(58px, 7.4vw, 78px); }
  .home-hero-art { width: clamp(208px, 24vw, 252px); }
  .home-six-caption { margin-top: 15px; font-size: 7.5px; }
  .home-ticker { margin-top: clamp(36px, 4.6vw, 52px); height: 39px; }
  .home-ticker-group span { font-size: 8.5px; padding-right: 27px; }
  .home-ticker-group span::after { right: 11px; }
  .home-ticker-group { padding-left: 23px; }

  .home-collection-head { padding-bottom: 15px; }
  .home-collection h2 { font-size: clamp(32px, 4.1vw, 40px); }
  .home-collection-note { font-size: 11px; }
  .home-grid { gap: 15px; margin-top: 18px; }

  .home-game-bar { height: 36px; padding: 0 13px; }
  .home-game-art { padding: 9px; }
  .home-game-stage { height: clamp(146px, 17vw, 164px); }
  .home-game-copy { padding: 15px 15px 14px; }
  .home-game-title { font-size: clamp(25px, 2.9vw, 30px); }
  .home-game-desc { margin-top: 8px; font-size: 12px; }
  .home-game-meta { padding-top: 13px; font-size: 9px; }
  .home-game-play { font-size: 9px; }

  .home-game-stage .mini-merge { width: 124px; }
  .home-game-stage .mini-water { transform: scale(0.95); }
  .home-game-stage .mini-sudoku { width: 116px; height: 116px; }
  .home-game-stage .mini-cluster { transform: scale(0.94); }
  .home-game-stage .mini-ttt { width: 110px; height: 110px; }
  .home-game-stage .mini-mines { width: 112px; height: 112px; }
}

@media (min-width: 920px) {
  .home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Keep the roomy phone hero: the description starts at the cover's top edge
   so the headline no longer strands an empty band above it, and the promise
   row sits on the cover's foot instead of hovering above its caption. The
   leftover height is shared above and below the CTAs, so a short locale does
   not leave the single-line promise row stranded far under the buttons. */
@media (max-width: 719px) {
  /* The masthead is a label, not a section. The release note used to be the
     only thing between it and the hero, so once the note was dismissed the
     hero sat a full section gap below the wordmark and the header read as a
     hole above the fold. The hero's gap is now the tight one; the note adds
     its own room below itself, so a fresh visit keeps the same rhythm. */
  .home-hero { margin-top: clamp(18px, 3vh, 30px); }
  .whats-new { margin-bottom: clamp(12px, 2vh, 18px); }
  .home-body {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    justify-content: space-between;
  }
}

@media (max-width: 559px) {
  .home-collection { margin-top: 16px; }
  html[data-daily="off"] .home-collection { margin-top: 31px; }
  .home-surprise { width: 45px; padding: 0; }
  .home-surprise span { display: none; }
}

@media (max-width: 480px) {
}

@media (max-width: 480px) and (orientation: portrait) {
  .hub-look-copy span { display: none; }
  .hub-look-copy strong { max-width: 12ch; font-size: 9.5px; }
  .hub-look-chevron { display: none; }
}

/* A short landscape window is wide, not narrow. Keep the Look pill's name and
   its chevron, and give its two-line copy enough height that a scaled-up
   system font cannot push the label out of the border. */
@media (orientation: landscape) and (max-height: 560px) {
  .hub-look { min-height: 40px; padding: 0 10px 0 9px; }
  .hub-look-copy span { display: block; }
  .hub-look-chevron { display: block; }
}

@media (max-width: 380px) {
  .hub-shell {
    padding-right: calc(var(--sa-right) + 15px);
    padding-left: calc(var(--sa-left) + 15px);
  }

  .hub-word { font-size: 11px; letter-spacing: 0.16em; }
  .hub-actions { gap: 5px; }
  .hub-share { width: 36px; height: 36px; }
  .hub-focus { width: 36px; height: 36px; }
  .hub-look { min-height: 36px; padding: 0 7px; }

  .home-hero {
    grid-template-columns: minmax(0, 1fr) 92px;
    column-gap: 13px;
    row-gap: 16px;
    margin-top: 24px;
  }

  .home-hero h1 { font-size: clamp(38px, 12.4vw, 47px); }
  .home-sub { margin-top: 14px; font-size: 12.5px; }
  .home-ctas { margin-top: 15px; gap: 7px; }
  .home-cta { gap: 9px; min-height: 43px; padding: 0 11px; font-size: 9px; }
  .home-surprise { width: 43px; min-width: 43px; min-height: 43px; }
  .home-promises { margin-top: 13px; font-size: 7.5px; letter-spacing: 0.04em; gap: 2px 6px; }
  .home-promises span + span::before { margin-right: 5px; }
  .home-six { gap: 4px; }
  .home-six-piece { padding: 0 6px 5px; border-radius: 7px; font-size: 7px; }
  .home-six-caption { margin-top: 8px; font-size: 6px; }
  .home-six-caption span:first-child { display: none; }
  .home-collection-head { gap: 10px; padding-bottom: 11px; }
  .home-collection h2 { font-size: 31px; }
  .home-collection-note { max-width: 18ch; font-size: 9.5px; }
  .home-ticker { margin-top: 27px; height: 35px; }
  .home-ticker-group span { font-size: 7.5px; padding-right: 21px; }
  .home-ticker-group span::after { right: 8px; width: 3.5px; height: 3.5px; }
  .home-ticker-group { padding-left: 15px; }
  .home-game-copy { padding: 11px 10px 10px; }
  .home-game-title { font-size: 23px; }
  .home-game-desc { font-size: 11.5px; margin-top: 6px; }
  .home-game-meta { padding-top: 9px; font-size: 8px; gap: 5px; }
  .home-game-play { font-size: 8px; }
  .home-game-bar { padding: 0 9px; gap: 6px; }
  .home-game-kind { font-size: 8px; }
  .home-game-stage { height: 120px; }
  .home-game-stage .mini-merge { width: 96px; gap: 6px; }
  .home-game-stage .mini-water { transform: scale(0.77); }
  .home-game-stage .mini-sudoku { width: 92px; height: 92px; }
  .home-game-stage .mini-cluster { transform: scale(0.73); }
  .home-game-stage .mini-ttt { width: 90px; height: 90px; }
  .home-game-stage .mini-mines { width: 92px; height: 92px; }
  .hub-foot { margin-top: 28px; font-size: 8px; }
  .hub-link { font-size: 8px; }
  .hub-meta .hub-version { font-size: 8px; }
}

@media (max-width: 340px) {
  .hub-look { padding: 0 8px; }
  .home-hero { grid-template-columns: minmax(0, 1fr) 84px; }
  .home-cta { gap: 7px; font-size: 8.5px; padding: 0 9px; }
  .home-collection-note { display: none; }
  .home-collection h2 { font-size: 29px; }
}

@media (hover: none) {
  .home-game:hover {
    transform: none;
    border-color: var(--home-rule);
    box-shadow: 0 3px 0 var(--home-hard);
  }

  .home-game:hover .home-game-arrow,
  .home-game:hover .home-game-play::after { transform: none; }

  html[dir="rtl"] .home-game:hover .home-game-play::after { transform: scaleX(-1); }
}

html[data-motion="reduced"] .hub-share,
html[data-motion="reduced"] .hub-look,
html[data-motion="reduced"] .home-cta,
html[data-motion="reduced"] .home-surprise,
html[data-motion="reduced"].home-ready .home-six-piece,
html[data-motion="reduced"].home-ready .home-six-caption,
html[data-motion="reduced"] .home-ticker-track,
html[data-motion="reduced"] .home-game,
html[data-motion="reduced"] .home-game-arrow,
html[data-motion="reduced"] .home-game-play::after {
    animation: none;
    transition: none;
  }


html[data-motion="reduced"] .home-ticker-track { animation: none; transform: none; }

/* ---------- Android stretch overscroll ----------
   Android 12+ stretches the content instead of rubber-banding it, but a fixed
   shell that scrolls internally never reaches the platform edge effect. On
   Android, overscroll.js takes over that edge gesture on the hub; iOS keeps its
   native rubber band because none of this applies there. */
html.has-stretch .hub {
  overscroll-behavior-y: none;
}

/* The stretch is written frame by frame by overscroll.js on the hub itself —
   a transition there would fight the spring and snap a caught animation flat. */
html.has-stretch .hub {
  transition: none;
}

/* The cover is a touch surface, not just decoration. Keep it above the
   surrounding art and make every piece a deliberate tap target on mobile. */
.home-hero-art {
  position: relative;
  z-index: 1;
}

.home-six {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

.home-six-piece {
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.hub-top + .whats-new { margin-top: 18px; }

/* ---------- first-run welcome ---------- */

/* The first visit gets one sheet, in the same language as every other sheet:
   a short mark, three numbered steps, and one way out. It is shown once and
   can be replayed from Look & feel. */
.welcome-card { padding-top: 20px; }

/* One filled action: the start button. Skip stays quiet so the first screen
   has a single obvious next step. */
.welcome-card .sheet-done {
  background: transparent;
  color: var(--muted);
}

.welcome-mark {
  display: flex;
  gap: 5px;
  margin: 16px 0 0;
}

.welcome-mark span {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.welcome-mark span:nth-child(1) { background: var(--six-1); }
.welcome-mark span:nth-child(2) { background: var(--six-2); }
.welcome-mark span:nth-child(3) { background: var(--six-3); }
.welcome-mark span:nth-child(4) { background: var(--six-4); }
.welcome-mark span:nth-child(5) { background: var(--six-5); }
.welcome-mark span:nth-child(6) { background: var(--six-6); }

.welcome-steps { margin-top: 18px; }

.welcome-start {
  display: flex;
  width: 100%;
  margin-top: 18px;
  justify-content: center;
}

.welcome-note { margin: 12px 0 0; text-align: center; }

/* With reduced motion the script never marks the shell, so the hub keeps the
   platform's own edge handling rather than the rebuilt stretch. */
html[data-motion="reduced"] .hub { overscroll-behavior-y: contain; }
