/* Home: a short pet-first stack on phones (hero, the pet's day, stamps, town goals, friends today); on desktop the pet and the Gazette between two rails. */

/* ---------- Hero ---------- */
.home-hero { background: var(--card); border: var(--line) solid var(--ink); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; }
.hero-scene {
  position: relative; min-height: 270px; display: grid; grid-template-columns: minmax(0, 440px) 1fr; align-items: end; gap: 0 12px;
  padding: 18px clamp(14px, 3vw, 32px) 0; background: linear-gradient(120deg, var(--land-from), var(--land-to));
}
.hero-scene > .land-banner { z-index: 0; } /* landBannerHtml: the still svg and its moving layers (style.css .land-banner) */
.hero-scene::before { /* keeps the text side readable over the plaza */
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, color-mix(in oklab, var(--land-from) 92%, transparent) 0 36%, color-mix(in oklab, var(--land-from) 55%, transparent) 50%, transparent 64%);
}
.hero-pet, .hero-text { position: relative; z-index: 2; }
.hero-pet { justify-self: center; display: block; line-height: 0; margin-bottom: -4px; filter: drop-shadow(0 6px 0 color-mix(in srgb, var(--ink) 18%, transparent)); }
.hero-text { align-self: center; padding-bottom: 12px; }
.hero-text h1 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.4rem); margin-bottom: .35em; }
.hero-text .speech { background: var(--card); max-width: 400px; box-shadow: var(--shadow-sm); }
.hero-text .speech::before { left: auto; right: -11px; border: 10px solid transparent; border-left-color: var(--ink); border-right: 0; } /* the pet stands to the right */
.hero-lede { font-weight: 700; font-size: 1.1rem; max-width: 34ch; }

.hero-foot { padding: 14px clamp(14px, 3vw, 32px) 16px; border-top: var(--line) solid var(--ink); }

/* Word + bar rows, in the pet hero */
.hero-meters { display: grid; gap: 6px; margin: 0; font-size: var(--fs-sm); }
.hero-meters > div { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; }
.hero-meters dt { font-weight: 800; }
.hero-meters dd { margin: 0; text-align: right; color: var(--muted); font-weight: 700; }
.hero-meters .stat-bar { grid-column: 1 / -1; }
/* The slim level line under the bars: level star, level, XP, and a thin bar taking the rest of the row */
.hero-xp { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; margin: 10px 0 0; font-size: var(--fs-sm); }
.hero-xp .lv-star { margin: 0; }
.hero-xp > span:not(.stat-bar) { color: var(--muted); font-weight: 700; }
.hero-xp .stat-bar { flex: 1 1 120px; height: 8px; }
.hero-text .speech b .lv-star { vertical-align: -.35em; }

/* ---------- Home stack: pet, its day, stamps, town goals, friends today ---------- */
.home-stack { display: grid; gap: var(--gap); max-width: 880px; width: 100%; margin-inline: auto; grid-template-columns: minmax(0, 1fr); }
.home-stack .card { margin: 0; }
/* The rails only group cards on wider screens; on phones their cards join the one column in DOM order. */
.home-rail { display: contents; }
@media (max-width: 767px) { .home-wide-only { display: none; } }
.home-stack h2 { font-size: 1.25rem; margin-bottom: 8px; }
.tile-more { font-weight: 700; margin-bottom: 0; }
@media (max-width: 560px) { .tile-more { text-align: center; } } /* the card's "more" link sits under its centered title */
.home-stack .tile-more { margin-top: 12px; }

