/*
  Home tab (Prefabs/Views/Home.prefab) and the pieces the News, Settings and Profile screens share
  (the blue popup frame, switches, FitLabel). Sizes are canvas units via --u (tokens.css).

  Phone: the prefab's own layout. The page is the area between the hub header and the tab bar; the
  robot and PLAY NOW are anchored to its bottom edge exactly like the prefab's bottom-anchored
  objects (PLAY NOW's bottom edge is 164u above the tab bar, the robot's centre 575u above it).
  Wide: two columns (news on the left, robot and PLAY NOW on the right).
*/

.fit-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: calc(var(--fit-size, 32) * var(--u));
}

/* ---- page ------------------------------------------------------------------------------------------ */
.home {
  --gutter: calc(40 * var(--u));
  /* the stage and the card read the page's own height (cqh) */
  container: home / size;
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: calc(28 * var(--u)) var(--gutter) 0;
}
.home__news {
  flex: none;
}

/* ---- CURRENT EVENTS (HomeContainer/CurrentEventsChooser) --------------------------------------------- */
.home-events {
  --card-h: calc(650 * var(--u));
  position: relative;
  height: var(--card-h);
  border-radius: calc(52 * var(--u));
  border: calc(4 * var(--u)) solid #8c7ade;
  background: #3640a6;
  box-shadow:
    inset 0 calc(3 * var(--u)) 0 rgba(255, 255, 255, 0.1),
    0 calc(8 * var(--u)) calc(22 * var(--u)) rgba(0, 18, 66, 0.3);
  animation: home-rise var(--t-slow) var(--ease-out) both;
}
@keyframes home-rise {
  from {
    opacity: 0;
    transform: translateY(calc(14 * var(--u)));
  }
}
.home-events__title {
  position: absolute;
  left: calc(40 * var(--u) - 4 * var(--u));
  /* 6 units below the prefab's 24: the title line is centred on the "See all" pill (24 + 34) */
  top: calc(30 * var(--u) - 4 * var(--u));
  right: calc(290 * var(--u));
  height: calc(56 * var(--u));
  display: flex;
  align-items: center;
  font-weight: var(--w-semibold);
  font-size: calc(44 * var(--u));
  color: #fff;
  text-shadow: var(--on-colour-shadow);
  white-space: nowrap;
}
.home-events__cadence {
  position: absolute;
  /* on the title's left edge (the TMP box sat 11 units further in, which read as a stray indent) */
  left: calc(40 * var(--u) - 4 * var(--u));
  right: calc(40 * var(--u));
  top: calc(82 * var(--u) - 4 * var(--u));
  height: calc(56 * var(--u));
  font-weight: var(--w-medium);
  font-size: calc(32 * var(--u));
  line-height: calc(56 * var(--u));
  color: #f0f0ff;
  text-shadow: var(--on-colour-shadow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-events__all {
  position: absolute;
  /* The same 24 units from the card's top and right edges (the prefab put it 10 down and 32 in, hard against the top
     edge), its right edge on the right edge of the story rows below (their body is 24 units in too), 68 units tall so
     it is centred on the title line (24 + 34 = 58, the title's centre) */
  right: calc(24 * var(--u) - 4 * var(--u));
  top: calc(24 * var(--u) - 4 * var(--u));
  min-width: calc(240 * var(--u));
  max-width: calc(330 * var(--u));
  height: calc(68 * var(--u));
  padding: 0 calc(24 * var(--u));
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #8a5cf6, #7540f0 55%, #6c36e4);
  box-shadow:
    inset 0 0 0 calc(3 * var(--u)) #a07df4,
    0 calc(5 * var(--u)) 0 rgba(36, 22, 112, 0.55);
  font-weight: var(--w-semibold);
  color: #fff;
  text-shadow: var(--on-colour-shadow);
  transition: transform var(--t-fast) var(--ease-out), filter var(--t-fast);
}
/* On a phone the pill takes the CURRENT EVENTS title's inset instead of the rows' (the title text stands about 13 px
   from the card's left edge): 32 units from the right edge and 28 from the top, 60 units tall so it is still
   centred on the title line (28 + 30 = 58); the hit area is widened to a 44 px touch target. */
.layout-phone .home-events__all {
  right: calc(32 * var(--u) - 4 * var(--u));
  top: calc(28 * var(--u) - 4 * var(--u));
  height: calc(60 * var(--u));
  padding: 0 calc(22 * var(--u));
}
.layout-phone .home-events__all::after {
  content: '';
  position: absolute;
  inset: -10px -6px;
}
.home-events__all:hover:not(:disabled) {
  filter: brightness(1.08);
}
.home-events__all:active:not(:disabled) {
  transform: translateY(calc(3 * var(--u)));
}
.home-events__all:disabled {
  opacity: 0.7;
}
.home-events__body {
  position: absolute;
  left: calc(24 * var(--u) - 4 * var(--u));
  right: calc(24 * var(--u) - 4 * var(--u));
  top: calc(140 * var(--u) - 4 * var(--u));
  bottom: calc(26 * var(--u) - 4 * var(--u));
  display: grid;
  /* the artwork column is as wide as the 768 x 1344 story art at the body's height, never more than the
     prefab's 34 % (the rows keep their width), so the art fills its rounded panel instead of floating in it */
  grid-template-columns: min(calc((var(--card-h) - 158 * var(--u)) * 0.5714), 34%) minmax(0, 1fr);
  column-gap: calc(18 * var(--u));
}
/* On the wide two-column layouts the 34 % cap made the tile narrower than the story art (a 0.51 tile for 0.5714 art at
   a desktop card), so the picture was cropped on both sides and cut the red ribbon straight down at the tile's edge.
   There the column is the art's own width at the body's height (the cap only guards a very short body), so the whole
   picture fills the tile edge to edge with nothing cropped; the rows are 17 to 32 px narrower for it. */
.layout-wide .home-events__body {
  grid-template-columns: min(calc((var(--card-h) - 158 * var(--u)) * 0.5714), 40%) minmax(0, 1fr);
}
.home-events__story {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: calc(32 * var(--u));
}
.home-events__art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* The globe (no story art yet, or it failed to load) and any picture shaped differently from the story art stand
   whole in the same rounded tile: the tile takes the story art's own blue (#3a43c4 against the card's #3640a6) with a
   soft lighter centre, and the picture is centred inside it, uncropped. */
.home-events__story.is-fallback,
.home-events__story.is-whole {
  background:
    radial-gradient(ellipse 80% 55% at 50% 46%, rgba(120, 130, 240, 0.2), rgba(120, 130, 240, 0) 100%),
    #3a43c4;
}
.home-events__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0 10%;
}
.home-events__fallback-art {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 calc(8 * var(--u)) calc(10 * var(--u)) rgba(0, 0, 0, 0.3));
}
.home-events__story.is-whole .home-events__art {
  object-fit: contain;
  padding: 8% 10%;
}
.home-events__rows {
  --summary-max: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: calc(14 * var(--u));
}

