/* SamSam World! screens: splash, Who's playing, Home, a land, Parents' Corner, the game bar, the sticker book */

/* ---------- the screen host: one screen at a time, cross-faded ---------- */
#screens { position: fixed; inset: 0; overflow: hidden; }
.playing #screens { display: none; }
/* .screen is the box that fills the window and scrolls under a finger. What a screen draws sits INSIDE it, as tall as it needs
   (js/ui/screens.js wraps it). A screen's own root must not be the scrolling box: its position and padding would cancel this rule,
   and the screen could no longer be scrolled (that happened to Who's playing and Home on phones until 2026-11-16). */
.screen { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior: contain;
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
  animation: screenIn .34s cubic-bezier(.2,.9,.3,1.12); }
.screen.still { animation: none; }
.screen.leaving { animation: screenOut .22s ease-in forwards; pointer-events: none; z-index: -1; }
@keyframes screenOut { to { opacity: 0; transform: scale(.985); } }
.logo { display: inline-flex; align-items: center; gap: .42em; font-weight: 700; line-height: 1; letter-spacing: -.035em; white-space: nowrap; color: var(--ink); }
.logo-mark { display: flex; flex: none; }
.logo-mark img { width: 1.9em; height: 1.9em; margin: -.2em -.08em -.2em -.12em; display: block; }
.logo-word span { font-weight: 400; color: var(--muted); }
h1, h2, h3 { font-weight: var(--fw-head); }

/* ---------- splash: the brand, Sam, one button ---------- */
#splash { position: fixed; inset: 0; z-index: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: var(--paper); cursor: pointer; overflow: hidden; padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l); }
#splash.out { animation: fadeOut .45s forwards; pointer-events: none; }
.splash-sky { display: none; }
#splash .sam { margin-bottom: 4px; }
.splash-logo { font-size: clamp(34px, 6vw, 56px); animation: riseIn .6s ease-out both; }
.splash-tag { margin: -4px 0 10px; color: var(--muted); font-size: clamp(16px, 2vw, 19px); font-weight: 500; animation: riseIn .6s .08s ease-out both; }
.splash-go { font-size: 19px; min-height: 60px; padding: 14px 48px; animation: riseIn .6s .16s ease-out both; }
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } }
/* a low screen (a phone on its side): everything a size smaller, so the button is in view */
@media (max-height: 480px) {
  #splash { gap: 8px; }
  #splash .sam { width: 96px !important; height: 96px !important; margin: 0; }
  .splash-logo { font-size: 30px; }
  .splash-tag { margin: -2px 0 4px; font-size: 15px; }
  .splash-go { min-height: 50px; padding: 10px 40px; font-size: 18px; }
}