/* ---------- The pet's day (home.js dayCard): face, name and Goal Post lanterns, one big Next up tap, then a slim list ---------- */
.day-card { container-type: inline-size; }
.day-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.day-head > svg { flex: none; width: 52px; height: 52px; }
.day-head > div { min-width: 0; display: grid; gap: 2px; }
.home-stack .day-head h2 { margin: 0; }
.day-meter { margin: 0; display: inline-flex; align-items: center; gap: 6px; font: 600 var(--fs-xs) var(--display); color: var(--muted); }
.day-lamps { display: inline-flex; gap: 3px; }
.day-lamps span { width: 13px; height: 13px; border: 2px solid var(--ink); border-radius: 50%; background: var(--card); }
.day-lamps .on { background: var(--sun); box-shadow: 0 0 0 3px color-mix(in oklab, var(--sun) 45%, transparent); }
.day-next-form { margin: 0; }
.day-next { display: grid; gap: 4px; width: 100%; margin: 0 0 12px; padding: 12px 14px; font: inherit; text-align: left; color: var(--ink); text-decoration: none; cursor: pointer;
  background: var(--ok-bg); border: var(--line) solid var(--ink); border-radius: var(--r-sm); box-shadow: var(--shadow-sm); }
.day-next.day-claim { background: var(--sun-cream); }
.day-next.day-collect { background: var(--parchment); }
.day-next.day-alert { background: var(--err-bg); }
.day-next > small { font: 600 var(--fs-xs) var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.day-next > b { font: 600 1.15rem/1.25 var(--display); }
.day-say { font-size: .9rem; font-weight: 700; background: color-mix(in oklab, #fff 70%, transparent); border-radius: 10px; padding: 4px 8px; }
.day-say b { font: 600 .9rem var(--display); }
.day-go { justify-self: start; font-weight: 700; font-size: var(--fs-sm); color: var(--link); }
.day-rows { list-style: none; margin: 0; padding: 0; display: grid; }
.day-rows a, .day-row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 4px; color: var(--ink); text-decoration: none; border-bottom: 2px dashed var(--rule); }
.day-rows form { margin: 0; }
.day-row { width: 100%; font: inherit; text-align: left; cursor: pointer; background: none; border: 0; border-bottom: 2px dashed var(--rule); border-radius: 0; box-shadow: none; } /* a row that posts (Feed) */
.day-rows li:last-child :is(a, .day-row) { border-bottom: 0; }
.day-rows .alert .day-tick { border-color: var(--loss); background: var(--err-bg); } /* a pet alert: a red ring */
.day-tick { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border: 2px solid var(--ink); border-radius: 50%; background: var(--card); font: 800 .7rem var(--body); }
.day-rows .ready .day-tick { border-color: var(--gain); background: var(--ok-bg); } /* ready now: a green ring, no pill */
.day-txt { display: grid; flex: 1; min-width: 0; }
.day-txt b { font-weight: 800; line-height: 1.25; }
.day-txt small { color: var(--muted); font-weight: 700; font-size: .84rem; line-height: 1.3; }
.day-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; flex: none; max-width: 42%; }
.day-tags .pill { padding: 0 8px; white-space: nowrap; }
.tag-pick { background: var(--hi); }
.tag-goal { background: var(--sun-cream); }
.tag-nanny { background: var(--parchment); }
.day-rows .done .day-tick { background: var(--lime); }
.day-rows .done b { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
@media (hover: hover) and (pointer: fine) { .day-next:hover .day-go, .day-rows li:not(.done) :is(a, .day-row):hover b { text-decoration: underline; } }
/* a narrow card (the desktop rail, small phones): the tags drop under the text, lined up with it */
@container (max-width: 330px) { .day-rows :is(a, .day-row) { flex-wrap: wrap; row-gap: 2px; } .day-tags { order: 3; width: 100%; max-width: none; justify-content: flex-start; padding-left: 32px; } } /* tick 20 + gap 12 */
.day-clear { margin: 0 0 12px; font-weight: 700; color: var(--muted); } /* no Next up: every Today row is done */
/* "N more things to do": the extras, closed; the summary is a full-width button like /daily's "N more dailies" */
.day-fold { margin-top: 12px; }
.day-fold > summary { display: block; cursor: pointer; text-align: center; list-style: none; }
.day-fold > summary::-webkit-details-marker { display: none; }
.day-fold[open] > summary { margin-bottom: 4px; }
.day-fold-caret { display: inline-block; transition: transform .15s; }
.day-fold[open] .day-fold-caret { transform: rotate(180deg); }
.day-more { margin: 12px 0 0; font-weight: 700; }
.day-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; padding-top: 10px; border-top: 2px dashed var(--rule); }
.day-foot p { flex: 1 1 200px; margin: 0; font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.day-foot form { margin: 0; }
/* phones: face, name and meter each on their own centered row; the rows stay left */
@media (max-width: 767px) {
  .day-head { flex-direction: column; text-align: center; }
  .day-head > div { justify-items: center; }
  .day-more, .day-foot, .day-clear { text-align: center; justify-content: center; }
}

@media (max-width: 767px) {
  .hero-foot { padding: 10px 12px; } /* the header strip shows the same three bars on phones, so only the level line stays */
  .hero-foot > :not(.hero-xp) { display: none; }
  .hero-xp { margin: 0; justify-content: center; }
  .hero-scene { min-height: 0; grid-template-columns: 1fr; padding-top: 14px; }
  .hero-pet svg { width: 130px; height: 130px; }
  .hero-scene::before { background: linear-gradient(180deg, color-mix(in oklab, var(--land-from) 85%, transparent) 0 55%, transparent 80%); }
  .hero-text { padding-bottom: 12px; text-align: center; }
  .hero-scene:not(:has(.hero-pet)) .hero-text { padding-bottom: 96px; } /* no pet: leave the plaza showing */
  .hero-text .speech { margin-inline: auto; }
  .hero-text .speech::before { display: none; }
  .hero-pet { justify-self: center; }
}

/* ---------- Wide Home (a pet on stage): tablet two columns, desktop stage + rails ---------- */
.hero-care { justify-content: center; margin-top: 14px; }
.today-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.today-links li { padding-left: 14px; border-left: 3px solid var(--hi); font-size: var(--fs-sm); }
.town-lead { display: grid; gap: 4px; color: var(--ink); text-decoration: none; padding: 12px 14px; background: var(--parchment); border: 2px solid var(--ink); border-radius: var(--r-sm); }
.town-lead b { font: 600 1.15rem/1.25 var(--display); }
.town-lead span { font-size: var(--fs-sm); }
.town-darling { display: flex; align-items: center; gap: 12px; margin-top: 12px; color: var(--ink); text-decoration: none; }
.town-darling svg { flex: none; }
.town-darling > span { display: grid; min-width: 0; }
.town-darling small { font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--emph); }
.town-darling b { font-family: var(--display); font-size: 1.1rem; }
@media (hover: hover) and (pointer: fine) { .town-lead:hover b, .town-darling:hover b { text-decoration: underline; } }

/* Tablet: the pet across the top, the day card beside the town rail, then the Gazette across the bottom (wide enough for its two columns). */
@media (min-width: 768px) {
  .home-wide { max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .home-wide .home-rail { display: grid; gap: var(--gap); align-content: start; }
  .home-wide .home-hero { grid-column: 1 / -1; }
  .home-wide .home-left { grid-column: 1; grid-row: 2; }
  .home-wide .home-right { grid-column: 2; grid-row: 2; }
  .home-wide .gazette { grid-column: 1 / -1; grid-row: 3; }
  .home-wide .hero-meters { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px; }
}

/* Desktop: the pet stands center stage (big, its bars, care buttons) with the Gazette under it, between a to-do rail and a town rail.
   The rails span both rows and the second row is 1fr, so a tall rail stretches that row instead of opening a gap under the stage. */
@media (min-width: 1100px) {
  .home-wide { grid-template-columns: minmax(250px, 1fr) minmax(0, 2fr) minmax(250px, 1fr); grid-template-rows: auto 1fr; }
  .home-wide .home-hero { grid-column: 2; grid-row: 1; }
  .home-wide .gazette { grid-column: 2; grid-row: 2; }
  .home-wide .home-left { grid-column: 1; grid-row: 1 / span 2; }
  .home-wide .home-right { grid-column: 3; grid-row: 1 / span 2; }
  .home-wide .hero-scene { grid-template-columns: minmax(0, 1fr); justify-items: center; min-height: 0; padding-top: 24px; text-align: center; }
  .home-wide .hero-scene::before { background: linear-gradient(180deg, color-mix(in oklab, var(--land-from) 88%, transparent) 0 40%, transparent 72%); }
  .home-wide .hero-text { display: grid; justify-items: center; padding-bottom: 0; }
  .home-wide .hero-text .speech { text-align: left; }
  .home-wide .hero-text .speech::before { right: auto; left: calc(50% - 10px); top: auto; bottom: -11px; border: 10px solid transparent; border-top-color: var(--ink); border-bottom: 0; } /* the pet stands below */
  .home-wide .hero-pet svg { width: clamp(240px, 22vw, 320px); height: auto; }
  .home-wide .hero-pet { margin-top: 8px; }
  .home-wide .hero-nap { text-align: left; }
}

/* ---------- Landing (visitors): one tappable Glimling hero, live bits, species gallery, things to do, map, story teaser, closing sign-up ---------- */
.landing { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(32px, 5vw, 56px); }
.landing > section > h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); margin-bottom: 16px; }
.landing > section > h2:has(+ .sec-lede) { margin-bottom: 8px; }
.sec-lede { max-width: 62ch; margin: 0 0 18px; }
.splash {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px 32px; align-items: center;
  background: linear-gradient(135deg, var(--card) 0%, color-mix(in oklab, var(--land-from) 60%, var(--card)) 100%);
  border: var(--line) solid var(--ink); border-radius: var(--r-card); box-shadow: var(--shadow); padding: clamp(20px, 4vw, 44px);
}
.splash-tagline { margin: 0 0 6px; font: 600 1.25rem var(--display); color: var(--emph); letter-spacing: .01em; }
.splash h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.2rem); }
.splash-tagline + h1 { margin-top: 0; }
.splash h1 span { white-space: nowrap; } /* breaks between the sentences, never inside one */
.splash .lede { max-width: 52ch; }
.splash-count { margin: 14px 0 0; font-size: var(--fs-sm); color: var(--muted); }
.splash-invite { margin: 10px 0 0; font-size: var(--fs-sm); font-weight: 600; } /* under the Adopt button while sign-ups need an invite */
.splash-count b { color: var(--ink); font-family: var(--display); font-size: 1.1rem; }
.lede-short { display: none; }
/* the hero Glimling: one big pet on a warm glow; a tap bounces it once and the next species takes its place (script in home.js) */
.hp-stage { display: grid; justify-items: center; text-align: center; }
.hp-pet { --hp: 300px; display: grid; place-items: center; width: calc(var(--hp) + 20px); height: calc(var(--hp) + 20px); max-width: 100%; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle, var(--sun-glow) 0, color-mix(in oklab, var(--sun-glow) 30%, transparent) 55%, transparent 70%); -webkit-tap-highlight-color: transparent; }
.hp-art { display: block; transform-origin: 50% 90%; }
.hp-art > svg { display: block; width: var(--hp); height: var(--hp); max-width: 100%; }
.hp-boing .hp-art { animation: hp-boing .55s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes hp-boing { 25% { transform: translateY(-22px) scale(.92, 1.08); } 55% { transform: translateY(0) scale(1.08, .92); } }
.hp-name { margin: 4px 0 2px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.hp-name b { font: 600 1.45rem var(--display); }
.hp-hint { margin: 0; color: var(--muted); font-size: var(--fs-sm); }

/* Live bits */
.live-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.live-card { display: flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; transition: translate .15s var(--ease-out), box-shadow .15s var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .live-card:hover { translate: -2px -2px; box-shadow: var(--shadow-lift); } }
.live-card svg { flex: none; width: 80px; height: 80px; }
.live-card > span { display: grid; gap: 2px; min-width: 0; overflow-wrap: break-word; }
/* Both Daily Darlings in one link (home.js darlingLink): the second Glimling stands half behind the first. */
:is(.town-darling, .live-card) > .darling-pets { display: flex; flex: none; }
.town-darling .darling-pets svg + svg { margin-left: -18px; }
.live-card .darling-pets svg + svg { margin-left: -24px; }
.live-card small { font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--emph); }
.live-card b { font-family: var(--display); font-size: 1.15rem; line-height: 1.25; }
.live .ticker { margin: 0; }
.live .ticker .head-row { margin-bottom: 12px; }

/* Species gallery: a tidy grid (every row full, every card the same height; the adopt card fills the last row) */
.species-grid { --cols: 4; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--gap); }
.species-card { display: grid; grid-template-rows: auto auto 1fr auto; justify-items: center; text-align: center; gap: 6px; min-width: 0; }
.species-card img { width: 120px; height: 120px; }
.species-card h3 { margin: 0; font-size: 1.2rem; }
.species-card h3 small { display: block; font-family: var(--body); font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.species-card p { margin: 0; font-size: var(--fs-sm); }
.species-more { grid-column: span 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; background: var(--hi-soft); }
.species-more p { margin: 0; font: 600 1.3rem/1.3 var(--display); max-width: 24ch; }
.paints { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding-top: 6px; }
.paint {
  width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid var(--ink); cursor: pointer;
  background: linear-gradient(135deg, var(--a), var(--b) 55%, var(--c)); transition: scale .15s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .paint:hover { scale: 1.12; } }
.paint[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--pink); }
.paint:focus-visible { outline: 3px solid var(--ink); outline-offset: 5px; box-shadow: 0 0 0 11px var(--sky); }
.paint[aria-pressed="true"]:focus-visible { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--pink), 0 0 0 11px var(--sky); }
.sp-strip { display: none; }

