/* ==========================================================================
   Little Roos — site chrome
   The layout every page shares: the bar, the wrap, the tiles, the cards, the
   grown-ups box and the footer. Colour comes only from tokens.css.
   Games do not load this file; they have their own shell.
   ========================================================================== */

img { display: block; max-width: 100%; }

/* ── Moving between pages ────────────────────────────────────────────────
   Cross-document view transitions: the page cross-fades, the place tile a
   child taps grows into that place's header, and a game's animal flies into
   the game's title screen. Browsers without them simply navigate. The names
   are set on the tapped link only (see LR.hero in _core.js), so each is unique. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.28s; }
::view-transition-group(place-hero), ::view-transition-group(hero-animal) {
  animation-duration: 0.42s; animation-timing-function: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

.lr-wrap { max-width: var(--lr-wrap); margin: 0 auto; padding: 0 var(--lr-gutter); }

.lr-visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── The bar ─────────────────────────────────────────────────────────────
   White, never teal: the kangaroo is teal and the guidelines reject a teal
   background for the logo. */
.lr-top {
  position: sticky; top: 0; z-index: 30;
  background: var(--lr-white);
  box-shadow: 0 1px 0 var(--lr-hairline);
}
.lr-top__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.lr-top__mark { display: block; line-height: 0; }
.lr-top__mark img { height: 44px; width: auto; padding: 4px 0; }   /* clear space ≥ the R in Roos */
.lr-top__links { display: flex; align-items: center; gap: 1.25rem; }
.lr-top__links a {
  font-weight: 700; font-size: 0.95rem; color: var(--lr-forest); text-decoration: none;
  min-height: var(--lr-tap-min); display: inline-flex; align-items: center;
}
.lr-top__links a:hover { color: var(--lr-deep-teal); }
.lr-top__sound {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--lr-white); border: 0;
  box-shadow: inset 0 0 0 1px rgba(7, 53, 46, 0.14);
  border-radius: var(--lr-radius-pill);
  color: var(--lr-forest); font: inherit; font-size: 0.85rem; font-weight: 700;
  padding: 0.55rem 1rem; cursor: pointer;
}
.lr-top__sound::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: rgba(7, 53, 46, 0.25);
}
.lr-top__sound[aria-pressed="true"]::before { background: var(--lr-olive); }
.lr-top__sound { white-space: nowrap; }

/* ── Headings ────────────────────────────────────────────────────────── */
.lr-h1, .lr-h2 {
  font-family: var(--lr-font-display); font-weight: var(--lr-display-weight);
  line-height: 1.05; color: var(--lr-forest); margin: 0;
}
.lr-h1 { font-size: var(--lr-size-h1); }
.lr-h2 { font-size: var(--lr-size-h2); }
.lr-kicker {
  font-weight: 800; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
}
.lr-lede { font-size: 1.1rem; color: var(--lr-text-muted); font-weight: 500; margin: 0.5rem 0 0; }