/* ---------- Who's playing? ---------- */
.screen-profiles { background: var(--paper); }
.profiles-screen { min-height: 100%; display: flex; flex-direction: column; align-items: center; padding: clamp(24px, 5vh, 52px) var(--gutter) 28px; }
.sky { display: none; }
.profiles-logo { font-size: clamp(20px, 2.4vw, 26px); }
.profiles-screen h1 { margin: clamp(28px, 7vh, 72px) 0 clamp(28px, 5vh, 52px); font-size: clamp(34px, 5vw, 52px); line-height: 1; text-align: center; letter-spacing: -.03em; }
.kids { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(20px, 4vw, 44px); max-width: 1100px; }
/* an iPad on its side: four children and "Add a child" stand in one row, so nothing waits below the edge of the screen (Safari leaves only 688 px of height there) */
@media (min-width: 1000px) { .kids { gap: clamp(20px, 2.6vw, 44px); max-width: 1140px; } }
.kid { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px; border-radius: var(--r-lg); color: var(--ink); }
.kid-pic { position: relative; display: block; border-radius: 50%; }
.kid .avatar { --kid: clamp(128px, 15vw, 176px); width: var(--kid); height: var(--kid); box-shadow: 0 0 0 6px #fff, 0 0 0 7px var(--hair), var(--sh-raise); transition: transform .18s; }
.kid:active .avatar { transform: scale(.96); }
.kid-name { margin-top: 6px; font-weight: var(--fw-head); font-size: clamp(22px, 2.4vw, 28px); line-height: 1.08; letter-spacing: -.02em; max-width: 220px; text-align: center; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }  /* a long name takes two lines */
.kid-age { font-weight: 500; font-size: 15px; color: var(--muted); }
/* what the child has done so far: two short lines under the age */
.kid-stats { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: -2px; font-weight: 500; font-size: 14px; line-height: 1.25; color: var(--muted); }
.kid-loves { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-height: 520px) { .kid-loves { display: none; } }  /* a phone on its side: one line is enough */
/* the same in full, in the grown-ups' Edit window */
.kstats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 22px; padding: 12px 16px; background: var(--ground); border-radius: var(--r-sm); }
.kstat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; min-width: 0; font-size: 15px; }
.kstat.wide { grid-column: 1 / -1; }
.kstat.wide .kstat-v { white-space: normal; overflow: visible; }
.kstat-l { flex: none; color: var(--muted); }
.kstat-v { min-width: 0; font-weight: 700; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .kstats { grid-template-columns: 1fr; } }
.kid.editing .avatar { animation: wiggle 1.2s infinite; }
.kid-pencil { position: absolute; right: 2px; top: 2px; width: 48px; height: 48px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 4px #fff; }
.add-pic { width: clamp(128px, 15vw, 176px); height: clamp(128px, 15vw, 176px); border: 2px dashed #C9C6BC; background: transparent; display: flex; align-items: center; justify-content: center; color: #8E8B80; }
.add-plus { display: flex; }
.add-plus svg { width: 44px; height: 44px; }
.kid.add .kid-name { font-size: clamp(19px, 2.1vw, 23px); color: var(--muted); }
.kid.add .kid-age { font-size: 14px; }
.kid .ring { inset: -10px; }  /* the grown-up's hold: around the picture */
.profiles-foot { margin-top: auto; padding-top: 30px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 22px; }
.foot-note { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 500; font-size: 15px; color: var(--muted); text-align: left; }
.foot-note svg { flex: none; }
/* a phone held upright: the children two by two (one under the other was a long way to scroll) */
@media (max-width: 600px) {
  .profiles-screen { padding: 18px 16px 22px; }
  .profiles-screen h1 { margin: 22px 0 20px; font-size: 32px; }
  .kids { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 8px; width: 100%; max-width: 440px; }
  .kid { min-width: 0; gap: 6px; padding: 4px 2px; }
  .kid .avatar { --kid: min(34vw, 132px); }
  .add-pic { width: min(34vw, 132px); height: min(34vw, 132px); }
  .kid-name { font-size: 20px; max-width: 100%; }
  .kid.add .kid-name { font-size: 18px; }
  .kid-stats, .kid-loves { max-width: 100%; }
  .kid-pencil { width: 44px; height: 44px; }
  .profiles-foot { padding-top: 24px; }
}
/* a phone on its side: a low screen, so a size smaller and the first row of children in view */
@media (orientation: landscape) and (max-height: 480px) {
  .profiles-screen { padding: 10px var(--gutter) 14px; }
  .profiles-logo { font-size: 18px; }
  .profiles-screen h1 { margin: 8px 0 14px; font-size: 26px; }
  .kids { display: flex; gap: 8px 22px; width: auto; max-width: none; }
  .kid { gap: 4px; }
  .kid .avatar { --kid: 96px; }
  .add-pic { width: 96px; height: 96px; }
  .add-plus svg { width: 34px; height: 34px; }
  .kid-name { margin-top: 4px; font-size: 18px; max-width: 150px; }
  .kid.add .kid-name { font-size: 16px; }
  .profiles-foot { padding-top: 12px; }
}

/* ---------- Home: the five lands, each with what it helps ---------- */
.screen-home { background: var(--paper); }
.home-screen { min-height: 100%; display: flex; flex-direction: column; max-width: 1280px; margin: 0 auto; }
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px var(--gutter) 8px; }
.home-logo { font-size: clamp(19px, 2.3vw, 25px); }
.top-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who { padding: 4px 16px 4px 4px; font-size: 16px; color: var(--ink); min-height: 48px; max-width: 220px; }
.who .avatar { width: 40px !important; height: 40px !important; position: relative; }
.who .ring { inset: -5px; }
.who-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.star-pill { font-size: 16px; min-height: 48px; padding: 8px 16px; gap: 6px; }
.star-pill svg { width: 20px; height: 20px; }
.lock-btn { color: var(--muted); width: 48px; height: 48px; }
.home-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: clamp(10px, 2.2vh, 26px) var(--gutter) clamp(14px, 2.6vh, 28px); }
.hero-eyebrow { margin: 0; font-size: 13px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.home-hero h1 { margin: 6px 0 6px; font-size: clamp(32px, 4.6vw, 50px); line-height: 1.04; letter-spacing: -.035em; overflow-wrap: anywhere; }
.hero-sub { margin: 0; font-size: clamp(16px, 1.8vw, 19px); color: var(--muted); font-weight: 500; }
.home-hero .sam { width: clamp(76px, 9.5vw, 108px) !important; height: clamp(76px, 9.5vw, 108px) !important; flex: none; }
.lands { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 16px); padding: 0 var(--gutter); flex: 1 0 auto; align-content: start; }
.land-card { background: #fff; color: var(--ink); border-radius: 24px; padding: 10px 10px 14px; display: flex; flex-direction: column; text-align: left;
  box-shadow: inset 0 0 0 1px var(--hair), var(--sh-card); transition: transform .18s, box-shadow .18s; }