/* Things to do */
.doings { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.doing { display: flex; flex-direction: column; overflow: hidden; }
.doing .scene > svg { aspect-ratio: 2.6; min-height: 0; }
.doing h3 { margin: 0 0 4px; }
.doing p { margin: 0; }
.doing .doing-fact { margin-top: auto; padding-top: 10px; font-weight: 800; font-size: var(--fs-sm); color: var(--emph); }

.landing .map-wrap { max-width: 1000px; margin-inline: auto; } /* the map past 1000px is all sea */

/* Story teaser: chapter 1's night scene beside the hook */
.story-teaser { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px 32px; align-items: center; background: var(--night); color: #fff; }
.story-art svg { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 2px solid var(--ink); border-radius: var(--r-tile); }
.story-copy h2 { color: #fff; font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); margin-bottom: 12px; }
.story-copy p { margin: 0 0 12px; }
.story-copy .btn-row { margin: 18px 0 0; }

/* Closing sign-up */
.splash-end { grid-template-columns: minmax(0, 1fr) auto; }
.splash-end h2 { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem); margin: 0 0 .2em; }
.end-pets { display: flex; align-items: end; }
.reduce-motion .hp-boing .hp-art { animation: none; }

/* tablets: the hero stacks, centered: tagline, headline, the Glimling, the intro, the two sign-up buttons side by side, the counts */
@media (max-width: 1024px) {
  .splash { grid-template-columns: minmax(0, 1fr); }
  .splash-copy { text-align: center; }
  .splash .lede { margin-inline: auto; }
  .splash .btn-row { justify-content: center; }
  .splash .btn-row .btn { flex: 1 1 200px; max-width: 320px; }
  .splash-hero { row-gap: 0; }
  .splash-hero .splash-copy { display: contents; } /* its lines join the hero grid so the Glimling can sit between headline and buttons */
  .splash-hero .splash-copy > * { min-width: 0; }
  .splash-hero .hp-stage { order: 1; margin-bottom: 16px; }
  .splash-hero .lede { order: 2; }
  .splash-hero .btn-row, .splash-hero .splash-invite { order: 3; }
  .splash-hero .splash-count { order: 4; }
  .hp-pet { --hp: 240px; }
  .live-card { flex-direction: column; align-items: flex-start; } /* art above the text: a long username fits the card width instead of breaking mid-word */
  .live-card svg { width: 64px; height: 64px; }
  .doings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* swatches get a 44px hit area around the same 28px dot, three across so six wrap 3 + 3 */
  .species-card { padding-inline: 8px; }
  .paints { gap: 0; max-width: 140px; margin-inline: auto; }
  .paint { position: relative; width: 44px; height: 44px; background: none; border: 0; }
  .paint::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; border: 2px solid var(--ink); background: linear-gradient(135deg, var(--a), var(--b) 55%, var(--c)); }
  .paint[aria-pressed="true"] { box-shadow: none; }
  .paint[aria-pressed="true"]:focus-visible { box-shadow: 0 0 0 11px var(--sky); } /* the pressed ring is on ::before here */
  .paint[aria-pressed="true"]::before { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--pink); }
}