/* the frame while the first read is in flight: ghost rows and the globe tile */
.home-event--ghost {
  pointer-events: none;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: none;
  animation: home-ghost 1.4s ease-in-out infinite alternate;
}
.home-event--ghost:nth-child(2) {
  animation-delay: 0.15s;
}
.home-event--ghost:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes home-ghost {
  to {
    opacity: 0.55;
  }
}
.reduced-motion .home-event--ghost {
  animation: none;
}

/* a story row (CategoryPlayFeaturedCard as Home's chooser row): white surface, orange disc, chevron */
.home-event {
  position: relative;
  flex: 1;
  min-height: 0;
  display: block;
  text-align: left;
  border-radius: calc(40 * var(--u));
  background: #fbfbfc;
  box-shadow:
    inset 0 calc(-6 * var(--u)) 0 #dcdcea,
    0 calc(6 * var(--u)) calc(4 * var(--u)) rgba(13, 9, 38, 0.28);
  color: #1b2559;
  transition: transform var(--t-fast) var(--ease-out), filter var(--t-fast);
}
.home-event:hover:not(:disabled) {
  filter: brightness(0.985);
}
.home-event:active:not(:disabled) {
  transform: translateY(calc(3 * var(--u)));
}
.home-event:disabled {
  opacity: 0.85;
}
.home-event__disc {
  position: absolute;
  left: calc(14 * var(--u));
  top: 50%;
  width: calc(100 * var(--u));
  height: calc(100 * var(--u));
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eb4f24;
  box-shadow: inset 0 calc(-4 * var(--u)) 0 rgba(0, 0, 0, 0.14);
}
.home-event__disc img {
  width: 68%;
  height: 68%;
  object-fit: contain;
  filter: drop-shadow(0 calc(1 * var(--u)) 0 rgba(0, 0, 0, 0.5));
}
/* the title and the summary as one block, centred on the row's face (above its 6 unit lower edge) */
.home-event__text {
  position: absolute;
  left: calc(132 * var(--u));
  right: calc(62 * var(--u));
  top: calc(14 * var(--u));
  bottom: calc(20 * var(--u));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: calc(6 * var(--u));
  min-width: 0;
  overflow: hidden;
}
/* one size for every row (--title-size, Home.js useRowLayout); a title too long for one line takes two */
.home-event__title {
  flex: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-weight: var(--w-bold);
  font-size: calc(var(--title-size, 34) * var(--u));
  line-height: 1.15;
}
.home-events__rows.is-measuring .home-event__title {
  display: block;
  white-space: nowrap;
}
/* the feed's summary in as many lines as the row has room for (--summary-lines: one, up to --summary-max) */
.home-event__kicker {
  flex: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--summary-lines, 1);
  overflow: hidden;
  font-weight: var(--w-semibold);
  font-size: calc(22 * var(--u));
  line-height: 1.3;
  color: rgba(27, 37, 89, 0.72);
}
/* HomeChevron: a 34 x 96 TMP box (SemiBold 64) whose pivot sits 28 units in from the row's right edge, centred vertically */
.home-event__chevron {
  position: absolute;
  right: calc(28 * var(--u) - 17 * var(--u));
  top: 50%;
  width: calc(34 * var(--u));
  height: calc(96 * var(--u));
  transform: translateY(-50%);
  text-align: center;
  font-weight: var(--w-semibold);
  font-size: calc(64 * var(--u));
  line-height: calc(96 * var(--u));
  color: #593bb3;
}

