/* Key Keepers
   A cozy storybook world. Soft frosted panels float over the Hollow, buttons are round honey pebbles,
   and the only strong colours are the finger families and the warm gold of rewards. */

:root {
  --ink: #2E2452;
  --ink-2: #5B5185;
  --ink-3: #9C95BF;
  --ink-4: #D7D1EC;
  --paper: #FFFFFF;
  --mist: #F5F2FF;
  --honey: #FFC84A;
  --honey-hi: #FFDB7A;
  --honey-lo: #D9901A;
  --glow: #FFF1C2;
  --rose: #FF8DB3;
  --peach: #FFAA5E;
  --lemon: #FFD35C;
  --leaf: #63D69A;
  --sky: #78C6FF;
  --violet: #B79CFF;
  --display: 'Grandstander', 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Andika', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  --lift: 0 12px 32px rgba(46, 36, 82, .16);
  --lift-2: 0 18px 48px rgba(46, 36, 82, .24);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: #CFE9FF;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
button { font: inherit; color: inherit; }
input { user-select: text; }
#app { position: fixed; inset: 0; }
.screen { position: absolute; inset: 0; animation: fadeIn .4s ease both; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 80; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }

/* ---------- frosted cards and pebble buttons ---------- */
.card {
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border: 1.5px solid rgba(255, 255, 255, .9);
  border-radius: 26px;
  box-shadow: var(--lift);
}
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; }
.row.end { justify-content: flex-end; }
.muted { color: var(--ink-3); font-size: 14px; }
.lbl { font-family: var(--display); font-weight: 700; font-size: 17px; margin: 16px 0 8px; }