/* ── Pills ───────────────────────────────────────────────────────────── */
.lr-pill {
  display: inline-block; font-weight: 700; font-size: 0.8rem;
  padding: 0.45rem 0.9rem; border-radius: var(--lr-radius-pill);
  background: var(--lr-mint-soft); color: var(--lr-deep-teal);
}
.lr-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ── Place tiles — the five worlds ───────────────────────────────────── */
.lr-worlds {
  display: grid; grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: clamp(200px, 20vw, 280px); gap: 18px;
}
.lr-world {
  position: relative; overflow: hidden;
  border-radius: var(--lr-radius-xl);
  padding: clamp(18px, 2.2vw, 26px);
  display: flex; flex-direction: column; justify-content: flex-end;
  color: var(--lr-white); text-decoration: none;
  box-shadow: var(--lr-shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.lr-world:hover, .lr-world:focus-visible { transform: translateY(-4px); box-shadow: var(--lr-shadow-pop); color: var(--lr-white); }
.lr-world img {
  position: absolute; right: 6%; top: 8%;
  max-height: 58%; max-width: 46%; width: auto; height: auto;
  filter: drop-shadow(0 12px 16px rgba(7, 53, 46, 0.18));
  transition: transform 0.25s ease;
}
.lr-world:hover img { transform: translateY(-4px) rotate(-3deg); }
.lr-world__teaches {
  font-weight: 700; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.lr-world__name {
  font-family: var(--lr-font-display); font-weight: var(--lr-display-weight);
  font-size: var(--lr-size-tile); line-height: 1.05; max-width: 72%;
}
.lr-world__count {
  position: absolute; top: 20px; left: 20px; z-index: 1;
  border-radius: var(--lr-radius-pill);
  padding: 0.4rem 0.75rem; font-size: 0.8rem; font-weight: 800;
}
/* Five places, five colours, cycling from the manifest order. Surface and
   ink come in pairs from tokens.css, so every label clears 4.5:1. */
.lr-world { --place-bg: var(--lr-place-1-bg); --place-ink: var(--lr-place-1-ink); --place-chip: var(--lr-chip-on-light);
  background: var(--place-bg); color: var(--place-ink); }
.lr-world:hover, .lr-world:focus-visible { color: var(--place-ink); }
.lr-world__count { background: var(--place-chip); }
.lr-cell { position: relative; display: grid; }
.lr-cell > .lr-world { min-height: 100%; }
.lr-cell--1, .lr-cell--2 { grid-column: span 3; }
.lr-cell--3, .lr-cell--4, .lr-cell--5 { grid-column: span 2; }
.lr-world--2 { --place-bg: var(--lr-place-2-bg); --place-ink: var(--lr-place-2-ink); --place-chip: var(--lr-chip-on-dark); }
.lr-world--3 { --place-bg: var(--lr-place-3-bg); --place-ink: var(--lr-place-3-ink); }
.lr-world--4 { --place-bg: var(--lr-place-4-bg); --place-ink: var(--lr-place-4-ink); }
.lr-world--5 { --place-bg: var(--lr-place-5-bg); --place-ink: var(--lr-place-5-ink); --place-chip: var(--lr-chip-on-dark); }
.lr-world--5 img { max-height: 52%; }

/* ── The Friday card ─────────────────────────────────────────────────── */
.lr-friday[hidden] { display: none; }
.lr-friday {
  margin-top: 22px;
  background: var(--lr-coral); color: var(--lr-forest);
  border-radius: var(--lr-radius-xl);
  padding: clamp(24px, 3vw, 36px) clamp(24px, 3.4vw, 40px);
  display: grid; grid-template-columns: auto 1fr auto; gap: clamp(16px, 2.6vw, 32px);
  align-items: center; box-shadow: var(--lr-shadow-card);
}
.lr-friday img { height: clamp(96px, 10vw, 130px); width: auto; }
.lr-friday .lr-kicker { color: var(--lr-forest); }
.lr-friday__name {
  font-family: var(--lr-font-display); font-weight: var(--lr-display-weight);
  font-size: clamp(1.9rem, 3.4vw, 2.75rem); line-height: 1.02; margin: 0.3rem 0 0.4rem; color: var(--lr-forest);
}
.lr-friday p { margin: 0; font-weight: 600; }

/* ── Game cards — the rows and the place pages ───────────────────────── */
.lr-games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; list-style: none; margin: 0; padding: 0; }
.lr-game {
  background: var(--lr-white); border-radius: var(--lr-radius-lg);
  padding: 18px; display: flex; align-items: center; gap: 16px;
  box-shadow: 0 0 0 1px var(--lr-hairline);
  color: var(--lr-forest); text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lr-game:hover, .lr-game:focus-visible { transform: translateY(-3px); box-shadow: var(--lr-shadow-card); color: var(--lr-forest); }
.lr-game img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.lr-game__name { display: block; font-weight: 800; font-size: 1.05rem; line-height: 1.15; }
.lr-game__meta { display: block; font-size: 0.85rem; color: var(--lr-text-muted); font-weight: 600; margin-top: 0.15rem; }
.lr-game__go {
  margin-left: auto; flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--lr-mint-soft); color: var(--lr-deep-teal);
  display: grid; place-items: center; font-weight: 800; font-size: 1.1rem;
}
.lr-game.is-played .lr-game__go { background: var(--lr-olive); color: var(--lr-forest); }

/* My mob (week 5): the door to the book of animal cards. */
.lr-mobdoor {
  display: flex; align-items: center; gap: clamp(14px, 2.4vw, 24px);
  background: var(--lr-white); color: var(--lr-forest); text-decoration: none;
  border-radius: var(--lr-radius-xl); padding: clamp(16px, 2.4vw, 24px) clamp(18px, 3vw, 32px);
  box-shadow: 0 0 0 1px var(--lr-hairline); transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lr-mobdoor:hover, .lr-mobdoor:focus-visible { transform: translateY(-3px); box-shadow: var(--lr-shadow-card); color: var(--lr-forest); }
.lr-mobdoor__faces { display: flex; flex: none; }
.lr-mobdoor__faces img { width: clamp(52px, 8vw, 76px); height: auto; margin-right: -14px; }
.lr-mobdoor__faces img.is-shadow { filter: brightness(0); opacity: 0.16; }
.lr-mobdoor__text { display: grid; gap: 0.15rem; min-width: 0; padding-left: 14px; }
.lr-mobdoor__name { font-family: var(--lr-font-display); font-weight: var(--lr-display-weight); font-size: var(--lr-size-tile); line-height: 1; }
.lr-mobdoor__sub { color: var(--lr-text-muted); font-weight: 600; }
@media (max-width: 560px) { .lr-mobdoor__faces img:nth-child(n+4) { display: none; } }
@media (prefers-reduced-motion: reduce) { .lr-mobdoor { transition: none; } }

/* Big tiles — a place page is a child's menu, so the games are large. */
.lr-bigtiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; list-style: none; margin: 0; padding: 0; }
.lr-bigtile {
  background: var(--lr-white); border-radius: var(--lr-radius-xl);
  padding: 22px; min-height: 260px; display: flex; flex-direction: column; justify-content: flex-end;
  position: relative; overflow: hidden;
  box-shadow: 0 0 0 1px var(--lr-hairline);
  color: var(--lr-forest); text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.lr-bigtile:hover, .lr-bigtile:focus-visible { transform: translateY(-4px); box-shadow: var(--lr-shadow-card); color: var(--lr-forest); }
.lr-bigtile img {
  position: absolute; top: 18px; right: 18px; max-height: 46%; max-width: 50%; width: auto; height: auto;
}
.lr-bigtile__name {
  font-family: var(--lr-font-display); font-weight: var(--lr-display-weight);
  font-size: clamp(1.4rem, 2.2vw, 1.85rem); line-height: 1.05; max-width: 80%;
}
.lr-bigtile__meta { font-size: 0.85rem; font-weight: 600; color: var(--lr-text-muted); margin-top: 0.35rem; }
.lr-bigtile__played { display: none; color: var(--lr-forest); font-weight: 800; }
.lr-bigtile.is-played .lr-bigtile__played { display: inline; }
.lr-bigtile__grown {
  position: absolute; bottom: 18px; right: 18px;
  font-size: 0.75rem; font-weight: 700; color: var(--lr-deep-teal); text-decoration: none;
  min-height: var(--lr-tap-min); display: inline-flex; align-items: center;
}

/* ── Grown-ups box ───────────────────────────────────────────────────── */
.lr-grown {
  background: var(--lr-white); border-radius: var(--lr-radius-xl);
  padding: clamp(24px, 3.2vw, 44px);
  display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center;
  box-shadow: 0 0 0 1px var(--lr-hairline);
}
.lr-grown p { margin: 0.4rem 0 0; color: var(--lr-text-muted); max-width: 640px; }
.lr-grown .lr-pills { margin-top: 1.1rem; }

/* ── Sections ────────────────────────────────────────────────────────── */
.lr-section { padding: clamp(36px, 5vw, 56px) 0 0; }
.lr-section__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; }
.lr-section__head a { font-weight: 800; color: var(--lr-deep-teal); text-decoration: none; }

/* ── Offline note ────────────────────────────────────────────────────── */
.lr-offline {
  display: none; text-align: center; padding: 0.6rem var(--lr-gutter);
  background: var(--lr-mint); color: var(--lr-forest); font-weight: 700; font-size: 0.85rem;
}
.lr-offline.is-on { display: block; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.lr-foot { background: var(--lr-forest); color: var(--lr-white); padding: 56px 0 40px; margin-top: clamp(48px, 6vw, 72px); }
.lr-foot__row { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; }
.lr-foot img { height: 56px; width: auto; }
.lr-foot p { margin: 14px 0 0; font-size: var(--lr-size-small); color: var(--lr-text-muted-on-dark); max-width: 420px; }
.lr-foot__cols { display: flex; gap: 56px; font-size: var(--lr-size-small); }
.lr-foot__cols b { display: block; margin-bottom: 10px; color: var(--lr-mint); }
.lr-foot__cols a { display: block; margin: 6px 0; color: rgba(255, 255, 255, 0.82); text-decoration: none; min-height: 28px; }
.lr-foot__cols a:hover { color: var(--lr-white); }

/* ── Phone ───────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .lr-top__inner { height: 64px; }
  .lr-top__mark img { height: 38px; }
  .lr-top__links { gap: 0.75rem; }
  .lr-top__links a { font-size: 0.85rem; }
  .lr-top__links .lr-top__hide-sm { display: none; }
  .lr-worlds { grid-template-columns: 1fr 1fr; grid-auto-rows: 200px; gap: 12px; }
  .lr-cell--1, .lr-cell--2, .lr-cell--5 { grid-column: span 2; }
  .lr-cell--3, .lr-cell--4 { grid-column: span 1; }
  .lr-world { border-radius: var(--lr-radius-lg); }
  .lr-world__name { max-width: 100%; }
  .lr-world--3 img, .lr-world--4 img { max-height: 36%; max-width: 60%; top: 16%; right: 8%; }
  .lr-world--3 .lr-world__count, .lr-world--4 .lr-world__count { display: none; }
  .lr-friday { grid-template-columns: 1fr; text-align: left; }
  .lr-games { grid-template-columns: 1fr; }
  .lr-bigtiles { grid-template-columns: 1fr 1fr; gap: 12px; }
  .lr-bigtile { min-height: 200px; padding: 16px 16px 46px; border-radius: var(--lr-radius-lg); }
  /* On a narrow tile the grown-ups link gets its own line under the name,
     rather than sitting on top of it. */
  .lr-bigtile__grown { right: auto; left: 16px; bottom: 2px; }
  .lr-bigtile__name { max-width: 100%; }
  .lr-grown { grid-template-columns: 1fr; gap: 20px; }
  .lr-foot__cols { gap: 28px; flex-wrap: wrap; }
}

/* ── The Talk door (shown once site.talk.door is on) ─────────────────── */
.lr-talkdoor {
  background: var(--lr-white); border-radius: var(--lr-radius-xl);
  padding: clamp(24px, 3.2vw, 44px);
  display: grid; grid-template-columns: auto 1fr auto; gap: clamp(18px, 3vw, 36px); align-items: center;
  box-shadow: 0 0 0 1px var(--lr-hairline);
}
.lr-talkdoor img { width: clamp(84px, 9vw, 120px); height: auto; }
.lr-talkdoor p { margin: 0.4rem 0 0; color: var(--lr-text-muted); max-width: 620px; }
.lr-talkdoor .lr-kicker { color: var(--lr-deep-teal); }
.lr-talkdoor__ctas { display: grid; gap: 10px; justify-items: stretch; }
@media (max-width: 760px) { .lr-talkdoor { grid-template-columns: 1fr; } .lr-talkdoor img { width: 84px; } }

/* ── Speakers: tap to hear a name ────────────────────────────────────────
   For children who can't read yet. White circle, Forest glyph (13.5:1), a
   comfortable 48 px target. Hidden when a grown-up has turned sound off. */
.lr-speak {
  display: inline-grid; place-items: center; flex: none;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  background: var(--lr-white); color: var(--lr-forest);
  box-shadow: 0 3px 0 rgba(7, 53, 46, 0.16), inset 0 0 0 1px rgba(7, 53, 46, 0.12);
  touch-action: manipulation; vertical-align: middle;
}
.lr-speak svg { width: 24px; height: 24px; }
.lr-speak:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(7, 53, 46, 0.16), inset 0 0 0 1px rgba(7, 53, 46, 0.12); }
.lr-speak.is-saying { animation: lr-say 0.6s ease; }
@keyframes lr-say { 40% { transform: scale(1.14); } }
.lr-quiet .lr-speak { display: none; }
.lr-speak--inline { margin-left: 0.5rem; width: 44px; height: 44px; position: relative; top: -0.15em; }
.lr-speak--tile { position: absolute; right: 14px; bottom: 14px; z-index: 2; }
.lr-speak--bigtile { position: absolute; left: 14px; top: 14px; z-index: 2; }

.lr-cell .lr-world__name { max-width: calc(100% - 56px); }
.lr-friday__name .lr-speak { font-size: 1rem; }
@media (prefers-reduced-motion: reduce) { .lr-speak.is-saying { animation: none; } }

/* ═══════════════════════════════════════════════════════════════════════
   The living world (week 4). The sky keeps the device's time and the
   Australian season; hosts idle and greet; animals hide round each place.
   html[data-phase] is dawn|day|dusk|night; html[data-season] is
   spring|summer|autumn|winter (set by LR.world in _world.js).
   ═══════════════════════════════════════════════════════════════════════ */

/* ── The home sky ─────────────────────────────────────────────────────── */
.lr-sky {
  --sky-top: var(--lr-sky-day-top); --sky-low: var(--lr-sky-day-low);
  --sky-ink: var(--lr-sky-ink); --sky-ink-soft: var(--lr-sky-ink-soft);
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--lr-radius-xl);
  background: linear-gradient(180deg, var(--sky-top), var(--sky-low));
}
[data-phase="dawn"]  .lr-sky { --sky-top: var(--lr-sky-dawn-top);  --sky-low: var(--lr-sky-dawn-low); }
[data-phase="dusk"]  .lr-sky { --sky-top: var(--lr-sky-dusk-top);  --sky-low: var(--lr-sky-dusk-low); }
[data-phase="night"] .lr-sky { --sky-top: var(--lr-sky-night-top); --sky-low: var(--lr-sky-night-low);
  --sky-ink: var(--lr-sky-night-ink); --sky-ink-soft: var(--lr-sky-night-ink-soft); }