/* ---- Today row (HomeTodayRowView) ---------------------------------------------------------------------- */
.home-today {
  display: flex;
  align-items: stretch;
  height: calc(150 * var(--u));
  margin-top: calc(22 * var(--u));
  padding: calc(12 * var(--u)) calc(14 * var(--u));
  border-radius: calc(36 * var(--u));
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    inset 0 0 0 calc(2 * var(--u)) rgba(255, 255, 255, 0.9),
    0 calc(6 * var(--u)) calc(14 * var(--u)) rgba(27, 37, 89, 0.16);
  animation: home-rise var(--t-slow) var(--ease-out) 60ms both;
}
.home-today__cell {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(12 * var(--u));
  padding: 0 calc(8 * var(--u));
  border-radius: calc(24 * var(--u));
  text-align: left;
  transition: background var(--t-fast);
}
.home-today__cell:hover {
  background: rgba(27, 37, 89, 0.05);
}
.home-today__cell:active {
  background: rgba(27, 37, 89, 0.09);
}
.home-today__divider {
  flex: none;
  align-self: center;
  width: calc(2 * var(--u));
  height: calc(90 * var(--u));
  background: #e8e3d8;
}
.home-today__icon {
  position: relative;
  flex: none;
  width: calc(72 * var(--u));
  height: calc(72 * var(--u));
}
.home-today__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.home-today__dot {
  position: absolute;
  right: calc(-4 * var(--u));
  top: calc(-4 * var(--u));
  width: calc(26 * var(--u));
  height: calc(26 * var(--u));
  border-radius: 50%;
  background: var(--alert);
  box-shadow: 0 0 0 calc(3 * var(--u)) #fff;
}
.home-today__text {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.home-today__top {
  height: calc(38 * var(--u));
  line-height: calc(38 * var(--u));
  font-weight: var(--w-bold);
  color: #1b2559;
}
.home-today__bottom {
  height: calc(34 * var(--u));
  line-height: calc(34 * var(--u));
  font-weight: var(--w-medium);
  color: #5f6877;
}

/* ---- robot and PLAY NOW -------------------------------------------------------------------------------- */
/* A phone browser's toolbars leave far less height than the screen (iPhone SE Safari: 375 x 548). The card
   then gives up to 110 units (its rows keep their title and a summary line), and the stage takes the rest:
   PLAY NOW keeps its place clear of the tab dome, the gap above it narrows from the prefab's 88 units to 48,
   and only then does the robot get smaller. */
.layout-phone .home-events {
  --card-h: clamp(calc(540 * var(--u)), calc(100cqh - 810 * var(--u)), calc(650 * var(--u)));
}
.home-stage {
  --robot-bottom: clamp(calc(330 * var(--u)), calc(100% - 427 * var(--u)), calc(370 * var(--u)));
  position: relative;
  flex: 1 0 auto;
  min-height: calc(546 * var(--u));
  margin: 0 calc(-1 * var(--gutter));
}
.home-stage__robot {
  position: absolute;
  left: 50%;
  bottom: var(--robot-bottom);
  width: auto;
  height: min(calc(411 * var(--u)), calc(100% - var(--robot-bottom) - 16 * var(--u)));
  aspect-ratio: 461 / 555;
  transform: translateX(-50%);
  pointer-events: none;
}
.home-stage__shadow {
  position: absolute;
  left: 50%;
  bottom: calc(-12 * var(--u));
  width: calc(123 * var(--u) * 1.0);
  height: calc(47 * var(--u));
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.12) 70%, rgba(0, 0, 0, 0));
}
.home-stage__figure {
  position: absolute;
  inset: 0;
}