.land-card:active { transform: scale(.975); }
@media (hover: hover) { .land-card:hover, .game-card:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--hair), var(--sh-raise); } }
.land-art { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 4 / 3; background: var(--tint); border-radius: 16px; flex: none; }
.land-art svg { width: 58%; height: auto; display: block; }
.land-body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 14px 6px 0; min-width: 0; }
.land-name { font-weight: var(--fw-head); font-size: clamp(17px, 1.9vw, 21px); line-height: 1.12; letter-spacing: -.02em; }
.land-helps { font-size: 13.5px; line-height: 1.38; color: var(--ink-2); font-weight: 500; }
.land-helps b { display: block; margin-bottom: 3px; font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--land-text); font-weight: 700; }
.land-count { margin-top: auto; padding-top: 10px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; font-weight: 650; font-size: 12.5px; color: var(--ink); }
.land-count .ages { color: var(--muted); font-weight: 500; }
.home-foot { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; padding: 22px var(--gutter); }
.play-next { max-width: 100%; }
.play-next span { overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.play-next b { font-weight: 700; }
.stickers-btn { position: relative; }

/* landscape: the cards fill the height, the picture takes the spare room */
@media (orientation: landscape) and (min-width: 761px) {
  .lands { grid-auto-rows: 1fr; align-content: stretch; max-height: 640px; }
  .land-art { aspect-ratio: auto; flex: 1 1 110px; min-height: 110px; }
  .land-art svg { width: auto; height: min(62%, 170px); max-width: 70%; }
  .land-body { flex: none; min-height: 146px; }
}
/* iPad portrait and phones: the lands in two columns, the fifth across the bottom */
@media (orientation: portrait), (max-width: 760px) {
  .lands { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .land-giggle { grid-column: span 2; flex-direction: row; align-items: stretch; gap: 6px; }
  .land-giggle .land-art { width: 38%; aspect-ratio: auto; min-height: 110px; }
  .land-giggle .land-art svg { width: min(58%, 110px); }
  .land-giggle .land-body { padding: 8px 10px 0; }
}
@media (orientation: portrait) and (min-width: 600px) {
  .land-art { aspect-ratio: 16 / 9; }
  .land-art svg { width: 34%; }
  .land-helps { font-size: 15px; }
  .land-count { font-size: 13.5px; }
}
@media (max-width: 600px) {
  .home-top { padding: 12px 16px 6px; gap: 8px; }
  .who { padding: 3px; max-width: none; min-height: 44px; }
  .who-name { display: none; }
  .top-right { gap: 6px; }
  .star-pill { font-size: 15px; padding: 6px 12px; min-height: 44px; }
  .lock-btn { width: 44px; height: 44px; }
  .home-hero { padding: 8px 16px 14px; }
  .home-hero .sam { width: 64px !important; height: 64px !important; }
  .lands { gap: 10px; padding: 0 16px; }
  .land-card { border-radius: 20px; padding: 8px 8px 12px; }
  .land-art { border-radius: 13px; }
  .land-body { padding: 10px 4px 0; gap: 6px; }
  .land-name { font-size: 17px; }
  .land-helps { font-size: 12.5px; }
  .land-count { font-size: 12px; }
  .home-foot { padding: 16px 16px 22px; gap: 10px; flex-wrap: nowrap; }
  .play-next { flex: 1; font-size: 16px; padding: 12px 16px; }
  .stickers-btn { flex: none; width: 52px; padding: 0; }
  .stickers-btn span:not(.ic-sticker) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* a phone on its side: the five lands in one row, their pictures and names (what a land helps with is on the land's own page) */
@media (orientation: landscape) and (max-height: 480px) {
  .home-top { padding: 8px var(--gutter) 2px; }
  .home-logo { font-size: 18px; }
  .who, .star-pill { min-height: 44px; }
  .lock-btn { width: 44px; height: 44px; }
  .home-hero { padding: 0 var(--gutter) 8px; }
  .hero-eyebrow, .hero-sub { display: none; }
  .home-hero h1 { margin: 0; font-size: 26px; }
  .home-hero .sam { width: 48px !important; height: 48px !important; }
  .lands { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: auto; gap: 8px; max-height: none; align-content: start; flex: 0 0 auto; }
  .land-card, .land-giggle { grid-column: auto; flex-direction: column; gap: 0; padding: 6px 6px 8px; border-radius: 16px; }
  .land-art, .land-giggle .land-art { width: 100%; aspect-ratio: 16 / 10; min-height: 0; flex: none; border-radius: 11px; }
  .land-art svg, .land-giggle .land-art svg { width: auto; height: 72%; max-width: 76%; }
  .land-body, .land-giggle .land-body { flex: none; min-height: 0; padding: 6px 2px 0; gap: 2px; }
  .land-name { font-size: 14.5px; }
  .land-helps { display: none; }
  .land-count { padding-top: 2px; font-size: 12px; }
  .land-count .ages { display: none; }
  .home-foot { padding: 10px var(--gutter) 12px; flex-wrap: nowrap; }
}

/* ---------- a land: what it helps, then its games ---------- */
.screen-land { background: var(--paper); }
.land-screen { min-height: 100%; padding-bottom: 32px; max-width: 1280px; margin: 0 auto; }
.land-head { display: flex; align-items: center; gap: clamp(12px, 1.6vw, 18px); padding: 18px var(--gutter) 16px; }
.back-btn { width: 48px; height: 48px; }
.back-btn svg { width: 22px; height: 22px; }
.land-head-art { width: 64px; height: 64px; flex: none; background: var(--tint); border-radius: 18px; display: flex; align-items: center; justify-content: center; }
.land-head-art svg { width: 72%; height: auto; display: block; }
.land-title { flex: 1 1 180px; min-width: 0; }
.land-title h1 { margin: 0; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.05; letter-spacing: -.03em; }
.land-title p { margin: 4px 0 0; font-size: 16px; font-weight: 600; color: var(--land-text); }
.helps { margin: 0 var(--gutter); background: var(--tint); border-radius: 20px; padding: 16px 20px 18px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; }
.helps-text { flex: 1 1 380px; min-width: 0; }
.helps-t { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 12px; color: var(--land-text); text-transform: uppercase; letter-spacing: .09em; }
.helps-text p { margin: 6px 0 0; font-size: 15.5px; font-weight: 500; line-height: 1.45; color: var(--ink); max-width: 68ch; }
.helps-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.helps .chip { background: #fff; font-size: 13px; font-weight: 650; padding: 6px 12px; }
.helps .chip.ages { background: var(--land-text); color: #fff; }
.land-sub { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 24px var(--gutter) 14px; }
.land-sub h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.land-sub span { font-size: 14px; font-weight: 500; color: var(--muted); }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(176px, 42vw), 1fr)); gap: clamp(12px, 1.6vw, 16px); padding: 0 var(--gutter); }
.game-card { position: relative; background: #fff; color: var(--ink); border-radius: 22px; padding: 16px 12px 14px; min-height: 168px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: inset 0 0 0 1px var(--hair), var(--sh-card); transition: transform .18s, box-shadow .18s; }
.game-card:active { transform: scale(.97); }
.game-card.next, .game-card.next:hover { box-shadow: inset 0 0 0 2px var(--accent), var(--sh-card); }
.next-tag { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; border-radius: var(--r-pill); padding: 4px 12px; font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.fav-tag { position: absolute; top: 12px; right: 12px; color: #E5383B; fill: #E5383B; display: flex; }
.fav-tag svg { fill: #E5383B; }
.game-icon { width: 84px; height: 84px; border-radius: 22px; background: var(--tint); display: flex; align-items: center; justify-content: center; font-size: 52px; line-height: 1; }
.game-name { font-weight: var(--fw-head); font-size: clamp(16px, 1.7vw, 18px); line-height: 1.15; letter-spacing: -.015em; text-align: center; }
.game-meta { margin-top: auto; display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 13px; color: var(--muted); }
.game-stars { display: inline-flex; align-items: center; gap: 4px; color: var(--star-text); }
.game-lv { display: inline-flex; align-items: center; gap: 6px; }
.game-lv i { width: 9px; height: 9px; border-radius: 50%; }
@media (max-width: 600px) {
  .land-head { padding: 12px 16px 12px; gap: 10px; }
  .land-head-art { width: 52px; height: 52px; border-radius: 15px; }
  .land-title h1 { font-size: 26px; }
  .land-title p { font-size: 14.5px; }
  .helps { margin: 0 16px; padding: 14px 16px; border-radius: 18px; }
  .helps-text p { font-size: 14.5px; }
  .land-sub { padding: 18px 16px 12px; }
  .game-grid { padding: 0 16px; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-card { min-height: 148px; padding: 14px 8px 12px; border-radius: 20px; gap: 8px; }
  .game-icon { width: 68px; height: 68px; font-size: 42px; border-radius: 18px; }
  .game-name { font-size: 15.5px; }
  .game-meta { font-size: 12px; gap: 8px; }
}


/* ---------- Parents' Corner ---------- */
.screen-parents { background: var(--paper); }
.parents-screen { display: flex; min-height: 100%; }
.pc-nav { width: 270px; flex: none; background: #fff; border-right: 1px solid var(--line); padding: 26px 18px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: calc(100vh - var(--safe-t) - var(--safe-b)); height: calc(100dvh - var(--safe-t) - var(--safe-b));
  /* its white runs on over the strip of the home bar (an iPad), and over the strip at the top */
  box-shadow: 0 var(--safe-b) 0 #fff, 1px var(--safe-b) 0 var(--line), 0 calc(0px - var(--safe-t)) 0 #fff; }
.pc-back { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: var(--fw-head); font-size: 16px; padding: 10px; margin-bottom: 12px; min-height: 44px; border-radius: var(--r-sm); align-self: flex-start; }
.pc-title { font-weight: var(--fw-head); font-size: 28px; padding: 0 10px 14px; }
.pc-tabs { display: flex; flex-direction: column; gap: 6px; }
.pc-tab { display: flex; align-items: center; gap: 12px; border-radius: var(--r-sm); padding: 12px 14px; min-height: 48px; font-weight: var(--fw-bold); font-size: 17px; text-align: left; color: var(--ink); }
.pc-tab svg { color: var(--muted); flex: none; }
.pc-tab.on { background: var(--primary-soft); color: var(--primary-edge); font-weight: var(--fw-head); }
.pc-tab.on svg { color: var(--primary-edge); }
.pc-main { flex: 1; min-width: 0; padding: 30px 36px 40px; display: flex; flex-direction: column; gap: 20px; max-width: 980px; }
.pc-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.pc-head h1 { margin: 0; font-size: 34px; line-height: 1.05; }
.pc-intro { margin: 0; font-size: 16px; font-weight: var(--fw-bold); color: var(--ink-2); line-height: 1.45; }
.kid-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.kid-chip { border-radius: var(--r-pill); padding: 8px 18px; min-height: 44px; font-weight: var(--fw-head); font-size: 15px; background: #fff; box-shadow: inset 0 0 0 1.5px #D9DCEA; }
.kid-chip.on { background: var(--ink); color: #fff; box-shadow: none; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat { background: #fff; border-radius: var(--r-md); padding: 18px 20px; border: 1px solid var(--line); }
.stat-l { font-weight: var(--fw-bold); font-size: 14px; color: var(--muted); }
.stat-v { font-weight: var(--fw-head); font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; }
.stat.long .stat-v { font-size: clamp(18px, 2.1vw, 24px); line-height: 1.25; margin-top: 6px; overflow-wrap: anywhere; }
.stat-s { margin-top: 4px; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.land-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) 140px; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid #EEF0F6; }
.land-row:last-child { border-bottom: 0; }
.land-row-name { display: flex; align-items: center; gap: 10px; font-weight: var(--fw-head); font-size: 17px; }
.land-row-name i { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.land-row-text { font-size: 15px; font-weight: var(--fw-bold); color: var(--ink-2); display: flex; flex-direction: column; gap: 2px; }
.land-row-text .muted { font-size: 13.5px; }
.pc-cta { display: flex; align-items: center; gap: 16px; background: var(--primary-soft); border-radius: var(--r-md); padding: 16px 20px; color: var(--ink); }
.pc-cta b { font-size: 17px; }
.pc-cta .grow > div { font-size: 15px; font-weight: var(--fw-bold); color: var(--ink-2); margin-top: 2px; }
.cta-ic { color: var(--primary-edge); display: flex; flex: none; }
/* iPhone and iPad in a browser: "Play from the Home Screen" (js/ui/homescreen.js: the cards here, the button on Who's playing, this window) */
.help-p { margin: 2px 0 14px; font-size: 16.5px; font-weight: var(--fw-bold); color: var(--ink-2); line-height: 1.45; }
.help-first { margin: 0 0 14px; font-size: 16px; font-weight: var(--fw-bold); color: var(--ink); line-height: 1.45; background: var(--giggle-tint); border-radius: var(--r-sm); padding: 12px 16px; }  /* warm yellow: read this first */
.help-first b { font-weight: var(--fw-head); }
.help-steps { margin: 0; padding-left: 24px; display: grid; gap: 8px; font-size: 17px; font-weight: var(--fw-head); color: var(--ink); line-height: 1.35; }
.help-small { margin: 12px 0 0; font-size: 14.5px; font-weight: var(--fw-bold); color: var(--muted); line-height: 1.4; }
.help-why { margin-top: 16px; background: var(--primary-soft); border-radius: var(--r-sm); padding: 12px 16px; font-size: 15.5px; font-weight: var(--fw-bold); color: var(--ink-2); line-height: 1.45; }
.help-why b { color: var(--ink); font-weight: var(--fw-head); }
.about-land { display: flex; gap: 20px; align-items: flex-start; padding: 18px 22px; border-left: 8px solid var(--accent); }
.about-art { width: 90px; flex: none; background: var(--tint); border-radius: var(--r-md); padding: 8px; }
.about-art svg { width: 100%; height: auto; display: block; }
.about-land h2 { margin: 0 0 6px; font-size: 22px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.about-ages { font-size: 14px; color: var(--land-text); background: var(--tint); border-radius: var(--r-pill); padding: 3px 10px; }
.about-land p { margin: 0 0 8px; font-size: 15.5px; font-weight: var(--fw-bold); color: var(--ink-2); line-height: 1.45; }
.about-land .together { color: var(--ink); }
.prose { padding: 14px 22px; }
.prose p { margin: 6px 0; font-size: 15.5px; font-weight: var(--fw-bold); color: var(--ink-2); line-height: 1.45; }
.kid-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid #EEF0F6; }
.kid-row:last-child { border-bottom: 0; }
.kid-row b { font-size: 18px; }
.kid-row-pic { display: flex; flex: none; border-radius: 50%; transition: transform .12s; }
.kid-row-pic:active { transform: scale(.94); }
/* a phone: the Edit button is its pencil alone, so a child's name and numbers get the room */
@media (max-width: 480px) {
  .kid-row { gap: 10px; }
  .kid-row .btn-soft { width: 44px; padding: 0; flex: none; }
  .kid-row .btn-soft span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 16px 0; border-bottom: 1px solid #EEF0F6; }
.set-row:last-child { border-bottom: 0; }
.set-row:has(> .set-ctl > .toggle:only-child) { flex-wrap: nowrap; }
.set-label { font-size: 19px; font-weight: var(--fw-head); }
.set-row .muted { margin-top: 2px; max-width: 520px; }
.set-ctl { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.set-note { font-size: 15px; color: var(--muted); padding: 8px 0; font-weight: var(--fw-bold); }
/* the row of tabs instead of the side menu: on a narrow screen, and on a low one (a big phone on its side), where the side menu's last tab could not be reached */
@media (max-width: 900px), (max-height: 560px) {
  .parents-screen { flex-direction: column; }
  .pc-nav { width: auto; height: auto; position: sticky; top: 0; z-index: 5; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px 8px; gap: 2px; box-shadow: 0 calc(0px - var(--safe-t)) 0 #fff;
    display: grid; grid-template-columns: auto 1fr; align-items: center; }
  .pc-back { margin: 0; padding: 8px; min-width: 44px; justify-content: center; }
  .pc-back span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pc-title { padding: 0 4px; font-size: 22px; }
  .pc-tabs { grid-column: 1 / -1; flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 6px; padding: 4px 0 2px; touch-action: pan-x pan-y; }
  .pc-tabs::-webkit-scrollbar { display: none; }
  .pc-tab { flex: none; padding: 8px 14px; font-size: 15px; gap: 8px; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1.5px var(--line); }
  .pc-tab.on { box-shadow: none; }
  .pc-tab svg { width: 18px; height: 18px; }
  .pc-main { padding: 18px 16px 30px; gap: 16px; }
  .pc-head h1 { font-size: 26px; }
  .stats { gap: 10px; }
  .stat { padding: 12px 14px; }
  .land-row { grid-template-columns: minmax(0, 1fr) 90px; gap: 6px 12px; }
  .land-row-text { grid-column: 1 / -1; grid-row: 2; }
  .about-land { flex-direction: column; gap: 10px; padding: 16px; }
  .about-art { width: 64px; }
  .pc-cta { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:first-child, .stats.six .stat:last-child { grid-column: span 2; }
}

/* ---------- in a game: the bar ---------- */
#bar { position: absolute; top: 0; left: 0; right: 0; height: calc(var(--bar-h) + var(--safe-t)); display: none; align-items: center; gap: 10px; padding: var(--safe-t) max(12px, var(--safe-r)) 0 max(12px, var(--safe-l));
  background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--hair), 0 3px 0 var(--tint); z-index: 30; }
.playing #bar { display: flex; animation: fadeIn .25s ease-out; }
.bar-btn { width: 52px; height: 52px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1px var(--hair), var(--sh-xs); color: var(--ink); flex: none; position: relative;
  display: inline-flex; align-items: center; justify-content: center; font-size: 26px; line-height: 1; transition: transform .12s; }
.bar-btn:active { transform: scale(.94); }
#home { color: var(--land-text); }
#fav { color: #E5383B; }
#fav svg { fill: transparent; transition: fill .15s; }
#fav.on svg { fill: #E5383B; }
#lvl { font-size: 24px; }
#title { flex: 1; min-width: 0; text-align: center; font-size: clamp(17px, 2.4vw, 22px); font-weight: var(--fw-head); letter-spacing: -.02em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#stars { font-size: 18px; padding: 8px 16px; gap: 6px; flex: none; min-height: 48px; }
@media (max-width: 600px) {
  :root { --bar-h: 64px; }
  #bar { gap: 6px; padding: var(--safe-t) max(6px, var(--safe-r)) 0 max(6px, var(--safe-l)); }
  .bar-btn { width: 46px; height: 46px; font-size: 22px; }
  .bar-btn svg { width: 22px; height: 22px; }
  #stars { font-size: 15px; padding: 6px 10px; gap: 4px; min-height: 44px; }
  #stars svg { width: 18px; height: 18px; }
  #title { font-size: 15px; white-space: normal; line-height: 1.15; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }  /* a long name takes two lines */
}


/* a low screen (a phone on its side): a slimmer bar leaves the game more room */
@media (max-height: 480px) {
  :root { --bar-h: 54px; }
  .bar-btn { width: 44px; height: 44px; font-size: 22px; }
  .bar-btn svg { width: 22px; height: 22px; }
  #stars { min-height: 44px; padding: 6px 12px; font-size: 16px; }
  #stars svg { width: 20px; height: 20px; }
  #title { font-size: 17px; }
}

/* ---------- the sticker book ---------- */
#book { position: fixed; inset: 0; z-index: 350; background: var(--paper); animation: screenIn .3s ease-out; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y;
  padding: max(14px, var(--safe-t)) max(16px, var(--safe-r)) max(30px, calc(var(--safe-b) + 14px)) max(16px, var(--safe-l)); }
#book.out { animation: fadeOut .22s forwards; }
.book-card { max-width: 940px; margin: 0 auto; }
.book-head { display: flex; align-items: center; gap: 12px; }
.book-head h2 { flex: 1; margin: 0; font-size: clamp(28px, 5vw, 40px); }
.book-count { font-size: 20px; }
.book-next { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 12px 0 4px; font-weight: var(--fw-head); font-size: 18px; color: var(--sticker-text); --tint: #fff; --accent: var(--sticker); }
.book-next .progress { flex: 1 1 160px; max-width: 280px; height: 14px; margin-left: 8px; }
.book-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 12px 2px 10px; touch-action: pan-x pan-y; }
.book-tabs::-webkit-scrollbar { display: none; }
.book-tab { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 88px; min-height: 80px; padding: 8px 10px; border-radius: 22px;
  background: #fff; box-shadow: inset 0 0 0 1px var(--hair), var(--sh-xs); font-size: 15px; font-weight: var(--fw-head); color: var(--muted); transition: transform .15s; }
.book-tab small { font-size: 12px; font-weight: var(--fw-bold); }
.book-tab-e { font-size: 30px; line-height: 1.1; }
.book-tab.on { background: var(--ink); color: #fff; box-shadow: none; }
#book h3 { font-size: 26px; margin: 8px 4px 12px; }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 14px; }
.slot { position: relative; aspect-ratio: 1; background: rgba(255,255,255,.7); border: 3px dashed var(--sticker-edge); border-radius: 26px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.slot:not(.locked) { background: #fff; border-style: solid; border-color: #fff; box-shadow: inset 0 0 0 1px var(--hair), var(--sh-card); }
.slot.locked .sticker { filter: brightness(0) opacity(.13); }
.slot-name { font-size: 16px; font-weight: var(--fw-head); color: var(--muted); }
.slot.new { animation: wiggle .5s 3; border-color: var(--star); box-shadow: 0 0 0 4px var(--star), 0 6px 0 var(--sticker-edge); }
.new-tag { position: absolute; top: -8px; right: -6px; background: #E5383B; color: #fff; font-size: 14px; font-weight: var(--fw-head); padding: 3px 8px; border-radius: 10px; transform: rotate(12deg); }
@media (max-width: 600px) {
  .book-head .sam { display: none; }
  .sticker-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .slot .sticker { font-size: 46px; }
  .slot-name { font-size: 13px; }
}

/* ---------- family voices: the cards in Parents' Corner, the recorder sheet ---------- */
.pc-h2 { margin: 6px 0 -6px; font-size: 22px; }
.fam-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 14px; }
.fam-card { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; flex-wrap: wrap; }
.fam-card b { font-size: 20px; }
.fam-card .progress { margin-top: 8px; max-width: 260px; }
.fam-card-btns { display: flex; gap: 8px; flex: none; }
.avatar.face { line-height: 1; }
.kid-voice-who { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.kid-voice .muted { margin-top: 0; }
.quick-names { margin-top: 10px; }
.chip-btn { min-height: 44px; padding: 8px 18px; font-size: 16px; }

#famrec .sheet-card { width: min(720px, 100%); }
#famrec .sheet-head h2 { font-size: 26px; }
#famrec.taking .form-btns, #famrec.taking .fam-tip, #famrec.taking .fam-note { display: none; }
.fam-progress { display: flex; align-items: center; gap: 14px; margin: 4px 0 2px; }
.fam-count { font-weight: var(--fw-head); font-size: 17px; white-space: nowrap; }
.fam-progress .progress { flex: 1; --tint: var(--primary-soft); --accent: var(--music); }
.fam-sub { margin: 18px 0 4px; font-size: 15px; font-weight: var(--fw-head); color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.fam-sub-note { margin: 6px 0; font-size: 15px; font-weight: var(--fw-bold); color: var(--ink-2); line-height: 1.4; }
.fam-note:empty { display: none; }
.fam-note { color: var(--music-text); }
.fam-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid #EEF0F6; }
.fam-row:last-child { border-bottom: 0; }
.fam-row-ic { font-size: 28px; width: 44px; text-align: center; flex: none; }
.fam-row-text { flex: 1; min-width: 0; font-size: 15px; color: var(--muted); font-weight: var(--fw-bold); }
.fam-row-text b { font-size: 17px; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.fam-row .tick { color: var(--music); display: inline-flex; }
.fam-row-btns { display: flex; gap: 8px; flex: none; align-items: center; }
.btn-soft.sq, .btn-danger.sq { width: 48px; padding: 0; }
.btn-danger.sq.wide { width: auto; padding: 8px 14px; }
.rec-alert:empty { display: none; }
.rec-alert { display: flex; gap: 12px; align-items: flex-start; background: #FFF1F0; border: 2px solid #F3C4C4; color: var(--ink); border-radius: var(--r-sm); padding: 12px 14px; margin: 8px 0; font-size: 15px; font-weight: var(--fw-bold); line-height: 1.4; }
.rec-alert b { display: block; font-size: 17px; color: var(--danger); margin-bottom: 2px; }
.rec-alert-ic { color: var(--danger); display: flex; flex: none; }

/* one take: the line, the countdown / red dot, the level meter, Stop */
.take { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 18px 8px 8px; }
.take-label { font-size: 15px; font-weight: var(--fw-head); color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.take-line { font-size: clamp(24px, 4vw, 32px); font-weight: var(--fw-head); line-height: 1.2; max-width: 520px; }
.take-big { width: 112px; height: 112px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 58px; font-weight: var(--fw-head);
  background: var(--primary-soft); color: var(--primary-edge); }
.take.count .take-big { animation: countPop .8s infinite; }
@keyframes countPop { 0% { transform: scale(1.18); } 30% { transform: scale(1); } }
.take.rec .take-big { background: #FFE3E3; }
.take.rec .take-big::after { content: ''; width: 44px; height: 44px; border-radius: 50%; background: #E5383B; animation: pulse 1s infinite; }
.take.work .take-big { animation: spinSoft 1.2s linear infinite; }
@keyframes spinSoft { to { transform: rotate(360deg); } }
.take-state { font-size: 20px; font-weight: var(--fw-head); min-height: 1.3em; }
.take.rec .take-state { color: #B3261E; }
.take.rec.heard .take-state { color: var(--music-text); }
.meter { width: min(440px, 100%); height: 22px; border-radius: var(--r-pill); background: var(--ground-2); overflow: hidden; box-shadow: inset 0 0 0 1.5px var(--line); }
.meter-fill { height: 100%; width: 0; border-radius: var(--r-pill); background: linear-gradient(90deg, #1E8E55, #4CD08A 60%, #FFC21A 85%, #E5383B); background-size: min(440px, 100vw) 100%; transition: width .06s linear; }
.take.work .meter { opacity: .35; }
.take-hint { font-size: 15px; font-weight: var(--fw-bold); color: var(--muted); max-width: 440px; }
.take-btns { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 6px; flex-wrap: wrap; }
.stop-btn { display: inline-flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 34px 12px 26px; border-radius: var(--r-pill);
  background: #E5383B; color: #fff; font-weight: var(--fw-head); font-size: 22px; box-shadow: var(--sh-card); transition: transform .12s; }
.stop-btn i { width: 26px; height: 26px; border-radius: 6px; background: #fff; }
.stop-btn:active { transform: scale(.97); }
.take.start .stop-btn, .take.work .stop-btn, .take.work .take-btns { visibility: hidden; }
@media (max-width: 600px) {
  .fam-row { flex-wrap: wrap; }
  .fam-row-btns { width: 100%; justify-content: flex-end; }
  .fam-card-btns { width: 100%; justify-content: flex-end; }
  .kid-voice .set-ctl { width: 100%; }
}