.lr-sky .lr-h1 { color: var(--sky-ink); position: relative; z-index: 1; }
.lr-sky .lr-lede { color: var(--sky-ink-soft); position: relative; z-index: 1; }

/* ── What's in a sky (the home sky and each place's header) ──────────── */
.lr-skyart { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; border-radius: inherit; }
.lr-sun, .lr-moon { position: absolute; border-radius: 50%; display: none; }
.lr-sun {
  width: clamp(44px, 6vw, 70px); aspect-ratio: 1; background: var(--lr-sun);
  box-shadow: 0 0 0 10px rgba(225, 142, 102, 0.18), 0 0 0 22px rgba(225, 142, 102, 0.09);
}
[data-phase="dawn"] .lr-sun { display: block; left: 5%; top: 30%; }
[data-phase="day"]  .lr-sun { display: block; left: 5%; top: 9%; }
[data-phase="dusk"] .lr-sun { display: block; left: 6%; top: 34%; }
/* Summer: the sun grows slow-turning rays. */
[data-season="summer"] .lr-sun::before {
  content: ""; position: absolute; inset: -60%; border-radius: 50%;
  background: repeating-conic-gradient(rgba(225, 142, 102, 0.28) 0 8deg, transparent 8deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 38%, #000 40%, transparent 70%);
          mask: radial-gradient(circle, transparent 38%, #000 40%, transparent 70%);
  animation: lr-spin 40s linear infinite;
}
@keyframes lr-spin { to { transform: rotate(1turn); } }
[data-phase="night"] .lr-moon {
  display: block; left: 5%; top: 11%; width: clamp(34px, 4.6vw, 52px); aspect-ratio: 1;
  background: var(--lr-moon); box-shadow: 0 0 22px rgba(244, 241, 230, 0.35);
}
[data-phase="night"] .lr-moon::after {           /* the crescent: the sky takes a bite */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--lr-sky-night-top); transform: translate(28%, -14%);
}
.lr-stars { position: absolute; inset: 0; opacity: 0; }
[data-phase="night"] .lr-stars { opacity: 1; }
[data-phase="dusk"]  .lr-stars { opacity: 0.35; }
.lr-stars i {
  position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: var(--lr-white);
  animation: lr-twinkle 3.6s ease-in-out infinite; animation-delay: var(--d);
}
@keyframes lr-twinkle { 50% { opacity: 0.25; transform: scale(0.7); } }
.lr-clouds { position: absolute; inset: 0; display: none; }
[data-phase="day"] .lr-clouds, [data-phase="dawn"] .lr-clouds { display: block; }
.lr-clouds i {
  position: absolute; left: 0; width: var(--w); height: calc(var(--w) * 0.3);
  border-radius: 999px; background: rgba(255, 255, 255, 0.78);
  animation: lr-drift 70s linear infinite; animation-delay: var(--d);
}
.lr-clouds i::before { content: ""; position: absolute; left: 22%; bottom: 40%; width: 46%; height: 150%; border-radius: 50%; background: inherit; }
@keyframes lr-drift { from { transform: translateX(-140px); } to { transform: translateX(calc(100vw + 40px)); } }

/* The season's flecks: blossom in spring, leaves in autumn. */
.lr-flecks { position: absolute; inset: 0; display: none; }
[data-season="spring"] .lr-flecks, [data-season="autumn"] .lr-flecks { display: block; }
.lr-flecks i {
  position: absolute; top: -16px; width: var(--s); height: var(--s);
  animation: lr-fall var(--t) linear infinite; animation-delay: var(--d);
}
[data-season="spring"] .lr-flecks i { border-radius: 70% 0 70% 0; background: var(--lr-pink-soft); box-shadow: inset 0 0 0 1px rgba(220, 112, 167, 0.5); }
[data-season="spring"] .lr-flecks i:nth-child(3n) { background: var(--lr-white); }
[data-season="autumn"] .lr-flecks i { border-radius: 0 70% 0 70%; background: var(--lr-olive); opacity: 0.8; }
[data-season="autumn"] .lr-flecks i:nth-child(2n) { background: var(--lr-coral); }
@keyframes lr-fall {
  0%   { transform: translate(0, 0) rotate(0); opacity: 0; }
  10%  { opacity: 1; }
  50%  { transform: translate(var(--x), 160px) rotate(var(--r)); }
  100% { transform: translate(0, 340px) rotate(calc(var(--r) * 2)); opacity: 0.2; }
}
/* Winter: soft mist drifting low. */
.lr-mist { position: absolute; inset: 0; display: none; }
[data-season="winter"] .lr-mist { display: block; }
.lr-mist i {
  position: absolute; left: -30%; width: 160%; height: 22%; bottom: -8%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.5), transparent 65%);
  animation: lr-mist 26s ease-in-out infinite alternate;
}
[data-phase="night"] .lr-mist { opacity: 0.35; }
.lr-mist i + i { bottom: -2%; height: 16%; opacity: 0.6; animation-duration: 34s; animation-direction: alternate-reverse; }
@keyframes lr-mist { to { transform: translateX(14%); } }
/* Summer: the air shimmers near the ground. */
.lr-haze { position: absolute; left: 0; right: 0; bottom: 0; height: 26%; display: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.16) 0 2px, transparent 2px 9px);
  animation: lr-haze 3s ease-in-out infinite alternate; }
