/* Better Care Games, Better Care Project by B7 Collective. Copyright (C) 2026 B7 Collective LLC. All rights reserved.
   Design system: warm cream paper, deep green for actions, one color per room, Literata for warmth and Atkinson Hyperlegible
   Next for everything you read. Player targets are 96px or more, nothing flashes, nothing is timed. See DESIGN-STANDARDS.md. */
@font-face { font-family: "Atkinson"; src: url("/assets/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/assets/fonts/literata-latin-wght-normal.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }

:root {
  --paper: #F3EDE2; --paper-2: #EAE2D4; --card: #FFFCF6; --line: #DDD3C3; --line-2: #C9BDA9;
  --ink: #1F2B28; --ink-2: #3E4A46; --ink-3: #5A6460;
  --green: #2D5B4C; --green-2: #234A3E; --green-t: #E1EBE4;
  --amber: #A9661F; --amber-t: #F6E7D3;
  --plum: #5E3F57; --plum-t: #EFE5EC;
  --felt: #24504C; --felt-t: #DCE9E6;
  --rose: #9A4A3C; --rose-t: #F3E2DC;
  --sky: #2F5A7A; --sky-t: #E0EAF1;
  --sage: #4E6B43; --sage-t: #E6EEDF;
  --shadow: 0 1px 2px rgba(40,30,15,.06), 0 8px 24px rgba(40,30,15,.08);
  --shadow-lg: 0 2px 4px rgba(40,30,15,.06), 0 18px 48px rgba(40,30,15,.14);
  --r: 22px; --r-lg: 30px;
  --t: 1; /* text scale, set by Comfort settings */
  --fs-body: calc(21px * var(--t)); --fs-small: calc(18px * var(--t)); --fs-btn: calc(26px * var(--t));
  --fs-h1: calc(44px * var(--t)); --fs-h2: calc(32px * var(--t)); --fs-big: calc(40px * var(--t));
  --tap: 96px; --tap-2: 64px;
  --ease: cubic-bezier(.2,.7,.2,1); --dur: 260ms;
  --pad: 36px;
}
html[data-text="lg"] { --t: 1.15; }
html[data-text="xl"] { --t: 1.32; }
html[data-contrast="high"] { --paper: #FFFFFF; --paper-2: #F1F1EE; --card: #FFFFFF; --ink: #000000; --ink-2: #1A1A1A; --ink-3: #2A2A2A; --line: #6B6B6B; --line-2: #3D3D3D; --green: #1B4436; --shadow: none; --shadow-lg: none; }
html[data-motion="less"] { --dur: 0ms; }
@media (prefers-reduced-motion: reduce) { :root { --dur: 0ms; } }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: "Atkinson", system-ui, sans-serif; font-size: var(--fs-body); line-height: 1.45; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; touch-action: manipulation; overscroll-behavior: none; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .28  0 0 0 0 .18  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
html[data-contrast="high"] body::before { display: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--green); }
img { display: block; max-width: 100%; }
.serif { font-family: "Literata", Georgia, serif; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus { outline: none; }
:focus-visible { outline: 4px solid #1D6FB8; outline-offset: 3px; border-radius: 14px; }
::selection { background: #CFE1D6; }

/* ---------- Frame ---------- */
#app { position: relative; z-index: 1; min-height: 100%; display: flex; flex-direction: column; }
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(14px, env(safe-area-inset-top)) var(--pad) 10px; background: linear-gradient(var(--paper) 72%, rgba(243,237,226,0)); }
.where { display: flex; align-items: center; gap: 10px; font-family: "Literata"; font-weight: 500; font-size: calc(22px * var(--t)); color: var(--ink-2); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.where .dot { flex: none; width: 13px; height: 13px; border-radius: 50%; background: var(--room, var(--amber)); }
.where .sub { color: var(--ink-3); }
.bar .group { display: flex; gap: 10px; flex: none; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--tap-2); padding: 0 22px; border-radius: 999px; font-weight: 650; font-size: calc(20px * var(--t)); color: var(--ink); background: var(--card); border: 2px solid var(--line); box-shadow: var(--shadow); white-space: nowrap; text-decoration: none; transition: transform var(--dur) var(--ease), background var(--dur); }
.pill svg { width: 26px; height: 26px; flex: none; }
.pill.calm { background: transparent; box-shadow: none; border-color: var(--line-2); }
.pill.soft { background: var(--green-t); border-color: #C3D5C8; color: var(--green-2); }
.pill.warn { background: var(--amber-t); border-color: #E7CBA6; color: #6A3E10; }
main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.screen { flex: 1; display: flex; flex-direction: column; gap: 22px; padding: 6px var(--pad) 32px; width: 100%; max-width: 1360px; margin: 0 auto; animation: enter var(--dur) var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
.tools-row { display: none; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: var(--tap); padding: 0 34px; border-radius: var(--r); font-weight: 700; font-size: var(--fs-btn); border: 2px solid transparent; text-decoration: none; text-align: center; line-height: 1.15; transition: transform var(--dur) var(--ease), box-shadow var(--dur), background var(--dur); user-select: none; }
.btn svg { width: 32px; height: 32px; flex: none; }
.btn.primary { background: var(--green); color: #fff; box-shadow: 0 2px 0 var(--green-2), 0 10px 24px rgba(45,91,76,.26); }
.btn.quiet { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); font-weight: 650; font-size: calc(24px * var(--t)); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); font-weight: 650; font-size: calc(22px * var(--t)); min-height: var(--tap-2); }
.btn.small { min-height: var(--tap-2); font-size: calc(20px * var(--t)); padding: 0 22px; border-radius: 18px; }
.btn.small svg { width: 24px; height: 24px; }
.btn.block { width: 100%; }
.btn.danger { background: #FBECE8; color: #7A2416; border-color: #EBC2B8; }
.btn:active, .pill:active, .tap:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) {
  .btn.primary:hover { background: var(--green-2); }
  .btn.quiet:hover, .pill:hover, .tap:hover { box-shadow: var(--shadow-lg); }
  .tap { cursor: pointer; }
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.kbd { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 8px; border: 2px solid var(--line-2); font-size: 16px; font-weight: 700; color: var(--ink-3); }
@media (pointer: coarse) { .kbd { display: none; } }

/* ---------- Front door ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hello { font-family: "Literata"; font-weight: 500; font-size: var(--fs-h1); line-height: 1.1; letter-spacing: -.01em; }
.subline { font-size: calc(23px * var(--t)); color: var(--ink-2); margin-top: 8px; }
.seg { display: flex; background: var(--paper-2); border-radius: 999px; padding: 6px; gap: 4px; border: 1px solid var(--line); }
.seg > button { min-height: 60px; display: flex; align-items: center; gap: 8px; padding: 0 22px; border-radius: 999px; font-weight: 650; font-size: calc(19px * var(--t)); color: var(--ink-2); }
.seg > button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.seg svg { width: 22px; height: 22px; }
.suggest { flex: 1; display: grid; grid-template-columns: 1.12fr 1fr; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; border: 1px solid #E6DDCD; min-height: 420px; }
.suggest .art { position: relative; min-height: 240px; background: var(--paper-2); }
.suggest .art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.suggest .copy { padding: 36px 38px 34px; display: flex; flex-direction: column; gap: 16px; }
.eyebrow { font-size: calc(17px * var(--t)); font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--room, var(--amber)); }
.title { font-family: "Literata"; font-weight: 500; font-size: calc(38px * var(--t)); line-height: 1.15; }
.lede { font-size: var(--fs-body); color: var(--ink-2); }
.chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-size: calc(18px * var(--t)); font-weight: 650; color: var(--ink-2); background: var(--paper); border-radius: 999px; padding: 8px 16px; }
.chip svg { width: 20px; height: 20px; }
.suggest .copy .btn { margin-top: auto; }
.newfrom { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: 20px; background: var(--amber-t); color: #5A3510; font-weight: 650; }
.newfrom img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; }

/* ---------- House ---------- */
.house { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.room { position: relative; display: flex; flex-direction: column; background: var(--card); border-radius: var(--r); overflow: hidden; border: 1px solid #E6DDCD; box-shadow: var(--shadow); text-align: left; min-height: 240px; }
.room .pic { aspect-ratio: 16/10; background: var(--paper-2); overflow: hidden; }
.room .pic img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.room .nm { display: flex; align-items: center; gap: 10px; padding: 16px 18px 18px; font-family: "Literata"; font-weight: 500; font-size: calc(26px * var(--t)); }
.room .nm small { margin-left: auto; font-family: "Atkinson"; font-weight: 650; font-size: calc(16px * var(--t)); color: var(--ink-3); }
.room .nm i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
@media (hover: hover) and (pointer: fine) { .room:hover .pic img { transform: scale(1.03); } }
.room.wide { grid-column: span 2; }
.roomhead { display: grid; grid-template-columns: 1fr 1.2fr; gap: 26px; align-items: center; }
.roomhead .pic { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16/9; box-shadow: var(--shadow); }
.roomhead .pic img { width: 100%; height: 100%; object-fit: cover; }
.games { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.game { display: flex; align-items: center; gap: 18px; min-height: 112px; padding: 16px 22px; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); text-align: left; }
.game .gi { flex: none; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--tint, var(--green-t)); color: var(--c, var(--green)); }
.game .gi svg { width: 34px; height: 34px; }
.game b { display: block; font-size: calc(24px * var(--t)); }
.game span { display: block; font-size: var(--fs-small); color: var(--ink-2); }
.game .both { margin-left: auto; flex: none; font-size: calc(15px * var(--t)); font-weight: 700; color: var(--ink-3); }

/* ---------- Play area ---------- */
.play { flex: 1; display: flex; flex-direction: column; gap: 18px; min-height: 0; }
.prompt { font-family: "Literata"; font-weight: 500; font-size: var(--fs-h2); line-height: 1.2; }
.prompt small { display: block; font-family: "Atkinson"; font-weight: 400; font-size: var(--fs-body); color: var(--ink-2); margin-top: 6px; }
.stage { flex: 1; position: relative; border-radius: var(--r-lg); background: var(--card); border: 1px solid #E6DDCD; box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; gap: 20px; min-height: 0; }
.choices { display: grid; gap: 16px; }
.choice { display: flex; align-items: center; gap: 20px; min-height: 112px; padding: 0 28px; background: var(--card); border-radius: 24px; border: 2px solid var(--line); box-shadow: var(--shadow); font-family: "Literata"; font-weight: 500; font-size: var(--fs-big); text-align: left; transition: background var(--dur), border-color var(--dur), transform var(--dur) var(--ease); }
.choice .k { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; font-family: "Atkinson"; font-size: 19px; font-weight: 750; color: var(--ink-3); }
@media (pointer: coarse) { .choice .k { display: none; } }
.choice.glow { border-color: var(--green); box-shadow: 0 0 0 6px rgba(45,91,76,.16), var(--shadow); }
.choice.right { background: var(--green-t); border-color: var(--green); }
.choice.soft { opacity: .55; }
.feedback { min-height: 40px; font-size: calc(24px * var(--t)); color: var(--green-2); font-weight: 650; }
.hear { align-self: flex-start; display: inline-flex; align-items: center; gap: 12px; min-height: var(--tap-2); padding: 0 24px; border-radius: 999px; background: var(--card); border: 2px solid var(--line); font-weight: 650; font-size: calc(20px * var(--t)); }
.hear svg { width: 26px; height: 26px; }
.tile { position: relative; display: grid; place-items: center; background: var(--card); border: 2px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); min-height: var(--tap); padding: 8px; transition: transform var(--dur) var(--ease), border-color var(--dur), box-shadow var(--dur), opacity var(--dur); }
.tile img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.tile.picked { border-color: var(--green); box-shadow: 0 0 0 6px rgba(45,91,76,.18), var(--shadow); transform: translateY(-4px); }
.tile.glow { border-color: var(--amber); box-shadow: 0 0 0 6px rgba(169,102,31,.18), var(--shadow); }
.tile.done { opacity: .35; }
.tile .lab { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: calc(17px * var(--t)); font-weight: 650; color: var(--ink-2); }
.bins { display: grid; gap: 16px; }
.bin { min-height: 150px; border-radius: 24px; border: 3px dashed var(--line-2); background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px; padding: 14px; font-weight: 700; font-size: calc(22px * var(--t)); }
.bin .bin-in { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.bin .bin-in img { width: 54px; height: 54px; object-fit: contain; }
.bin.ready { border-color: var(--green); background: var(--green-t); }
.endcard { display: grid; place-items: center; text-align: center; gap: 18px; padding: 30px; }
.endcard .big { font-family: "Literata"; font-weight: 500; font-size: var(--fs-h1); line-height: 1.15; }
.endcard p { max-width: 34em; color: var(--ink-2); }
.endcard .row-2 { width: min(640px, 100%); }
.finished-art { width: min(560px, 90%); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.tip { display: flex; gap: 16px; align-items: flex-start; background: var(--card); border-radius: 22px; padding: 18px 22px; border: 1px solid #E6DDCD; box-shadow: var(--shadow); }
.tip .ic { flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--amber-t); display: grid; place-items: center; color: var(--amber); }
.tip .ic svg { width: 26px; height: 26px; }
.tip b { display: block; font-size: calc(16px * var(--t)); letter-spacing: .06em; text-transform: uppercase; color: var(--amber); margin-bottom: 2px; }
.tip p { font-size: calc(20px * var(--t)); }
.schedule { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: var(--fs-small); color: var(--ink-2); }
.schedule span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--paper-2); }
.schedule span.now { background: var(--green-t); color: var(--green-2); font-weight: 700; }

/* ---------- Sheets, dialogs, toast ---------- */
.veil { position: fixed; inset: 0; z-index: 60; background: rgba(31,43,40,.38); display: flex; align-items: flex-end; justify-content: center; animation: fade var(--dur) both; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(760px, 100%); max-height: 92vh; overflow: auto; background: var(--paper); border-radius: 30px 30px 0 0; padding: 26px var(--pad) max(28px, env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: rise var(--dur) var(--ease) both; }
@media (min-width: 720px) { .veil { align-items: center; } .sheet { border-radius: 30px; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.sheet h2 { font-family: "Literata"; font-weight: 500; font-size: var(--fs-h2); line-height: 1.15; margin-bottom: 8px; }
.sheet p { color: var(--ink-2); }
.sheet .acts { display: grid; gap: 12px; margin-top: 20px; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, 140%); opacity: 0; visibility: hidden; z-index: 70; background: var(--ink); color: #fff; padding: 16px 24px; border-radius: 18px; font-weight: 650; max-width: min(92vw, 640px); transition: transform var(--dur) var(--ease); }
.toast.on { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.still { position: fixed; inset: 0; z-index: 65; display: grid; place-items: center; background: rgba(243,237,226,.82); backdrop-filter: blur(3px); }
.still .box { text-align: center; padding: 34px; }
.still .box b { display: block; font-family: "Literata"; font-weight: 500; font-size: var(--fs-h1); margin-bottom: 14px; }

/* ---------- Family settings ---------- */
.fam { display: grid; grid-template-columns: 300px 1fr; gap: 26px; align-items: start; }
.fam-nav { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid #E6DDCD; border-radius: var(--r); padding: 12px; box-shadow: var(--shadow); }
.fam-nav button { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 14px; border-radius: 16px; font-weight: 650; font-size: calc(19px * var(--t)); color: var(--ink-2); text-align: left; }
.fam-nav button svg { width: 24px; height: 24px; flex: none; color: var(--ink-3); }
.fam-nav button[aria-current="page"] { background: var(--green-t); color: var(--green-2); }
.fam-nav button[aria-current="page"] svg { color: var(--green); }
.fam-body { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.fam-body h1 { font-family: "Literata"; font-weight: 500; font-size: calc(38px * var(--t)); line-height: 1.1; }
.fam-body .d { color: var(--ink-2); margin-top: 4px; font-size: var(--fs-small); }
.card { background: var(--card); border-radius: var(--r); border: 1px solid #E6DDCD; box-shadow: var(--shadow); padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.card h2 { font-size: calc(16px * var(--t)); font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.card .big { font-family: "Literata"; font-weight: 500; font-size: calc(44px * var(--t)); line-height: 1; }
.card .big small { font-family: "Atkinson"; font-size: calc(20px * var(--t)); color: var(--ink-2); font-weight: 400; margin-left: 6px; }
.grid3 { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 150px; padding-top: 8px; }
.chart .day { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.chart .stack { width: 100%; max-width: 40px; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 10px; overflow: hidden; min-height: 6px; background: var(--paper-2); }
.chart .t { background: var(--green); } .chart .s { background: #E3B77F; }
.chart .day span { font-size: 15px; color: var(--ink-2); font-weight: 650; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: calc(16px * var(--t)); color: var(--ink-2); }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 7px; vertical-align: -1px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; align-items: center; gap: 12px; font-size: calc(19px * var(--t)); }
.item .sw { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--paper-2); color: var(--ink-2); overflow: hidden; }
.item .sw svg { width: 22px; height: 22px; } .item .sw img { width: 100%; height: 100%; object-fit: cover; }
.item small { display: block; font-size: calc(15px * var(--t)); color: var(--ink-2); }
.item .grow { flex: 1; min-width: 0; }
.ans { background: var(--paper); border-radius: 16px; padding: 12px 14px; font-size: calc(17px * var(--t)); color: var(--ink-2); }
.ans b { color: var(--ink); }
.empty { color: var(--ink-3); font-size: var(--fs-small); }
.foot { font-size: calc(16px * var(--t)); color: var(--ink-2); line-height: 1.5; }
.rows { display: flex; flex-direction: column; }
.srow { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 10px 4px; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.srow:last-child { border-bottom: 0; }
.srow .grow { flex: 1; min-width: 0; }
.srow b { display: block; font-size: calc(20px * var(--t)); }
.srow span.s { display: block; font-size: calc(16px * var(--t)); color: var(--ink-2); }
.toggle { flex: none; width: 66px; height: 40px; border-radius: 999px; background: var(--line-2); position: relative; transition: background var(--dur); }
.toggle::after { content: ""; position: absolute; top: 5px; left: 5px; width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform var(--dur) var(--ease); }
.toggle[aria-checked="true"] { background: var(--green); }
.toggle[aria-checked="true"]::after { transform: translateX(26px); }
.pick { display: flex; gap: 10px; flex-wrap: wrap; }
.pick button { min-height: 56px; padding: 0 18px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); font-weight: 650; font-size: calc(18px * var(--t)); }
.pick button[aria-pressed="true"] { border-color: var(--green); background: var(--green-t); color: var(--green-2); }
label.fl { display: flex; flex-direction: column; gap: 8px; font-weight: 650; font-size: calc(18px * var(--t)); }
.in { width: 100%; min-height: 60px; padding: 12px 16px; border-radius: 16px; border: 2px solid var(--line-2); background: #fff; font-size: calc(20px * var(--t)); }
.in:focus-visible { outline: 4px solid #1D6FB8; outline-offset: 2px; }
textarea.in { min-height: 96px; resize: vertical; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips .c { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 8px 0 16px; border-radius: 999px; background: var(--paper-2); font-weight: 650; font-size: calc(17px * var(--t)); }
.chips .c button { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); }
.chips .c button svg { width: 18px; height: 18px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photos .ph { position: relative; border-radius: 18px; overflow: hidden; background: var(--paper-2); aspect-ratio: 1; border: 2px solid var(--line); text-align: left; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; }
.photos .ph span { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,.55)); color: #fff; font-weight: 650; font-size: 16px; }
.photos .add { display: grid; place-items: center; gap: 6px; color: var(--green-2); font-weight: 700; background: var(--green-t); border-style: dashed; border-color: #A9C4B4; text-align: center; }
.photos .add svg { width: 34px; height: 34px; }
.words6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.words6 span { display: grid; place-items: center; min-height: 60px; border-radius: 14px; background: var(--paper); border: 2px solid var(--line); font-weight: 750; font-size: calc(22px * var(--t)); }
.qr { width: 200px; height: 200px; background: #fff; padding: 10px; border-radius: 16px; border: 1px solid var(--line); }
.qr svg { width: 100%; height: 100%; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: calc(16px * var(--t)); }
.status.on { background: var(--green-t); color: var(--green-2); } .status.off { background: var(--paper-2); color: var(--ink-2); } .status.wait { background: var(--amber-t); color: #6A3E10; }
.status svg { width: 18px; height: 18px; }

/* Better Care Project presence */
.bcp-band { position: relative; overflow: hidden; display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: var(--r); background: #14302A; color: #F4EFE6; }
.bcp-band svg.rings { position: absolute; right: -40px; top: -40px; width: 220px; height: 220px; opacity: .14; }
.bcp-band .mk { flex: none; }
.bcp-band b { display: block; font-family: "Literata"; font-weight: 500; font-size: calc(24px * var(--t)); }
.bcp-band span { display: block; font-size: calc(17px * var(--t)); color: #CFE0D6; }
.bcp-band a { color: #F4EFE6; }
.bcp-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.bcp-links a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: 999px; border: 2px solid rgba(244,239,230,.35); color: #F4EFE6; text-decoration: none; font-weight: 650; font-size: calc(16px * var(--t)); }
.byline { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 0 18px; font-size: calc(16px * var(--t)); color: var(--ink-3); }
.byline a { color: var(--ink-2); font-weight: 650; text-decoration: none; }
.beta { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--amber-t); color: #6A3E10; font-weight: 750; font-size: calc(14px * var(--t)); letter-spacing: .04em; text-transform: uppercase; }

/* Setup */
.setup { max-width: 760px; margin: 0 auto; width: 100%; padding: 30px var(--pad) 40px; display: flex; flex-direction: column; gap: 22px; min-height: 100%; animation: enter var(--dur) var(--ease) both; }
.setup .mk-row { display: flex; align-items: center; gap: 14px; }
.setup h1 { font-family: "Literata"; font-weight: 500; font-size: var(--fs-h1); line-height: 1.12; }
.setup .lead { font-size: calc(22px * var(--t)); color: var(--ink-2); }
.setup .acts { display: grid; gap: 14px; margin-top: auto; }
.choicebig { display: flex; align-items: center; gap: 18px; min-height: 120px; padding: 18px 24px; border-radius: 24px; border: 2px solid var(--line); background: var(--card); box-shadow: var(--shadow); text-align: left; }
.choicebig .gi { flex: none; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--green-t); color: var(--green); }
.choicebig .gi svg { width: 34px; height: 34px; }
.choicebig b { display: block; font-size: calc(24px * var(--t)); }
.choicebig span { display: block; color: var(--ink-2); font-size: var(--fs-small); }
.choicebig[aria-pressed="true"] { border-color: var(--green); background: var(--green-t); }
.steps-dots { display: flex; gap: 8px; } .steps-dots i { width: 32px; height: 8px; border-radius: 8px; background: var(--line); } .steps-dots i.on { background: var(--green); }
.sample { padding: 22px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); }
.sample p { font-family: "Literata"; font-size: calc(28px * var(--t)); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .house { grid-template-columns: repeat(2, 1fr); }
  .room.wide { grid-column: span 2; }
  .grid3 { grid-template-columns: 1fr 1fr; } .grid3 > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .fam { grid-template-columns: 1fr; }
  .fam-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 8px; }
  .fam-nav button { flex: none; }
  .roomhead { grid-template-columns: 1fr; }
}
@media (max-width: 719px) {
  :root { --pad: 16px; --fs-body: calc(19px * var(--t)); --fs-btn: calc(24px * var(--t)); --fs-h1: calc(32px * var(--t)); --fs-h2: calc(26px * var(--t)); --fs-big: calc(32px * var(--t)); --tap: 88px; --tap-2: 58px; }
  .pill { padding: 0 14px; font-size: calc(18px * var(--t)); gap: 8px; }
  .pill .long, .only-wide { display: none !important; }
  .where { font-size: calc(18px * var(--t)); }
  .bar .group { gap: 8px; }
  .screen { gap: 14px; padding-bottom: 20px; }
  .head { flex-direction: column; align-items: stretch; gap: 12px; }
  .seg > button { flex: 1; justify-content: center; min-height: 54px; padding: 0 10px; }
  .suggest { grid-template-columns: 1fr; min-height: 0; flex: none; }
  .suggest .art { min-height: 190px; }
  .suggest .copy { padding: 18px 20px 20px; gap: 10px; }
  .title { font-size: calc(27px * var(--t)); }
  .suggest .lede { display: none; }
  .row-2 { gap: 10px; }
  .row-2 .btn { font-size: calc(20px * var(--t)); padding: 0 10px; min-height: 76px; }
  .house { grid-template-columns: 1fr 1fr; gap: 12px; }
  .room { min-height: 0; } .room .nm { font-size: calc(20px * var(--t)); padding: 10px 12px 12px; } .room .nm small { display: none; }
  .games { grid-template-columns: 1fr; }
  .stage { padding: 18px; }
  .choice { min-height: 96px; padding: 0 20px; }
  .grid3, .grid2 { grid-template-columns: 1fr; } .grid3 > :first-child { grid-column: auto; }
  .tools-row { display: flex; gap: 10px; padding: 0 var(--pad) 8px; } .tools-row .pill { flex: 1; }
  .bar .t-only { display: none; }
  .words6 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1500px) { :root { --pad: 48px; } }
@media print { .bar, .tools-row, .toast, .veil { display: none !important; } body::before { display: none; } }

/* ===================================================================================================================
   Shell details
   =================================================================================================================== */
.icw { display: inline-flex; }
.ic { width: 1em; height: 1em; }
.boot { padding: 40px var(--pad); color: var(--ink-2); max-width: 640px; }
.boot p + p { margin-top: 8px; font-size: var(--fs-small); }
.where .mk { flex: none; border-radius: 10px; }
.fam-pill { position: relative; overflow: hidden; }
.fam-pill .hint { font-size: calc(15px * var(--t)); color: var(--ink-3); font-weight: 650; }
.hold { position: absolute; left: 0; bottom: 0; height: 4px; width: calc(var(--p, 0) * 100%); background: var(--green); border-radius: 4px; }
.door-screen { gap: 20px; }
.doors { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.door { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap-2); padding: 0 20px; border-radius: 999px; background: var(--card); border: 2px solid var(--line); font-weight: 650; font-size: calc(19px * var(--t)); box-shadow: var(--shadow); }
.door i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.house-link { margin-right: 4px; }
.game .gt { min-width: 0; }
.game .kbd { margin-left: auto; }
.btn .icw svg, .pill .icw svg { width: 28px; height: 28px; }

/* End card */
.end-mark { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--green-t); color: var(--green); }
.end-mark svg { width: 48px; height: 48px; }
.endcard .pick { justify-content: center; }
.endcard .pick button { min-height: var(--tap-2); font-size: calc(20px * var(--t)); padding: 0 22px; }
.next-time { color: var(--ink-2); font-size: var(--fs-small); text-align: center; }
.next-time summary { cursor: pointer; min-height: 48px; display: inline-flex; align-items: center; font-weight: 650; }
.next-time .pick { margin: 6px 0; }
.spark { width: min(560px, 100%); text-align: left; }
.finished-art img, .finished-art canvas { width: 100%; display: block; }
.finished-art .bed, .finished-art .bowl, .finished-art .basket { margin: 0; box-shadow: none; }

/* Together tools */
ul.tips { margin: 16px 0 0 22px; display: grid; gap: 10px; color: var(--ink-2); }
.subject { margin-top: 16px; padding: 20px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); font-family: "Literata"; font-size: calc(26px * var(--t)) !important; color: var(--ink) !important; line-height: 1.3; }

/* Choices */
.choices { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.choice { text-align: left; }
.choice .lab { display: flex; flex-direction: column; min-width: 0; }
.choice .lab small { font-family: "Atkinson"; font-size: var(--fs-small); color: var(--ink-2); }
.choice.withimg { flex-direction: column; justify-content: center; text-align: center; padding: 16px; gap: 10px; min-height: 200px; }
.choice.withimg img { width: min(120px, 70%); aspect-ratio: 1; object-fit: contain; }
.choice.withimg .lab { align-items: center; font-family: "Atkinson"; font-weight: 650; font-size: calc(21px * var(--t)); }
.choice.withimg .k { position: absolute; top: 10px; left: 10px; width: 36px; height: 36px; font-size: 16px; }
.choice { position: relative; transition: border-color var(--dur), box-shadow var(--dur), background var(--dur), opacity var(--dur); }
@media (hover: hover) and (pointer: fine) { .choice:hover { border-color: var(--line-2); box-shadow: var(--shadow-lg); } }
.choice.glow, .tile.glow, .pc.glow, .dom.glow, .ncell.glow, .bill.glow, .mcard.glow, .jpiece.glow { animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 10px rgba(45,91,76,.12), var(--shadow); } }
html[data-motion="less"] .glow { animation: none !important; }
.center { display: flex; justify-content: center; align-items: center; flex-direction: column; gap: 14px; text-align: center; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.big-q { font-family: "Literata"; font-weight: 500; font-size: var(--fs-big); line-height: 1.2; }
.big-ic svg { width: 64px; height: 64px; color: var(--room, var(--green)); }
.empty-state { margin: auto; max-width: 640px; text-align: center; display: grid; gap: 16px; justify-items: center; }

/* ---------- Word games ---------- */
.saying, .pairq { font-family: "Literata"; font-weight: 500; font-size: var(--fs-big); line-height: 1.2; text-align: center; padding: 26px 10px 6px; }
.saying .q svg { width: 44px; height: 44px; color: var(--room); opacity: .6; display: block; margin: 0 auto 10px; }
.blank { display: inline-block; min-width: 3.5em; border-bottom: 4px solid var(--room, var(--green)); color: var(--green-2); text-align: center; }
.whole .blank, .blank:not(:empty) { font-style: normal; }
.bed { position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 16 / 6; background: var(--sage-t); box-shadow: var(--shadow); }
.bed-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 70%; opacity: .9; }
.bloom { position: absolute; width: 11%; transform-origin: bottom center; translate: -50% 0; animation: grow 900ms var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes grow { from { transform: scale(.2); opacity: 0; } }
.word-area { display: flex; flex-direction: column; gap: 16px; }
.poems { grid-template-columns: 1fr; }
.poem-pick { min-height: 96px; }
.poem-text { flex: 1; overflow: auto; background: #FBF6EC; border-radius: 22px; padding: 26px 30px; border: 1px solid var(--line); max-height: 52vh; }
.poem-text.one { max-height: none; flex: none; }
.stanza { font-family: "Literata"; font-size: calc(27px * var(--t)); line-height: 1.5; padding: 8px 12px; border-radius: 14px; transition: background var(--dur); }
.stanza + .stanza { margin-top: 14px; }
.stanza.now { background: var(--plum-t); }
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.topic { min-height: var(--tap); padding: 16px 22px; border-radius: 22px; background: var(--card); border: 2px solid var(--line); box-shadow: var(--shadow); font-size: calc(23px * var(--t)); text-align: left; }
.talkcard { padding: 30px; border-radius: 24px; background: #FBF6EC; border: 1px solid var(--line); text-align: center; }
.story-bits { display: flex; flex-direction: column; gap: 8px; }
.story-bits b { font-size: var(--fs-small); color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.talk { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; flex: 1; min-height: 0; }
.talk-pic { border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-lg); background: var(--paper-2); aspect-ratio: 1; max-height: 64vh; }
.talk-pic img { width: 100%; height: 100%; object-fit: cover; }
.talk-side { display: flex; flex-direction: column; gap: 22px; }
.talk-side .acts { display: grid; gap: 12px; }

/* ---------- Everyday games ---------- */
.slots { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.slot { position: relative; min-height: 150px; border-radius: 20px; border: 3px dashed var(--line-2); background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; text-align: center; }
.slot .num { position: absolute; top: 8px; left: 10px; width: 32px; height: 32px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; font-weight: 750; color: var(--ink-2); }
.slot.filled { border-style: solid; border-color: var(--green); background: var(--green-t); animation: enter var(--dur) var(--ease) both; }
.slot.filled .num { background: var(--green); color: #fff; }
.slot img { width: 64px; height: 64px; object-fit: contain; }
.slot .st { font-size: calc(17px * var(--t)); font-weight: 650; line-height: 1.25; }
.step-choices .choices { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.tray .tile, .stall .tile { aspect-ratio: 1; padding: 12px 10px 34px; touch-action: none; }
.tile .lab { font-size: calc(16px * var(--t)); }
.bins { grid-template-columns: 1fr 1fr; }
.bin { touch-action: manipulation; }
.bin .bin-ic { width: 64px; height: 64px; object-fit: contain; }
.bin.ready { animation: breathe 1.8s ease-in-out infinite; }
.drag-ghost { position: fixed; z-index: 90; pointer-events: none; margin: 0; box-shadow: var(--shadow-lg) !important; opacity: .95; }
.lifting { opacity: .35; }
.measure { display: grid; grid-template-columns: minmax(240px, .8fr) 1.2fr; gap: 22px; align-items: start; }
.recipe { list-style: none; display: grid; gap: 10px; }
.recipe li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; background: var(--card); border: 2px solid var(--line); font-weight: 650; font-size: calc(21px * var(--t)); }
.recipe li img { width: 48px; height: 48px; object-fit: contain; }
.recipe li .count { margin-left: auto; color: var(--green-2); }
.recipe li.now { border-color: var(--amber); background: var(--amber-t); }
.recipe li.done { border-color: var(--green); background: var(--green-t); }
.measure-main { display: grid; grid-template-columns: 1fr 1.3fr; gap: 18px; align-items: center; }
.shelf { display: flex; justify-content: center; }
.big-add { width: min(220px, 100%); aspect-ratio: 1; padding: 18px 18px 40px; }
.bowl { position: relative; aspect-ratio: 1; max-width: 360px; width: 100%; margin: 0 auto; }
.bowl-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; }
.bowl-in { position: absolute; left: 14%; right: 14%; top: 18%; height: 42%; z-index: 2; }
.in-bowl { position: absolute; width: 26%; bottom: 0; transform: rotate(var(--r)); animation: plop 420ms var(--ease) both; }
@keyframes plop { from { transform: translateY(-60px) rotate(var(--r)); opacity: 0; } }
.market { display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: start; }
.market-side { display: grid; gap: 16px; }
.shoplist { list-style: none; padding: 18px 20px; border-radius: 20px; background: #FBF6EC; border: 1px solid var(--line); display: grid; gap: 10px; font-size: calc(21px * var(--t)); box-shadow: var(--shadow); }
.shoplist .head { display: flex; align-items: center; gap: 10px; font-family: "Literata"; font-size: calc(24px * var(--t)); }
.shoplist .head svg { width: 26px; height: 26px; }
.shoplist li { display: flex; align-items: center; gap: 12px; }
.shoplist .tick { width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--line-2); flex: none; }
.shoplist .got .tick { background: var(--green) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12.5l4.5 4.5L19 7.5'/></svg>") center/80% no-repeat; border-color: var(--green); }
.shoplist .got { color: var(--ink-3); }
.shoplist .price { margin-left: auto; font-weight: 700; color: var(--ink-2); }
.basket { position: relative; aspect-ratio: 1.3; }
.basket-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.basket .bin-in { position: absolute; left: 18%; right: 18%; top: 10%; height: 40%; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 2px; }
.basket .bin-in img { width: 30%; animation: plop 420ms var(--ease) both; --r: 0deg; }
.stall { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; align-content: start; }
.ware .tag { position: absolute; top: 8px; right: 10px; background: var(--amber-t); color: #6A3E10; font-weight: 750; border-radius: 10px; padding: 2px 10px; font-size: calc(18px * var(--t)); }
.sum { font-family: "Literata"; font-size: var(--fs-big); text-align: center; }
.till { display: grid; gap: 16px; grid-column: 1 / -1; text-align: center; font-size: calc(24px * var(--t)); }
.till-in { min-height: 70px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.bills { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.bill { min-width: 200px; min-height: var(--tap); border-radius: 14px; background: linear-gradient(135deg, #DDE8D2, #C7D8BA); border: 3px solid #9DB58B; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: "Literata"; font-weight: 700; font-size: calc(34px * var(--t)); color: #2F4A2A; box-shadow: var(--shadow); }
.bill small { font-family: "Atkinson"; font-size: calc(15px * var(--t)); font-weight: 650; }
.bill.small { min-width: 70px; min-height: 44px; font-size: 20px; border-width: 2px; padding: 0 10px; animation: plop 300ms var(--ease) both; --r: 0deg; }
.table-wrap { position: relative; border-radius: 26px; overflow: hidden; background: repeating-linear-gradient(90deg, #E9DFCF 0 34px, #E3D7C4 34px 68px); padding: 34px 26px; box-shadow: inset 0 2px 10px rgba(60,40,20,.08); }
.table { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 16px; }
.on-table { aspect-ratio: 1; padding: 12px 10px 34px; }
.cloth { position: absolute; inset: 0; background: repeating-linear-gradient(45deg, #EFD9CF 0 18px, #F6E7DF 18px 36px); transform: translateY(-102%); transition: transform 800ms var(--ease); box-shadow: 0 6px 18px rgba(60,40,20,.18); }
.cloth.down { transform: none; }
html[data-motion="less"] .cloth { transition-duration: 1ms; }

/* ---------- Game table ---------- */
.piles { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.pile { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pile .next { font-weight: 700; color: var(--ink-2); font-size: calc(17px * var(--t)); }
.pile .next.full { color: var(--green-2); }
.ghost-card { width: 120px; aspect-ratio: 5 / 7; border-radius: 16px; border: 3px dashed var(--line-2); display: grid; place-items: center; align-content: center; font-family: "Literata"; font-size: 32px; color: var(--ink-3); }
.ghost-card .s { font-size: 40px; }
.ghost-card.red { color: #C97C6E; }
.pc { position: relative; width: 120px; aspect-ratio: 5 / 7; border-radius: 16px; background: #fff; border: 2px solid var(--line); box-shadow: var(--shadow); display: grid; place-items: center; font-family: "Literata"; font-weight: 600; }
.pc .s { font-size: 64px; line-height: 1; }
.pc .r { position: absolute; top: 8px; left: 12px; font-size: 30px; }
.pc .r.flip { top: auto; left: auto; bottom: 8px; right: 12px; transform: rotate(180deg); }
.pc.red { color: #B23A2E; } .pc.black { color: #1F2B28; }
.hand { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: auto; padding-top: 18px; border-top: 2px solid var(--line); }
.hand .pc { width: 132px; }
@media (hover: hover) and (pointer: fine) { .hand .pc:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); } }
.pairs { display: grid; gap: 14px; max-width: 760px; width: 100%; margin: 0 auto; }
.mcard { position: relative; aspect-ratio: 1; border-radius: 20px; perspective: 900px; }
.mcard .back, .mcard .front { position: absolute; inset: 0; border-radius: 20px; display: grid; place-items: center; backface-visibility: hidden; transition: transform 420ms var(--ease); box-shadow: var(--shadow); }
.mcard .back { background: var(--felt); color: #CFE3DE; border: 4px solid #2F6460; }
.mcard .back svg { width: 40%; height: 40%; opacity: .5; }
.mcard .front { background: #fff; border: 2px solid var(--line); transform: rotateY(180deg); padding: 10px 10px 30px; }
.mcard .front img { width: 72%; height: 72%; object-fit: contain; }
.mcard .front .lab { position: absolute; bottom: 8px; font-size: calc(16px * var(--t)); font-weight: 650; color: var(--ink-2); }
.mcard.up .back, .mcard.matched .back, .mcard.peek .back { transform: rotateY(180deg); }
.mcard.up .front, .mcard.matched .front, .mcard.peek .front { transform: none; }
.mcard.matched .front { border-color: var(--green); background: var(--green-t); }
html[data-motion="less"] .mcard .back, html[data-motion="less"] .mcard .front { transition-duration: 1ms; }
.dline { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 120px; }
.dend { text-align: center; font-weight: 650; color: var(--ink-2); font-size: calc(21px * var(--t)); }
.dhand { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: auto; padding-top: 18px; border-top: 2px solid var(--line); }
.dom { display: inline-flex; align-items: center; gap: 0; padding: 10px; border-radius: 16px; background: #FFFDF8; border: 2px solid #CFC3AE; box-shadow: var(--shadow); }
.dom .half { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 70px; height: 70px; padding: 6px; }
.dom .half i { border-radius: 50%; }
.dom .half i.p { background: #1F2B28; }
.dom .mid { width: 2px; align-self: stretch; background: #CFC3AE; margin: 0 6px; }
.dom.laid { transform: scale(.82); }
.dom.laid.last { border-color: var(--green); box-shadow: 0 0 0 5px rgba(45,91,76,.16), var(--shadow); }

/* ---------- Numbers ---------- */
.frames { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
.frame { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 14px; border-radius: 18px; background: #FBF6EC; border: 2px solid var(--line); }
.frame i { width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--line-2); }
.frame i.on { background: var(--green); border-color: var(--green); }
.frame i.add { background: #E3B77F; border-color: #D29A55; animation: plop 360ms var(--ease) both; --r: 0deg; }
.find { text-align: center; font-size: calc(26px * var(--t)); font-weight: 650; }
.find b { font-family: "Literata"; font-size: 1.3em; color: var(--green-2); }
.nsq { display: grid; gap: 12px; width: min(620px, 100%, 62vh); margin: 0 auto; }
.ncell { aspect-ratio: 1; border-radius: 18px; background: var(--card); border: 2px solid var(--line); box-shadow: var(--shadow); font-family: "Literata"; font-weight: 600; font-size: calc(40px * var(--t)); }
.ncell.done { background: var(--green-t); border-color: var(--green); color: var(--green-2); }

/* ---------- Picture games ---------- */
.faces { display: grid; grid-template-columns: 1.2fr 1fr; gap: 26px; align-items: center; flex: 1; }
.face-pic { border-radius: 26px; overflow: hidden; box-shadow: var(--shadow-lg); background: var(--paper-2); max-height: 62vh; display: grid; place-items: center; }
.face-pic img { width: 100%; height: 100%; max-height: 62vh; object-fit: contain; }
.face-side { display: flex; flex-direction: column; gap: 18px; }
.face-side .choices { grid-template-columns: 1fr; }
.face-cap { display: none; flex-direction: column; gap: 4px; }
.face-cap.on { display: flex; animation: enter var(--dur) var(--ease) both; }
.face-cap b { font-family: "Literata"; font-weight: 500; font-size: var(--fs-big); line-height: 1.1; }
.face-cap span { font-size: calc(24px * var(--t)); color: var(--ink-2); }
.face-cap small { font-size: var(--fs-body); color: var(--ink-2); }
.jig { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: start; }
.jboard { position: relative; display: grid; border-radius: 18px; overflow: hidden; background: var(--paper-2); box-shadow: var(--shadow); width: 100%; max-height: 64vh; }
.jboard::before { content: ""; position: absolute; inset: 0; background: var(--img) center/100% 100%; opacity: .16; pointer-events: none; }
.jslot { position: relative; border: 2px dashed rgba(31,43,40,.25); background-repeat: no-repeat; }
.jslot.ready { border: 3px solid var(--green); background-color: rgba(225,235,228,.6); animation: breathe 1.8s ease-in-out infinite; }
.jslot.filled { border: 0; animation: none; }
.jboard.whole .jslot { border: 0; }
.jtray { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.jpiece { border-radius: 12px; border: 3px solid #fff; box-shadow: var(--shadow); background-repeat: no-repeat; min-height: 80px; touch-action: none; }
.jpiece.picked { border-color: var(--green); box-shadow: 0 0 0 6px rgba(45,91,76,.18), var(--shadow); transform: translateY(-4px); }
.jpiece.done { visibility: hidden; }
.spot { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.spot-panel { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); cursor: pointer; }
.spot-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.spot-cloth { position: absolute; left: 0; right: 0; bottom: 0; height: 52%; background: linear-gradient(#F3E7D6, #EADCC6); border-top: 3px solid #D9C7AC; }
.spot-obj { position: absolute; width: 15%; aspect-ratio: 1; object-fit: contain; transform: translate(-50%, -50%); pointer-events: none; }
.ring { position: absolute; width: 20%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 5px solid var(--green); pointer-events: none; animation: enter var(--dur) var(--ease) both; }
.ring.hint { border-color: var(--amber); border-style: dashed; animation: breathe 1.8s ease-in-out infinite; }

/* ---------- Music ---------- */
.two-big { grid-template-columns: 1fr 1fr; margin: auto 0; }
.two-big .choicebig { min-height: 160px; }
.songlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.song { display: flex; align-items: center; gap: 14px; min-height: 96px; padding: 12px 18px; border-radius: 20px; background: var(--card); border: 2px solid var(--line); box-shadow: var(--shadow); text-align: left; }
.song .gi { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--plum-t); color: var(--plum); }
.song .gi svg { width: 28px; height: 28px; }
.song b { display: block; font-size: calc(21px * var(--t)); }
.song small { display: block; color: var(--ink-2); font-size: calc(16px * var(--t)); }
.lyrics { flex: 1; min-height: 0; overflow: auto; padding: 18px 26px; border-radius: 22px; background: #FBF6EC; border: 1px solid var(--line); }
.lyrics .part { display: inline-block; font-size: calc(16px * var(--t)); font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--plum); margin-bottom: 8px; }
.lyrics .line { font-family: "Literata"; font-size: calc(30px * var(--t)); line-height: 1.4; color: var(--ink-3); padding: 2px 12px; border-radius: 12px; }
.lyrics .line.sung { color: var(--ink-2); }
.lyrics .line.now { color: var(--ink); background: var(--plum-t); font-weight: 600; }
.bells { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; margin: auto 0; }
.handbell { display: grid; place-items: center; padding: 10px 0; border-radius: 20px; min-height: 160px; background: var(--card); border: 2px solid var(--line); box-shadow: var(--shadow); }
.bell-art svg { width: 70%; max-width: 90px; display: block; margin: 0 auto; transform-origin: 50% 8%; }
.handbell.swing .bell-art svg { animation: swing 900ms ease-out; }
@keyframes swing { 20% { transform: rotate(16deg); } 45% { transform: rotate(-11deg); } 70% { transform: rotate(6deg); } }
html[data-motion="less"] .handbell.swing .bell-art svg { animation: none; }

/* ---------- Calm Corner ---------- */
.paint { flex: 1; width: 100%; min-height: 320px; border-radius: 22px; border: 1px solid var(--line); background: #FBF6EC; touch-action: none; cursor: crosshair; box-shadow: var(--shadow); }
.calm-tools { width: min(640px, 100%); margin: 0 auto; }
.pond { position: relative; flex: 1; min-height: 320px; border-radius: 26px; overflow: hidden; box-shadow: var(--shadow); touch-action: manipulation; cursor: pointer; }
.pond-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.koi { position: absolute; left: 0; top: 0; transform-origin: 50% 50%; pointer-events: none; filter: drop-shadow(0 6px 6px rgba(20,50,60,.22)); will-change: transform; }
.ripple { position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 3px solid rgba(255,255,255,.8); transform: translate(-50%, -50%); animation: ripple 1.8s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { width: 240px; height: 240px; opacity: 0; border-width: 1px; } }

/* ---------- Setup and family details ---------- */
.acts.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 0; }
.size-choice { flex-direction: column; justify-content: center; text-align: center; min-height: 130px; }
.size-choice .aa { font-family: "Literata"; font-weight: 600; }
.row-add { display: flex; gap: 10px; align-items: center; }
.row-add .in { flex: 1; }
.done-mark { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; }
.done-mark svg { width: 48px; height: 48px; }
.setup .acts { margin-top: 6px; }
.setup .acts:last-child { margin-top: auto; }
.notes-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.notes-top .btn { margin-left: auto; }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.face-head { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.face-head img { width: 96px; height: 96px; border-radius: 18px; object-fit: cover; }
.voicebox { display: flex; gap: 10px; }
.btn.recording { background: #FBECE8; border-color: #EBC2B8; color: #7A2416; }
.share-words { display: grid; grid-template-columns: 1fr 200px; gap: 16px; align-items: center; }
.bcp-links.light a { color: var(--green-2); border-color: var(--line-2); }
label.btn { cursor: pointer; }
.srow .inline { flex: none; }
.choicebig { position: relative; }
.photos .ph.add { cursor: pointer; }
.fam-body .card p { color: var(--ink-2); }
.fam-body .card p.big-q { color: var(--ink); }

/* ---------- Sensory-friendly: calmer and more predictable ---------- */
html[data-sensory="on"] body::before { display: none; }
html[data-sensory="on"] .suggest .art, html[data-sensory="on"] .room .pic img { filter: saturate(.75); }
html[data-sensory="on"] .glow, html[data-sensory="on"] .ready { animation: none !important; }
html[data-sensory="on"] .choice.glow { box-shadow: 0 0 0 6px rgba(45,91,76,.25); }

/* ---------- Narrower screens ---------- */
@media (max-width: 900px) {
  .talk, .faces, .jig, .market, .measure { grid-template-columns: 1fr; }
  .talk-pic { max-height: 44vh; aspect-ratio: 16 / 10; }
  .measure-main { grid-template-columns: 1fr 1fr; }
  .bells { grid-template-columns: repeat(4, 1fr); }
  .market-side { grid-template-columns: 1fr 160px; align-items: start; }
}
@media (max-width: 719px) {
  .choices { grid-template-columns: 1fr !important; }
  .step-choices .choices, .face-side .choices { grid-template-columns: 1fr !important; }
  .choice.withimg { flex-direction: row; min-height: 96px; text-align: left; justify-content: flex-start; }
  .choice.withimg img { width: 64px; }
  .choice.withimg .lab { align-items: flex-start; }
  .slots { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
  .slot { min-height: 96px; } .slot .st { display: none; } .slot img { width: 48px; height: 48px; }
  .spot { grid-template-columns: 1fr; gap: 10px; }
  .pc, .hand .pc { width: 88px; } .pc .s { font-size: 42px; } .pc .r { font-size: 22px; }
  .ghost-card { width: 80px; }
  .dom .half { width: 46px; height: 46px; gap: 3px; padding: 3px; }
  .frame i { width: 40px; height: 40px; }
  .row-3 { grid-template-columns: 1fr; }
  .two-big { grid-template-columns: 1fr; }
  .acts.three { grid-template-columns: repeat(3, 1fr); }
  .size-choice { min-height: 96px; padding: 10px; }
  .share-words { grid-template-columns: 1fr; }
  .market-side { grid-template-columns: 1fr; }
  .measure-main { grid-template-columns: 1fr; }
  .bowl { max-width: 220px; }
  .stanza { font-size: calc(22px * var(--t)); }
  .lyrics .line { font-size: calc(24px * var(--t)); }
  .table-wrap { padding: 18px 12px; } .table { gap: 8px; }
  .bed { aspect-ratio: 16 / 8; }
  .doors .door { min-height: 52px; padding: 0 14px; }
}
/* Folded phones and short landscape screens */
@media (max-height: 560px) and (orientation: landscape) {
  .suggest { grid-template-columns: 1fr 1fr; } .suggest .art { min-height: 0; }
  .choice { min-height: 80px; }
}
@media print {
  body[data-route="family"] .fam-nav, body[data-route="family"] .notes-top .btn, body[data-route="family"] .notes-top .pick { display: none !important; }
  body[data-route="family"] .fam { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
}

.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.tile img { flex: 1 1 0; min-height: 0; width: 100%; height: auto; object-fit: contain; }
/* Games fit the screen: the play area scrolls inside itself instead of pushing buttons off the bottom */
body[data-route="play"] #app { height: 100vh; height: 100dvh; }
body[data-route="play"] main { min-height: 0; }
.screen.play { min-height: 0; }
.stage { overflow: auto; overscroll-behavior: contain; }
.bed { max-height: 30vh; width: 100%; aspect-ratio: auto; height: 30vh; flex: none; }
.paint, .pond { min-height: 220px; }
.sticky-bins { position: sticky; bottom: -1px; background: var(--card); padding-top: 12px; z-index: 2; }
@media (max-width: 719px) {
  body[data-route="play"] .bar .pill.calm .pl { display: none; }
  body[data-route="play"] .bar .pill.calm { padding: 0 14px; }
  .suggest .row-2 { grid-template-columns: 1fr; }
  .on-table .lab { display: none; }
  .on-table { padding: 8px; }
  .pairs { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .bed { height: 17vh; max-height: 17vh; }
  .market-side { grid-template-columns: 1fr 110px; }
  .shoplist { font-size: calc(18px * var(--t)); padding: 12px 14px; }
  .jtray { grid-template-columns: repeat(3, 1fr); }
  .jpiece { min-height: 60px; }
  .tray { grid-template-columns: repeat(3, 1fr); }
  .stall { grid-template-columns: repeat(3, 1fr); }
}
.row-2 > *, .row-3 > * { min-width: 0; }
h1[tabindex="-1"]:focus, .prompt:focus { outline: none; }
@media (max-width: 719px) { body[data-route="play"] .where .sub { display: none; } }
/* What a game engages, and the research behind it */
.skills { display: flex; flex-wrap: wrap; gap: 6px; }
.skills span { font-size: calc(15px * var(--t)); font-weight: 700; color: var(--room, var(--green-2)); background: color-mix(in srgb, var(--room, var(--green)) 10%, #fff); border-radius: 999px; padding: 4px 12px; }
.game .sk { margin-top: 4px; font-size: calc(15px * var(--t)) !important; font-weight: 650; color: var(--c, var(--ink-3)) !important; }
.engaged { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: var(--green-t); color: var(--green-2) !important; font-weight: 650; font-size: calc(18px * var(--t)); }
.engaged svg { width: 20px; height: 20px; flex: none; }
.sheet-sk { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; color: var(--ink) !important; }
.sheet-sub { margin-top: 16px; font-size: calc(15px * var(--t)); font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2) !important; }
.research { display: grid; gap: 10px; margin-top: 8px; }
.rs { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.rs b { display: block; font-size: calc(19px * var(--t)); }
.rs p { font-size: calc(17px * var(--t)); margin-top: 2px; }
.rs .refs { font-size: calc(15px * var(--t)); color: var(--ink-3); }
.rs .refs a { color: var(--green-2); }
.sheet .eyebrow { color: var(--green-2); }
@media (max-width: 719px) { .suggest .skills { display: none; } }
