:root {
  --sky: #7fd3ff; --sky2: #c9eeff; --sea: #3fa9f5; --ink: #20304a; --soft: #5d6b80; --card: #ffffff; --bg: #eaf7ff;
  --yellow: #ffd23f; --pink: #ff7aa8; --green: #4cc38a; --orange: #ff9f43; --purple: #9b7bff; --red: #ff5a5f;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --r: 22px; --tap: 56px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow-x: hidden; }
body { font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 18px; -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
button, a, input, select { font: inherit; color: inherit; touch-action: manipulation; }
button { cursor: pointer; border: 0; background: none; }
img, svg { max-width: 100%; }
.sb-strip { position: fixed; top: 0; left: 0; right: 0; height: max(6px, calc(var(--safe-t) + 6px)); background: var(--sky); z-index: 40; pointer-events: none; }
.app { display: flex; flex-direction: column; height: 100%; max-width: 100%; overflow: hidden; }
.top { flex: none; display: flex; align-items: center; gap: 8px; padding: calc(var(--safe-t) + 8px) calc(var(--safe-r) + 10px) 8px calc(var(--safe-l) + 10px); background: var(--sky); position: relative; z-index: 41; min-width: 0; }
.brand { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 20px; font-weight: 800; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.18); letter-spacing: .01em; }
.pill { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 999px; background: #fff; font-weight: 800; box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.pill.grown { justify-content: center; padding: 0; width: 44px; position: relative; overflow: hidden; }
.pill.grown .fill { position: absolute; left: 0; bottom: 0; height: 100%; width: 0; background: rgba(255,210,63,.6); }
.view { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 12px calc(var(--safe-r) + 12px) 20px calc(var(--safe-l) + 12px); outline: none; }
.nav { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 6px calc(var(--safe-r) + 8px) calc(var(--safe-b) + 6px) calc(var(--safe-l) + 8px); background: #fff; box-shadow: 0 -2px 12px rgba(0,0,0,.08); z-index: 30; }
.nav-b { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60px; border-radius: 18px; text-decoration: none; font-weight: 800; font-size: 14px; color: var(--soft); }
.nav-b .ni { font-size: 30px; line-height: 1.1; }
.nav-b.on { background: var(--sky2); color: var(--ink); }
.wrap { max-width: 760px; margin: 0 auto; }
h2 { font-size: 24px; margin: 4px 0 12px; }
h3 { font-size: 19px; margin: 16px 0 8px; }
p { line-height: 1.45; }
.muted { color: var(--soft); }
.small { font-size: 15px; }
.card { background: var(--card); border-radius: var(--r); padding: 14px; box-shadow: 0 3px 0 rgba(32,48,74,.08), 0 6px 18px rgba(32,48,74,.06); margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); gap: 12px; }
.grid.g3 { grid-template-columns: repeat(auto-fill, minmax(min(96px, 100%), 1fr)); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 20px; border-radius: 999px; background: var(--yellow); font-weight: 800; font-size: 20px; box-shadow: 0 4px 0 rgba(0,0,0,.15); text-decoration: none; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.15); }
.btn.blue { background: var(--sea); color: #fff; } .btn.green { background: var(--green); color: #fff; } .btn.pink { background: var(--pink); color: #fff; } .btn.white { background: #fff; }
.btn.big { min-height: 72px; font-size: 24px; padding: 0 28px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; }
.say { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: #fff; font-size: 26px; box-shadow: 0 3px 0 rgba(0,0,0,.12); flex: none; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 120px; padding: 12px 8px; border-radius: var(--r); background: #fff; text-decoration: none; font-weight: 800; text-align: center; box-shadow: 0 4px 0 rgba(0,0,0,.08); }
.tile .ti { font-size: 46px; line-height: 1; }
.tile .tt { font-size: 17px; }
.tile .ts { font-size: 13px; color: var(--soft); font-weight: 700; }
/* pet */
.room { position: relative; border-radius: 28px; background: linear-gradient(#bfe9ff 0 58%, #ffe6a8 58% 100%); padding: 10px 10px 14px; overflow: hidden; }
.room .win { position: absolute; top: 14px; left: 14px; width: 72px; height: 58px; border-radius: 12px; background: #e6f8ff; border: 5px solid #fff; }
.room .win::after { content: "☁️"; position: absolute; left: 10px; top: 6px; font-size: 26px; }
.petname { text-align: center; font-size: 26px; font-weight: 900; margin: 2px 0 0; }
.catbox { position: relative; width: min(74vw, 330px); margin: 0 auto; cursor: pointer; }
.catbox .cat-svg { display: block; width: 100%; height: auto; overflow: visible; }
.catbox.bounce { animation: bounce .6s; } .catbox.wiggle { animation: wiggle .7s; } .catbox.jump { animation: jump .8s; }
.cat-tail { transform-origin: 215px 290px; animation: tail 2.4s ease-in-out infinite; }
@keyframes tail { 0%,100% { transform: rotate(0deg); } 50% { transform: rotate(-8deg); } }
@keyframes bounce { 0%,100% { transform: translateY(0); } 30% { transform: translateY(-18px); } 60% { transform: translateY(0); } 80% { transform: translateY(-6px); } }
@keyframes wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
@keyframes jump { 0%,100% { transform: translateY(0) scale(1); } 20% { transform: translateY(6px) scale(1.05,.92); } 50% { transform: translateY(-50px); } }
.bubble { position: absolute; top: 4px; right: 4px; max-width: 46%; background: #fff; border-radius: 18px; padding: 8px 12px; font-weight: 800; font-size: 17px; box-shadow: 0 3px 0 rgba(0,0,0,.1); }
.meters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.meter { background: #fff; border-radius: 16px; padding: 6px 6px 8px; text-align: center; font-size: 24px; box-shadow: 0 3px 0 rgba(0,0,0,.08); }
.meter .bar { height: 10px; border-radius: 6px; background: #eef1f5; overflow: hidden; margin-top: 4px; }
.meter .bar i { display: block; height: 100%; border-radius: 6px; background: var(--green); transition: width .6s; }
.meter.low .bar i { background: var(--red); } .meter.mid .bar i { background: var(--orange); }
.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.act { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 84px; min-width: 0; padding: 4px; text-align: center; line-height: 1.15; overflow-wrap: anywhere; border-radius: 22px; background: #fff; font-weight: 800; font-size: 16px; box-shadow: 0 4px 0 rgba(0,0,0,.1); }
.act .ai { font-size: 36px; line-height: 1.1; }
.tray { display: flex; gap: 10px; overflow-x: auto; padding: 8px 2px 10px; }
.tray .food { flex: none; width: 84px; min-height: 92px; border-radius: 18px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 34px; box-shadow: 0 3px 0 rgba(0,0,0,.1); }
.tray .food small { font-size: 14px; font-weight: 800; }
.fx { position: absolute; pointer-events: none; font-size: 34px; animation: floatup 1.4s forwards; }
@keyframes floatup { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-120px) scale(1.4); } }
.room.dark { background: linear-gradient(#22315a 0 58%, #4a4060 58% 100%); transition: background .6s; }
/* customize */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.tabs button { flex: none; min-height: 48px; padding: 0 14px; border-radius: 999px; background: #fff; font-weight: 800; }
.tabs button.on { background: var(--sea); color: #fff; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: 64px; height: 64px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 3px 0 rgba(0,0,0,.12); position: relative; font-size: 28px; display: flex; align-items: center; justify-content: center; background: #fff; }
.sw.on { border-color: var(--sea); }
.sw .price { position: absolute; bottom: -8px; right: -6px; background: var(--yellow); border-radius: 999px; font-size: 12px; font-weight: 900; padding: 1px 6px; }
.namepick { display: flex; flex-wrap: wrap; gap: 8px; }
.namepick button { min-height: 48px; padding: 0 14px; border-radius: 999px; background: #fff; font-weight: 800; }
/* map */
.sea { position: relative; width: min(100%, max(300px, calc((100vh - 230px) * .75))); aspect-ratio: 3 / 4; margin: 0 auto; container-type: inline-size; border-radius: 28px; overflow: hidden; background: radial-gradient(circle at 30% 20%, #8fdcff, #3fa9f5 70%); }
@media (min-aspect-ratio: 1/1) { .sea { aspect-ratio: 4 / 3; width: min(100%, max(320px, calc((100vh - 230px) * 1.3333))); } .isle { width: 20%; } }
.sea .wave { position: absolute; font-size: 22px; opacity: .55; }
.isle { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; justify-content: center; top: calc(12% + var(--y, 50) * .76%); width: 27%; max-width: 160px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 40%, #fff3c4, #ffd77a 62%, #69c46a 63%); box-shadow: 0 6px 0 rgba(0,0,0,.12); font-weight: 900; font-size: 13px; text-align: center; line-height: 1.1; padding: 6px; }
.isle .ii { font-size: 34px; font-size: clamp(18px, 6.5cqw, 34px); line-height: 1.1; }
.isle { font-size: clamp(10px, 2.4cqw, 14px); }
.isle.home { background: radial-gradient(circle at 50% 40%, #ffffff, #dfe8f2 62%, #9fb3c8 63%); }
.jetfly { position: absolute; width: 22%; max-width: 130px; left: 50%; top: calc(12% + var(--y, 50) * .76%); transform: translate(-50%, -50%); transition: left 1.1s ease-in-out, top 1.1s ease-in-out; pointer-events: none; z-index: 3; }
.jetfly.flip svg { transform: scaleX(-1); }
/* today */
.dayhead { display: flex; align-items: center; gap: 10px; }
.dayhead .theme { font-size: 40px; }
.daynav { display: flex; gap: 6px; margin-left: auto; }
.daynav button { width: 48px; height: 48px; border-radius: 50%; background: #fff; font-size: 22px; font-weight: 900; box-shadow: 0 3px 0 rgba(0,0,0,.1); }
.verse { background: linear-gradient(135deg, #fff7d6, #ffe9f2); }
.verse .ref { font-weight: 900; }
.blocks { display: grid; gap: 10px; }
.blk { display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 10px 12px; border-radius: 22px; background: #fff; text-decoration: none; box-shadow: 0 3px 0 rgba(0,0,0,.08); }
.blk .bi { font-size: 38px; width: 50px; text-align: center; flex: none; }
.blk .bt { flex: 1 1 auto; min-width: 0; font-weight: 800; }
.blk .bt small { display: block; font-weight: 700; color: var(--soft); font-size: 14px; }
.blk .bk { flex: none; font-size: 30px; }
.blk.done { background: #e6f9ef; }
.blk.done .bk::after { content: "✅"; }
.tag { display: inline-block; font-size: 12px; font-weight: 900; border-radius: 999px; padding: 2px 8px; margin-right: 4px; }
.tag.app { background: #e3f2ff; color: #1565c0; } .tag.off { background: #fff1d6; color: #9a5b00; }
.sum { display: flex; gap: 8px; flex-wrap: wrap; font-weight: 800; font-size: 15px; }
.sum { gap: 6px; } .sum span { background: #fff; border-radius: 999px; padding: 6px 10px; font-size: 14px; }
/* lesson */
.qwrap { text-align: center; }
.prompt { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 24px; font-weight: 900; min-height: 56px; }
.show { font-size: 64px; line-height: 1.15; margin: 10px 0; word-break: break-word; }
.show.things { font-size: 44px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 520px; margin: 10px auto; }
.show.things.many { font-size: 30px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(96px, 100%), 1fr)); gap: 12px; max-width: 560px; margin: 14px auto 0; }
.choice { min-height: 110px; border-radius: 26px; background: #fff; font-size: 52px; font-weight: 900; box-shadow: 0 5px 0 rgba(0,0,0,.12); display: flex; align-items: center; justify-content: center; padding: 8px; }
.choice.word { font-size: 34px; }
.choice svg { width: 76px; height: 76px; }
.choice.ok { background: #c9f6dc; animation: bounce .5s; } .choice.no { background: #ffe0e0; animation: wiggle .4s; }
.progress { display: flex; gap: 6px; justify-content: center; margin: 4px 0 10px; }
.progress i { width: 14px; height: 14px; border-radius: 50%; background: #d7e3ef; } .progress i.on { background: var(--yellow); } .progress i.cur { background: var(--sea); }
.minicat { width: 120px; margin: 0 auto; } .minicat .cat-svg { width: 100%; height: auto; }
/* words */
.words { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; font-size: 40px; font-weight: 900; }
.word-b { min-height: 64px; padding: 4px 16px; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.1); }
.word-b.hl { background: var(--yellow); }
.sounds { display: flex; gap: 6px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
.snd { min-width: 64px; min-height: 64px; border-radius: 16px; font-size: 38px; font-weight: 900; color: #fff; display: flex; align-items: center; justify-content: center; padding: 0 10px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 16px; border-radius: 999px; background: #fff; font-weight: 800; box-shadow: 0 3px 0 rgba(0,0,0,.1); }
.toggle.on { background: var(--purple); color: #fff; }
/* piano */
.piano { display: flex; gap: 2px; height: 210px; max-width: 640px; margin: 10px auto; user-select: none; -webkit-user-select: none; }
.key { flex: 1 1 0; min-width: 0; border-radius: 0 0 16px 16px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 10px; font-weight: 900; font-size: 22px; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.3); box-shadow: inset 0 -8px 0 rgba(0,0,0,.18); }
.key.down, .key.lit { filter: brightness(1.25); transform: translateY(3px); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.key.lit { outline: 5px solid #fff; outline-offset: -8px; }
.tune-notes { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; font-weight: 900; font-size: 22px; }
.tune-notes span { min-width: 34px; padding: 4px 6px; border-radius: 10px; color: #fff; }
.tune-notes span.now { outline: 4px solid var(--ink); }
.tune-notes span.past { opacity: .35; }
/* draw / color / origami */
.drawbox, .colorbox, .oribox { max-width: 440px; margin: 0 auto; background: #fff; border-radius: 24px; padding: 8px; box-shadow: 0 3px 0 rgba(0,0,0,.08); }
.draw-svg, .color-svg, .ori-svg { display: block; width: 100%; height: auto; }
.draw-new { animation: pulse 1s 2; }
@keyframes pulse { 50% { opacity: .35; } }
.palette { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0; }
.palette button { width: 48px; height: 48px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.palette button.on { border-color: var(--ink); transform: scale(1.12); }
canvas.paint { display: block; width: 100%; max-width: 440px; aspect-ratio: 1; margin: 0 auto; background: #fff; border-radius: 24px; touch-action: none; box-shadow: 0 3px 0 rgba(0,0,0,.08); }
.steps-nav { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 12px; }
.stepno { font-weight: 900; min-width: 60px; text-align: center; }
/* off-screen */
.off-hero { text-align: center; }
.off-hero .oi { font-size: 84px; line-height: 1.1; }
.badge-off { display: inline-block; background: #fff1d6; color: #9a5b00; font-weight: 900; border-radius: 999px; padding: 6px 14px; margin: 6px 0; }
ol.steps { padding-left: 24px; } ol.steps li { margin: 6px 0; line-height: 1.4; }
.adult { background: #fff4f4; border-radius: 16px; padding: 10px 12px; font-size: 16px; }
/* games */
.gamearea { position: relative; height: min(62vh, 520px); border-radius: 26px; overflow: hidden; background: linear-gradient(#bfe9ff, #e9f8ff); touch-action: manipulation; }
.balloon { position: absolute; bottom: -120px; width: 84px; height: 104px; border-radius: 50% 50% 46% 46%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 44px; font-weight: 900; animation: rise linear forwards; box-shadow: inset -8px -10px 0 rgba(0,0,0,.12); }
.balloon::after { content: ""; position: absolute; bottom: -24px; left: 50%; width: 2px; height: 24px; background: #8899aa; }
@keyframes rise { to { transform: translateY(calc(-1 * min(62vh, 520px) - 140px)); } }
.bowl { font-size: 70px; text-align: center; }
.fishpile { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.fishpile button { width: 64px; height: 64px; font-size: 40px; border-radius: 18px; background: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.1); }
.bins { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(90px, 100%), 1fr)); gap: 10px; }
.bin { min-height: 110px; border-radius: 24px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 900; color: #fff; }
/* grown-ups */
.gate { text-align: center; }
.holdbtn { width: 160px; height: 160px; border-radius: 50%; background: var(--yellow); font-size: 22px; font-weight: 900; position: relative; overflow: hidden; box-shadow: 0 6px 0 rgba(0,0,0,.15); }
.holdbtn .fill { position: absolute; left: 0; bottom: 0; width: 100%; height: 0; background: rgba(76,195,138,.55); }
.holdbtn span { position: relative; }
.prog { margin: 6px 0; }
.prog .pb { height: 12px; background: #eef1f5; border-radius: 6px; overflow: hidden; } .prog .pb i { display: block; height: 100%; background: var(--green); }
.set { display: flex; flex-wrap: wrap; gap: 8px; }
.set button { min-height: 48px; padding: 0 14px; border-radius: 999px; background: #eef4fb; font-weight: 800; }
.set button.on { background: var(--sea); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; background: #eef8f1; border-radius: 999px; padding: 4px 12px; font-weight: 800; }
.chip.learn { background: #fff4dc; }
textarea, input[type=text], input[type=date], select { width: 100%; min-height: 48px; border-radius: 14px; border: 2px solid #d6e2ee; padding: 8px 12px; background: #fff; font-size: 17px; }
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(20,30,50,.45); display: flex; align-items: center; justify-content: center; padding: max(20px, var(--safe-t)) max(20px, var(--safe-r)) max(20px, var(--safe-b)) max(20px, var(--safe-l)); }
[hidden] { display: none !important; }
.overlay .pop { background: #fff; border-radius: 28px; padding: 20px; max-width: 420px; width: 100%; text-align: center; max-height: 90vh; overflow-y: auto; }
.confetti { position: fixed; top: -40px; font-size: 30px; z-index: 70; pointer-events: none; animation: fall 2.2s linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 92px); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 16px; font-weight: 700; max-width: 88vw; opacity: 0; transition: opacity .3s; z-index: 80; pointer-events: none; text-align: center; }
.toast.on { opacity: 1; }
:focus-visible { outline: 4px solid #1565c0; outline-offset: 2px; }
@media (max-width: 400px) { .piano { margin-left: -6px; margin-right: -6px; } }
@media (max-width: 379px) { .piano.k8 { flex-wrap: wrap; height: auto; gap: 6px; } .piano.k8 .key { flex: 1 1 22%; height: 120px; border-radius: 16px; } }
@media (max-width: 360px) { body { font-size: 17px; } .brand { font-size: 17px; } .pill { padding: 0 9px; } .choice { min-height: 96px; font-size: 44px; } .act { min-height: 76px; } .nav-b .ni { font-size: 26px; } }
@media (min-width: 700px) { .catbox { width: min(330px, 100%); } .petwrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; } .petwrap > * { min-width: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.wtap { display: inline-block; min-height: 44px; min-width: 44px; padding: 4px 4px; border-radius: 10px; font-weight: 700; line-height: 1.5; }
.verse-words { font-size: 22px; line-height: 1.2; }

/* v2 layout guards: nothing wider than the screen, every row may shrink or wrap */
.wrap { max-width: min(760px, 100%); }
.card, .room, .tile, .blk, .btn, .row > * { min-width: 0; max-width: 100%; }
.btn { flex-wrap: wrap; text-align: center; }
.view > * { max-width: 100%; }

/* freeze dance with YouTube songs */
.spick { display: flex; flex-direction: column; gap: 12px; }
.spick .surprise { align-self: center; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; min-width: 0; }
.songbtn { display: block; border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.12); min-height: 60px; min-width: 0; }
.songbtn:active { transform: translateY(2px); }
.sthumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--pink), var(--purple)); overflow: hidden; }
.sthumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sthumb .sti { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 44px; }
.sthumb .stb { position: absolute; right: 6px; bottom: 6px; background: rgba(255,255,255,.9); border-radius: 10px; padding: 0 6px; font-size: 18px; }
.sthumb.sm { width: 96px; flex: none; border-radius: 12px; }
.sthumb.big { width: min(78vw, 420px, 62vh); border-radius: 22px; box-shadow: 0 6px 0 rgba(0,0,0,.15); }
.fzw { max-width: 820px; }
.fzstage { position: relative; display: grid; min-height: min(70vh, 620px); border-radius: 28px; overflow: hidden; background: #2b2d6e; isolation: isolate; }
.fzstage > * { grid-area: 1 / 1; min-width: 0; }
.fzlayer { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; text-align: center; }
.fzlayer[hidden], .fztap[hidden] { display: none; }
.fzready { background: linear-gradient(160deg, #7fd3ff, #c9b8ff); }
.fzvid { position: relative; z-index: 0; overflow: hidden; background: #000; }
.fzvid iframe, .fzhost { display: block; width: 100%; height: 100%; border: 0; }
.fzhost { position: absolute; inset: 0; }
.fzshield { position: absolute; inset: 0; z-index: 2; }
.fzstage[data-mode="small"][data-phase="dance"] .fzvid { z-index: 3; align-self: end; justify-self: end; width: min(42%, 260px); aspect-ratio: 16 / 9; margin: 0 12px 84px 0; border-radius: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.fzstage[data-phase="tap"] .fzvid { z-index: 5; }
.fzstage[data-phase="tap"] .fzshield { display: none; }
.fztap { z-index: 6; align-self: start; justify-self: center; margin-top: 10px; padding: 10px 16px; border-radius: 999px; background: #fff; font-weight: 900; pointer-events: none; box-shadow: 0 4px 0 rgba(0,0,0,.15); max-width: calc(100% - 20px); }
.fzhand { display: inline-block; animation: bounce 1s infinite; }
.fzdance { background: linear-gradient(135deg, #ff7aa8, #ffb86b, #ffd23f, #4cc38a, #3fa9f5, #9b7bff); background-size: 400% 400%; animation: fzbg 6s ease infinite; }
@keyframes fzbg { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.fzcat { width: min(62vw, 300px, 46vh); }
.fzcat svg { display: block; width: 100%; height: auto; overflow: visible; }
.fzcat.dancing { animation: fzdance .9s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes fzdance { 0%,100% { transform: rotate(-9deg) translateY(0); } 25% { transform: rotate(0deg) translateY(-16px); } 50% { transform: rotate(9deg) translateY(0); } 75% { transform: rotate(0deg) translateY(-10px) scale(1.04); } }
.fznotes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fznotes span { position: absolute; font-size: 40px; animation: fznote 2.6s linear infinite; }
.fznotes span:nth-child(1) { left: 8%; animation-delay: 0s; } .fznotes span:nth-child(2) { left: 30%; animation-delay: .7s; } .fznotes span:nth-child(3) { left: 62%; animation-delay: 1.3s; } .fznotes span:nth-child(4) { left: 84%; animation-delay: 1.9s; }
@keyframes fznote { 0% { top: 100%; opacity: 0; transform: rotate(0); } 15% { opacity: 1; } 100% { top: -10%; opacity: 0; transform: rotate(40deg); } }
.fzbar { position: relative; width: min(86%, 520px); height: 14px; border-radius: 999px; background: rgba(255,255,255,.5); }
.fzbar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px; background: #fff; }
.fzbar span { position: absolute; top: -14px; left: -18px; font-size: 30px; transition: left .25s linear; }
.fzfreeze { background: radial-gradient(circle at 50% 40%, #e8fbff, #9fdcff 60%, #5ab4f0); }
.fzbig { font-size: clamp(48px, 13vw, 110px); font-weight: 900; color: #fff; text-shadow: 0 4px 0 #2b7bd6, 0 0 24px #bff2ff; letter-spacing: .02em; animation: fzpop .35s ease-out; line-height: 1; }
@keyframes fzpop { 0% { transform: scale(.4); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
.fzcat.frozen { filter: saturate(.55) hue-rotate(160deg) brightness(1.08) drop-shadow(0 0 10px #e0f7ff); border: 6px solid rgba(255,255,255,.85); border-radius: 30px; background: rgba(224,247,255,.55); padding: 8px; width: min(52vw, 250px, 40vh); }
.fzsnow { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fzsnow span { position: absolute; top: -10%; font-size: 30px; animation: fzsnow 3s linear infinite; }
.fzsnow span:nth-child(1) { left: 6%; } .fzsnow span:nth-child(2) { left: 26%; animation-delay: .6s; } .fzsnow span:nth-child(3) { left: 50%; animation-delay: 1.2s; } .fzsnow span:nth-child(4) { left: 72%; animation-delay: .3s; } .fzsnow span:nth-child(5) { left: 90%; animation-delay: 1.6s; }
@keyframes fzsnow { to { top: 105%; transform: rotate(180deg); } }
.fzerr { background: linear-gradient(160deg, #fff4d6, #ffd9e6); }
.fzsad { font-size: 90px; line-height: 1; }
.fzmsg { font-size: 24px; font-weight: 900; margin: 0; }
@media (max-height: 520px) and (orientation: landscape) {
  .fzstage { min-height: calc(100vh - 150px); }
  .fzready { flex-direction: row; flex-wrap: wrap; }
  .sthumb.big { width: min(44vw, 340px); }
  .fzcat { width: min(30vw, 40vh, 200px); }
  .fzcat.frozen { width: min(26vw, 34vh, 170px); }
  .fzbig { font-size: clamp(40px, 9vw, 80px); }
}
.sadd { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.sadd input { flex: 1 1 200px; min-width: 0; max-width: 100%; min-height: 52px; padding: 0 14px; border-radius: 14px; border: 2px solid #cfe3f5; font-size: 17px; background: #fff; }
.slist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sitem { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; background: #f4f9ff; min-width: 0; }
.sitem.bad { background: #fff3e0; }
.sinfo { flex: 1 1 140px; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.stitle { font-size: 16px; line-height: 1.25; }
.swarn { font-size: 14px; color: #8a4b00; }
.sbtns { display: flex; gap: 6px; flex: none; margin-left: auto; }
.sb { width: 48px; height: 48px; border-radius: 14px; background: #fff; font-size: 22px; box-shadow: 0 2px 0 rgba(0,0,0,.1); }
.sb[disabled] { opacity: .35; }
.linkbtn { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 8px; border-radius: 10px; background: #fff; font-weight: 800; text-decoration: underline; }
#songMsg.err { color: #b3261e; font-weight: 700; } #songMsg.ok { color: #1b7a4b; font-weight: 700; }

/* pet care mini-games */
.carew { max-width: 820px; }
.crow { flex-wrap: nowrap; margin-bottom: 8px; }
.csteps { flex: 1 1 auto; min-width: 0; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.cstep { font-size: 26px; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #fff; opacity: .45; filter: grayscale(1); box-shadow: 0 2px 0 rgba(0,0,0,.1); }
.cstep.now { opacity: 1; filter: none; transform: scale(1.12); background: var(--yellow); }
.cstep.done { opacity: 1; filter: none; background: var(--green); }
.cstage { position: relative; height: min(68vh, 600px); min-height: 300px; border-radius: 28px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; background: linear-gradient(#cdefff 0 62%, #b6e3c6 62% 100%); }
.cstage[data-kind="bath"] { background: linear-gradient(#e3f6ff 0 60%, #9fd9f5 60% 100%); background-image: linear-gradient(#e3f6ff 0 60%, #9fd9f5 60% 100%), repeating-linear-gradient(90deg, transparent 0 46px, rgba(255,255,255,.6) 46px 50px); }
.ccat { position: absolute; left: 50%; bottom: 8%; width: min(54%, 46vh, 300px); transform: translateX(-50%); }
.ccat svg { display: block; width: 100%; height: auto; overflow: visible; pointer-events: none; }
.ccat.inbath { bottom: 15%; width: min(64%, 46vh, 330px); }
.tub { position: absolute; left: 8%; right: 8%; bottom: 4%; height: 24%; border-radius: 20px 20px 80px 80px; background: #fff; box-shadow: inset 0 -10px 0 #d6eefa; }
.tubfront { position: absolute; left: 8%; right: 8%; bottom: 4%; height: 14%; border-radius: 0 0 80px 80px; background: linear-gradient(#ffffff, #e6f5fd); border-top: 8px solid #c9e8f8; z-index: 3; pointer-events: none; }
.mudlayer { position: absolute; inset: 0; pointer-events: none; }
.mud { position: absolute; width: 22%; aspect-ratio: 1.3; margin: -8% 0 0 -11%; border-radius: 48% 52% 45% 55%; background: radial-gradient(circle at 40% 40%, #8d6e4a, #6b4a2b 70%); transition: opacity .2s; }
.suds { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 18%, rgba(255,255,255,.9) 30%, rgba(214,240,255,.85) 70%, rgba(170,220,255,.6)); box-shadow: 0 0 0 2px rgba(255,255,255,.7); transform: scale(var(--s, 1)); z-index: 4; pointer-events: none; animation: sudsin .25s ease-out; transition: opacity .3s, transform .3s; }
.suds.gone { opacity: 0; transform: scale(1.6); }
@keyframes sudsin { from { transform: scale(.2); } }
.drop { position: absolute; font-size: 26px; z-index: 5; pointer-events: none; animation: drop .7s ease-in forwards; }
@keyframes drop { to { transform: translateY(80px); opacity: 0; } }
.wet { position: absolute; font-size: 22px; pointer-events: none; transition: opacity .3s, transform .3s; }
.wet.gone { opacity: 0; transform: translateY(16px); }
.ccat.sparkle::after { content: "✨"; position: absolute; right: 4%; top: 6%; font-size: 48px; animation: bounce 1s infinite; }
.tool { position: absolute; z-index: 6; width: 76px; height: 76px; display: flex; align-items: center; justify-content: center; font-size: 56px; line-height: 1; border-radius: 22px; background: rgba(255,255,255,.85); box-shadow: 0 4px 0 rgba(0,0,0,.15); cursor: grab; touch-action: none; left: 12px; top: 12px; }
.tool[hidden] { display: none; }
.tool.held { transform: scale(1.12); box-shadow: 0 10px 18px rgba(0,0,0,.25); cursor: grabbing; }
.towel { background: repeating-linear-gradient(90deg, #ff7aa8 0 14px, #fff 14px 22px, #9b7bff 22px 36px, #fff 36px 44px); border-radius: 18px; }
.food.tool { top: auto; bottom: 10px; flex-direction: column; font-size: 44px; width: 80px; height: 84px; }
.food.tool[data-cfood="fish"] { left: calc(50% - 136px); } .food.tool[data-cfood="milk"] { left: calc(50% - 40px); } .food.tool[data-cfood="kibble"] { left: calc(50% + 56px); }
.food.tool small { font-size: 13px; font-weight: 800; }
.food.tool.near { box-shadow: 0 0 0 6px var(--yellow); }
.ccat.eating { bottom: 104px; width: min(46%, 36vh, 260px); }
.mouth { position: absolute; left: 50%; bottom: calc(104px + min(46%, 36vh, 260px) * 0.62); width: min(20%, 16vh, 110px); aspect-ratio: 1.4; transform: translate(-50%, 50%); border-radius: 50%; border: 4px dashed rgba(255,122,168,.0); pointer-events: none; }
.ccat.chomp { animation: chomp .6s; }
@keyframes chomp { 0%,100% { transform: translateX(-50%) scale(1); } 25% { transform: translateX(-50%) scale(1.08, .94); } 50% { transform: translateX(-50%) scale(.96, 1.05); } 75% { transform: translateX(-50%) scale(1.05, .97); } }
.tummy { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); width: min(60%, 320px); height: 18px; border-radius: 999px; background: rgba(255,255,255,.7); box-shadow: inset 0 0 0 2px rgba(0,0,0,.08); }
.tummy::before { content: "🍗"; position: absolute; left: -34px; top: -8px; font-size: 26px; }
.tummy i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--orange); transition: width .5s; }
.floor { position: absolute; left: 0; right: 0; bottom: 0; height: 34%; background: repeating-linear-gradient(90deg, #f3d39b 0 60px, #e8c27f 60px 64px); }
.ccat.player { left: 8%; transform: none; transition: left .55s ease-in-out; width: min(40%, 40vh, 240px); }
.ccat.player.run { animation: wiggle .5s; }
.ccat.player.pounce { animation: pounce .6s; }
@keyframes pounce { 0% { transform: translateY(0); } 40% { transform: translateY(-34%) rotate(calc(var(--look, 1) * 8deg)); } 100% { transform: translateY(0); } }
.yarn { left: auto; right: 14px; top: 14px; background: rgba(255,255,255,.6); border-radius: 50%; }
.yarn.roll { transition: left .6s cubic-bezier(.2,.8,.3,1), top .6s cubic-bezier(.5,0,.8,1); animation: spin .6s linear; }
@keyframes spin { to { transform: rotate(720deg); } }
.cstage[data-kind="sleep"] { background: linear-gradient(#3b4b8f 0 58%, #c79a6c 58% 100%); }
.nightsky { position: absolute; inset: 0 0 50% 0; }
.star { position: absolute; width: 48px; height: 48px; font-size: 30px; filter: grayscale(1) brightness(.7); opacity: .6; border-radius: 50%; }
.star.lit { filter: drop-shadow(0 0 10px #fff3a0); opacity: 1; animation: bounce .6s; }
.bed { position: absolute; left: 14%; right: 14%; bottom: 6%; height: 22%; border-radius: 30px 30px 14px 14px; background: linear-gradient(#ffffff 0 30%, #7fb4ff 30%); }
.ccat.sleeper { bottom: 14%; width: min(44%, 40vh, 250px); }
.lamp { position: absolute; right: 12px; bottom: 30%; width: 72px; height: 72px; font-size: 46px; border-radius: 50%; background: #fff7c2; box-shadow: 0 0 30px 10px rgba(255,240,150,.8); z-index: 6; }
.blanket { left: 12px; top: auto; bottom: 30%; width: 96px; height: 70px; border-radius: 18px; background: repeating-linear-gradient(45deg, #ffd23f 0 12px, #ff9f43 12px 24px); border: 4px solid #fff; }
.blanket.on { left: 50% !important; top: auto !important; bottom: 12%; width: min(52%, 280px); height: 26%; transform: translateX(-50%); border-radius: 26px 26px 14px 14px; pointer-events: none; z-index: 5; }
.dim { position: absolute; inset: 0; background: rgba(10,14,40,.0); pointer-events: none; transition: background .6s; z-index: 4; }
.cstage.dark .dim { background: rgba(10,14,40,.55); }
.cstage.dark .lamp { background: #555a70; box-shadow: none; }
.cstage.dark .star { z-index: 7; }
.zzz { position: absolute; left: 58%; top: 34%; z-index: 8; font-weight: 900; color: #fff; font-size: 40px; pointer-events: none; }
.zzz span { position: absolute; animation: zz 2.4s ease-out infinite; } .zzz span:nth-child(2) { animation-delay: .6s; left: 22px; font-size: 30px; } .zzz span:nth-child(3) { animation-delay: 1.2s; left: 40px; font-size: 22px; }
@keyframes zz { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(30px, -90px); opacity: 0; } }
@media (max-height: 520px) and (orientation: landscape) { .carew { position: relative; } .crow { position: absolute; left: 8px; right: 8px; top: 8px; z-index: 9; pointer-events: none; margin: 0; } .crow > a { pointer-events: auto; } .cstage { height: calc(100vh - 120px); min-height: 200px; } .tool { width: 64px; height: 64px; font-size: 46px; top: 76px; } .yarn { top: 76px; } .food.tool { width: 70px; height: 58px; font-size: 32px; bottom: auto; } .food.tool small { font-size: 11px; } .food.tool[data-cfood] { left: auto; right: 12px; } .food.tool[data-cfood="fish"] { top: 4px; } .food.tool[data-cfood="milk"] { top: 68px; } .food.tool[data-cfood="kibble"] { top: 132px; } .ccat.eating { bottom: 6%; width: min(36%, 44vh, 260px); } .tummy { width: min(46%, 300px); } }
/* dress up: drag a swatch onto the cat */
.dragghost { position: fixed; z-index: 90; pointer-events: none; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; font-size: 40px; border-radius: 50%; box-shadow: 0 8px 18px rgba(0,0,0,.3); transform: translate(-50%, -50%) scale(1.1); }
#cat.droptarget { outline: 6px dashed var(--yellow); outline-offset: 4px; border-radius: 24px; }

body.immersive .nav { display: none; }

/* back + home buttons (every screen but Pet) */
.pill[hidden] { display: none; }
.pill.navb { min-width: 60px; min-height: 60px; width: 60px; padding: 0; justify-content: center; font-size: 30px; background: #fff; }
@media (max-width: 420px) { body.sub .pill.stars { display: none; } body.sub .top { gap: 6px; } body.sub .pill.coins { padding: 0 10px; } }
@media (max-width: 340px) { body.sub .brand { display: none; } }