[data-season="summer"] .lr-haze { display: block; }
@keyframes lr-haze { to { transform: translateY(-4px) scaleY(1.06); opacity: 0.6; } }

/* A small sky (a place's header, where the name sits): only what can't get
   in the way of the words: stars, the season's flecks, and a warm glow at
   dawn and dusk behind the host. */
.lr-skyart--small .lr-sun, .lr-skyart--small .lr-moon, .lr-skyart--small .lr-clouds,
.lr-skyart--small .lr-haze, .lr-skyart--small .lr-mist { display: none !important; }
.lr-skyart--small::before {
  content: ""; position: absolute; right: -10%; top: -30%; width: 70%; height: 110%; border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 220, 203, 0.55), transparent 65%); opacity: 0;
}
[data-phase="dawn"] .lr-skyart--small::before, [data-phase="dusk"] .lr-skyart--small::before { opacity: 1; }
[data-phase="dusk"] .lr-skyart--small::before { background: radial-gradient(circle, rgba(244, 209, 227, 0.55), transparent 65%); }

/* ── The visitor: someone from the cast flies across the home sky ────── */
.lr-visitor {
  position: absolute; z-index: 2; top: 14%; left: 0; width: 72px; height: 72px;
  padding: 0; border: 0; background: none; cursor: pointer; touch-action: manipulation;
  animation: lr-fly 34s linear infinite; animation-delay: 3s; transform: translateX(-120px);
}
.lr-visitor img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(7, 53, 46, 0.18)); }
.lr-visitor.is-looping img { animation: lr-loop 0.9s ease; }
@keyframes lr-fly {
  0%   { transform: translate(-120px, 0); }
  12%  { transform: translate(30vw, -10px); }
  25%  { transform: translate(60vw, 8px); }
  40%, 100% { transform: translate(calc(100vw + 120px), -6px); }
}
@keyframes lr-loop { 50% { transform: rotate(-1turn) scale(1.2); } 100% { transform: rotate(-1turn); } }

