:root {
  color-scheme: light;
  font-family: system-ui, "Noto Sans CJK SC", sans-serif;
  --cream:#fff8e9; --paper:#fffef8; --ink:#193d33; --muted:#4c685d;
  --green:#17664f; --green-dark:#0b4f3b; --mint:#dcedce; --line:#dce6cf;
  --gold:#ffda70; --sky:#def5ef; --peach:#ffebd4; --pink:#fce6e5;
  color:var(--ink); background:var(--cream); -webkit-tap-highlight-color:transparent;
}
*,*::before,*::after { box-sizing:border-box }
body { margin:0; min-width:300px; overscroll-behavior:none }
button,input,textarea { font:inherit }
button { border:0; cursor:pointer; touch-action:manipulation; color:inherit }
button:disabled { cursor:default }
button:focus-visible,input:focus-visible,textarea:focus-visible { outline:3px solid #c77916; outline-offset:3px }
img { display:block; object-fit:contain; pointer-events:none; user-select:none }
h1,h2,h3,p { margin:0 }
h1,h2,h3 { font-weight:900; line-height:1.12 }
strong { font-weight:850 }
small,.small { color:var(--muted); font-size:14px; line-height:1.4 }
#game { min-height:100dvh }
.screen {
  width:100%; min-height:100dvh; padding:24px clamp(22px,4.1vw,54px) 96px;
  display:flex; flex-direction:column; gap:16px; position:relative; isolation:isolate;
}
.screen[data-room="parent"],.screen[data-room="settings"],.screen[data-room="pin"] {
  background:#eff5e9; padding-bottom:28px;
}
.scenery {
  background:#c4eccc url("art/island.png") center/cover no-repeat;
  overflow:hidden; min-height:max(100dvh,450px);
}
.scenery::before { content:""; position:absolute; inset:0; z-index:-1;
  background:linear-gradient(90deg,#f4ffce44 0%,transparent 54%);
}
.top, .heading, .title-line, .actions, .summary, .profile-chip, .stat, .counter, .form-head, .week-nav {
  display:flex; align-items:center; gap:12px;
}
.top { justify-content:space-between; position:relative; z-index:3; min-height:54px }
.heading { align-items:flex-start }
.heading h1 { font-size:clamp(28px,4.2vw,49px); letter-spacing:-.035em }
.heading p { color:var(--muted); margin-top:8px; line-height:1.3; font-size:clamp(14px,1.8vw,18px) }
.title-line { align-items:center }
.heading-actions { margin-left:auto; flex:none }
.heading .stat { white-space:nowrap }
.header-avatar { width:52px; height:52px; border-radius:18px; background:var(--mint); padding:3px }
.profile-chip,.stat,.ghost,.back,.pill {
  min-height:50px; padding:7px 16px; border-radius:18px; background:var(--paper);
  font-weight:780; box-shadow:0 3px 0 #224b2e19;
}
.profile-chip img { width:40px; height:40px; border-radius:14px; background:var(--mint) }
.audio-toggle {
  display:grid; place-items:center; flex:none; width:50px; padding:0;
  background:var(--mint); color:var(--green-dark);
  transition:transform .12s ease, background .12s ease;
}
.audio-toggle:active { transform:translateY(2px) }
.audio-toggle svg { width:25px; height:25px; pointer-events:none }
.audio-toggle[aria-pressed="false"] { background:var(--paper); color:var(--muted) }
.audio-toggle[aria-pressed="true"] .audio-slash { display:none }
.stat img { width:32px; height:32px }
.back { min-width:52px; background:var(--mint); box-shadow:none; font-size:27px; line-height:1 }
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:50px;
  border-radius:17px; background:var(--green); color:#fff; padding:10px 18px; font-weight:850;
  box-shadow:0 4px 0 var(--green-dark); transition:transform .12s ease,box-shadow .12s ease;
}
.btn img { width:28px; height:28px }
.btn:active:not(:disabled) { transform:translateY(3px); box-shadow:none }
.btn.soft { background:var(--mint); color:var(--green-dark); box-shadow:0 3px 0 #bed3ac }
.btn.light { background:var(--paper); color:var(--green-dark); box-shadow:0 3px 0 #142f2521 }
.btn.gold { background:var(--gold); color:#4a330d; box-shadow:0 4px 0 #ce9a28 }
.btn:disabled,.muted-button { background:#e7ecdf; color:#496655; box-shadow:none }
.panel {
  background:var(--paper); border:1px solid var(--line); border-radius:28px;
  padding:20px; box-shadow:0 5px 0 #37502711;
}
.home-copy { z-index:2; width:min(46%,450px); margin:clamp(14px,4.9vh,55px) 0 0; color:var(--ink) }
.home-copy .hello { font-size:clamp(21px,3.4vw,39px); font-weight:850; line-height:1.1; color:#145842 }
.home-copy h1 { font-size:clamp(43px,8.3vw,91px); letter-spacing:-.075em; margin:1px 0 14px; color:#133f2e }
.home-action { width:min(100%,390px); border:2px solid #fffffff0; box-shadow:0 5px 0 #5b8c3c48 }
.home-action h2 { font-size:clamp(19px,2.65vw,29px) }
.home-action p { display:flex; align-items:center; gap:8px; color:#46654f; margin:8px 0 10px }
.home-action p img { width:30px; height:30px }
.home-action .btn { width:100% }
.hero-jason { position:absolute; z-index:1; right:12.2%; bottom:13.7%; width:38%;
  height:75%; object-position:center bottom; filter:drop-shadow(0 12px 8px #1b4a2a4d); }
.paw { position:absolute; right:8%; bottom:16%; z-index:2; width:10%; height:18%; object-position:center bottom }
.profile-card { width:min(43%,430px); z-index:2; margin-top:clamp(12px,5vh,54px);
  text-align:center; padding:22px 20px 18px; }
.profile-card h1 { font-size:clamp(28px,4vw,47px); margin:8px 0 7px }
.profile-card p { color:var(--muted); margin-bottom:10px }
.profile-card .btn { width:100%; margin-top:7px }
.big-avatar { width:112px; height:111px; margin:auto; background:var(--mint); border-radius:35px; padding:6px }
.bottom {
  z-index:4; position:fixed; left:50%; bottom:13px; transform:translateX(-50%);
  display:grid; grid-template-columns:repeat(5,1fr); gap:5px; padding:6px;
  width:min(80%,850px); background:var(--paper); border:1px solid #fffffff0;
  box-shadow:0 5px 0 #1d432f30,0 12px 23px #224b2e19; border-radius:25px;
}
.bottom button { min-height:53px; padding:4px 7px; border-radius:18px; background:transparent;
  font-weight:850; display:flex; align-items:center; justify-content:center; gap:6px; font-size:clamp(13px,1.75vw,19px); }
.bottom img { width:35px; height:35px }
.bottom [aria-current="page"] { background:var(--mint) }
.review-grid,.parent-grid,.two-grid,.reward-grid { display:grid; gap:16px }
.review-grid,.parent-grid { grid-template-columns:1.58fr 1fr }
.two-grid { grid-template-columns:repeat(2,minmax(0,1fr)) }
.reward-grid { grid-template-columns:repeat(3,minmax(0,1fr)) }
.row { min-height:78px; display:flex; gap:14px; align-items:center; padding:10px 0; }
.row + .row,.list-row + .list-row { border-top:1px solid var(--line) }
.row h2,.row h3 { font-size:clamp(18px,2.4vw,25px); margin-bottom:4px }
.row .stamp { padding:7px; flex:none; width:56px; height:56px; border-radius:20px; background:var(--mint) }
.row:nth-child(2) .stamp { background:var(--sky) }
.row:nth-child(3) .stamp { background:var(--peach) }
.row .stamp img { width:100%; height:100% }
.row .points { margin-left:auto; font-weight:850; min-width:53px; white-space:nowrap; justify-content:flex-end }
.row .points img { width:28px; height:28px }
.center { text-align:center }
.highlight { background:var(--mint); }
.highlight .feature-art { margin:0 auto 6px; width:118px; height:106px }
.highlight h2 { font-size:clamp(27px,3.4vw,40px); margin:6px 0 10px }
.highlight .btn { width:100%; margin-top:9px }
blockquote { margin:10px 0 0; padding:11px 13px; background:var(--sky); color:#27534a; border-radius:15px; overflow-wrap:anywhere; }
.jar { text-align:center; background:var(--mint); padding:14px; min-width:0; }
.jar.spend { background:var(--peach) }
.jar h2 { font-size:clamp(21px,3vw,32px) }
.jar .btn { width:100%; margin-top:8px }
.jar-stage { width:100%; height:clamp(95px,18vh,154px); position:relative; margin:4px 0 }
.jar-stage .vessel { margin:auto; width:140px; height:100% }
.jar-stage .wish { position:absolute; left:calc(50% + 55px); bottom:8px; width:55px; height:46px }
.jar-stage .jar-coins { position:absolute; left:50%; bottom:9%; transform:translateX(-50%); display:flex;
  justify-content:center; flex-wrap:wrap-reverse; align-content:flex-end; width:63px; gap:0; max-height:37px; }
.jar-coins img { width:15px; height:15px; margin:-1px }
.jar strong { display:block; font-size:clamp(22px,2.7vw,31px); line-height:1.15 }
.jar .small { margin-top:2px }
.summary { justify-content:space-between; background:var(--paper); border:1px solid var(--line);
  padding:9px 12px; border-radius:18px; flex-wrap:wrap; }
.summary .btn { min-height:48px }
.summary .actions { margin-left:auto; flex-wrap:wrap }
.coin-pile { display:flex; flex-wrap:wrap; gap:3px; align-items:center }
.coin-pile img { width:23px; height:23px }
.card-reward { display:flex; flex-direction:column; gap:6px; min-width:0; padding:13px }
.card-reward .reward-art {
  background:#ede5fa; border-radius:17px; width:100%; height:clamp(93px,16vh,148px); padding:8px;
}
.card-reward:nth-child(2) .reward-art { background:var(--peach) }
.card-reward:nth-child(3) .reward-art { background:var(--mint) }
.card-reward h2 { font-size:clamp(17px,2.4vw,25px); overflow-wrap:anywhere }
.card-reward .action-line { display:flex; justify-content:space-between; align-items:center; gap:5px; margin-top:auto }
.card-reward .action-line img { width:27px; height:27px }
.card-reward .action-line span { display:flex; align-items:center; gap:4px; white-space:nowrap }
.card-reward .btn { min-width:84px; padding-inline:10px }
.sheet { max-width:720px; margin:auto; width:100% }
.list-row { display:flex; align-items:center; gap:14px; justify-content:space-between; min-height:65px; padding:9px 0; overflow-wrap:anywhere }
.list-row > div { min-width:0 }
.list-row img { width:45px; height:43px; flex:none }
.list-row .right { margin-left:auto; text-align:right; flex-shrink:0 }
.empty { text-align:center; padding:18px; color:var(--muted) }
.empty img { margin:0 auto 8px; width:107px; height:115px }
.empty h2 { color:var(--ink); margin-bottom:7px }
.parent-buttons { margin-left:auto; display:flex; gap:8px; flex-wrap:wrap }
.parent-grid .panel { min-width:0 }
.form-head { justify-content:space-between; margin-bottom:8px; flex-wrap:wrap }
.week-nav { gap:6px }
.week-nav button,.counter button { min-width:48px; min-height:48px; font-size:23px; padding:4px }
.counter { margin-left:auto; gap:6px }
.field { display:grid; gap:6px; color:#315346; font-weight:750; margin-block:9px; }
.field input,.field textarea,.counter input {
  width:100%; color:var(--ink); border:1px solid #a9baad; padding:10px;
  background:#fff; border-radius:12px; min-height:48px; appearance:none;
}
.field textarea { min-height:57px; resize:vertical }
.counter input { width:55px; text-align:center; padding:4px; font-size:20px; font-weight:bold }
.form-footer { display:flex; gap:9px; flex-wrap:wrap; margin-top:10px; }
.confirm-grid { display:grid; grid-template-columns:1fr 125px; gap:8px; align-items:center }
.confirm-grid .detail-jason { width:125px; height:164px }
.status-label { padding:5px 10px; background:var(--mint); border-radius:12px; font-weight:750; white-space:nowrap }
dialog {
  border:1px solid var(--line); border-radius:26px; width:min(90vw,480px); padding:20px; color:var(--ink); background:var(--paper);
  box-shadow:0 12px 50px #0a463544; max-height:85dvh; overflow:auto;
}
dialog::backdrop { background:#16402d91 }
dialog h2 { margin-bottom:8px; font-size:27px }
dialog p { margin-bottom:10px; overflow-wrap:anywhere }
dialog img { width:130px; height:122px; margin:0 auto 6px }
dialog .actions { justify-content:flex-end; flex-wrap:wrap }
#message {
  position:fixed; z-index:12; bottom:88px; left:50%; transform:translateX(-50%); color:#fff;
  border-radius:16px; background:#224c3e; padding:11px 18px; pointer-events:none;
  max-width:90vw; font-weight:730; text-align:center;
}
#message:empty { padding:0; background:none }
.celebrate { animation:hop .48s cubic-bezier(.17,.67,.34,1.22) both }
@keyframes hop { 0%{transform:translateY(12px) scale(.88)} 58%{transform:translateY(-14px) scale(1.05)} 100%{transform:none} }
@media(max-height:650px) {
  .screen { padding-top:17px; gap:13px; padding-bottom:83px }
  .screen[data-room="parent"],.screen[data-room="settings"],.screen[data-room="pin"] { padding-bottom:17px }
  .bottom { bottom:8px }
  .row { min-height:66px; padding:7px 0 }
  .panel { padding:16px }
  .card-reward { padding:12px }
  .highlight .feature-art { width:105px; height:88px }
}
@media(max-width:720px) {
  .bottom { width:93% }
  .bottom img { width:27px; height:27px }
  .parent-grid { grid-template-columns:1fr }
  .heading .stat { padding-inline:8px }
  .row { gap:8px }
  .row .stamp { width:44px; height:44px; border-radius:13px }
  .panel { padding:13px }
  .counter input { width:47px }
  .card-reward .action-line { flex-wrap:wrap }
}
@media(max-width:540px) {
  .heading { flex-wrap:wrap }
  .bottom button { flex-direction:column; gap:0 }
  .profile-card { width:55% }
  .profile-card .big-avatar { width:80px; height:80px }
  .review-grid,.reward-grid { grid-template-columns:1fr }
  .home-copy { width:55% }
}
@media(prefers-reduced-motion:reduce) { *,*::after,*::before { animation:none !important; transition:none !important } }
.small-icon { width:46px; height:39px }
.pin-card { max-width:425px }

/* Individually rendered character poses and landscape layers. */
.scenery { background-image:url("art/motion/landscape.webp"); }
.scenery::before { background:linear-gradient(90deg,#f0ffd235,transparent 48%); }
.toy { position:absolute; z-index:2; padding:0; background:transparent; min-width:56px; min-height:56px; border-radius:28px; }
.toy img,.toy canvas { width:100%; height:100%; object-fit:contain; object-position:center bottom; pointer-events:none; }
.toy canvas { display:none; }
.toy.pose-ready canvas { display:block; }
.toy.pose-ready img { display:none; }
.hero-jason { right:29.2%; width:25%; height:57%; bottom:17%; filter:drop-shadow(0 11px 7px #1751324f); }
.buddy { right:6.8%; width:22%; height:41%; bottom:15.2%; filter:drop-shadow(0 7px 5px #174d3852); }
.island-world { width:max(100%,159.78dvh); height:max(100%,62.59vw); position:absolute; left:50%; top:50%;
  transform:translate(-50%,-50%); z-index:1; pointer-events:none; }

.screen.entering > :not(.bottom,.island-world,.toy) {
  animation:page-bounce 325ms cubic-bezier(.19,.63,.30,1) both;
}
@keyframes page-bounce { 0%{opacity:.22;transform:scale(.976) translateY(15px)} 68%{opacity:1;transform:scale(1.011) translateY(-2px)} 100%{opacity:1;transform:none} }
.btn,.bottom button,.day-picker button,.cal-cell { transition:transform 140ms cubic-bezier(.28,.82,.4,1.4),box-shadow 140ms; }
.btn:active:not(:disabled),.bottom button:active,.day-picker button:active:not(:disabled),.cal-cell:active { transform:translateY(3px) scale(.965,.91); }
.tap-burst { position:fixed; pointer-events:none; overflow:visible; z-index:90; left:var(--x); top:var(--y); }
.tap-burst i { position:absolute; width:8px; height:8px; background:#ffd967; border-radius:3px;
  box-shadow:0 1px 0 #bc813b; animation:tap-sprinkle 435ms ease-out both;
  --dx:35px; --dy:0px; }
.tap-burst i:nth-child(2) { --dx:22px; --dy:-23px; background:#7ae6c8; }
.tap-burst i:nth-child(3) { --dx:-22px; --dy:-23px; background:#ffab8c; }
.tap-burst i:nth-child(4) { --dx:-35px; --dy:0px; }
.tap-burst i:nth-child(5) { --dx:-18px; --dy:21px; background:#a8e9ff; }
.tap-burst i:nth-child(6) { --dx:18px; --dy:21px; background:#ffe999; }
.tap-burst.joy i { width:12px; height:12px; animation-name:joy-sprinkle; }
@keyframes tap-sprinkle { 0%{transform:scale(.3);opacity:0} 22%{opacity:1} 100%{transform:translate(var(--dx),var(--dy)) rotate(93deg) scale(.3);opacity:0} }
@keyframes joy-sprinkle { 0%{transform:scale(.3);opacity:0} 19%{opacity:1} 100%{transform:translate(calc(2 * var(--dx)),calc(2 * var(--dy))) rotate(135deg) scale(.33);opacity:0} }
@media (prefers-reduced-motion:reduce) {
  .tap-burst { display:none; }
}

/* Ledger and parent tools */
.cal-toolbar,.segments { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.cal-toolbar { justify-content:space-between; }
.segments .btn { min-width:54px }
.ledger-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.ledger-stats .stat { min-height:48px; justify-content:space-between; gap:5px; padding-inline:12px; }
.ledger-stats strong { font-size:clamp(16px,2.25vw,26px); }
.ledger-stats .stat:nth-child(2) { background:var(--mint); }
.ledger-stats .stat:nth-child(3) { background:var(--peach); }
.ledger-stats .stat:nth-child(4) { background:var(--sky); }
.calendar-grid,.day-picker { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; }
.cal-days { display:grid; grid-template-columns:repeat(7,1fr); grid-column:1/-1; text-align:center; color:var(--muted); font-size:14px; }
.cal-cell,.day-picker button { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:48px; min-width:0; border-radius:13px; padding:3px 2px; background:var(--paper); border:1px solid var(--line); }
.cal-cell strong,.day-picker strong { font-size:18px; }
.cal-cell small,.day-picker small { font-size:11px; white-space:nowrap; max-width:100%; overflow:hidden; text-overflow:ellipsis; }
.cal-cell.other { background:#fff7e5; color:#67796e; }
.cal-cell[aria-current],.day-picker [aria-pressed="true"] { background:var(--gold); border-color:#edba4a; }
.day-picker :disabled { opacity:.52; }
.day-picker { margin-block:9px 4px; }
.score-mode .btn { min-height:48px; }
.ledger-list h2 { font-size:23px; margin-bottom:7px; }
.ledger-out { color:#953e1f; }
.ledger-in { color:#19634d; }
.screen[data-room="reward-admin"] { background:#eff5e9; padding-bottom:28px; }
.editor { align-self:start; }
.field select { color:var(--ink); border:1px solid #a9baad; padding:10px; border-radius:12px; min-height:48px; background:var(--paper); font:inherit; min-width:0; }
@media(max-width:680px) {
  .ledger-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .editor .actions { flex-wrap:wrap; }
  .cal-cell small { font-size:9px; }
}