/* phones: the hero fits one screen above the tab bar; species and things to do become swipe rows */
@media (max-width: 767px) {
  .landing { gap: 40px; }
  .landing > section > h2, .sec-lede { text-align: center; margin-inline: auto; }
  .splash, .splash-end { grid-template-columns: minmax(0, 1fr); }
  .splash { padding: 16px 16px 20px; gap: 14px; }
  .splash-hero { row-gap: 0; }
  .splash-tagline { font-size: 1.05rem; margin-bottom: 4px; }
  .splash h1 { font-size: 1.7rem; margin-bottom: 8px; }
  .splash .lede { font-size: var(--fs-sm); margin: 0 0 14px; }
  .splash .btn-row .btn { max-width: none; }
  .splash .btn-big { min-height: 48px; padding: 8px 20px; font-size: 1.05rem; }
  .splash-count { margin-top: 10px; }
  /* phones: buttons straight under the Glimling so they sit above the tab bar; the short intro and the counts follow */
  .splash-hero .btn-row { order: 2; }
  .splash-hero .lede { order: 3; margin: 16px auto 0; }
  .splash-hero .hp-stage { margin-bottom: 14px; }
  .lede-long { display: none; }
  .lede-short { display: inline; }
  .hp-pet { --hp: 190px; }
  .hp-name { margin-top: 0; }
  .hp-name b { font-size: 1.3rem; }
  .end-pets { justify-content: center; }
  .end-pets svg { width: 100px; height: 100px; }

  .live-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .live-card { flex-direction: row; align-items: center; }
  /* the ticker reads as a short list here: a crawling line on a phone shows half a sentence at a time */
  .live .ticker-window { display: block; }
  .live .ticker-copy { display: none; }
  .live .ticker-track { animation: none; flex-direction: column; gap: 8px; padding: 12px 14px; }
  .live .ticker-track li { white-space: normal; }
  .live .ticker-track li:nth-child(n+5) { display: none; }

  /* species: one big Glimling at a time, a face strip to jump (the Hatchery's carousel) */
  .species-grid { position: relative; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 10px 12px 4px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .species-grid::-webkit-scrollbar { display: none; }
  .species-grid > .species-card { flex: 0 0 100%; scroll-snap-align: center; grid-template-rows: auto auto auto 1fr; padding: 16px; gap: 8px; }
  .species-card img { width: 180px; height: 180px; }
  .species-card h3 { font-size: 1.45rem; }
  .species-card p { font-size: 1rem; max-width: 30ch; }
  .species-card .paints { max-width: none; align-self: end; }
  .species-more { display: none; }
  .sp-strip { position: relative; display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px; scrollbar-width: none; }
  .sp-strip::-webkit-scrollbar { display: none; }
  .sp-strip a { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 50%; background: var(--card); scroll-snap-align: center; }
  .sp-strip a[aria-current] { background: var(--hi); box-shadow: 0 0 0 3px var(--pink); }
  .sp-strip img { width: 38px; height: 38px; }

  /* things to do: one swipe row, the next card peeking in */
  .doings { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 10px 12px 4px; scroll-padding-inline: 4px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .doings::-webkit-scrollbar { display: none; }
  .doings > .doing { flex: 0 0 82%; scroll-snap-align: start; }

  .story-teaser { grid-template-columns: minmax(0, 1fr); gap: 0; }
  /* edge to edge in the card: out by the card's padding, top corners rounded to sit inside its border */
  .story-art { margin: calc(-1 * clamp(16px, 2.4vw, 24px)) calc(-1 * clamp(16px, 2.4vw, 24px)) 16px; border-radius: calc(var(--r-card) - var(--line)) calc(var(--r-card) - var(--line)) 0 0; overflow: hidden; }
  .story-art svg { border: 0; border-bottom: var(--line) solid var(--ink); border-radius: 0; aspect-ratio: 4 / 3; }
  .story-copy { text-align: center; }
  .story-copy .btn-row .btn { flex-basis: 100%; }
}

/* One-tap feed and the nap note under the pet's speech bubble. */
.hero-nap { margin: 8px 0 0; max-width: 400px; font-size: var(--fs-sm); background: color-mix(in srgb, #fff 80%, transparent); border-radius: var(--r-sm); padding: 6px 10px; }
/* Feed and Wardrobe side by side under the speech bubble (Feed drops out when the pet is full). */
.hero-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; }
.hero-acts .hero-feed { margin-top: 0; min-height: 44px; display: inline-flex; align-items: center; }
.hero-acts .hero-feed-form { margin: 0; }
@media (max-width: 767px) { .hero-acts { justify-content: center; } }
@media (min-width: 1100px) { .home-wide .hero-acts { justify-content: center; } }
.hero-feed-form { margin: 10px 0 0; }
.hero-feed { display: inline-flex; align-items: center; min-height: 44px; margin-top: 10px; }
.hero-feed-form .hero-feed { margin-top: 0; }

/* ---------- Stamp card (routes/streak.js, art/stamps.js): "Stamp N of 5", one Tomorrow line, five postage stamps with land names and prizes, then the stamp-5 box, the mystery-stamp news or the note ---------- */
/* everything centered at every width: the card is ~330px on phones and ~250px in the desktop rail, too narrow for a side-by-side header */
.home-stack .stamps { padding: 12px; text-align: center; }
@media (min-width: 768px) { .home-stack .stamps { padding: 12px 16px 14px; } } /* the other rail cards breathe more; phones keep every px for the stamps */
.home-stack .stamps h2 { margin: 0; font-size: 1.15rem; }
.stamps-card { margin-left: 4px; font: 700 .72rem var(--body); color: var(--muted); vertical-align: 2px; } /* "Card 3": a whisper, not a second title */
.stamps-next { margin: 2px 0 2px; font: 600 .85rem var(--display); color: var(--muted); }
.stamps-next b { color: var(--emph); }
/* subgrid: a two-line land name under one stamp keeps every prize on the same baseline */
.stamps-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: auto auto auto; gap: 0 2px; }
.stamps-row li { display: grid; grid-row: span 3; grid-template-rows: subgrid; justify-items: center; min-width: 0; }
.st-day { display: block; width: 100%; max-width: 62px; }
.st-day svg { display: block; width: 100%; height: auto; overflow: visible; }
.st-land { align-self: start; max-width: 100%; font-size: .6rem; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; color: var(--muted); }
.st-prize { align-self: end; font-size: .72rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.stamps-row .today .st-prize { color: var(--ink); }
.stamps-row .next .st-prize { color: var(--emph); }
.stamps-note { margin: 6px 0 0; font-size: .82rem; color: var(--muted); }
/* the first card's mystery-stamp news: what was revealed today, what the sealed one hints at */
.stamps-mystery { display: grid; gap: 2px; margin: 8px 0 0; padding: 4px 10px; background: var(--sun-cream); border: 2px dashed var(--ink); border-radius: var(--r-sm); font-size: .82rem; line-height: 1.3; }
.stamps-mystery p { margin: 0; }
.streak-box { margin: 10px 0 0; }
.streak-box .btn { --b1: var(--card); --b2: var(--sun); display: flex; gap: 8px; width: 100%; padding: 2px 12px; font-size: var(--fs-sm); white-space: nowrap; } /* one line: the gloss would wash out a wrapped first line */
.streak-box svg { width: 30px; height: 30px; margin: -6px 0; animation: box-nudge 2.6s ease-in-out infinite; }
.streak-box.is-rare .btn { box-shadow: 0 0 0 3px var(--pink), 0 0 0 6px var(--sun), var(--shadow-sm); }
.streak-box.is-opening svg { animation: jp-shake .14s linear infinite; }
@keyframes box-nudge { 0%, 78%, 100% { transform: none; } 84% { transform: rotate(-9deg); } 90% { transform: rotate(8deg); } 95% { transform: rotate(-4deg); } }
.reduce-motion .streak-box svg { animation: none; }
@media (prefers-reduced-motion: reduce) { .streak-box svg { animation: none; } }

/* ---------- Town goals: Moonlit Picnic and the raid, one row each split by a dashed line ---------- */
.goal-rows { display: grid; gap: 10px; }
.goal { display: grid; gap: 6px; align-content: start; }
.goal + .goal { padding-top: 10px; border-top: 2px dashed var(--rule); }
.goal-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.goal-top svg { flex: none; width: 26px; height: 26px; }
.goal-top b { flex: 1; min-width: 0; font: 600 1rem/1.2 var(--display); }
.goal-line { margin: 0; font-size: var(--fs-sm); }
.goal-link { font-weight: 700; white-space: nowrap; }
.goal.is-done .stat-bar { border-color: var(--gain); }
.pill-done { padding: 0 8px; background: var(--lime); }
.nw { white-space: nowrap; }

/* ---------- Friends today (and the /friends Today list, which shares .fr-list from style.css) ---------- */
.friends-empty { margin: 0 0 12px; padding: 12px; font-size: var(--fs-sm); background: var(--hi-soft); border: 2px dashed var(--pick); border-radius: var(--r-sm); }
.friends-today .btn-row { margin: 0; }

/* ---------- The Gazette under the pet (tablet and desktop): lead story left, the Darling and two player lines right ---------- */
.gazette { container-type: inline-size; }
.gazette .head-row { align-items: baseline; margin-bottom: 10px; }
.gz-more { font-weight: 700; font-size: var(--fs-sm); }
.gz-cols { display: grid; gap: 14px; }
.gz-side { display: grid; gap: 12px; align-content: start; }
.gz-side .town-darling { margin-top: 0; }
@container (min-width: 480px) { .gz-cols { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; gap: 20px; } }
/* the town build row on the day card (src/services/build-nudge.js homeRow) */
.day-rows .build .day-tick { border-color: var(--grape); background: var(--sun-cream); }
/* A tagged row's "?" to Nanny's Handbook sits beside the row's link (links can't nest); the row's dashed rule moves to the li. */
.day-rows li.has-q { display: flex; align-items: center; gap: 4px; border-bottom: 2px dashed var(--rule); }
.day-rows li.has-q:last-child { border-bottom: 0; }
.day-rows li.has-q > :is(a, form) { flex: 1; min-width: 0; }
.day-rows li.has-q :is(a, .day-row) { border-bottom: 0; }
.day-rows li.has-q > a.hb-q { flex: none; width: 44px; padding: 0; gap: 0; justify-content: center; }