/* ── Hosts: idle on the home tiles and on each place ─────────────────── */
.lr-world img { animation: lr-bob 5s ease-in-out infinite; }
.lr-cell:nth-child(2) .lr-world img { animation-delay: -1.3s; }
.lr-cell:nth-child(3) .lr-world img { animation-delay: -2.6s; }
.lr-cell:nth-child(4) .lr-world img { animation-delay: -3.4s; }
.lr-cell:nth-child(5) .lr-world img { animation-delay: -0.7s; }
@keyframes lr-bob { 50% { transform: translateY(-5px); } }
.lr-host img { animation: lr-look 9s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes lr-look {
  0%, 30%, 100% { transform: none; }
  36%, 50% { transform: rotate(-5deg) translateY(-3px); }
  56%, 70% { transform: rotate(4deg); }
  76% { transform: none; }
}
.lr-host.is-hopping img { animation: lr-hophost 0.6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes lr-hophost { 40% { transform: translateY(-16px) rotate(-4deg) scale(1.04); } }
/* Night: the hosts are sleepy. A gentle hint that it's nearly bedtime. */
[data-phase="night"] .lr-world img { animation: lr-sleepy 6s ease-in-out infinite; transform-origin: 50% 90%; }
.lr-host.is-sleepy img { animation: lr-sleepy 6s ease-in-out infinite; }
@keyframes lr-sleepy { 0%, 100% { transform: rotate(-8deg) translateY(6px); } 50% { transform: rotate(-5deg) translateY(8px) scaleY(0.97); } }
.lr-zzz { position: absolute; right: 12%; top: -6%; font-family: var(--lr-font-display); color: inherit; pointer-events: none; }
.lr-zzz i { position: absolute; font-style: normal; font-size: 1.3rem; opacity: 0; animation: lr-z 3.6s ease-in infinite; }
.lr-zzz i:nth-child(2) { animation-delay: 1.2s; font-size: 1.6rem; }
.lr-zzz i:nth-child(3) { animation-delay: 2.4s; font-size: 1.1rem; }
@keyframes lr-z { 10% { opacity: 1; } 100% { opacity: 0; transform: translate(22px, -46px); } }

/* ── Hidden animals: peeking over an edge ───────────────────────────── */
.lr-edge { position: relative; }
.lr-peek { position: absolute; bottom: 100%; width: 88px; height: 88px; overflow: hidden; z-index: 3; pointer-events: none; }
/* On the "Pick a game" row: it sits in the row, peeking up from where the
   game tiles begin. */
.lr-peek--1 { right: 28px; bottom: -1.25rem; }
.lr-peek--2 { right: 48px; }
.lr-peek--3 { left: 58%; }
.lr-peek__btn {
  display: block; width: 88px; height: 88px; padding: 0; border: 0; background: none; cursor: pointer;
  pointer-events: auto; touch-action: manipulation;
  transform: translateY(52%); transition: transform 0.45s cubic-bezier(.3, 1.5, .5, 1);
  animation: lr-peek 7s ease-in-out infinite; animation-delay: var(--wait);
}
.lr-peek__btn img { width: 100%; height: 100%; object-fit: contain; }
@keyframes lr-peek { 0%, 70%, 100% { transform: translateY(52%); } 78%, 90% { transform: translateY(40%); } }
.lr-peek__btn.is-found { transform: translateY(0); animation: lr-found 0.7s ease; }
@keyframes lr-found { 0% { transform: translateY(52%); } 60% { transform: translateY(-8px) rotate(6deg); } 100% { transform: translateY(0); } }
.lr-peek__btn:focus-visible { outline: 3px solid var(--lr-coral); outline-offset: -3px; border-radius: var(--lr-radius-md); }

/* ── Still, for anyone who asks for less motion ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .lr-flecks, .lr-haze, .lr-clouds { display: none !important; }
  .lr-stars i, .lr-world img, .lr-host img, .lr-sun::before, .lr-mist i, .lr-zzz i { animation: none !important; }
  .lr-zzz i:first-child { opacity: 1; }
  .lr-visitor { animation: none !important; transform: none; left: auto; right: 12px; top: 10px; width: 56px; height: 56px; }
  .lr-peek__btn { animation: none !important; transition: none; }
  [data-phase="night"] .lr-world img, .lr-host.is-sleepy img { transform: rotate(-8deg) translateY(6px); }
}

/* ── The Lub-Dub Club (/heart/, decision 32) ────────────────────────────
   A wide tile under the five places, in the same family: big rounded card,
   kicker, display name, the animal peeking in. Coral with forest ink. */
.lr-heartway { margin-top: 18px; }
.lr-heartway__tile {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; gap: 12px;
  min-height: clamp(200px, 20vw, 260px);
  padding: clamp(18px, 2.4vw, 30px) clamp(20px, 3vw, 40px);
  border-radius: var(--lr-radius-xl);
  background: var(--lr-coral); color: var(--lr-forest); text-decoration: none;
  box-shadow: var(--lr-shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.lr-heartway__tile:hover, .lr-heartway__tile:focus-visible { transform: translateY(-4px); box-shadow: var(--lr-shadow-pop); color: var(--lr-forest); }
.lr-heartway__text { display: flex; flex-direction: column; gap: 0.35rem; position: relative; z-index: 1; }
.lr-heartway__name {
  font-family: var(--lr-font-display); font-weight: var(--lr-display-weight);
  font-size: clamp(1.8rem, 3.6vw, 2.8rem); line-height: 1.02;
}
.lr-heartway__sub { font-size: 1.05rem; line-height: 1.4; max-width: 34ch; }
.lr-heartway__go {
  align-self: flex-start; margin-top: 0.5rem;
  min-height: var(--lr-tap-min); display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0 1.2rem; border-radius: var(--lr-radius-pill);
  background: var(--lr-forest); color: var(--lr-white); font-weight: 800;
}
.lr-heartway__art { position: relative; height: 100%; min-height: 170px; }
.lr-heartway__heart {
  position: absolute; left: 4%; top: 50%; width: min(52%, 170px); height: auto;
  transform: translateY(-50%); transform-origin: 50% 60%;
  filter: drop-shadow(0 12px 16px rgba(7, 53, 46, 0.2));
  animation: lr-lubdub 1.1s ease-in-out infinite;
}
.lr-heartway__art img {
  position: absolute; right: 0; bottom: -6%; width: min(58%, 200px); height: auto;
  filter: drop-shadow(0 12px 16px rgba(7, 53, 46, 0.18));
  animation: lr-bob 5s ease-in-out infinite; animation-delay: -1.9s;
}
.lr-heartway__grown { margin: 10px 6px 0; font-size: 0.95rem; }
@keyframes lr-lubdub {
  0%, 100% { transform: translateY(-50%) scale(1); }
  12% { transform: translateY(-50%) scale(1.09); }
  24% { transform: translateY(-50%) scale(1); }
  36% { transform: translateY(-50%) scale(1.05); }
  48% { transform: translateY(-50%) scale(1); }
}
@media (max-width: 720px) {
  .lr-heartway { margin-top: 12px; }
  .lr-heartway__tile { grid-template-columns: 1fr; border-radius: var(--lr-radius-lg); padding: 18px 18px 20px; }
  .lr-heartway__art { order: -1; min-height: 120px; height: 120px; }
  .lr-heartway__heart { width: 104px; left: 0; }
  .lr-heartway__art img { width: 128px; bottom: -10px; }
}
@media (prefers-reduced-motion: reduce) {
  .lr-heartway__heart, .lr-heartway__art img { animation: none; }
  .lr-heartway__tile { transition: none; }
}

/* ── Springy everything (week 6) ─────────────────────────────────────────
   Every tile a child taps gives a little: it lifts with a spring on hover,
   squashes as a finger presses, and bounces back as it lets go. Under
   reduced motion, none of it. */
.lr-world, .lr-game, .lr-bigtile, .lr-mobdoor, .lr-heartway__tile, .lr-card, .lr-fav__place {
  transition: transform 0.38s cubic-bezier(.3, 1.7, .5, 1), box-shadow 0.2s ease;
}
.lr-world:active, .lr-game:active, .lr-bigtile:active, .lr-mobdoor:active,
.lr-heartway__tile:active, .lr-card:active, .lr-fav__place:active {
  transform: scale(0.95, 0.93); transition-duration: 0.08s;
}
.lr-world:active img, .lr-bigtile:active img, .lr-card:active img { transform: translateY(2px) scale(1.04, 0.94); }
.lr-cta, .lr-speak, .lr-top__sound { transition: transform 0.35s cubic-bezier(.3, 1.8, .5, 1), background 0.15s ease, box-shadow 0.15s ease; }
.lr-cta:active { transform: scale(0.94); transition-duration: 0.08s; }
@media (prefers-reduced-motion: reduce) {
  .lr-world, .lr-game, .lr-bigtile, .lr-mobdoor, .lr-heartway__tile, .lr-card, .lr-fav__place, .lr-cta, .lr-speak, .lr-top__sound { transition: none; }
  .lr-world:active, .lr-game:active, .lr-bigtile:active, .lr-mobdoor:active, .lr-heartway__tile:active, .lr-card:active, .lr-fav__place:active,
  .lr-cta:active, .lr-world:active img, .lr-bigtile:active img, .lr-card:active img { transform: none; }
}

/* Your favourite places (week 6): the places this device plays most, in their
   own colours, each with a shortcut to its most-played game. */
.lr-favs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; list-style: none; margin: 0; padding: 0; }
.lr-fav { display: grid; gap: 8px; }
.lr-fav__place {
  display: flex; align-items: center; gap: 12px; text-decoration: none; min-height: 88px;
  background: var(--fav-bg); color: var(--fav-ink); border-radius: var(--lr-radius-lg); padding: 12px 18px;
}
.lr-fav__place:hover, .lr-fav__place:focus-visible { color: var(--fav-ink); box-shadow: var(--lr-shadow-card); }
.lr-fav__place img { width: 72px; height: auto; flex: none; }
.lr-fav__name { font-family: var(--lr-font-display); font-weight: var(--lr-display-weight); font-size: var(--lr-size-tile); line-height: 1.05; }
.lr-fav__play { font-weight: 700; color: var(--lr-link); padding: 0.4rem 0.2rem; min-height: 44px; display: inline-flex; align-items: center; gap: 0.3rem; }
.lr-fav--1 { --fav-bg: var(--lr-place-1-bg); --fav-ink: var(--lr-place-1-ink); }
.lr-fav--2 { --fav-bg: var(--lr-place-2-bg); --fav-ink: var(--lr-place-2-ink); }
.lr-fav--3 { --fav-bg: var(--lr-place-3-bg); --fav-ink: var(--lr-place-3-ink); }
.lr-fav--4 { --fav-bg: var(--lr-place-4-bg); --fav-ink: var(--lr-place-4-ink); }
.lr-fav--5 { --fav-bg: var(--lr-place-5-bg); --fav-ink: var(--lr-place-5-ink); }
@media (max-width: 760px) { .lr-favs { grid-template-columns: 1fr; } }
