/* routine game (site/routine.js): daily routines with the bear, sequencing cards, grown-ups' real-life helper */
.rt { background: #FFEFE0 url(img/playroom.webp) center / cover no-repeat; --m: min(60vh, 48vw); --t: min(22vh, 15vw); --c: min(20vw, 27vh); }
@media (orientation: portrait) { .rt { --m: min(84vw, 44vh); --t: min(24vw, 13vh); --c: min(29vw, 20vh); } }

/* day strip (picture schedule) */
.rt-strip { position: absolute; z-index: 12; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; gap: clamp(4px, 1.2vmin, 12px); background: rgba(255,255,255,.72); padding: 6px 10px; border-radius: 999px; }
@media (orientation: portrait) { .rt-strip { top: calc(max(10px, env(safe-area-inset-top)) + 66px); } }
.rt-chip { width: clamp(36px, 7.5vmin, 60px); aspect-ratio: 1; border-radius: 50%; background: #fff; display: grid; place-items: center;
  position: relative; cursor: pointer; box-shadow: 0 .5vmin 0 rgba(0,0,0,.08); transition: transform .25s, box-shadow .25s; }
.rt-chip img { width: 70%; height: 70%; object-fit: contain; }
.rt-chip.cur { transform: scale(1.18); box-shadow: 0 0 0 4px #FF8F6B; }
.rt-chip.got::after { content: "⭐"; position: absolute; right: -6px; top: -8px; font-size: clamp(14px, 3vmin, 22px); }

/* play area: the bear card + a tray of things to use */
.rt-play { position: absolute; z-index: 5; inset: 76px 2vw 62px; display: flex; align-items: center; justify-content: center; gap: 5vmin; }
@media (orientation: portrait) { .rt-play { flex-direction: column; top: 140px; gap: 4vmin; } }
.rt-main { width: var(--m); height: var(--m); flex: none; position: relative; border-radius: 9%; background: #FFF4E0; overflow: hidden;
  box-shadow: 0 1.4vmin 0 rgba(107,74,58,.15); cursor: pointer; touch-action: none; }
.rt-main > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rt-main .emoji { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--m) * .6); }
.rt-over { position: absolute; inset: 0; pointer-events: none; }
.rt-main.rt-hands { background: #E3F6FF; }
.rt-main.rt-hands > img { object-fit: contain; padding: 12%; }
.rt-tray { display: flex; flex-direction: column; flex-wrap: wrap; max-height: 100%; gap: 4vmin; align-items: center; justify-content: center; }
@media (orientation: portrait) { .rt-tray { flex-direction: row; } }
.rt-item { width: var(--t); height: var(--t); flex: none; border-radius: 26%; background: rgba(255,255,255,.88); display: grid; place-items: center;
  cursor: pointer; position: relative; touch-action: none; box-shadow: 0 1vmin 0 rgba(0,0,0,.08);
  transition: transform .35s cubic-bezier(.3,1.4,.5,1), opacity .3s; }
.rt-item > img { width: 76%; height: 76%; object-fit: contain; }
.rt-item.big { width: calc(var(--m) * .62); height: calc(var(--m) * .62); }
.rt-item.rt-off { transform: scale(0); opacity: 0; pointer-events: none; }
.rt-item.held { z-index: 30; transition: none; }
.rt-item.dark > img { filter: grayscale(1) brightness(.6); }
.rt-glow { animation: rtglow 1.4s ease 2; }
@keyframes rtglow { 50% { box-shadow: 0 0 0 1vmin rgba(255,224,138,.95), 0 0 5vmin 2vmin rgba(255,224,138,.85); transform: scale(1.06); } }
.rt-fly { position: fixed; pointer-events: none; z-index: 60; }
.rt-fly img { width: 100%; height: 100%; object-fit: contain; }

/* night (wake up / bedtime) and the sun */
.rt-night { position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: 0; transition: opacity 1.2s ease;
  background: radial-gradient(circle at 75% 15%, #3A4A8A, #141B3D 75%); }
.rt-night.dusk { opacity: .25; }
.rt-night.on { opacity: .72; }
.rt-moon { position: absolute; top: 9%; left: 8%; width: min(16vmin, 120px); opacity: 0; transition: opacity 1s; }
.rt-moon img { width: 100%; }
.rt-stars { position: absolute; inset: 0; opacity: 0; transition: opacity 1.5s;
  background: radial-gradient(circle, #FFF6C2 0 2.5px, transparent 3.5px) 0 0 / 23vmin 19vmin,
    radial-gradient(circle, #fff 0 1.5px, transparent 2.5px) 7vmin 9vmin / 17vmin 23vmin,
    radial-gradient(circle, #FFE9A8 0 2px, transparent 3px) 15vmin 4vmin / 29vmin 13vmin; }
.rt-night.on .rt-moon, .rt-night.on .rt-stars { opacity: 1; }
.rt-sun { position: absolute; z-index: 7; right: 6vw; top: 18vh; width: min(18vmin, 140px); pointer-events: none; opacity: 0; --up: 0;
  transform: translateY(calc((1 - var(--up)) * 30vh)) scale(calc(.6 + var(--up) * .4)); transition: transform 1s cubic-bezier(.3,1.3,.5,1), opacity .6s; }
.rt-sun.show { opacity: 1; }
.rt-sun img { width: 100%; animation: rtspin 12s linear infinite; }
@keyframes rtspin { to { transform: rotate(360deg) } }

/* suds, toothbrush, clothes, blanket */
.rt-sud { position: absolute; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 30%, #EAF7FF 60%, #BFE3FF);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.85), 0 1px 3px rgba(80,120,160,.25); animation: rtsud .25s ease-out; }
@keyframes rtsud { from { transform: scale(0) } }
.rt-brush { position: absolute; left: 74%; top: 70%; width: 34%; aspect-ratio: 1; transform: translate(-78%, -22%); transition: left .06s, top .06s; z-index: 2; }
.rt-brush img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 .6vmin .4vmin rgba(0,0,0,.2)); }
.rt-brush.demo { animation: rtbrush .45s ease-in-out 4; }
@keyframes rtbrush { 0%, 100% { margin-left: 0 } 25% { margin-left: -12% } 75% { margin-left: 6% } }
.rt-wear { position: absolute; pointer-events: none; opacity: 0; transform: scale(.6); transition: opacity .25s, transform .45s cubic-bezier(.3,1.5,.5,1); }
.rt-wear img { width: 100%; display: block; }
.rt-wear.on { opacity: 1; transform: none; }
.rt-wear.shirt { left: 14%; width: 72%; top: 66%; }
.rt-wear.cap { left: 26%; width: 48%; top: -4%; }
.rt-wear.cap.on { transform: rotate(-8deg); }
.rt-wear.teddy { left: 4%; width: 32%; top: 50%; }
.rt-quilt { position: absolute; left: -4%; right: -4%; bottom: -2%; height: 33%; border-radius: 14% 14% 0 0 / 30% 30% 0 0;
  background: radial-gradient(circle, rgba(255,255,255,.55) 0 14%, transparent 16%) 0 0 / 11% 22%, #FF9EB5;
  box-shadow: inset 0 1.6vmin 0 #FFD0DC, 0 -.6vmin 1.4vmin rgba(107,74,58,.2);
  transform: translateY(110%); transition: transform .9s cubic-bezier(.3,1.2,.5,1); }
.rt-quilt.on { transform: none; }

/* toilet: the bear sits behind the seat; the flush swirls */
.rt-toilet { overflow: hidden; }
.rt-toilet > img { position: relative; z-index: 1; }
.rt-sitter { position: absolute; z-index: 0; left: 10%; top: -2%; width: 46%; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  transform: translateY(70%) scale(.4); opacity: 0; transition: transform .45s cubic-bezier(.3,1.5,.5,1), opacity .2s; }
.rt-sitter img { width: 100%; height: 100%; object-fit: cover; }
.rt-sitter.on { transform: none; opacity: 1; }
.rt-swirl { position: absolute; z-index: 2; left: 16%; top: 48%; width: 40%; aspect-ratio: 2.2; border-radius: 50%; opacity: 0; pointer-events: none;
  background: conic-gradient(#7CCBFF, #fff, #A6D8FF, #fff, #7CCBFF); }
.rt-swirl.on { animation: rtswirl 1.4s ease-in-out; }
@keyframes rtswirl { 0% { opacity: 0; transform: rotate(0) scale(.4) } 20% { opacity: .95 } 80% { opacity: .9 } 100% { opacity: 0; transform: rotate(720deg) scale(1) } }

/* eating: a bowl with a spoon */
.rt-bowl > img { width: 80%; height: 80%; }
.rt-spoon { position: absolute; right: 2%; top: 4%; width: 46%; aspect-ratio: 1; transform: rotate(35deg); pointer-events: none; }
.rt-spoon img { width: 100%; height: 100%; object-fit: contain; }
.rt-bite { position: absolute; left: 36%; top: 3%; width: 28%; height: 18%; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px #E5DCCB, 0 0 0 2px #fff; }

/* 3-4 yr: put the cards in order */
.rt-ask { z-index: 12; }
.rt-seq { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5vmin; }
.rt-slots, .rt-pool { display: flex; gap: 2.4vmin; justify-content: center; flex-wrap: wrap; }
@media (orientation: portrait) {
  .rt-ask { top: calc(max(14px, env(safe-area-inset-top)) + 64px); }
  .rt-seq.four { --c: min(40vw, 16.5vh); gap: 3vmin; }
  .rt-seq.four .rt-slots, .rt-seq.four .rt-pool { max-width: calc(var(--c) * 2 + 3vmin); }
}
.rt-slot { width: var(--c); height: var(--c); border-radius: 5vmin; border: .6vmin dashed rgba(107,74,58,.35); background: rgba(255,255,255,.55);
  display: grid; place-items: center; font-size: calc(var(--c) * .34); font-weight: 700; color: rgba(107,74,58,.35); position: relative; }
.rt-card { width: var(--c); height: var(--c); border-radius: 5vmin; overflow: hidden; background: #fff; cursor: pointer; position: relative;
  box-shadow: 0 1.2vmin 0 rgba(107,74,58,.15); touch-action: none; }
.rt-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rt-card.icon img { object-fit: contain; padding: 14%; }
.rt-card .emoji { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--c) * .5); }
.rt-card.in { position: absolute; inset: -.6vmin; width: auto; height: auto; box-shadow: 0 0 0 .6vmin #FFE08A; cursor: default; }

/* grown-ups' real-life helper */
.rt-real { position: absolute; inset: 0; z-index: 30; background: #FFF4E0; display: flex; flex-direction: column; align-items: center;
  padding: max(14px, env(safe-area-inset-top)) 16px 16px; overflow-y: auto; touch-action: pan-y; animation: fadein .3s ease; }
.rt-head { font-weight: 700; font-size: clamp(18px, 3.4vmin, 26px); margin: 8px 0 10px; min-height: 40px; display: flex; align-items: center; }
.rt-tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 14px; }
@media (max-width: 500px) { .rt-tab { padding: 8px 11px; font-size: 14px; } .rt-tabs { gap: 6px; } }
.rt-tab { font: inherit; font-weight: 700; font-size: clamp(14px, 2.6vmin, 19px); border: 0; border-radius: 999px; padding: 10px 16px;
  background: #fff; color: var(--ink); box-shadow: 0 .5vmin 0 rgba(0,0,0,.08); cursor: pointer; }
.rt-tab.on { background: #FF8F6B; color: #fff; }
.rt-body { width: 100%; flex: 1; display: flex; align-items: center; justify-content: center; }
.rt-note { font-size: clamp(13px, 2.2vmin, 16px); line-height: 1.55; color: var(--soft); max-width: 460px; text-align: center; }
.rt-note b { color: #E06F4E; }
.rt-btn2 { font: inherit; font-size: 15px; border: 2px solid #F2CDA8; background: #fff; color: var(--ink); border-radius: 12px; padding: 8px 14px; cursor: pointer; margin-top: 8px; }

/* tooth-brushing timer */
.rt-timer { display: flex; align-items: center; justify-content: center; gap: 5vmin; flex-wrap: wrap; }
.rt-ringwrap { position: relative; }
.rt-ring { position: relative; width: min(54vh, 42vw, 440px); aspect-ratio: 1; }
@media (orientation: portrait) { .rt-ring { width: min(70vw, 40vh); } }
.rt-ringsvg, .rt-ringsvg svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rt-ringsvg svg { transform: rotate(-90deg); }
.rt-ringsvg circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.rt-ringsvg .trk { stroke: #F6DFC4; }
.rt-ringsvg .bar { stroke: #6FCB8A; transition: stroke-dashoffset .3s linear; }
.rt-ringbear { position: absolute; inset: 11%; border-radius: 50%; overflow: hidden; background: #FFF4E0; }
.rt-ringbear > img { width: 100%; height: 100%; object-fit: cover; }
.rt-tbrush { position: absolute; left: 52%; top: 66%; width: 38%; aspect-ratio: 1; transform: translate(-78%, -22%); }
.rt-tbrush img { width: 100%; height: 100%; object-fit: contain; }
.rt-ring.on .rt-tbrush { animation: rtbrushing .5s ease-in-out infinite; }
@keyframes rtbrushing { 0%, 100% { margin-left: -10% } 50% { margin-left: 10% } }
.rt-time { position: absolute; left: 50%; bottom: -4%; transform: translateX(-50%); background: #fff; border-radius: 999px; padding: 2px 18px;
  font-weight: 700; font-size: clamp(24px, 6vmin, 44px); box-shadow: 0 .6vmin 0 rgba(0,0,0,.08); font-variant-numeric: tabular-nums; }
.rt-side { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.rt-quads { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: min(320px, 86vw); }
.rt-q { background: #fff; border-radius: 16px; padding: 6px 8px; display: flex; align-items: center; gap: 8px; font-weight: 700;
  font-size: clamp(13px, 2.2vmin, 16px); transition: background .3s, opacity .3s; position: relative; }
.rt-q img { width: 30px; height: 30px; }
.rt-q.on { background: #FFE08A; box-shadow: 0 0 0 3px #FFC933; }
.rt-q.done { opacity: .55; }
.rt-q.done::after { content: "✓"; position: absolute; right: 10px; color: #4FA866; }
.rt-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.rt-go { font-size: clamp(20px, 4vmin, 32px); padding: 1.6vmin 5vmin; }

/* picture checklist with stickers */
.rt-chartwrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.rt-chart { --ct: min(26vh, 24vw, 190px); display: grid; grid-template-columns: repeat(3, var(--ct)); gap: 2.4vmin; }
@media (orientation: portrait) { .rt-chart { --ct: min(40vw, 21vh); grid-template-columns: repeat(2, var(--ct)); } }
@media (orientation: landscape) and (max-height: 500px) { .rt-chart { --ct: min(30vh, 14vw); grid-template-columns: repeat(6, var(--ct)); } }
.rt-ct { width: var(--ct); aspect-ratio: 1; border-radius: 22%; background: #fff; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4%; cursor: pointer; position: relative; box-shadow: 0 1vmin 0 rgba(0,0,0,.08); font-weight: 700;
  font-size: clamp(12px, calc(var(--ct) * .12), 20px); transition: background .3s; }
.rt-ct img { width: 56%; height: 56%; object-fit: contain; }
.rt-ct.got { background: #FFF6C9; }
.rt-ct.got::after { content: "⭐"; position: absolute; top: -4%; right: -2%; font-size: calc(var(--ct) * .3); animation: rtstamp .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes rtstamp { from { transform: scale(2.4) rotate(-30deg); opacity: 0 } }