/* The approved garden clearing is an opaque scenery plate, never a baked robot/UI.
   Its authored paving anchor and the hero feet share one crop calculation. */
.hub-backdrop__home-ground { display: none; }
.hub-backdrop--home .hub-backdrop__layer { animation: none; }
.hub-backdrop--home.is-grounded .hub-backdrop__layer { display: none; }
.hub-backdrop--home.is-grounded .hub-backdrop__home-ground {
  display: block;
  position: absolute;
  inset: 0;
  background-image: url('../assets/home/park-clearing.webp');
  background-repeat: no-repeat;
  background-size: var(--home-ground-size, cover);
  background-position: var(--home-ground-position, center bottom);
}

/* Separate soft contact under each sole plus a diffuse shared penumbra.
   Percentages follow the canonical registered R2AddFriend clip, at every scale. */
.home-stage__robot .home-stage__shadow {
  left: 55%;
  bottom: 0;
  width: 62%;
  height: 7%;
  background: radial-gradient(ellipse, #5b472850 0%, #5b472826 43%, transparent 73%);
}
.home-stage__shadow::before,
.home-stage__shadow::after {
  content: '';
  position: absolute;
  bottom: 31%;
  width: 43%;
  height: 56%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #493a286e 0%, #493a2838 45%, transparent 76%);
}
.home-stage__shadow::before { left: 2%; }
.home-stage__shadow::after { right: 2%; }

/* The prefab's PLAY NOW sits 64 units above the tab bar: the raised Home dome stands 20 units above the bar
   (shell.css, measured against the native capture) and PLAY NOW keeps 44 units of air over it, at least 19 px
   on a short browser window. */
.home-play {
  position: absolute;
  left: 50%;
  bottom: calc(20 * var(--u) + max(44 * var(--u), 19px));
  width: calc(100% - 300 * var(--u));
  max-width: calc(678 * var(--u) * 1.2);
  height: calc(200 * var(--u));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(8 * var(--u));
  padding: 0 calc(34 * var(--u)) calc(14 * var(--u));
  color: #fff;
  background: none;
  transition: filter var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.home-play::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: calc(70 * var(--u));
  background: linear-gradient(180deg, #ffe150, #ffd62a 45%, #ffd40c 72%, #fdc806);
  box-shadow:
    inset 0 calc(3 * var(--u)) 0 rgba(255, 255, 255, 0.45),
    inset 0 calc(-12 * var(--u)) 0 #f7b607,
    0 calc(12 * var(--u)) calc(20 * var(--u)) rgba(80, 52, 0, 0.35);
  transition: transform var(--t-fast) var(--ease-out);
}
.home-play:hover::before {
  filter: brightness(1.04);
}
.home-play:active::before {
  transform: translateY(calc(6 * var(--u))) scale(0.99);
}
.home-play__title,
.home-play__subtitle {
  width: 100%;
  text-align: center;
  font-weight: var(--w-bold);
  color: #fff;
  paint-order: stroke fill;
  -webkit-text-stroke: calc(5 * var(--u)) rgba(122, 88, 0, 0.55);
  text-shadow: 0 calc(5 * var(--u)) 0 rgba(122, 88, 0, 0.35);
  overflow: visible;
  text-overflow: clip;
}
.home-play__title {
  line-height: calc(104 * var(--u));
  height: calc(104 * var(--u));
}
.home-play__subtitle {
  font-weight: var(--w-semibold);
  line-height: calc(40 * var(--u));
  height: calc(40 * var(--u));
  -webkit-text-stroke-width: calc(4 * var(--u));
}

/* ---- wide: news on the left, robot and PLAY NOW on the right -------------------------------------------- */
/* A real 360px phone needs readable article copy rather than a scaled 1080-unit three-row chooser.
   The same source feed/selection remains intact; See all contains every story. */
.layout-phone .home-events {
  --card-h: clamp(222px, calc(650 * var(--u)), 300px);
}
.layout-phone .home-events__title {
  left: 12px;
  right: 172px;
  top: 10px;
  height: 22px;
  font-size: clamp(15px, calc(44 * var(--u)), 22px);
}
.layout-phone .home-events__cadence {
  left: 12px;
  right: 172px;
  top: 35px;
  height: 16px;
  margin: 0;
  font-size: 11px;
  line-height: 16px;
}
.layout-phone .home-events__all {
  top: 11px;
  right: 10px;
  min-width: 80px;
  max-width: 112px;
  height: 26px;
  padding: 0 9px;
}
.layout-phone .home-events__all .fit-label {
  font-size: 12px;
  line-height: 18px;
}
.layout-phone .home-events__body {
  display: block;
  top: 60px;
  left: 8px;
  right: 8px;
  bottom: 10px;
}
.layout-phone .home-events__story {
  position: absolute;
  top: -52px;
  right: 122px;
  width: 34px;
  height: 44px;
  border-radius: 0;
  background: none;
}
.layout-phone .home-events__art,
.layout-phone .home-events__story.is-whole .home-events__art {
  padding: 0;
  object-fit: contain;
}
.layout-phone .home-events__fallback { padding: 0; }
.layout-phone .home-events__rows { height: 100%; gap: 8px; }
.layout-phone .home-event:nth-child(n + 3) { display: none; }
.layout-phone .home-event__disc { left: 10px; width: 36px; height: 36px; }
.layout-phone .home-event__text { left: 56px; right: 24px; top: 8px; bottom: 10px; gap: 3px; }
.layout-phone .home-event__title { font-size: clamp(14px, calc(32 * var(--u)), 18px); }
.layout-phone .home-event__kicker { font-size: clamp(12px, calc(26 * var(--u)), 14px); }
.layout-phone .home-event__chevron { right: 5px; width: 16px; height: 36px; font-size: 30px; line-height: 36px; }

/* Keep translated actions whole. On narrow phones the authentic story art shares
   the caption row, leaving the title and action their own clear first row. */
@media (max-width: 374px) {
  .layout-phone .home-events__title { right: 132px; }
  .layout-phone .home-events__cadence { top: 44px; right: 48px; }
  .layout-phone .home-events__body { top: 68px; }
  .layout-phone .home-events__story {
    top: -28px;
    right: 6px;
    width: 24px;
    height: 24px;
  }
}

/* Browser chrome can leave under600px of height. Put the unchanged hero beside Play so the action stays visible. */
@media (max-height: 600px) and (orientation: portrait) {
  .layout-phone .home-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 116px;
    padding: 8px 12px 18px;
  }
  .layout-phone .home-stage__robot {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    flex: none;
    height: 90px;
    max-width: 24%;
  }
  .layout-phone .home-play {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    flex: 1;
    width: auto;
    min-width: 0;
    height: 64px;
  }
}

.layout-wide .home {
  --u: 0.7px;
  --gutter: 24px;
  display: grid;
  grid-template-columns: minmax(0, calc(898 * var(--u) + 8px)) minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: start;
  column-gap: 40px;
  padding: 28px 24px 24px;
}
.layout-wide .home__news {
  grid-column: 1;
}
.layout-wide .home-stage {
  grid-column: 2;
  min-height: 0;
  margin: 0;
  height: min(calc(1000 * var(--u)), 100%);
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(70 * var(--u));
}
.layout-wide .home-stage__robot {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  width: auto;
  height: min(calc(640 * var(--u)), 46vh);
}
.layout-wide .home-play {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  width: min(100%, calc(678 * var(--u)));
  flex: none;
}

/* Large monitors: the hub column grows past 1160 px (tokens.css), so the canvas unit grows with it until the two
   columns span the column exactly: the news column on its left edge and PLAY NOW, which is 678 units wide, on its
   right edge, level with the header band above (a fixed 0.7 px unit left PLAY NOW centred in a wider column, ending
   140 px short of the band at 1920 x 1080). The home page is the column less its 24 px padding on each side; the
   news column (898 units + 8 px), the 40 px gap and PLAY NOW make up 1576 units + 48 px of it. */
@media (min-width: 1600px) {
  .layout-wide .home {
    --u: max(0.7px, calc((min(var(--column-max), 100vw - 148px) - 96px) / 1576));
  }
}

/* A landscape tablet (iPad 1180x820, 1024x768) has room for the desktop's two columns once the
   canvas unit shrinks so the authored news column leaves the robot and PLAY NOW a real column. */
@media (min-width: 1000px) and (max-width: 1199px) and (orientation: landscape) {
  .layout-wide .home {
    /* leaves the stage at least ~360px beside the news column on a 1024px iPad */
    --u: min(0.6px, calc((100vw - 562px) / 898));
    column-gap: 32px;
  }
}

/* The two-column layouts (laptop and up, landscape tablets): the news column takes the page's height up to
   740 units (beyond that the 34 % art column would crop its story art by more than an eighth), so a tall window fills instead of ending halfway down; the robot column is exactly as tall as the
   news column, PLAY NOW stands at its foot (level with the Today row's lower edge) and the robot is centred in
   the room above it. Whatever the card cannot use centres the whole composition. */
@media (min-width: 1200px), (min-width: 1000px) and (max-width: 1199px) and (orientation: landscape) {
  .layout-wide .home {
    align-content: safe center;
    align-items: stretch;
  }
  .layout-wide .home-events {
    --card-h: clamp(calc(560 * var(--u)), calc(100cqh - 172 * var(--u)), calc(740 * var(--u)));
  }
  .layout-wide .home-stage {
    height: auto;
    justify-content: flex-end;
    gap: 0;
    container-type: size;
  }
  .layout-wide .home-stage__robot {
    flex: none;
    height: clamp(120px, calc(100cqh - 310 * var(--u)), calc(640 * var(--u)));
    margin: auto 0;
  }
}

/* A portrait or narrow tablet keeps the wide navigation rail but stacks Home's content in one column.
   The stage takes exactly the height left under the news and Today strip, and the robot shrinks
   inside it, so PLAY NOW is always on screen. The page scrolls only if even the smallest robot
   cannot fit. */
@media (min-width: 760px) and (max-width: 999px), (min-width: 1000px) and (max-width: 1199px) and (orientation: portrait) {
  .layout-wide .home {
    display: flex;
    align-items: stretch;
    gap: 24px;
    overflow-y: auto;
  }
  .layout-wide .home-stage {
    flex: 1 1 0;
    /* PLAY NOW and the smallest side-by-side robot (the container query below) fit in this; a taller minimum
       made a 768 x 1024 iPad scroll 68 px although the side-by-side stage fits */
    min-height: calc(200 * var(--u) + 72px);
    height: auto;
    padding: 12px 0 8px;
    gap: 24px;
    flex-wrap: wrap;
    align-content: center;
    container-type: size;
  }
  .layout-wide .home-stage__robot {
    flex: none;
    height: clamp(140px, calc(100cqh - 200 * var(--u) - 44px), 400px);
    max-width: 100%;
  }
  /* Too short to stack them (iPad 768x1024): the robot stands beside PLAY NOW. The column wraps,
     so PLAY NOW moves into a second column next to the robot. */
  @container (max-height: 340px) {
    .layout-wide .home-stage__robot {
      height: clamp(120px, calc(100cqh - 24px), 230px);
      max-width: 30cqw;
    }
    .layout-wide .home-play {
      width: min(calc(678 * var(--u)), 64cqw);
    }
  }
}

/* Short landscape retains the complete hero and primary action on entry. */
@media (min-width: 760px) and (max-width: 999px) and (max-height: 819px) {
  .layout-wide .home-stage {
    flex-direction: row;
    gap: 24px;
    min-height: 164px;
  }
  .layout-wide .home-stage__robot {
    flex: none;
    height: clamp(140px, 30vh, 230px);
  }
  .layout-wide .home-play {
    flex: 0 1 474px;
    min-width: 0;
  }
}