.pbtn {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.1;
  color: var(--ink);
  background: linear-gradient(#FFFFFF, #F1EDFF);
  border: 2px solid rgba(46, 36, 82, .12);
  border-radius: 999px;
  padding: 10px 18px;
  box-shadow: 0 4px 0 rgba(46, 36, 82, .15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform .08s, box-shadow .08s, filter .15s;
  white-space: nowrap;
}
.pbtn:hover { filter: brightness(1.03); }
.pbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(46, 36, 82, .15); }
.pbtn svg { width: 20px; height: 20px; fill: var(--ink); stroke: var(--ink); }
.pbtn.honey {
  background: linear-gradient(#FFDF84, #FFBC38);
  border-color: rgba(160, 100, 0, .28);
  box-shadow: 0 5px 0 var(--honey-lo), 0 12px 24px rgba(232, 159, 28, .3);
}
.pbtn.honey:active { box-shadow: 0 2px 0 var(--honey-lo); }
.pbtn.big { font-size: 22px; padding: 14px 28px; }
.pbtn.big:has(small) { flex-direction: column; gap: 2px; padding: 11px 28px; }
.pbtn small { display: block; font-family: var(--body); font-size: 13px; font-weight: 700; opacity: .75; }
.pbtn.small { font-size: 14px; padding: 7px 13px; box-shadow: 0 3px 0 rgba(46, 36, 82, .15); }
.pbtn.icon { width: 46px; height: 46px; padding: 0; }
.pbtn.icon.off svg { opacity: .4; }
.pbtn.labeled { flex-direction: column; gap: 3px; padding: 8px 14px 7px; border-radius: 20px; font-size: 13px; }
.pbtn.labeled svg { width: 24px; height: 24px; }
.pbtn.danger { background: #FFE2EA; }
.pbtn[aria-pressed=true] { background: linear-gradient(#FFF6D6, #FFE7A3); }

.cap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.8em;
  height: 1.8em;
  padding: 0 .3em;
  margin: 0 .08em;
  font-family: var(--display);
  font-weight: 800;
  font-size: .95em;
  line-height: 1;
  color: var(--ink);
  background: var(--ft, #fff);
  border-radius: .45em;
  box-shadow: inset 0 -.14em 0 rgba(46, 36, 82, .18), 0 0 0 2px rgba(46, 36, 82, .2);
  vertical-align: middle;
}
.cap.wide { min-width: 3.4em; font-size: .78em; font-family: var(--body); }
.ftag { display: inline-flex; align-items: center; gap: .3em; font-weight: 700; white-space: nowrap; }
.ftag::before { content: ''; width: .75em; height: .75em; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px rgba(46, 36, 82, .3); }

.pbar { height: 10px; width: 90px; border-radius: 6px; background: rgba(46, 36, 82, .1); overflow: hidden; flex: 0 0 auto; }
.pbar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #63D69A, #A6EBC2); transition: width .5s ease; }
.pbar.warm i { background: linear-gradient(90deg, #FFB547, #FF8D7A); }
.pbar.big { width: 220px; height: 14px; }

/* ---------- Pip ---------- */
.pip-coach { display: flex; align-items: flex-start; gap: 6px; max-width: 520px; transition: opacity .3s; }
.pip-coach.hide { opacity: 0; pointer-events: none; }
.pip { width: 66px; flex: 0 0 auto; animation: pipFloat 3.2s ease-in-out infinite; }
.pip-svg { width: 100%; display: block; overflow: visible; }
.pip-wings ellipse { transform-box: fill-box; transform-origin: center bottom; animation: flutter .16s ease-in-out infinite alternate; }
.pip-halo { animation: twinkle 2.6s ease-in-out infinite; }
.pip-bubble {
  background: #fff;
  border-radius: 20px 20px 20px 6px;
  padding: 10px 16px;
  margin-top: 12px;
  font-size: 17px;
  line-height: 1.4;
  box-shadow: var(--lift);
}
.pip-bubble p { margin: 0; }
.pip-bubble.pop { animation: bubblePop .3s ease-out; }
.pip-coach.quiet .pip-bubble { background: #FFFBEA; }

/* ---------- Keylings and eggs ---------- */
.kl-svg, .egg-svg, .bld-svg, .decor-svg, .hat-svg, .gift-svg, .nest-svg { display: block; overflow: visible; width: 100%; height: 100%; }
.kl-body { transform-box: fill-box; transform-origin: 50% 100%; animation: breathe 3.4s ease-in-out infinite; }
.kl-eyes-open { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
.kl-eyes-shut, .kl-eyes-happy, .kl-mouth-eat { display: none; }
.kl-wings ellipse { transform-box: fill-box; transform-origin: center; animation: flutter .3s ease-in-out infinite alternate; }
.kl-glow { opacity: .3; animation: glowSoft 2.8s ease-in-out infinite; }
.is-eating .kl-mouth { display: none; }
.is-eating .kl-mouth-eat { display: inline; }
.is-eating .kl-body { animation: munch .35s ease-in-out 2; }
.is-dancing .kl-eyes-open { display: none; }
.is-dancing .kl-eyes-happy { display: inline; }
.is-dancing .kl-body { animation: dance .5s ease-in-out infinite; }
.is-sleeping .kl-eyes-open { display: none; }
.is-sleeping .kl-eyes-shut { display: inline; }
.is-sleeping .kl-body { animation: sleepy 3.6s ease-in-out infinite; }
.egg-letter { font-family: var(--display); font-weight: 800; font-size: 30px; fill: var(--ink); opacity: .82; }
.egg-body { transform-box: fill-box; transform-origin: 50% 100%; }
.wobbly .egg-body, .t-egg .egg-body { animation: wobble 2.6s ease-in-out infinite; }
.egg.ready .egg-body { animation: wobble .6s ease-in-out infinite; }
.egg.hop .egg-svg { animation: eggHop .45s ease-out; }

/* ---------- Round screen ---------- */
.rnd { position: absolute; inset: 0; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--sky0), var(--sky1) 70%, #fff); }
.rnd-top { display: flex; align-items: center; gap: 12px; padding: 12px 18px 4px; }
.rnd-title { min-width: 0; max-width: 34vw; background: rgba(255, 255, 255, .88); padding: 6px 16px 7px; border-radius: 18px; box-shadow: 0 4px 14px rgba(46, 36, 82, .1); }
.rnd-title b { display: block; font-family: var(--display); font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rnd-title span { font-size: 14px; color: var(--ink-2); }
.beads { flex: 1; display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 20px; }
.beads i { width: 16px; height: 16px; border-radius: 50%; background: rgba(255, 255, 255, .75); box-shadow: inset 0 0 0 2px rgba(46, 36, 82, .14); transition: background .2s; }
.beads i.on { background: radial-gradient(circle at 35% 30%, #FFF6D6, #FFC84A 55%, #E89F1C); box-shadow: 0 0 10px rgba(255, 200, 74, .75); animation: beadPop .35s ease-out; }
.bead-count { font-family: var(--display); font-size: 28px; margin-right: 6px; }
.egg-chip { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .85); border-radius: 999px; padding: 4px 14px 4px 6px; font-weight: 700; font-size: 14px; box-shadow: 0 4px 12px rgba(46, 36, 82, .08); }
.mini-egg { width: 26px; height: 30px; display: inline-block; flex: 0 0 auto; }
.rnd-main { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 18px 12px; }
.stage {
  position: relative;
  width: min(1100px, 100%);
  flex: 1 1 auto;
  min-height: 250px;
  border-radius: 34px;
  overflow: hidden;
  background: rgba(255, 255, 255, .4);
  box-shadow: 0 16px 44px rgba(46, 36, 82, .16), inset 0 0 0 2px rgba(255, 255, 255, .7);
}
.stage-art { position: absolute; inset: 0; }
.scene-soft { position: absolute; inset: 0; background: radial-gradient(130% 60% at 50% 118%, var(--near) 0 55%, transparent 56%), linear-gradient(var(--sky1), #FFFFFF 85%); }
.scene-soft::before, .scene-soft::after { content: ''; position: absolute; width: 180px; height: 60px; border-radius: 60px; background: #fff; opacity: .8; box-shadow: 40px -22px 0 6px #fff, 90px 0 0 -4px #fff; animation: drift 38s ease-in-out infinite alternate; }
.scene-soft::before { left: 12%; top: 18%; }
.scene-soft::after { right: 18%; top: 10%; transform: scale(.7); animation-duration: 52s; }
.scene-soft.book-bg::before, .scene-soft.book-bg::after { display: none; }
.scene-soft.night-soft::before, .scene-soft.night-soft::after { opacity: .12; }
.scene-soft.night-soft { background: radial-gradient(130% 60% at 50% 118%, #3F6E7A 0 55%, transparent 56%), linear-gradient(#2A2463, #5E4A9E); }
.pip-slot { position: absolute; left: 16px; top: 14px; z-index: 3; }
.caps-hint { position: absolute; right: 16px; top: 16px; z-index: 5; background: #FFF6D6; border-radius: 14px; padding: 8px 14px; font-weight: 700; font-size: 14px; box-shadow: var(--lift); }
.ribbon-slot { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 4; max-width: 96%; transition: opacity .4s; }
.ribbon-slot.hidden-ribbon { opacity: 0; pointer-events: none; }
.ribbon { display: flex; align-items: baseline; gap: 22px; padding: 12px 28px 14px; background: rgba(255, 255, 255, .95); border-radius: 30px; box-shadow: 0 12px 30px rgba(46, 36, 82, .2); white-space: nowrap; }
.wr-prev { font-size: 20px; color: var(--ink-3); min-width: 40px; text-align: right; }
.wr-cur { position: relative; display: flex; align-items: baseline; font-size: clamp(36px, 4.4vw, 58px); font-weight: 700; letter-spacing: .02em; padding: 0 8px; border-radius: 18px; }
.wr-cur.enter { animation: wordIn .3s ease-out; }
.wl { position: relative; color: var(--ink); transition: color .12s; }
.wl.done { color: #F0A21A; text-shadow: 0 0 14px rgba(255, 200, 74, .7); }
.wl.cur::after { content: ''; position: absolute; left: 4%; right: 4%; bottom: -7px; height: 6px; border-radius: 4px; background: var(--fc); animation: curBob .9s ease-in-out infinite; }
.wl.fizz { animation: fizz .4s ease-out; }
.wl.sp { font-size: .34em; align-self: center; margin-left: 12px; }
.wl.sp i { font-style: normal; font-family: var(--body); font-weight: 700; padding: 5px 12px; border-radius: 10px; background: rgba(120, 198, 255, .2); color: var(--ink-2); }
.wl.sp.cur i { background: var(--sky); color: #fff; }
.wl.sp.cur::after { display: none; }
.wl.sp.done i { background: #FFE9A8; color: var(--ink-2); }
.wr-cur.sparkle { background: linear-gradient(110deg, #FFF8DF 20%, #FFE38A 40%, #FFF8DF 60%); background-size: 220% 100%; animation: shimmer 1.6s linear infinite; box-shadow: 0 0 0 3px #FFD35C, 0 0 26px rgba(255, 211, 92, .85); }
.wr-cur.own { box-shadow: 0 0 0 3px #FFB3CF; }
.wr-tag { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); font-family: var(--display); font-size: 13px; letter-spacing: 0; background: #FFD35C; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.wr-tag.own { background: #FFB3CF; }
.wr-next { font-size: 22px; color: var(--ink-2); opacity: .55; white-space: pre; }
.rhythm { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--ink-2); background: rgba(255, 255, 255, .82); padding: 4px 14px; border-radius: 999px; }
.rh { display: flex; gap: 5px; }
.rh i { width: 12px; height: 12px; border-radius: 50%; background: rgba(46, 36, 82, .12); transition: background .15s, box-shadow .15s; }
.rh i.on { background: var(--violet); box-shadow: 0 0 8px rgba(183, 156, 255, .9); }
.rhythm.flash .rh i { animation: rhFlash .8s ease-out; }
.kb-slot { width: min(980px, 100%); height: clamp(150px, 27vh, 270px); flex: 0 0 auto; }
.pause-ov { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(46, 36, 82, .35); padding: 16px; }
.pause-card { padding: 26px 30px; text-align: center; max-width: 480px; }
.pause-card h2 { font-family: var(--display); font-size: 30px; margin: 0 0 6px; }
.pause-card p { font-size: 17px; margin: 0 0 18px; }

/* round stages */
.nest-wrap { position: absolute; left: 50%; top: calc((100% - 134px) / 2); transform: translate(-50%, -50%); width: 280px; display: flex; flex-direction: column; align-items: center; }
.nest-wrap .egg { width: clamp(84px, 15vh, 170px); aspect-ratio: 128 / 150; position: relative; z-index: 2; margin-bottom: -22px; }
.nest-wrap .nest { width: clamp(140px, 23vh, 260px); aspect-ratio: 200 / 70; position: relative; z-index: 3; }
.egg-glow { position: absolute; left: 50%; top: 40%; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 210, 110, .85), rgba(255, 170, 94, .25) 45%, transparent 68%); transform: translate(-50%, -50%); opacity: .3; transition: opacity .5s, transform .5s; z-index: 1; }
.warm-label { margin-top: 12px; display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink-2); background: rgba(255, 255, 255, .8); padding: 6px 12px; border-radius: 999px; }
.try-dots { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 8px; background: rgba(255, 255, 255, .92); padding: 10px 18px; border-radius: 22px; box-shadow: var(--lift); font-family: var(--display); font-size: 19px; text-align: center; }
.try-dots div { display: flex; gap: 8px; }
.try-dots i { width: 18px; height: 18px; border-radius: 50%; background: rgba(46, 36, 82, .12); }
.try-dots i.on { background: var(--honey); box-shadow: 0 0 10px rgba(255, 200, 74, .8); animation: beadPop .3s; }
.feed-wrap { position: absolute; left: 50%; top: calc((100% - 134px) / 2); transform: translate(-50%, -50%); display: flex; align-items: flex-end; gap: 30px; }
.big-pet { width: clamp(120px, 23vh, 280px); }
.bowl { position: relative; width: 120px; height: 50px; margin-bottom: 10px; }
.bowl svg { width: 100%; height: 100%; display: block; }
.hearts { position: absolute; right: 20px; top: 18px; display: flex; gap: 6px; font-size: 22px; color: rgba(46, 36, 82, .15); }
.hearts i { font-style: normal; transition: color .3s, transform .3s; }
.hearts i.on { color: var(--rose); transform: scale(1.15); text-shadow: 0 0 10px rgba(255, 141, 179, .6); }
.build-wrap { position: absolute; left: 50%; top: 18px; bottom: 140px; transform: translateX(-50%); width: min(420px, 60%); }
.bld { position: absolute; inset: 0; }
.bld.ghost { opacity: .22; filter: grayscale(1); }
.bld.real { transition: clip-path .6s ease; }
.bld.real.done { animation: builtPop .8s ease-out; }
.ground-pad { position: absolute; left: 10%; right: 10%; bottom: -6px; height: 16px; border-radius: 50%; background: rgba(46, 36, 82, .12); z-index: -1; }
.build-label { position: absolute; right: 16px; top: 16px; z-index: 3; display: flex; flex-direction: column; gap: 6px; background: rgba(255, 255, 255, .9); padding: 10px 14px; border-radius: 18px; box-shadow: var(--lift); font-size: 14px; color: var(--ink-2); }
.build-label b { font-family: var(--display); font-size: 18px; color: var(--ink); }
.build-label .pbar { width: 170px; }
.book-bg { background: linear-gradient(#F7EEDD, #EFE2C9); }
.book { position: absolute; left: 50%; top: 16px; bottom: 140px; transform: translateX(-50%); width: min(900px, 92%); display: flex; border-radius: 18px; box-shadow: 0 18px 40px rgba(80, 50, 20, .25); }
.book-page { flex: 1; background: #FFFDF6; padding: 22px 28px; overflow: hidden; }
.book-page.left { border-radius: 18px 0 0 18px; box-shadow: inset -14px 0 20px -14px rgba(80, 50, 20, .3); flex: 0 0 34%; display: flex; flex-direction: column; }
.book-page.right { border-radius: 0 18px 18px 0; box-shadow: inset 14px 0 20px -14px rgba(80, 50, 20, .3); display: flex; align-items: center; }
.chapter-k { font-size: 13px; font-weight: 700; color: var(--honey-lo); }
.book-page h3 { font-family: var(--display); font-size: 22px; margin: 4px 0 8px; line-height: 1.15; }
.book-art { flex: 1; display: grid; place-items: center; }
.pip-mini { width: 90px; animation: pipFloat 3s ease-in-out infinite; }
.page-n { font-size: 13px; color: var(--ink-3); }
.story-text { font-size: clamp(16px, 1.55vw, 21px); line-height: 1.7; margin: 0; }
.tk { color: transparent; border-radius: 4px; background: linear-gradient(transparent 62%, rgba(46, 36, 82, .1) 62% 80%, transparent 80%); transition: color .5s, background .5s; }
.tk.typeable { background: linear-gradient(transparent 62%, rgba(255, 200, 74, .5) 62% 80%, transparent 80%); }
.tk.shown { color: var(--ink); background: none; }
.tk.target { color: var(--ink); background: #FFEDB0; box-shadow: 0 0 0 3px #FFD35C; padding: 0 3px; }
.track { position: absolute; left: 4%; right: 4%; top: 70px; bottom: 150px; display: flex; flex-direction: column; gap: 12px; }
.lane { position: relative; flex: 1; border-radius: 22px; background: rgba(255, 255, 255, .55); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .8); }
.runner { position: absolute; left: 8px; bottom: 4px; width: 96px; will-change: transform; }
.runner .tag { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); white-space: nowrap; font-family: var(--display); font-size: 13px; background: #fff; padding: 1px 8px; border-radius: 999px; box-shadow: 0 2px 6px rgba(46, 36, 82, .12); }
.runner.ghost svg { opacity: .45; filter: saturate(.4) hue-rotate(200deg); }
.finish { position: absolute; right: 0; top: -6px; bottom: -6px; width: 16px; border-radius: 8px; background: repeating-conic-gradient(var(--ink) 0 25%, #fff 0 50%) 0 0 / 16px 16px; opacity: .7; }
.start-card { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); text-align: center; padding: 20px; }
.start-card h3 { font-family: var(--display); font-size: 30px; margin: 0; }
.start-card p { margin: 0; font-size: 17px; max-width: 520px; }
.start-card .sub { font-size: 14px; color: var(--ink-2); }
.jar-wrap { position: absolute; left: 50%; top: calc((100% - 134px) / 2); transform: translate(-50%, -50%); display: flex; align-items: center; gap: 40px; }
.jar { position: relative; width: clamp(120px, 18vh, 170px); aspect-ratio: 170 / 200; border-radius: 40px 40px 50px 50px; background: rgba(220, 235, 255, .25); box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .6), 0 10px 30px rgba(0, 0, 0, .2); }
.jar::before { content: ''; position: absolute; left: 30px; right: 30px; top: -16px; height: 22px; border-radius: 8px; background: #C99A6B; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15); }
.flies { position: absolute; inset: 14px; }
.fly-dot { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #FFF3A0; box-shadow: 0 0 14px 6px rgba(255, 230, 110, .7); animation: firefly 3s ease-in-out infinite; }
.timer-ring { position: relative; width: 110px; height: 110px; display: grid; place-items: center; }
.timer-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.tr-bg { fill: rgba(255, 255, 255, .2); stroke: rgba(255, 255, 255, .5); stroke-width: 3; }
.tr-fg { fill: none; stroke: #FFE45C; stroke-width: 5; stroke-dasharray: 113.1; stroke-dashoffset: 0; stroke-linecap: round; }
.timer-ring b { position: relative; font-family: var(--display); font-size: 34px; color: #fff; }

/* things flying across the screen */
.flyer { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; will-change: transform; }
.food-fly { font-size: 40px; filter: drop-shadow(0 4px 4px rgba(46, 36, 82, .2)); }
.spark-fly { font-size: 34px; color: #FFB938; text-shadow: 0 0 12px #FFD35C; }
.block-fly { display: block; width: 34px; height: 26px; border-radius: 7px; background: var(--c); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .12), 0 0 0 2.5px var(--ink); }
.gift-fly { display: block; width: 46px; height: 46px; }
.float-txt { position: fixed; transform: translate(-50%, -50%); font-family: var(--display); font-weight: 800; font-size: 26px; color: #fff; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; pointer-events: none; z-index: 75; animation: floatUp 1.2s ease-out forwards; white-space: nowrap; }
.float-txt.gold { color: #FFD35C; }
.float-txt.heart { color: var(--rose); font-size: 34px; }

/* ---------- keyboard ---------- */
.kbv { width: 100%; height: 100%; display: flex; justify-content: center; }
.kbv-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.kb-chassis { fill: #4A3F86; }
.key .k-side { fill: var(--fd, #B9B3D6); }
.key .k-top { fill: var(--ft, #F1EEFB); transition: fill .15s; }
.key.mod .k-side { fill: #8A83B3; }
.key.mod .k-top { fill: #C7C1E2; }
.key.locked .k-side { fill: #9F99C2; }
.key.locked .k-top { fill: #DAD5EE; }
.key .k-bump { fill: var(--ink); opacity: .4; }
.key .k-glow { fill: none; stroke: var(--fc, #fff); stroke-width: 6; opacity: 0; }
.key .kp, .key .kc, .kl .klc { transform-box: fill-box; transform-origin: center; }
.key .kc, .kl .klc { transition: transform .07s ease-out; }
.key.down .kc, .kl.down .klc { transform: translateY(4px); }
.key.target .k-top { fill: var(--fc, #fff); }
.key.target .k-glow { opacity: 1; animation: glow 1s ease-in-out infinite; }
.key.target .kp { animation: keyBob 1s ease-in-out infinite; }
.key.wrong .k-top { fill: #EEE9FF; }
.focus-mode .key:not(.focus):not(.target) { opacity: .5; }
.focus-mode .kl:not(.focus):not(.target) { opacity: .4; }
.key, .kl { transition: opacity .3s; }
.kb-labels text { font-family: var(--display); font-weight: 700; fill: var(--ink); text-anchor: middle; dominant-baseline: central; pointer-events: none; paint-order: stroke; stroke: rgba(255, 255, 255, .6); stroke-width: 3px; stroke-linejoin: round; }
.kt-main { font-size: 23px; }
.kt-shift { font-size: 13px; opacity: .75; }
.kt-base { font-size: 19px; }
.kb-labels .kt-mod { font-size: 12px; text-anchor: start; font-family: var(--body); opacity: .75; stroke: none; }
.kl.locked text { fill: #8A84AE; stroke: none; }
.kb-hands { transition: opacity .45s; }
.hands-soft { opacity: .7; }
.nail-ring { transform-box: fill-box; transform-origin: center; animation: ring 1s ease-out infinite; }
.kb-arrow { fill: none; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 12 10; animation: dash .7s linear infinite; }
.kb-arrow-back { fill: none; stroke-width: 13; stroke-linecap: round; }
.kb-labels .kb-pop { font-size: 36px; stroke: #fff; stroke-width: 7px; transform-box: fill-box; transform-origin: center; animation: kbPop .85s ease-out forwards; }

/* ---------- the Hollow ---------- */
.hub, .title-scr, .bed-scr { position: absolute; inset: 0; overflow: hidden; }
.world { position: absolute; inset: 0; }
.world-svg { width: 100%; height: 100%; display: block; }
.world-layer { position: absolute; inset: 0; pointer-events: none; }
.world-layer > * { pointer-events: auto; }
.world-sign { font-family: var(--display); font-weight: 800; font-size: 22px; fill: var(--ink); }
.wpet, .wegg { position: absolute; left: 0; top: 0; background: none; border: 0; padding: 0; cursor: pointer; will-change: transform; }
.wpet.flip .kl-svg { transform: scaleX(-1); }
.wpet.walking .kl-body { animation: walkBob .42s ease-in-out infinite; }
.wpet:hover .kl-body, .wpet:focus-visible .kl-body { animation: hopOnce .5s ease-out; }
.zz { position: absolute; right: -4%; top: 0; font-family: var(--display); font-weight: 800; color: #fff; font-size: 14px; text-shadow: 0 2px 6px rgba(0, 0, 0, .3); animation: zz 2.4s ease-in-out infinite; }
.wegg-glow { position: absolute; inset: -40%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 214, 120, .95), transparent 62%); animation: twinkle 2.2s ease-in-out infinite; }
.wegg .egg-svg { position: relative; }
.wegg .egg-body { animation: wobble 2.6s ease-in-out infinite; }
.hub-top { position: absolute; top: 14px; left: 16px; right: 16px; display: flex; align-items: flex-start; gap: 12px; z-index: 6; pointer-events: none; }
.hub-top > * { pointer-events: auto; }
.keeper { padding: 9px 18px; }
.keeper b { display: block; font-family: var(--display); font-size: 22px; line-height: 1.1; }
.keeper span { font-size: 13px; color: var(--ink-2); }
.hub-nav { margin-left: auto; display: flex; gap: 8px; align-items: flex-start; }
.gate { position: relative; }
.gate-ring { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); transform: rotate(-90deg); pointer-events: none; }
.gate-ring circle { fill: none; stroke: var(--honey); stroke-width: 4; stroke-dasharray: 120; stroke-dashoffset: 120; }
.gate.holding .gate-ring circle { transition: stroke-dashoffset 1s linear; stroke-dashoffset: 0; }
.hub-pip { position: absolute; top: 88px; left: 16px; z-index: 6; }
.hub { --dock: 190px; }
.hub > .world { bottom: var(--dock); }
.hub-dock { position: absolute; left: 0; right: 0; bottom: 0; height: var(--dock); z-index: 6; display: flex; align-items: stretch; justify-content: center; gap: 14px; padding: 12px 16px 14px; background: linear-gradient(var(--g1), var(--g2)); box-shadow: inset 0 10px 18px -12px rgba(46, 36, 82, .35); }
.hub-dock::before { content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 16px; background: radial-gradient(14px 10px at 12px 14px, var(--g1) 98%, transparent) 0 0 / 24px 16px repeat-x; }
.dock-spacer { width: 232px; flex: 0 1 232px; }
.hub-next { flex: 1 1 640px; max-width: 660px; padding: 14px 18px 10px; display: flex; flex-direction: column; justify-content: center; }
.next-main { display: flex; align-items: center; gap: 14px; }
.next-ic { width: 70px; height: 70px; flex: 0 0 auto; display: grid; place-items: center; }
.next-ic.moon { font-size: 54px; }
.book-ic svg { width: 56px; height: 56px; fill: none; stroke: var(--ink); }
.next-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.next-txt .eyebrowless { font-size: 13px; font-weight: 700; color: var(--honey-lo); }
.next-txt b { font-family: var(--display); font-size: clamp(19px, 1.9vw, 25px); line-height: 1.1; }
.next-txt .pbar { width: 100%; margin: 4px 0; }
.next-txt > span:last-child { font-size: 15px; color: var(--ink-2); }
.play-btn svg { width: 22px; height: 22px; }
.next-unlock, .sum-next { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding-top: 8px; border-top: 1.5px dashed rgba(46, 36, 82, .12); }
.nu-ic { width: 50px; height: 40px; flex: 0 0 auto; }
.next-unlock > div, .sum-next > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.next-unlock span, .sum-next span { font-size: 12px; color: var(--ink-2); }
.next-unlock b, .sum-next b { font-family: var(--display); font-size: 16px; }
.next-unlock .pbar, .sum-next .pbar { width: 100%; }
.next-unlock small, .sum-next small { font-size: 12px; color: var(--ink-2); }
.hub-week { flex: 0 1 252px; padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; }
.hub-week b, .hub-more b { font-family: var(--display); font-size: 16px; }
.pots { display: flex; align-items: flex-end; gap: 3px; margin: 6px 0 4px; }
.pot { display: flex; flex-direction: column; align-items: center; width: 24px; font-size: 11px; color: var(--ink-2); }
.pot i { font-style: normal; font-size: 19px; filter: grayscale(.7) opacity(.55); }
.pot.bloom i { filter: none; animation: bob 2.4s ease-in-out infinite; }
.pot.today small { font-weight: 800; color: var(--ink); }
.chest { margin-left: auto; font-size: 30px; background: none; border: 0; padding: 0; filter: grayscale(.6) opacity(.55); }
.chest.ready { filter: none; cursor: pointer; animation: chestBounce 1.1s ease-in-out infinite; }
.chest.opened { filter: none; }
.week-line { font-size: 12px; color: var(--ink-2); }
.hub-more { flex: 0 1 232px; padding: 12px; display: flex; flex-direction: column; justify-content: center; }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.more-btn { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 14px; border: 0; background: rgba(46, 36, 82, .06); font-family: var(--display); font-weight: 700; font-size: 13px; text-align: left; cursor: pointer; transition: background .15s, transform .08s; }
.more-btn:hover { background: rgba(255, 200, 74, .25); }
.more-btn:active { transform: translateY(2px); }
.more-btn span { font-size: 18px; }

/* ---------- title and setup ---------- */
.title-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%); width: min(560px, calc(100% - 32px)); padding: 28px 32px 26px; text-align: center; }
.logo { font-family: var(--display); font-weight: 800; font-size: clamp(48px, 7vw, 76px); margin: 0; line-height: 1; letter-spacing: .01em; color: var(--ink); text-shadow: 0 4px 0 #FFD35C, 0 10px 30px rgba(255, 200, 74, .5); }
.title-eggs { display: flex; justify-content: center; gap: 12px; margin: 14px 0 8px; }
.t-egg { width: 54px; height: 64px; }
.title-card > p { font-size: 18px; line-height: 1.45; margin: 6px 0 16px; }
.hold-row { display: flex; align-items: center; gap: 14px; justify-content: center; margin-bottom: 16px; text-align: left; font-size: 15px; }
.hold { position: relative; width: 70px; height: 70px; display: grid; place-items: center; flex: 0 0 auto; }
.hold svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.hold > span { position: relative; display: flex; font-size: 12px; }
.hr-bg { fill: none; stroke: rgba(46, 36, 82, .1); stroke-width: 6; }
.hr-fg { fill: none; stroke: var(--leaf); stroke-width: 6; stroke-dasharray: 169.6; stroke-dashoffset: 169.6; stroke-linecap: round; }
.setup-scr { position: absolute; inset: 0; overflow-y: auto; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(120% 70% at 50% 110%, #8FD18C 0 40%, transparent 41%), linear-gradient(#9ED8FF, #E9F7FF); }
.setup-card { width: min(680px, 100%); padding: 26px 30px; }
.setup-card h1 { font-family: var(--display); font-size: 38px; margin: 0; }
#kname { width: 100%; font-family: var(--body); font-size: 30px; font-weight: 700; padding: 10px 18px; border: 2px solid rgba(46, 36, 82, .15); border-radius: 18px; background: #fff; color: var(--ink); outline: none; }
#kname:focus { border-color: var(--sky); box-shadow: 0 0 0 4px rgba(120, 198, 255, .3); }
.nudge { animation: fizz .4s; }
.theme-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.theme-opt { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 18px; border: 2px solid rgba(46, 36, 82, .1); background: #fff; cursor: pointer; font-family: var(--display); font-size: 14px; }
.theme-opt[aria-pressed=true] { border-color: var(--honey); box-shadow: 0 0 0 3px rgba(255, 200, 74, .4); }
.theme-sw { height: 56px; border-radius: 12px; background: radial-gradient(120% 70% at 50% 120%, var(--b) 0 50%, transparent 51%), linear-gradient(var(--a), #fff); position: relative; }
.theme-sw::after { content: ''; position: absolute; right: 12px; top: 10px; width: 14px; height: 14px; border-radius: 50%; background: var(--c); }
.skins { display: flex; gap: 10px; flex-wrap: wrap; }
.skin { width: 42px; height: 42px; border-radius: 50%; background: var(--c); border: 2px solid rgba(46, 36, 82, .2); cursor: pointer; }
.skin[aria-pressed=true] { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--honey); }

/* ---------- pages: collection, book, write, grown-ups ---------- */
.page-scr { position: absolute; inset: 0; overflow-y: auto; padding: 16px 20px 30px; background: linear-gradient(#E3F2FF, #F7F3FF); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.page-top { width: min(1100px, 100%); display: flex; align-items: center; gap: 14px; }
.page-top h1 { flex: 1; font-family: var(--display); font-size: clamp(26px, 3vw, 36px); margin: 0; }
.page-top .count { font-family: var(--display); font-size: 16px; background: #fff; padding: 6px 14px; border-radius: 999px; box-shadow: var(--lift); }
.tabs { width: min(1100px, 100%); display: flex; gap: 8px; }
.tab { padding: 9px 16px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .7); font-family: var(--display); font-weight: 700; cursor: pointer; }
.tab[aria-selected=true] { background: #fff; box-shadow: var(--lift); }
.tab-body { width: min(1100px, 100%); }
.tab-note { color: var(--ink-2); margin: 4px 0 12px; }
.kgrid { display: flex; flex-direction: column; gap: 8px; background: #4A3F86; padding: 14px; border-radius: 26px; box-shadow: var(--lift-2); }
.krow { display: flex; gap: 8px; }
.kcell { position: relative; min-width: 0; height: 96px; border-radius: 16px; background: #F1EEFB; border: 0; padding: 4px 4px 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: inset 0 -5px 0 rgba(46, 36, 82, .15); }
.kcell > span { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--ink-2); }
.kcell.has { background: #FFFFFF; cursor: pointer; }
.kcell.has svg { height: 74px; width: auto; }
.kcell.has:hover .kl-body { animation: hopOnce .5s ease-out; }
.kcell.egg { background: #FFF6DE; }
.kcell.egg .egg-svg { height: 56px; width: auto; }
.kcell.egg .pbar { width: 70%; height: 6px; position: absolute; bottom: 22px; }
.kcell.shell { background: rgba(255, 255, 255, .25); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45); }
.kcell.shell > span, .kcell.plain > span { color: rgba(255, 255, 255, .8); font-size: 16px; position: static; }
.kcell.plain { background: rgba(255, 255, 255, .04); box-shadow: none; }
.kcell.plain > span { color: rgba(255, 255, 255, .38); font-size: 13px; }
.kcell.egg .new-tag { position: absolute; top: 4px; right: 6px; font-style: normal; font-family: var(--display); font-size: 11px; background: var(--honey); padding: 1px 7px; border-radius: 999px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.cell { background: #fff; border-radius: 22px; padding: 14px 12px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; border: 0; box-shadow: var(--lift); }
.cell svg { height: 100px; width: auto; }
.cell b { font-family: var(--display); font-size: 16px; }
.cell small { color: var(--ink-2); }
.cell.has { cursor: pointer; }
.cell[data-pet]:hover .kl-body { animation: hopOnce .5s ease-out; }
.cell.unknown { background: rgba(255, 255, 255, .6); box-shadow: none; }
.cell .q { width: 100px; height: 100px; display: grid; place-items: center; font-family: var(--display); font-size: 44px; color: var(--ink-4); border-radius: 50%; border: 3px dashed var(--ink-4); }
.book-scr { width: min(1100px, 100%); display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.chapters { display: flex; flex-direction: column; gap: 6px; }
.ch-btn { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 16px; border: 0; background: rgba(255, 255, 255, .7); font-family: var(--display); font-weight: 700; font-size: 15px; cursor: pointer; }
.ch-btn span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--glow); flex: 0 0 auto; }
.ch-btn.on { background: #fff; box-shadow: var(--lift); }
.ch-btn:disabled { opacity: .5; cursor: default; }
.chapter { padding: 24px 30px; background: #FFFDF6; }
.chapter h2 { font-family: var(--display); font-size: 28px; margin: 0 0 12px; }
.pg { font-size: 20px; line-height: 1.7; margin: 0 0 14px; }
.hidden-pg { color: var(--ink-3); font-style: italic; }
.read { border: 0; background: var(--glow); border-radius: 50%; width: 32px; height: 32px; vertical-align: middle; cursor: pointer; padding: 6px; }
.read svg { width: 100%; height: 100%; fill: var(--ink); stroke: var(--ink); }
.the-end { font-family: var(--display); font-size: 22px; text-align: center; color: var(--honey-lo); }
.write-scr { padding-bottom: 12px; }
.write-wrap { width: min(900px, 100%); display: flex; flex-direction: column; gap: 12px; }
.to-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.to-opt { display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 2px solid rgba(46, 36, 82, .1); background: #fff; cursor: pointer; font-family: var(--display); font-size: 14px; }
.to-opt[aria-pressed=true] { border-color: var(--honey); box-shadow: 0 0 0 3px rgba(255, 200, 74, .35); }
.to-av { width: 34px; height: 34px; display: grid; place-items: center; }
.to-av.diary { font-size: 22px; }
.paper { padding: 22px 26px; min-height: 180px; background: repeating-linear-gradient(#FFFDF6 0 39px, #E9E1FF 39px 40px); }
.paper-text { font-size: 26px; line-height: 40px; white-space: pre-wrap; word-break: break-word; min-height: 120px; }
.dear { display: block; font-family: var(--display); color: var(--ink-2); }
.caret { display: inline-block; width: 3px; height: 30px; background: var(--ink); vertical-align: -5px; margin-left: 2px; animation: caret 1s steps(1) infinite; }
.paper-hint { font-size: 14px; color: var(--ink-3); margin-top: 8px; }
.paper.nudge { animation: fizz .4s; }
.write-scr .kb-slot { margin-top: auto; }
.parent-grid { width: min(1100px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.pc { padding: 20px 24px; }
.pc h2 { font-family: var(--display); font-size: 24px; margin: 0 0 10px; }
.pc h3 { font-family: var(--display); font-size: 17px; margin: 18px 0 6px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats div { background: var(--mist); border-radius: 16px; padding: 10px 12px; }
.stats b { display: block; font-family: var(--display); font-size: 26px; }
.stats span { font-size: 12px; color: var(--ink-2); }
.spark { width: 100%; height: 76px; }
.spark polyline { fill: none; stroke: var(--sky); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.keys-t { width: 100%; border-collapse: collapse; font-size: 14px; }
.keys-t th { text-align: left; font-size: 12px; color: var(--ink-2); padding: 4px 6px; }
.keys-t td { padding: 4px 6px; border-top: 1px solid rgba(46, 36, 82, .08); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1.5px dashed rgba(46, 36, 82, .1); }
.set-row b { display: block; font-size: 16px; }
.set-row span { font-size: 13px; color: var(--ink-2); }
.switch { width: 58px; height: 32px; border-radius: 999px; border: 0; background: var(--ink-4); position: relative; cursor: pointer; flex: 0 0 auto; padding: 0; }
.switch i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(46, 36, 82, .25); transition: left .15s; }
.switch[aria-checked=true] { background: var(--leaf); }
.switch[aria-checked=true] i { left: 29px; }
.seg { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; flex: 0 0 auto; max-width: 60%; }
.seg button { border: 0; background: var(--mist); padding: 6px 10px; border-radius: 10px; font-weight: 700; font-size: 13px; cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--honey); }
.about { font-size: 14px; line-height: 1.5; color: var(--ink-2); }

/* ---------- modals: summaries, celebrations, cards ---------- */
.modal-back { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(46, 36, 82, .4); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fadeIn .25s; }
.modal { width: 100%; max-width: 640px; max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 30px; padding: 24px 28px; box-shadow: var(--lift-2); animation: popIn .35s cubic-bezier(.2, 1.4, .4, 1); }
.modal h2 { font-family: var(--display); font-size: 30px; margin: 4px 0 10px; line-height: 1.15; }
.summary, .celebrate, .whatnext, .sent, .style-pick { text-align: center; }
.style-pick { text-align: left; }
.style-pick h2 { text-align: center; }
.sum-pip { width: 74px; margin: -6px auto 0; animation: pipFloat 3s ease-in-out infinite; }
.chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 4px 0 10px; }
.chip { background: var(--mist); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 15px; }
.chip.gold { background: var(--glow); }
.gifts { display: flex; justify-content: center; gap: 16px; margin: 10px 0; }
.gift { position: relative; width: 110px; height: 120px; }
.gift-box { position: absolute; inset: 10px 15px 30px; animation: giftShake .5s ease-in-out var(--d) 2, giftAway .3s ease-in calc(var(--d) + 1s) forwards; }
.gift-open { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; opacity: 0; animation: giftReveal .5s cubic-bezier(.2, 1.5, .4, 1) calc(var(--d) + 1.1s) forwards; }
.gift-open b { font-family: var(--display); font-size: 13px; }
.gift-item { width: 80px; height: 74px; display: grid; place-items: center; }
.gift-item svg { width: 100%; height: 100%; }
.gift-item.berries { font-size: 50px; }
.story-quote { margin: 10px 0; padding: 14px 18px; background: #FFFDF6; border-radius: 18px; font-size: 18px; line-height: 1.6; text-align: left; box-shadow: inset 0 0 0 2px #F3E6C9; }
.cliff { font-family: var(--display); font-size: 18px; color: var(--honey-lo); }
.best { font-family: var(--display); font-size: 18px; color: #2F9E68; }
.best.soft { color: var(--ink-2); font-family: var(--body); font-size: 16px; }
.note { font-family: var(--display); font-size: 17px; margin: 6px 0; }
.sum-progress { background: var(--mist); border-radius: 20px; padding: 10px 14px; margin: 12px 0 10px; text-align: left; }
.sum-progress .sum-next { margin-top: 0; padding-top: 0; border-top: 0; }
.sum-egg { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1.5px dashed rgba(46, 36, 82, .12); }
.sum-egg .pbar { flex: 1; }
.sum-egg small { color: var(--ink-2); }
.sleepy { font-family: var(--display); font-size: 17px; color: var(--violet); margin: 4px 0 10px; }
.cel-back .modal { max-width: 560px; }
.cel-art { position: relative; width: 220px; height: 220px; margin: 0 auto; display: grid; place-items: center; }
.cel-art.small { width: 150px; height: 150px; }
.cel-art.built { width: 300px; height: 230px; animation: builtPop .8s ease-out; }
.cel-art.chest-open { width: 160px; height: 140px; animation: builtPop .7s ease-out; }
.hatch-egg { position: absolute; inset: 10px 30px; }
.hatch-pet { position: absolute; inset: -6px 0; }
.hatch-egg.shake .egg-svg { animation: eggShake .5s ease-in-out; }
.hatch-pet { opacity: 0; transform: scale(.3); transition: opacity .4s, transform .6s cubic-bezier(.2, 1.6, .4, 1); }
.hatch-burst { position: absolute; inset: -20px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 241, 194, 1), rgba(255, 211, 92, .5) 40%, transparent 70%); opacity: 0; transform: scale(.4); }
.cel-art.hatched .hatch-egg { opacity: 0; transform: scale(1.3); transition: .3s; }
.cel-art.hatched .hatch-pet { opacity: 1; transform: scale(1); }
.cel-art.hatched .hatch-burst { animation: burst 1s ease-out; }
.cel-sub { font-size: 17px; line-height: 1.45; }
.name-form label { display: block; font-family: var(--display); font-size: 17px; margin: 8px 0; }
.name-form input, .rename input { font-family: var(--body); font-size: 24px; font-weight: 700; padding: 8px 14px; border-radius: 16px; border: 2px solid rgba(46, 36, 82, .15); color: var(--ink); width: 220px; outline: none; }
.name-form input:focus, .rename input:focus { border-color: var(--sky); box-shadow: 0 0 0 4px rgba(120, 198, 255, .3); }
.petcard { display: flex; gap: 20px; align-items: flex-start; text-align: left; }
.pc-art { width: 190px; flex: 0 0 auto; }
.pc-info { flex: 1; min-width: 0; }
.pc-info .pc-name { margin: 0; }
.pc-info p { margin: 4px 0; font-size: 16px; }
.pc-facts { display: flex; gap: 16px; flex-wrap: wrap; color: var(--ink-2); font-size: 14px !important; }
.rename { display: flex; gap: 8px; align-items: center; margin: 10px 0 4px; }
.rename input { font-size: 18px; width: 170px; padding: 6px 12px; }
.hat-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.hat-opt { width: 58px; height: 50px; border-radius: 14px; border: 2px solid rgba(46, 36, 82, .1); background: var(--mist); cursor: pointer; padding: 4px; font-size: 12px; font-weight: 700; }
.hat-opt[aria-pressed=true] { border-color: var(--honey); background: var(--glow); }
.petcard .row { justify-content: flex-start; }
.sent-art { width: 150px; height: 150px; margin: 0 auto; display: grid; place-items: center; animation: builtPop .6s ease-out; }
.diary-big { font-size: 90px; }
.bed-card { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: min(520px, calc(100% - 32px)); padding: 24px 30px; text-align: center; }
.bed-card h1 { font-family: var(--display); font-size: 36px; margin: 0 0 6px; }
.bed-card p { font-size: 18px; line-height: 1.45; margin: 6px 0; }
.bed-card .teaser { font-family: var(--display); color: var(--violet); margin-bottom: 16px; }
.moon-ic { font-size: 56px; animation: bob 3s ease-in-out infinite; }
#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 90; pointer-events: none; }
.toast { background: #fff; border-radius: 18px; padding: 10px 16px; font-weight: 700; box-shadow: var(--lift); display: flex; gap: 10px; align-items: center; animation: popIn .3s ease-out; }
.toast.out { opacity: 0; transform: translateY(10px); transition: .4s; }

/* ---------- world motion ---------- */
.drift { animation: drift 46s ease-in-out infinite alternate; }
.twinkle { animation: twinkle 2.4s ease-in-out infinite; }
.spin { transform-box: fill-box; transform-origin: center; animation: spin 9s linear infinite; }
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker .5s ease-in-out infinite alternate; }
.smoke circle { animation: smoke 3.2s ease-out infinite; }
.smoke circle:nth-child(2) { animation-delay: 1.6s; }
.float { animation: floaty 5s ease-in-out infinite; }
.sway { transform-box: fill-box; transform-origin: 50% 0; animation: sway 4s ease-in-out infinite; }
.shimmer { animation: twinkle 1.8s ease-in-out infinite; }
.clock-hand { transform-box: view-box; transform-origin: 0 -196px; animation: spin 20s linear infinite; }

/* ---------- keyframes ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 0% { transform: scale(.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes bubblePop { 0% { transform: scale(.94); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes pipFloat { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }
@keyframes flutter { from { transform: scaleY(1); } to { transform: scaleY(.55); } }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.02, .985); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes munch { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.06, .92); } }
@keyframes dance { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-12px) rotate(6deg); } }
@keyframes sleepy { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, .96); } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-5deg); } 40% { transform: rotate(4deg); } 60% { transform: rotate(-2deg); } 80% { transform: rotate(1deg); } }
@keyframes eggHop { 0% { transform: translateY(0); } 40% { transform: translateY(-14px) scale(1.04, .97); } 100% { transform: translateY(0); } }
@keyframes eggShake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@keyframes beadPop { 0% { transform: scale(.4); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes wordIn { from { transform: translateY(10px); opacity: .35; } to { transform: none; opacity: 1; } }
@keyframes curBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes fizz { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px) rotate(-3deg); } 75% { transform: translateX(4px) rotate(3deg); } }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes rhFlash { 0% { background: #FFD35C; box-shadow: 0 0 14px #FFD35C; } 100% { background: rgba(46, 36, 82, .12); box-shadow: none; } }
@keyframes builtPop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes firefly { 0%, 100% { transform: translate(0, 0); opacity: 1; } 50% { transform: translate(10px, -14px); opacity: .6; } }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); } 20% { opacity: 1; transform: translate(-50%, -60%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -170%) scale(1); } }
@keyframes keyBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes glow { 0%, 100% { opacity: .95; } 50% { opacity: .3; } }
@keyframes ring { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes dash { to { stroke-dashoffset: -22; } }
@keyframes kbPop { 0% { transform: translateY(6px) scale(.6); opacity: 0; } 20% { opacity: 1; transform: translateY(-6px) scale(1.15); } 100% { transform: translateY(-44px) scale(1); opacity: 0; } }
@keyframes walkBob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-5px) rotate(3deg); } }
@keyframes hopOnce { 0% { transform: translateY(0); } 40% { transform: translateY(-16px); } 100% { transform: translateY(0); } }
@keyframes zz { 0% { transform: translate(0, 0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(10px, -26px); opacity: 0; } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes glowSoft { 0%, 100% { opacity: .32; } 50% { opacity: .14; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes chestBounce { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-6px) rotate(-8deg); } 60% { transform: translateY(0) rotate(6deg); } }
@keyframes giftShake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@keyframes giftAway { to { transform: scale(1.4); opacity: 0; } }
@keyframes giftReveal { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes burst { 0% { opacity: 1; transform: scale(.4); } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes caret { 50% { opacity: 0; } }
@keyframes drift { from { transform: translateX(-60px); } to { transform: translateX(60px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flicker { from { transform: scale(1, 1); } to { transform: scale(.92, 1.08); } }
@keyframes smoke { 0% { transform: translateY(0); opacity: .8; } 100% { transform: translateY(-40px); opacity: 0; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes sway { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }

/* ---------- smaller screens ---------- */
@media (max-width: 1180px) {
  .hub-nav .pbtn.labeled span { display: none; }
  .hub-nav .pbtn.labeled { padding: 10px 12px; }
  .week-line { display: none; }
}
@media (max-width: 980px) {
  .hub-week, .dock-spacer { display: none; }
}
@media (max-height: 760px) {
  .kb-slot { height: clamp(130px, 25vh, 220px); }
  .pip { width: 54px; }
  .pip-bubble { font-size: 15px; padding: 8px 13px; }
  .rnd-top { padding-top: 8px; }
  .stage { min-height: 220px; }
  .hub-next { padding: 12px 16px 10px; }
  .next-ic { width: 64px; height: 64px; }
}
@media (max-width: 760px) {
  .hub-more, .hub-week { display: none; }
  .parent-grid, .book-scr { grid-template-columns: 1fr; }
  .theme-pick { grid-template-columns: repeat(2, 1fr); }
  .petcard { flex-direction: column; align-items: center; }
  .rnd-title { max-width: 50vw; }
  .beads, .egg-chip, .rhythm { display: none; }
  .wr-prev, .wr-next { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
