/* ===================== Z-PETS ===================== */
:root {
  --pink: #FF7EB9; --pink-d: #E65A9C;
  --purple: #9C7BFF; --purple-d: #7A57E6;
  --blue: #5EC2FF; --blue-d: #3A9FE0;
  --green: #4FD6A0; --green-d: #2EB27F;
  --yellow: #FFD54F; --yellow-d: #F0B323;
  --orange: #FF9F5A; --orange-d: #E87D35;
  --red: #FF6B7D;
  --ink: #4A3A6B; --ink-soft: #7C6C9C;
  --card: #FFFFFF;
  --bg1: #FFE4F1; --bg2: #E2F2FF;
  --radius: 22px;
  --font: 'Fredoka', 'Baloo 2', 'Nunito', 'Segoe UI Rounded', system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font); color: var(--ink);
  background: linear-gradient(160deg, #FFD3E8, #D6ECFF);
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
  overscroll-behavior: none;
}
button { font-family: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
#app {
  position: relative; height: 100dvh; max-width: 520px; margin: 0 auto; overflow: hidden;
  background: linear-gradient(180deg, var(--bg1), var(--bg2));
  box-shadow: 0 0 40px rgba(120, 80, 160, .18);
}

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  font-weight: 700; font-size: 20px; letter-spacing: .5px; color: #fff;
  padding: 14px 26px; border-radius: 999px; background: var(--c, var(--pink));
  box-shadow: 0 6px 0 var(--cd, var(--pink-d)), 0 10px 18px rgba(0, 0, 0, .12);
  transition: transform .08s, box-shadow .08s; text-shadow: 0 2px 0 rgba(0, 0, 0, .12);
}
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--cd, var(--pink-d)); }
.btn.big { font-size: 26px; padding: 16px 38px; }
.btn.pink { --c: var(--pink); --cd: var(--pink-d); }
.btn.green { --c: var(--green); --cd: var(--green-d); }
.btn.blue { --c: var(--blue); --cd: var(--blue-d); }
.btn.purple { --c: var(--purple); --cd: var(--purple-d); }
.btn.yellow { --c: var(--yellow); --cd: var(--yellow-d); color: #6B4A00; text-shadow: none; }
.btn.orange { --c: var(--orange); --cd: var(--orange-d); }
.btn.white { --c: #fff; --cd: #E3D8F0; color: var(--ink); text-shadow: none; }
.btn.round { width: 46px; height: 46px; padding: 0; font-size: 22px; --c: #fff; --cd: #E3D8F0; color: var(--ink); text-shadow: none; }
.btn[disabled] { filter: grayscale(.7); opacity: .6; }

/* ---------- telas ---------- */
.screen { position: absolute; inset: 0; display: none; flex-direction: column; }
.screen.active { display: flex; animation: screenIn .35s ease; }
@keyframes screenIn { from { opacity: 0; transform: scale(.98); } }

/* ---------- tela inicial ---------- */
#screen-title { align-items: center; justify-content: center; gap: 10px; padding: 20px; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #FFF3FA 0, #FFD8EC 45%, #C9E6FF 100%); }
.title-bg i { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .55); animation: floaty 7s ease-in-out infinite; }
.title-bg i:nth-child(1) { width: 90px; height: 90px; left: 6%; top: 10%; }
.title-bg i:nth-child(2) { width: 50px; height: 50px; right: 10%; top: 18%; animation-delay: -2s; }
.title-bg i:nth-child(3) { width: 130px; height: 130px; right: -30px; bottom: 16%; animation-delay: -4s; }
.title-bg i:nth-child(4) { width: 40px; height: 40px; left: 14%; bottom: 22%; animation-delay: -1s; }
.title-bg i:nth-child(5) { width: 70px; height: 70px; left: 40%; top: 4%; animation-delay: -3s; background: rgba(255, 213, 79, .35); }
.title-bg i:nth-child(6) { width: 60px; height: 60px; left: -10px; bottom: 6%; animation-delay: -5s; background: rgba(156, 123, 255, .25); }
@keyframes floaty { 50% { transform: translateY(-18px) scale(1.06); } }
.logo { position: relative; font-weight: 700; font-size: clamp(58px, 18vw, 92px); line-height: 1; display: flex; letter-spacing: 1px; filter: drop-shadow(0 6px 0 rgba(90, 50, 140, .18)); }
.logo span { display: inline-block; -webkit-text-stroke: 3px #fff; paint-order: stroke fill; animation: letterBob 2.4s ease-in-out infinite; }
.logo .l1 { color: var(--purple); font-size: 1.15em; }
.logo .dash { color: var(--yellow-d); animation-delay: .1s; }
.logo .l2 { color: var(--pink); animation-delay: .2s; }
.logo .l3 { color: var(--blue); animation-delay: .3s; }
.logo .l4 { color: var(--green); animation-delay: .4s; }
.logo .l5 { color: var(--orange); animation-delay: .5s; }
@keyframes letterBob { 50% { transform: translateY(-8px) rotate(-3deg); } }
.tagline { margin: 0; font-weight: 600; color: var(--ink-soft); letter-spacing: 3px; font-size: 15px; }
.title-pet { width: min(62vw, 270px); aspect-ratio: 1; margin: 6px 0 18px; }
.title-pet svg { width: 100%; height: 100%; }

/* ---------- nome ---------- */
#screen-name { background: radial-gradient(circle at 50% 20%, #FFF6FB, #FFE0EF 50%, #D9EEFF); overflow-y: auto; }
.name-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: calc(16px + var(--safe-top)) 14px calc(20px + var(--safe-bot)); min-height: 100%; }
.name-pet { width: 128px; height: 128px; }
.name-display { min-width: 220px; min-height: 64px; padding: 6px 20px; border-radius: 20px; background: #fff; font-size: 42px; font-weight: 700; letter-spacing: 6px; text-align: center; color: var(--purple-d); box-shadow: inset 0 -4px 0 #EFE6FA, 0 6px 16px rgba(120, 80, 160, .12); }
.name-display .ph { color: #D9CDEB; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip-btn { background: #fff; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 18px; color: var(--ink); box-shadow: 0 4px 0 #E8DDF5; }
.chip-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #E8DDF5; }
.keyboard { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; width: 100%; max-width: 420px; }
.key { aspect-ratio: 1; border-radius: 14px; background: #fff; font-size: 22px; font-weight: 700; color: var(--ink); box-shadow: 0 4px 0 #E3D8F0; }
.key:active { transform: translateY(3px); box-shadow: 0 1px 0 #E3D8F0; background: #FFF3C4; }
.key.del { background: #FFE1E6; grid-column: span 2; aspect-ratio: auto; }

/* ---------- casa: barra superior ---------- */
.topbar { display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--safe-top)) 12px 6px; }
.namebox { display: flex; flex-direction: column; align-items: flex-start; background: #fff; padding: 6px 14px; border-radius: 18px; box-shadow: 0 4px 0 #EADFF6; min-width: 0; }
.pet-name { font-weight: 700; font-size: 20px; line-height: 1.05; color: var(--purple-d); white-space: nowrap; }
.stage-chip { font-size: 11px; font-weight: 600; color: #fff; background: var(--green); padding: 1px 8px; border-radius: 99px; margin-top: 2px; letter-spacing: 1px; }
.xp { flex: 1; height: 18px; background: #fff; border-radius: 99px; position: relative; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .08); }
.xp-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px; background: linear-gradient(90deg, #8EF0C3, var(--green)); transition: width .6s; }
.xp-icon { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 13px; }
.stars-box { background: #fff; border-radius: 18px; padding: 8px 12px; font-size: 18px; font-weight: 700; color: #C98A00; box-shadow: 0 4px 0 #F3E3B5; white-space: nowrap; }
.stars-box.small { padding: 6px 10px; font-size: 16px; }
.stars-box.bump { animation: bump .45s; }
@keyframes bump { 40% { transform: scale(1.25); } }

/* ---------- barras de status ---------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 2px 12px 8px; }
.stat { background: #fff; border-radius: 16px; padding: 5px 5px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; box-shadow: 0 3px 0 #EADFF6; }
.stat .s-ico { font-size: 20px; line-height: 1; }
.stat .s-bar { display: block; width: 100%; height: 8px; background: #F1EAF8; border-radius: 9px; overflow: hidden; }
.stat .s-fill { display: block; height: 100%; border-radius: 9px; transition: width .5s, background .5s; }
.stat.low { animation: wobble 1s ease-in-out infinite; }
@keyframes wobble { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }

/* ---------- cena (quarto) ---------- */
.scene { position: relative; flex: 1; margin: 0 10px; border-radius: 28px; overflow: hidden; box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .7), 0 8px 24px rgba(120, 80, 160, .15); touch-action: none; }
.wall { position: absolute; inset: 0; background-color: #FFEAF4;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .9) 3px, transparent 3.5px), radial-gradient(circle, rgba(255, 180, 215, .35) 3px, transparent 3.5px);
  background-size: 34px 34px; background-position: 0 0, 17px 17px; transition: background .6s; }
.window { position: absolute; left: 7%; top: 7%; width: 32%; aspect-ratio: 1 / 1.05; border-radius: 50% 50% 14px 14px; background: #fff; padding: 7px; box-shadow: 0 5px 0 rgba(160, 110, 180, .2); }
.sky { position: relative; width: 100%; height: 100%; border-radius: 50% 50% 9px 9px; overflow: hidden; background: linear-gradient(#7FD0FF, #CDEFFF); transition: background 1s; }
.sky::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 5px; margin-left: -2.5px; background: #fff; box-shadow: 0 0 0 0 #fff; }
.sky::before { content: ''; position: absolute; top: 55%; left: 0; right: 0; height: 5px; background: #fff; z-index: 2; }
.sun { position: absolute; width: 34%; aspect-ratio: 1; border-radius: 50%; background: #FFE066; right: 12%; top: 16%; box-shadow: 0 0 0 6px rgba(255, 224, 102, .35); }
.cloud { position: absolute; height: 14%; width: 40%; background: #fff; border-radius: 99px; animation: drift 14s linear infinite; }
.cloud.c1 { top: 40%; left: -40%; } .cloud.c2 { top: 68%; left: -60%; animation-delay: -7s; width: 30%; }
@keyframes drift { to { transform: translateX(380%); } }
.moon { display: none; position: absolute; width: 30%; aspect-ratio: 1; border-radius: 50%; right: 16%; top: 14%; box-shadow: -8px 4px 0 0 #FFF4B8; }
.scene.night .sky { background: linear-gradient(#2E2A6B, #5A4FA8); }
.scene.night .sun, .scene.night .cloud { display: none; }
.scene.night .moon { display: block; }
.frame { position: absolute; right: 9%; top: 9%; width: 22%; aspect-ratio: 1; border-radius: 14px; background: #fff; display: grid; place-items: center; font-size: clamp(20px, 7vw, 34px); transform: rotate(4deg); box-shadow: 0 5px 0 rgba(160, 110, 180, .2); border: 5px solid #FFD27A; }
.shelf { position: absolute; right: 6%; top: 36%; width: 30%; border-bottom: 7px solid #E8B98A; border-radius: 4px; display: flex; justify-content: space-around; font-size: clamp(16px, 5.5vw, 26px); filter: drop-shadow(0 3px 0 rgba(160, 110, 80, .2)); }
.floor { position: absolute; left: 0; right: 0; bottom: 0; height: 30%;
  background: repeating-linear-gradient(90deg, #F7D3A6 0 46px, #F2C794 46px 50px); border-top: 6px solid #F0BE88; }
.rug { position: absolute; left: 50%; bottom: 7%; width: 74%; height: 13%; transform: translateX(-50%); border-radius: 50%;
  background: repeating-radial-gradient(ellipse at center, #C9B6FF 0 12px, #DCCFFF 12px 24px); box-shadow: 0 4px 0 rgba(120, 80, 160, .15); }
.bowl { position: absolute; left: 7%; bottom: 9%; font-size: clamp(24px, 8vw, 38px); filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .1)); }

/* modo banho */
.scene.bath .wall { background-color: #DDF3FF; background-image: linear-gradient(rgba(255, 255, 255, .8) 3px, transparent 3px), linear-gradient(90deg, rgba(255, 255, 255, .8) 3px, transparent 3px); background-size: 40px 40px; background-position: 0 0, 0 0; }
.scene.bath .floor { background: repeating-linear-gradient(90deg, #BFE6FF 0 38px, #A9DCFF 38px 41px); border-top-color: #97D2FA; }
.scene.bath .rug { background: radial-gradient(ellipse, #fff 0 40%, #CDEBFF 41% 70%, #9FD6FA 71%); }
.scene.bath .window, .scene.bath .frame, .scene.bath .shelf, .scene.bath .bowl { opacity: 0; }
.bath-ui { display: none; position: absolute; left: 12px; right: 12px; top: 12px; z-index: 6; align-items: center; gap: 8px; flex-wrap: wrap; }
.scene.bath .bath-ui { display: flex; }
.bath-bar { flex: 1; height: 18px; background: #fff; border-radius: 99px; overflow: hidden; }
#bath-fill { height: 100%; width: 0; background: linear-gradient(90deg, #9FE3FF, var(--blue)); transition: width .2s; }
.bath-hint { order: 3; width: 100%; text-align: center; font-weight: 700; font-size: 18px; color: var(--blue-d); background: rgba(255, 255, 255, .85); border-radius: 99px; padding: 4px 10px; }
.sponge { display: none; position: absolute; z-index: 7; font-size: 54px; pointer-events: none; transform: translate(-50%, -50%) rotate(-15deg); filter: drop-shadow(0 4px 2px rgba(0, 0, 0, .15)); left: 75%; top: 70%; }
.scene.bath .sponge { display: block; }

/* modo noite / dormir */
.night-overlay { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 60%, rgba(40, 30, 100, .35), rgba(20, 16, 60, .78)); opacity: 0; transition: opacity 1s; z-index: 4; }
.night-overlay i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #FFF6B8; box-shadow: 0 0 8px #FFF6B8; animation: twk 2s ease-in-out infinite; }
.night-overlay i:nth-child(1) { left: 12%; top: 14%; } .night-overlay i:nth-child(2) { left: 30%; top: 30%; animation-delay: .5s; }
.night-overlay i:nth-child(3) { left: 70%; top: 12%; animation-delay: 1s; } .night-overlay i:nth-child(4) { left: 86%; top: 34%; animation-delay: 1.4s; }
.night-overlay i:nth-child(5) { left: 52%; top: 8%; animation-delay: .8s; } .night-overlay i:nth-child(6) { left: 20%; top: 52%; animation-delay: 1.7s; }
.night-overlay i:nth-child(7) { left: 80%; top: 56%; animation-delay: .3s; }
@keyframes twk { 50% { opacity: .2; transform: scale(.6); } }
.scene.sleeping .night-overlay { opacity: 1; }
.scene.sleeping .pet { z-index: 5; filter: brightness(.88); }

/* pet */
.pet { position: absolute; left: 50%; bottom: 8%; width: min(64%, 300px); aspect-ratio: 1; transform: translateX(-50%); z-index: 3; cursor: pointer; }
.pet svg { width: 100%; height: 100%; overflow: visible; }
.pet.boing svg { animation: boing .5s; }
@keyframes boing { 30% { transform: scale(1.12, .86); } 60% { transform: scale(.94, 1.08); } }
.pet.jump svg { animation: jump .7s; }
@keyframes jump { 35% { transform: translateY(-22%) scale(.96, 1.06); } 70% { transform: translateY(0) scale(1.1, .9); } }
.pet.shake svg { animation: shakeX .5s; }
@keyframes shakeX { 20%, 60% { transform: translateX(-6%); } 40%, 80% { transform: translateX(6%); } }

/* animações internas do SVG */
.pet-svg .breathe { transform-box: fill-box; transform-origin: 50% 100%; animation: breathe 2.6s ease-in-out infinite; }
.pet-svg.stage-0 .breathe { animation: jelly 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.03, .97); } }
@keyframes jelly { 25% { transform: scale(1.06, .94); } 50% { transform: scale(.97, 1.04); } 75% { transform: scale(1.02, .98); } }
.pet-svg .eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.5s infinite; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.pet-svg .wag { animation: wag .5s ease-in-out infinite alternate; }
@keyframes wag { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
.pet-svg .wag-slow { animation: wag 1.4s ease-in-out infinite alternate; }
.pet-svg .flap { animation: flap .9s ease-in-out infinite alternate; }
@keyframes flap { to { transform: rotate(calc(var(--d) * -14deg)); } }
.pet-svg .flap-slow { animation: flap 1.6s ease-in-out infinite alternate; }
.pet-svg .ear-flop { animation: earf 2.6s ease-in-out infinite; }
@keyframes earf { 50% { transform: rotate(4deg); } }
.pet-svg .ear-bun { animation: earb 3s ease-in-out infinite; }
@keyframes earb { 0%, 80%, 100% { transform: rotate(0); } 88% { transform: rotate(-6deg); } }
.pet-svg .antenna { animation: earb 2.2s ease-in-out infinite; }
.pet-svg .glow { animation: glow 1.4s ease-in-out infinite; }
@keyframes glow { 50% { opacity: .1; } }
.pet-svg .twinkle { animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { transform: scale(0); opacity: 0; } 30%, 60% { transform: scale(1); opacity: 1; } }
.pet-svg .stink { animation: floatUp 2s ease-in-out infinite; opacity: .8; }
@keyframes floatUp { 50% { transform: translateY(-5px); opacity: .4; } }
.pet-svg .tear { animation: tear 1.6s ease-in infinite; }
@keyframes tear { from { transform: translateY(-4px); opacity: 0; } 40% { opacity: 1; } to { transform: translateY(8px); opacity: 0; } }
.pet-svg.mood-sleep .breathe { animation: breathe 4s ease-in-out infinite; }

/* balão de fala */
.bubble { position: absolute; z-index: 6; left: 50%; top: 5%; transform: translateX(-50%) scale(0); max-width: 86%; width: max-content;
  background: #fff; border-radius: 22px; padding: 10px 16px; font-size: 19px; font-weight: 600; text-align: center; line-height: 1.25;
  box-shadow: 0 6px 0 rgba(160, 110, 200, .18), 0 10px 22px rgba(80, 40, 120, .12); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); cursor: pointer; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -12px; margin-left: -12px; border: 12px solid transparent; border-bottom: 0; border-top-color: #fff; }
.bubble.show { transform: translateX(-50%) scale(1); }
.bubble .big { display: block; font-size: 34px; font-weight: 700; color: var(--purple-d); letter-spacing: 3px; margin-top: 2px; }
.bubble .spk { display: inline-block; font-size: 15px; margin-left: 4px; opacity: .7; }
.bubble.static { position: relative; left: auto; top: auto; transform: none; max-width: 100%; }
.bubble.static::after { display: none; }

/* botão veterinário */
.vet-btn { display: none; position: absolute; right: 12px; top: 40%; z-index: 6; background: #fff; color: var(--red); font-weight: 700; font-size: 15px; padding: 10px 12px; border-radius: 16px; box-shadow: 0 5px 0 #F7C9D0; animation: pulse 1.2s infinite; }
.vet-btn.show { display: block; }

/* efeitos */
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 8; overflow: hidden; }
.particle { position: absolute; font-size: 26px; animation: rise 1.4s ease-out forwards; }
@keyframes rise { from { transform: translate(-50%, 0) scale(.5); opacity: 0; } 20% { opacity: 1; transform: translate(-50%, -10px) scale(1); } to { transform: translate(calc(-50% + var(--dx, 0px)), -120px) scale(.9); opacity: 0; } }
.particle.fall { animation: fall 1s ease-in forwards; }
@keyframes fall { from { transform: translate(-50%, 0); opacity: 1; } to { transform: translate(calc(-50% + var(--dx, 0px)), 90px) rotate(90deg); opacity: 0; } }
.bub { position: absolute; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .95); background: radial-gradient(circle at 30% 30%, #fff, rgba(190, 230, 255, .5)); animation: bub 1.2s ease-out forwards; }
@keyframes bub { from { transform: scale(.2); opacity: 1; } to { transform: translateY(-50px) scale(1); opacity: 0; } }
.drop { position: absolute; top: -20px; width: 8px; height: 16px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #7FCBFF; animation: drop .7s linear forwards; }
@keyframes drop { to { transform: translateY(520px); } }
.flyfood { position: fixed; z-index: 60; font-size: 54px; pointer-events: none; transition: transform .6s cubic-bezier(.4, -0.3, .6, 1), opacity .6s; }
.zzz { position: absolute; font-weight: 700; color: #fff; font-size: 26px; animation: zzz 2.4s ease-out forwards; text-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
@keyframes zzz { from { opacity: 0; transform: translate(0, 0) scale(.5); } 30% { opacity: 1; } to { opacity: 0; transform: translate(40px, -90px) scale(1.2); } }

/* ---------- barra de ações ---------- */
.actions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; padding: 10px 10px calc(12px + var(--safe-bot)); }
.act { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #fff; border-radius: 20px; padding: 8px 2px 7px; box-shadow: 0 5px 0 #E6D9F4; transition: transform .08s; }
.act:active { transform: translateY(4px); box-shadow: 0 1px 0 #E6D9F4; }
.act .ico { font-size: 30px; line-height: 1.05; }
.act .lbl { font-size: 13px; font-weight: 700; letter-spacing: .5px; }
.act.school { background: linear-gradient(180deg, #FFE97A, #FFD23F); box-shadow: 0 5px 0 #E5AE10; }
.act.pulse, .pulse { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.1); } }
.act.on { background: #3E3580; color: #fff; box-shadow: 0 5px 0 #262061; }

/* ---------- gaveta ---------- */
.sheet-back { position: absolute; inset: 0; background: rgba(60, 30, 90, .35); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 30; }
.sheet-back.show { opacity: 1; pointer-events: auto; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 31; background: #FFF9FD; border-radius: 30px 30px 0 0; padding: 8px 14px calc(16px + var(--safe-bot)); transform: translateY(105%); transition: transform .32s cubic-bezier(.3, 1.3, .5, 1); max-height: 78%; display: flex; flex-direction: column; box-shadow: 0 -10px 30px rgba(80, 40, 120, .2); }
.sheet.show { transform: translateY(0); }
.sheet-handle { width: 54px; height: 6px; border-radius: 9px; background: #E6D9F4; margin: 0 auto 8px; }
.sheet-body { overflow-y: auto; }
.sheet h3 { margin: 4px 0 10px; text-align: center; font-size: 24px; color: var(--purple-d); }
.request { display: flex; align-items: center; gap: 10px; justify-content: center; background: #FFF3C4; border-radius: 18px; padding: 8px 12px; margin-bottom: 10px; font-weight: 600; }
.request b { font-size: 26px; letter-spacing: 3px; color: var(--orange-d); }
.food-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.food { background: #fff; border-radius: 20px; padding: 10px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 5px 0 #EEE3F8; position: relative; }
.food:active { transform: translateY(4px); box-shadow: 0 1px 0 #EEE3F8; }
.food .fe { font-size: 38px; line-height: 1.1; }
.food .fw { font-size: 14px; font-weight: 700; letter-spacing: 1px; }
.food .tag { position: absolute; top: 4px; right: 6px; font-size: 14px; }
.food.sweet { background: #FFF0F6; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-bottom: 4px; }
.more-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 4px; border-radius: 22px; color: #fff; font-weight: 700; font-size: 16px; box-shadow: 0 6px 0 rgba(0, 0, 0, .15); }
.more-btn .ico { font-size: 40px; }

/* ---------- modal ---------- */
.modal-back { position: absolute; inset: 0; z-index: 50; background: rgba(60, 30, 90, .45); display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-back.show { display: flex; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { position: relative; width: 100%; max-height: 92%; overflow-y: auto; background: #FFF9FD; border-radius: 30px; padding: 20px 18px; text-align: center; animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); box-shadow: 0 20px 50px rgba(60, 20, 100, .3); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.modal h2 { margin: 0 0 8px; font-size: 28px; color: var(--purple-d); }
.modal p { font-size: 18px; margin: 8px 0; line-height: 1.35; }
.modal .m-pet { width: 190px; height: 190px; margin: 0 auto; }
.modal .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.modal .x { position: absolute; right: 12px; top: 12px; }
.tabs { display: flex; gap: 6px; justify-content: center; margin: 6px 0 12px; }
.tab { padding: 8px 14px; border-radius: 99px; background: #F1E9FA; font-weight: 700; font-size: 15px; }
.tab.on { background: var(--purple); color: #fff; }
.letter-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.lt { aspect-ratio: 1; border-radius: 14px; display: grid; place-items: center; font-size: 26px; font-weight: 700; background: #F1ECF7; color: #CFC3E0; }
.lt.on { background: var(--c, var(--pink)); color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .12); }
.word-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.wd { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 16px; padding: 8px 10px; font-weight: 700; font-size: 18px; letter-spacing: 1px; box-shadow: 0 4px 0 #EEE3F8; }
.wd span { font-size: 28px; }
.aff-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-weight: 600; font-size: 15px; text-align: left; }
.aff-row .ae { font-size: 26px; width: 34px; }
.aff-row .ab { flex: 1; height: 14px; background: #F1EAF8; border-radius: 9px; overflow: hidden; }
.aff-row .ab i { display: block; height: 100%; border-radius: 9px; }
.empty { color: var(--ink-soft); font-size: 16px; padding: 10px; }
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shop-item { background: #fff; border-radius: 20px; padding: 10px 4px; box-shadow: 0 5px 0 #EEE3F8; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.shop-item .se { font-size: 40px; }
.shop-item .sn { font-weight: 700; font-size: 14px; }
.shop-item .sp { font-size: 14px; font-weight: 700; color: #C98A00; }
.shop-item.worn { background: #E6FFF3; box-shadow: 0 5px 0 #B5EED3; }
.parents { text-align: left; font-size: 15px; line-height: 1.45; }
.parents h4 { margin: 14px 0 4px; color: var(--purple-d); font-size: 17px; }
.toggle { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-weight: 600; font-size: 16px; border-bottom: 1px dashed #EADFF6; }
.sw { width: 54px; height: 30px; border-radius: 99px; background: #DDD3EA; position: relative; transition: background .2s; }
.sw::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 2px 4px rgba(0, 0, 0, .15); }
.sw.on { background: var(--green); } .sw.on::after { left: 27px; }

/* ---------- toast ---------- */
.toast { position: absolute; left: 50%; top: calc(14px + var(--safe-top)); transform: translate(-50%, -150%); z-index: 70; background: #fff; padding: 10px 18px; border-radius: 99px; font-weight: 700; font-size: 17px; box-shadow: 0 8px 20px rgba(80, 40, 120, .2); transition: transform .3s cubic-bezier(.3, 1.5, .5, 1); white-space: nowrap; }
.toast.show { transform: translate(-50%, 0); }

/* confete */
.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: conf 2.2s ease-in forwards; }
@keyframes conf { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- escolinha ---------- */
.game-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(10px + var(--safe-top)) 12px 6px; }
.game-head h2 { margin: 0; font-size: 26px; color: var(--purple-d); }
#screen-school { background: radial-gradient(circle at 50% 0, #FFF9E0, #FFEFC2 40%, #FFE0EE); }
.school-intro { display: flex; align-items: center; gap: 8px; padding: 0 14px 6px; }
.school-pet { width: 96px; height: 96px; flex: none; }
.game-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 6px 14px calc(18px + var(--safe-bot)); align-content: start; grid-auto-rows: max-content; }
.gcard { position: relative; border-radius: 26px; padding: 14px 10px 12px; color: #fff; text-align: center; box-shadow: 0 7px 0 rgba(0, 0, 0, .14); display: flex; flex-direction: column; align-items: center; gap: 4px; overflow: hidden; }
.gcard:active { transform: translateY(5px); box-shadow: 0 2px 0 rgba(0, 0, 0, .14); }
.gcard::before { content: ''; position: absolute; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .16); right: -40px; top: -40px; }
.gcard .gi { font-size: 46px; line-height: 1.1; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .12)); }
.gcard .gt { font-weight: 700; font-size: 19px; letter-spacing: .5px; text-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.gcard .gd { font-size: 13px; font-weight: 500; opacity: .95; }
.gcard .gs { position: absolute; left: 10px; top: 8px; font-size: 13px; background: rgba(255, 255, 255, .3); border-radius: 99px; padding: 1px 7px; font-weight: 700; }

/* ---------- minigame ---------- */
#screen-game { background: radial-gradient(circle at 50% 0, #F1FBFF, #DDF1FF 45%, #F3E6FF); }
.dots { display: flex; gap: 6px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px #D9CCF0; }
.dots i.done { background: var(--green); box-shadow: none; }
.dots i.cur { background: var(--yellow); box-shadow: none; transform: scale(1.2); }
.game-teacher { display: flex; align-items: center; gap: 6px; padding: 2px 12px 4px; }
.mini-pet { width: 92px; height: 92px; flex: none; }
.mini-pet svg { width: 100%; height: 100%; overflow: visible; }
.bubble.say { flex: 1; font-size: 19px; text-align: left; padding: 10px 14px; }
.bubble.say::before { content: ''; position: absolute; left: -10px; top: 50%; margin-top: -10px; border: 10px solid transparent; border-left: 0; border-right-color: #fff; }
.game-area { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 8px 14px calc(18px + var(--safe-bot)); overflow: hidden; }

.pic { font-size: clamp(80px, 26vw, 130px); line-height: 1; filter: drop-shadow(0 8px 0 rgba(80, 40, 120, .12)); animation: picIn .5s cubic-bezier(.3, 1.6, .5, 1); cursor: pointer; }
@keyframes picIn { from { transform: scale(.3) rotate(-20deg); opacity: 0; } }
.word-big { font-size: clamp(38px, 12vw, 56px); font-weight: 700; letter-spacing: 6px; color: var(--purple-d); text-align: center; line-height: 1.1; }
.word-big .hole { display: inline-block; min-width: .8em; border-bottom: 5px solid var(--pink); color: var(--pink); }
.word-big .lit { color: var(--pink); animation: bump .4s; display: inline-block; }
.choices { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; width: 100%; }
.choice { min-width: 86px; height: 86px; padding: 0 16px; border-radius: 24px; background: #fff; font-size: 44px; font-weight: 700; color: var(--ink); box-shadow: 0 7px 0 #E0D3F2; transition: transform .1s; }
.choice:active { transform: translateY(5px); box-shadow: 0 2px 0 #E0D3F2; }
.choice.word { font-size: 26px; letter-spacing: 2px; height: 70px; }
.choice.ok { background: var(--green); color: #fff; box-shadow: 0 7px 0 var(--green-d); animation: bump .4s; }
.choice.no { background: #FFE1E6; animation: shakeX .4s; }
.choice.ghost { opacity: .35; pointer-events: none; }

/* caça-letras */
.bubbles-field { position: relative; width: 100%; flex: 1; min-height: 300px; }
.lbubble { position: absolute; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; display: grid; place-items: center; font-size: 42px; font-weight: 700; color: #fff;
  background: radial-gradient(circle at 24% 22%, rgba(255, 255, 255, .85) 0 8%, transparent 9%), var(--c); box-shadow: inset -6px -8px 0 rgba(0, 0, 0, .1), 0 6px 14px rgba(80, 40, 120, .18); animation: bobb 3s ease-in-out infinite; text-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
@keyframes bobb { 50% { transform: translateY(-12px); } }
.lbubble.popped { animation: popOut .35s forwards; }
@keyframes popOut { to { transform: scale(1.6); opacity: 0; } }
.lbubble.no { animation: shakeX .4s; }

/* monta palavra */
.slots { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.slot { min-width: 78px; height: 74px; padding: 0 8px; border-radius: 18px; border: 4px dashed #CDBDEB; display: grid; place-items: center; font-size: 34px; font-weight: 700; color: var(--purple-d); background: rgba(255, 255, 255, .5); }
.slot.filled { border: 0; background: var(--yellow); color: #6B4A00; box-shadow: 0 5px 0 var(--yellow-d); animation: bump .35s; }
.tiles { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.tile { min-width: 78px; height: 74px; padding: 0 10px; border-radius: 18px; background: #fff; font-size: 32px; font-weight: 700; color: var(--purple-d); box-shadow: 0 6px 0 #DCCCF3; }
.tile:active { transform: translateY(4px); box-shadow: 0 2px 0 #DCCCF3; }
.tile.used { visibility: hidden; }
.tile.no { animation: shakeX .4s; background: #FFE1E6; }

/* traçar */
.trace-wrap { position: relative; width: min(86vw, 360px, 52vh); aspect-ratio: 1; background: #fff; border-radius: 30px; box-shadow: 0 8px 0 #E0D3F2, inset 0 0 0 4px #F3ECFB; touch-action: none; }
.trace-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 30px; touch-action: none; }
.trace-tools { display: flex; gap: 10px; }

/* fala */
.mic { width: 110px; height: 110px; border-radius: 50%; font-size: 52px; background: var(--pink); box-shadow: 0 8px 0 var(--pink-d); color: #fff; }
.mic.listening { animation: pulse .8s infinite; background: var(--red); }
.speak-row { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.syl { display: inline-block; padding: 0 2px; transition: color .2s, transform .2s; }
.syl.on { color: var(--pink); transform: translateY(-6px); }
.sep { color: #D8CCEA; }

/* memória */
.mem-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; max-width: 420px; }
.card { aspect-ratio: .85; perspective: 600px; }
.card .in { position: relative; width: 100%; height: 100%; transition: transform .4s; transform-style: preserve-3d; }
.card.open .in, .card.done .in { transform: rotateY(180deg); }
.card .face { position: absolute; inset: 0; border-radius: 18px; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 5px 0 rgba(0, 0, 0, .1); }
.card .back { background: linear-gradient(135deg, var(--purple), var(--pink)); color: #fff; font-size: 34px; font-weight: 700; }
.card .front { background: #fff; transform: rotateY(180deg); font-size: clamp(34px, 10vw, 46px); }
.card .front.w { font-size: clamp(14px, 4.2vw, 20px); font-weight: 700; letter-spacing: 1px; color: var(--purple-d); padding: 4px; text-align: center; word-break: break-all; }
.card.done .front { background: #E3FFF1; }

/* o pet errou */
.judge { display: flex; gap: 18px; }
.judge .btn { font-size: 26px; padding: 16px 26px; }

/* fim de jogo */
.end { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.end .big-stars { font-size: 52px; letter-spacing: 6px; animation: bump .6s; }
.end h2 { margin: 0; font-size: 30px; color: var(--purple-d); }
.end p { margin: 0; font-size: 19px; }
.learned-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.learned-chips span { background: #fff; padding: 6px 12px; border-radius: 99px; font-weight: 700; font-size: 18px; box-shadow: 0 3px 0 #EEE3F8; }

@media (min-height: 760px) {
  .act .ico { font-size: 34px; }
  .stat .s-ico { font-size: 24px; }
}
@media (max-height: 640px) {
  .pet { width: min(54%, 240px); }
  .act .ico { font-size: 24px; }
  .act .lbl { font-size: 11px; }
  .mini-pet { width: 70px; height: 70px; }
  .choice { height: 72px; min-width: 72px; font-size: 36px; }
}

/* ===================== jeito de app de celular ===================== */
html { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; }
body { -webkit-touch-callout: none; }
img, svg { -webkit-user-drag: none; }
.btn.install { --c: #fff; --cd: #E6D8F5; color: var(--purple-d); font-size: 17px; padding: 10px 20px; margin-top: 12px; }
.install-tip { max-width: 300px; margin: 10px auto 0; background: #fff; border-radius: 18px; padding: 10px 14px; font-size: 16px; text-align: center; box-shadow: 0 4px 0 #EBDDF7; }
[hidden] { display: none !important; }
.rotate { display: none; position: fixed; inset: 0; z-index: 999; background: linear-gradient(160deg, #FF9FCF, #9C7BFF); color: #fff; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-size: 26px; font-weight: 700; }
.rotate .rot-phone { font-size: 90px; animation: rotPhone 1.6s ease-in-out infinite; }
@keyframes rotPhone { 0%, 30% { transform: rotate(-90deg); } 60%, 100% { transform: rotate(0); } }
@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) { .rotate { display: flex; } }
/* no computador o jogo aparece no formato de um celular */
@media (min-width: 700px) and (pointer: fine) {
  body { display: grid; place-items: center; }
  #app { width: 412px; height: min(100dvh - 32px, 900px); border-radius: 36px; border: 10px solid #3B2E57; box-shadow: 0 20px 60px rgba(80, 40, 120, .35); }
}
.color-row { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; white-space: nowrap; margin-top: -6px; }
.btn.small-btn { --c: #fff; --cd: #E6D8F5; color: var(--purple-d); font-size: 14px; padding: 6px 12px; box-shadow: 0 4px 0 var(--cd); }
.name-pet.jump, .mini-pet.jump { animation: jump .5s; }

/* paleta de cores da gosminha */
.color-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: -4px; }
.color-label { font-size: 16px; font-weight: 600; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.sw-c { width: 36px; height: 36px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 12%, var(--a) 14%, var(--b)); box-shadow: 0 3px 0 rgba(80, 40, 120, .15), inset 0 0 0 2px rgba(255, 255, 255, .6); transition: transform .15s; }
.sw-c.on { transform: scale(1.18); box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--b); }
