/* Plank Pals — styles. Tokens and components from docs/01-design.md. Light mode only. */
:root {
  color-scheme: light;

  /* ---------- Surfaces & text ---------- */
  --bg:            #FFF7EC;
  --bg-sunny:      #FFF0B3;
  --surface:       #FFFFFF;
  --surface-2:     #FDEFDC;
  --line:          #EADBC8;
  --ink:           #3B2A20;
  --ink-soft:      #7A6353;
  --ink-faint:     #B3A091;
  --night:         #2A211C;

  /* ---------- Exercise colours ---------- */
  --plank:         #1F9D5B;
  --plank-dark:    #177A46;
  --plank-light:   #D4F5C9;
  --squat:         #8A4FC7;
  --squat-dark:    #6B3799;
  --squat-light:   #E8D9FF;
  --go:            #1F9D5B;
  --go-dark:       #177A46;

  /* ---------- Exercise screen background states ---------- */
  --ex-bg-run:     #DDF2FC;
  --ex-bg-goal:    #D4F5C9;
  --ex-bg-record:  #FFE9A8;

  /* ---------- Accents ---------- */
  --sun:           #FFC83D;
  --sun-dark:      #E0A200;
  --sky:           #5EC8F2;
  --sky-dark:      #2FA3D1;
  --pink:          #FF9AA2;
  --empty:         #E6DFD6;
  --empty-line:    #CFC5B8;

  /* ---------- Pup ---------- */
  --pup-fur:       #E8A96B;
  --pup-fur-dark:  #B8733F;
  --pup-spot:      #D08A50;
  --pup-cream:     #FFF3E0;
  --pup-ink:       #3B2A20;
  --pup-cheek:     #FF9AA2;
  --pup-tongue:    #FF7A8A;

  /* ---------- Sticker page backgrounds ---------- */
  --st-garden:  #D4F5C9;
  --st-ocean:   #CDEFFF;
  --st-yummy:   #FFD6DA;
  --st-sky:     #2B3A67;
  --st-jungle:  #FFE0C2;
  --st-sparkle: #E8D9FF;

  /* ---------- Typography ---------- */
  --font: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-12: 12px;  --fs-14: 14px;  --fs-16: 16px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-32: 32px;
  --fs-44: 44px;
  --fs-64: 64px;
  --fs-timer: 128px;
  --fs-count: 160px;
  --fs-countdown: 200px;
  --fw-regular: 500; --fw-bold: 700; --fw-heavy: 800;
  --lh-body: 1.35;

  /* ---------- Spacing ---------- */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  /* ---------- Sizes ---------- */
  --tap-min: 64px;
  --tap-parent: 44px;
  --content-w: 343px;

  /* ---------- Radii ---------- */
  --r-sm: 12px; --r-md: 20px; --r-lg: 28px; --r-xl: 40px; --r-pill: 999px;

  /* ---------- Shadows ---------- */
  --sh-card:    0 2px 0 rgba(59,42,32,.06), 0 6px 16px rgba(59,42,32,.10);
  --sh-float:   0 10px 30px rgba(59,42,32,.18);
  --sh-sticker: 0 2px 0 rgba(59,42,32,.10), 0 6px 12px rgba(59,42,32,.22);
  --sh-plank:   0 8px 0 #177A46, 0 14px 24px rgba(23,122,70,.28);
  --sh-squat:   0 8px 0 #6B3799, 0 14px 24px rgba(107,55,153,.28);
  --sh-go:      0 8px 0 #177A46, 0 14px 24px rgba(23,122,70,.28);

  /* ---------- Motion ---------- */
  --dur-press: 120ms; --dur-fast: 180ms; --dur-base: 280ms; --dur-slow: 450ms; --dur-hero: 700ms;
  --ease-out:    cubic-bezier(.2, .8, .2, 1);
  --ease-in-out: cubic-bezier(.45, 0, .55, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --beat: 2.5s;

  /* ---------- Safe areas ---------- */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
}

/* ================= Base & shell ================= */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-weight: var(--fw-regular); line-height: var(--lh-body);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  overscroll-behavior: none; touch-action: manipulation;
}
input, textarea, select { -webkit-user-select: text; user-select: text; font-size: 16px; font-family: inherit; }
button { font-family: inherit; color: inherit; }

.screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--safe-top) + var(--sp-2)) calc(var(--safe-right) + var(--sp-4))
           calc(var(--safe-bottom) + var(--sp-4)) calc(var(--safe-left) + var(--sp-4));
  overflow: hidden;
  min-height: 100vh; min-height: 100dvh;
  transition: background-color var(--dur-slow) var(--ease-out);
}
.screen > * { width: 100%; max-width: 480px; flex-shrink: 0; }
.screen > .spacer { flex: 1 1 auto; flex-shrink: 1; min-height: 0; }
.screen--scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 64px; flex: none; gap: var(--sp-2); }
.spacer { flex: 1 1 auto; }
.tnum { font-variant-numeric: tabular-nums; }
#screen-plank, #screen-squats { touch-action: none; }

/* ================= Buttons ================= */
.btn {
  appearance: none; border: 0; margin: 0; font: inherit; font-weight: var(--fw-heavy); color: #fff;
  display: flex; align-items: center; justify-content: center; gap: var(--sp-3);
  min-width: var(--tap-min); min-height: var(--tap-min); border-radius: var(--r-lg); cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out), box-shadow var(--dur-press) var(--ease-out), opacity var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(6px); }
.btn[disabled] { opacity: .4; pointer-events: none; }

.btn-ex { flex: 1; height: 200px; flex-direction: column; gap: 4px; position: relative;
          font-size: var(--fs-24); border-radius: var(--r-xl); padding: 8px 6px; }
.btn-ex--plank { background: var(--plank); box-shadow: var(--sh-plank); }
.btn-ex--squat { background: var(--squat); box-shadow: var(--sh-squat); }
.btn-ex--plank:active { box-shadow: 0 2px 0 var(--plank-dark); }
.btn-ex--squat:active { box-shadow: 0 2px 0 var(--squat-dark); }
.btn-ex .ex-pic { width: 100%; max-width: 139px; height: 112px; border-radius: var(--r-lg);
                  background: rgba(255,255,255,.22); display: grid; place-items: center; overflow: visible; }
.btn-ex .ex-pic.pup-wrap { height: 112px; place-items: center; }
.btn-ex .ex-goal { font-size: var(--fs-20); font-weight: var(--fw-bold); opacity: .95; }

.btn-big { width: 100%; height: 112px; background: var(--go); box-shadow: var(--sh-go);
           font-size: 56px; border-radius: var(--r-xl); }
.btn-big:active { box-shadow: 0 2px 0 var(--go-dark); }
.btn-big--soft { background: var(--surface); color: var(--ink); box-shadow: 0 8px 0 var(--line), var(--sh-card); }
.btn-big--soft:active { box-shadow: 0 2px 0 var(--line); }
.btn-big .btn-text { font-size: var(--fs-24); }

.btn-tile { flex: 1; height: 88px; background: var(--surface); color: var(--ink);
            box-shadow: 0 6px 0 var(--line), var(--sh-card); flex-direction: column; gap: 0;
            font-size: var(--fs-20); font-weight: var(--fw-bold); }
.btn-tile .emoji { font-size: 40px; line-height: 1; }

.btn-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--surface); color: var(--ink);
            box-shadow: 0 4px 0 var(--line), var(--sh-card); font-size: 34px; padding: 0; }
.btn-icon--xl { width: 96px; height: 96px; font-size: 56px; }
.btn-icon[disabled] { opacity: .35; }
.btn-icon.is-invisible { visibility: hidden; }

.btn-lock { width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: 50%;
            background: transparent; font-size: 22px; opacity: .4; box-shadow: none; }

.btn-parent { min-height: 48px; padding: 0 var(--sp-5); border-radius: var(--r-sm);
              background: var(--ink); color: #fff; font-size: var(--fs-16); font-weight: var(--fw-bold); }
.btn-parent--ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn-parent--danger { background: var(--surface); color: #8a3b12; box-shadow: inset 0 0 0 2px #e9c3a8; }
.btn-parent.small { min-height: 40px; min-width: 40px; padding: 0 var(--sp-3); }
.btn-parent:active { transform: translateY(2px); }

.invite { animation: invite 2.4s var(--ease-in-out) infinite; }
@keyframes invite { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* ================= Speech bubble ================= */
.bubble { position: absolute; left: 50%; bottom: calc(var(--pup-size, 200px) * var(--stage-scale, 1) + 6px); translate: -50% 0;
  max-width: 300px; width: max-content; padding: 10px 18px; border-radius: 24px;
  background: #fff; box-shadow: var(--sh-float); color: var(--ink);
  font-size: var(--fs-24); font-weight: var(--fw-bold); line-height: 1.2; text-align: center;
  animation: bubble-in var(--dur-slow) var(--ease-bounce) both; z-index: 5; pointer-events: none; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 18px; height: 18px;
  background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 3px; }
.bubble.is-leaving { animation: bubble-out 200ms var(--ease-out) both; }
@keyframes bubble-in  { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes bubble-out { to { transform: scale(.8); opacity: 0; } }
.bubble-free { position: relative; left: auto; bottom: auto; translate: none; margin: 0 auto; }

/* ================= Pup ================= */
.pup .acc { display: none; }
.pup:is([data-stage="2"],[data-stage="3"],[data-stage="4"],[data-stage="5"],[data-stage="6"]) .acc-bandana,
.pup:is([data-stage="3"],[data-stage="4"],[data-stage="5"],[data-stage="6"]) .acc-collar,
.pup:is([data-stage="4"],[data-stage="5"],[data-stage="6"]) .acc-cape,
.pup:is([data-stage="5"],[data-stage="6"]) .acc-headband,
.pup:is([data-stage="5"],[data-stage="6"]) .acc-sneakers,
.pup[data-stage="6"] .acc-medal { display: inline; }
.pup[data-stage="6"] .acc-tag { display: none; }

.pup .pup-eyes-size { transform-box: fill-box; transform-origin: center; }
.pup[data-stage="1"] .pup-eyes-size { transform: scale(1.18); }

.pup-wrap { --pup-size: 200px; position: relative; display: grid; place-items: end center; height: var(--pup-size); margin: 0 auto; }
.pup { width: calc(var(--pup-size) * var(--pup-scale, 1)); height: auto; overflow: visible;
       transition: width var(--dur-hero) var(--ease-bounce); display: block; }
.pup[data-stage="1"] { --pup-scale: .58; }
.pup[data-stage="2"] { --pup-scale: .68; }
.pup[data-stage="3"] { --pup-scale: .78; }
.pup[data-stage="4"] { --pup-scale: .87; }
.pup[data-stage="5"] { --pup-scale: .94; }
.pup[data-stage="6"] { --pup-scale: 1; }
.pup-wrap.fixed-size .pup { --pup-scale: 1; }
.pup-wrap.fixed-size { height: auto; }

.pup .pup-root  { transform-box: view-box; transform-origin: 100px 192px; }
.pup .pup-body, .pup .acc-cape { transform-box: view-box; transform-origin: 100px 190px; }
.pup .pup-head  { transform-box: view-box; transform-origin: 100px 132px; }
.pup .pup-neck  { transform-box: view-box; transform-origin: 100px 140px; }
.pup .pup-tail  { transform-box: view-box; transform-origin: 140px 156px; }
.pup .pup-paw-r { transform-box: view-box; transform-origin: 122px 184px; }
.pup .pup-eyes  { transform-box: fill-box; transform-origin: center; }

.pup .pup-eyes-happy, .pup .pup-eyes-sleepy, .pup .pup-tongue { display: none; }
.pup:is([data-mood="cheer"],[data-mood="jump"],[data-mood^="trick-"]) .pup-eyes { display: none; }
.pup:is([data-mood="cheer"],[data-mood="jump"],[data-mood^="trick-"]) :is(.pup-eyes-happy, .pup-tongue) { display: inline; }
.pup:is([data-mood="squat"],[data-mood="pose-squat"]) .pup-tongue { display: inline; }
.pup[data-mood="sleepy"] .pup-eyes { display: none; }
.pup[data-mood="sleepy"] .pup-eyes-sleepy { display: inline; }
.pup.is-tilt .pup-head { transform: rotate(-10deg); }

.pup[data-mood="idle"] .pup-body { animation: pup-breathe 2.4s var(--ease-in-out) infinite; }
.pup[data-mood="idle"] .pup-head { animation: pup-head-bob 2.4s var(--ease-in-out) infinite; }
.pup[data-mood="idle"] .pup-tail { animation: pup-wag .9s var(--ease-in-out) infinite alternate; }
.pup[data-mood="idle"] .pup-eyes { animation: pup-blink 4.2s linear infinite; }
@keyframes pup-breathe  { 0%,100% { transform: scale(1,1); } 50% { transform: scale(1.02,1.04); } }
@keyframes pup-head-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes pup-wag      { from { transform: rotate(-10deg); } to { transform: rotate(14deg); } }
@keyframes pup-blink    { 0%,94%,100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }

.pup[data-mood="cheer"] .pup-root { animation: pup-bounce .6s var(--ease-out) infinite alternate; }
.pup[data-mood="cheer"] .pup-head { animation: pup-tilt 1.2s var(--ease-in-out) infinite; }
.pup[data-mood="cheer"] .pup-tail { animation: pup-wag .22s linear infinite alternate; }
@keyframes pup-bounce { from { transform: translateY(0) scale(1.03,.97); } to { transform: translateY(-10px) scale(.98,1.02); } }
@keyframes pup-tilt   { 0%,100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }

.pup[data-mood="jump"] .pup-root { animation: pup-jump .8s var(--ease-out) infinite; }
.pup[data-mood="jump"] .pup-head { animation: pup-tilt .8s var(--ease-in-out) infinite; }
.pup[data-mood="jump"] .pup-tail { animation: pup-wag .18s linear infinite alternate; }
@keyframes pup-jump {
  0%   { transform: translateY(0)     scale(1.10,.88); }
  25%  { transform: translateY(-46px) scale(.94,1.08); }
  50%  { transform: translateY(-58px) rotate(-4deg); }
  75%  { transform: translateY(-20px) scale(.97,1.04); }
  90%  { transform: translateY(0)     scale(1.12,.86); }
  100% { transform: translateY(0)     scale(1,1); }
}

.pup[data-mood="sleepy"] .pup-body { animation: pup-breathe 3.6s var(--ease-in-out) infinite; }
.pup[data-mood="sleepy"] .pup-head { animation: pup-doze 3.6s var(--ease-in-out) infinite; }
@keyframes pup-doze { 0%,100% { transform: rotate(0) translateY(0); } 50% { transform: rotate(-5deg) translateY(3px); } }

/* Squat-along: one cycle = one rep */
.pup[data-mood="squat"] :is(.pup-body, .acc-cape) { animation: squat-body var(--beat) var(--ease-in-out) infinite; }
.pup[data-mood="squat"] :is(.pup-head, .pup-neck) { animation: squat-head var(--beat) var(--ease-in-out) infinite; }
.pup[data-mood="squat"] .pup-tail { animation: squat-tail var(--beat) linear infinite; }
.pup[data-mood="squat"] .pup-eyes { animation: pup-blink 4.2s linear infinite; }
.floor-shadow { height: 18px; margin: -10px auto 0; border-radius: 50%; width: 60%;
  background: radial-gradient(ellipse, rgba(59,42,32,.18), transparent 70%); }
.floor-shadow.is-squatting { animation: squat-shadow var(--beat) var(--ease-in-out) infinite; }
@keyframes squat-body   { 0%,100% { transform: scale(1,1); }    44%,56% { transform: scale(1.1,.78); } }
@keyframes squat-head   { 0%,100% { transform: translateY(0); } 44%,56% { transform: translateY(24px); } }
@keyframes squat-shadow { 0%,100% { transform: scaleX(1); }     44%,56% { transform: scaleX(1.15); } }
@keyframes squat-tail {
  0%,80% { transform: rotate(0); } 84% { transform: rotate(18deg); } 88% { transform: rotate(-12deg); }
  92% { transform: rotate(18deg); } 96% { transform: rotate(-8deg); } 100% { transform: rotate(0); } }
.pup[data-mood="pose-squat"] :is(.pup-body, .acc-cape) { transform: scale(1.1,.78); }
.pup[data-mood="pose-squat"] :is(.pup-head, .pup-neck) { transform: translateY(24px); }

/* Tricks */
.pup[data-mood="trick-wag"]  .pup-tail { animation: pup-wag .15s linear 8 alternate; }
.pup[data-mood="trick-wag"]  .pup-root { animation: pup-bounce .3s var(--ease-out) 4 alternate; }
.pup[data-mood="trick-sneeze"] .pup-head { animation: sneeze 1.1s var(--ease-out) both; }
@keyframes sneeze { 0% { transform: none; } 45% { transform: rotate(-8deg) translateY(-6px) scale(1.04); }
                    55% { transform: rotate(10deg) translateY(6px) scale(.96); } 70%,100% { transform: none; } }
.pup[data-mood="trick-sit"] .pup-root { animation: sit 1.2s var(--ease-bounce) both; }
@keyframes sit { 0%,100% { transform: none; } 30%,75% { transform: translateY(10px) scale(1.06,.9); } }
.pup[data-mood="trick-highfive"] .pup-paw-r { animation: highfive 1.2s var(--ease-bounce) both; }
.pup[data-mood="trick-highfive"] .pup-head  { animation: pup-tilt 1.2s var(--ease-in-out) both; }
@keyframes highfive { 0%,100% { transform: none; } 30%,70% { transform: translate(18px,-78px) rotate(-25deg); } }
.pup[data-mood="trick-spin"] .pup-root { animation: spin-fake .9s var(--ease-in-out) both; }
@keyframes spin-fake { 0%,100% { transform: scaleX(1); } 25% { transform: scaleX(0); } 50% { transform: scaleX(-1); } 75% { transform: scaleX(0); } }
.pup[data-mood="trick-jump"] .pup-root { animation: pup-jump .8s var(--ease-out) 2 both; }
.pup[data-mood="trick-flip"] .pup-root { transform-origin: 100px 120px; animation: backflip 1.1s var(--ease-in-out) both; }
@keyframes backflip { 0% { transform: none; } 15% { transform: translateY(6px) scale(1.08,.9); }
  55% { transform: translateY(-80px) rotate(-360deg); } 85% { transform: translateY(0) rotate(-360deg) scale(1.08,.9); }
  100% { transform: rotate(-360deg); } }

/* Side-view plank Pup */
.pup-plank .pp-root { transform-box: view-box; transform-origin: 88px 86px;
  animation: pp-wobble 1.4s var(--ease-in-out) infinite; }
.pup-plank .pp-tail { transform-box: view-box; transform-origin: 126px 50px;
  animation: pup-wag .5s var(--ease-in-out) infinite alternate; }
@keyframes pp-wobble { 0%,100% { transform: rotate(calc(var(--wobble) * -1)); } 50% { transform: rotate(var(--wobble)); } }
.pup-plank[data-stage="1"] { --wobble: 4deg; }
.pup-plank[data-stage="2"] { --wobble: 3deg; }
.pup-plank[data-stage="3"] { --wobble: 2deg; }
.pup-plank[data-stage="4"] { --wobble: 1.2deg; }
.pup-plank[data-stage="5"] { --wobble: .6deg; }
.pup-plank[data-stage="6"] { --wobble: 0deg; }
.pup-plank[data-mood="still"] :is(.pp-root, .pp-tail) { animation: none; }
.is-goal .pup-plank .pp-tail, .is-record .pup-plank .pp-tail { animation-duration: .18s; }

/* ================= Splash ================= */
#splash { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center;
          transition: opacity var(--dur-base) var(--ease-out); font-size: 96px; }
#splash.is-gone { opacity: 0; pointer-events: none; }

/* ================= Banner ================= */
.banner { position: fixed; left: 12px; right: 12px; top: calc(var(--safe-top) + 8px); z-index: 90;
  background: #FFF4CC; color: var(--ink); border-radius: var(--r-sm); box-shadow: var(--sh-float);
  padding: 12px 44px 12px 14px; font-size: var(--fs-14); font-weight: var(--fw-bold); }
.banner button { position: absolute; right: 6px; top: 50%; translate: 0 -50%; border: 0; background: none; font-size: 20px; width: 36px; height: 36px; }

/* ================= Setup / Parent style ================= */
.parent-style { font-size: var(--fs-16); }
.parent-style h1 { font-size: var(--fs-24); margin: var(--sp-3) 0 var(--sp-1); }
.hint { color: var(--ink-soft); font-size: var(--fs-14); margin: 0; }
.text-input { width: 100%; height: 56px; font-size: var(--fs-20); border-radius: var(--r-sm); border: 2px solid var(--line);
  padding: 0 var(--sp-4); background: var(--surface); color: var(--ink); outline: none; }
.text-input:focus { border-color: var(--sky-dark); }
.text-area { width: 100%; min-height: 120px; font-size: 16px; border-radius: var(--r-sm); border: 2px solid var(--line);
  padding: var(--sp-3); background: var(--surface); color: var(--ink); resize: vertical; }
.pc-group { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--sh-card); overflow: hidden; }
.pc-row { min-height: 56px; padding: 6px var(--sp-4); display: flex; align-items: center; justify-content: space-between;
          gap: var(--sp-3); font-size: var(--fs-16); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pc-row:last-child { border-bottom: 0; }
.pc-row .grow { flex: 1; min-width: 0; }
.pc-row .val { font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.pc-row .sub { display: block; color: var(--ink-soft); font-size: var(--fs-12); }
.pc-label { margin: var(--sp-5) var(--sp-2) var(--sp-2); font-size: var(--fs-12); font-weight: var(--fw-bold);
            letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); display: block; }
.row-pic { width: 56px; height: 44px; display: grid; place-items: center; flex: none; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 48px; height: 48px; border-radius: var(--r-sm); border: 0; background: var(--surface-2);
  font-size: 26px; font-weight: 800; color: var(--ink); }
.stepper button:active { transform: translateY(2px); }
.stepper output { min-width: 64px; text-align: center; font-weight: var(--fw-heavy); font-size: var(--fs-20); font-variant-numeric: tabular-nums; }
.seg { display: flex; border-radius: var(--r-sm); overflow: hidden; box-shadow: inset 0 0 0 2px var(--line); }
.seg button { min-width: 52px; height: 44px; border: 0; background: transparent; font-weight: 700; font-size: 16px; color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; z-index: 2; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--empty-line); transition: background var(--dur-fast); }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform var(--dur-fast) var(--ease-out); }
.switch input:checked + span { background: var(--go); }
.switch input:checked + span::after { transform: translateX(20px); }
input[type=range] { accent-color: var(--squat); width: 140px; flex: 1; min-width: 100px; }
.pc-row .text-input { flex: 1; width: auto; min-width: 0; }
.pc-row .pup-wrap { margin: 0; }
.note { background: #FFF4CC; border-radius: var(--r-sm); padding: 10px 12px; font-size: var(--fs-14); margin: var(--sp-2) 0; }
.note.ok { background: var(--plank-light); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-2) 0; }

.setup { display: flex; flex-direction: column; gap: var(--sp-2); min-height: 100%; padding-bottom: var(--sp-4); }
.setup .btn-big { font-size: var(--fs-24); margin-top: var(--sp-5); }
.setup .sound-row { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-4); flex-wrap: wrap; }

/* ================= Meet Pup ================= */
#screen-meet { background: radial-gradient(circle at 50% 55%, #5A4638 0%, var(--night) 60%); transition: background 1.2s var(--ease-out); }
#screen-meet.is-lit { background: var(--bg); }
.meet-top { height: 150px; display: grid; place-items: end center; padding-bottom: 12px; }
.basket-stage { position: relative; width: 240px; height: 260px; margin: 0 auto; cursor: pointer; }
.basket { position: absolute; left: 0; bottom: 0; width: 240px; height: 192px; overflow: visible; }
.basket-pup { position: absolute; left: 50%; translate: -50% 0; bottom: 96px; opacity: 0; }
.basket-stage.is-wiggling .basket { animation: basket-wiggle 2.2s var(--ease-in-out) infinite; transform-origin: 50% 100%; }
@keyframes basket-wiggle { 0%,40%,100% { transform: rotate(0); } 5%,15%,25% { transform: rotate(-6deg); }
                           10%,20%,30% { transform: rotate(6deg); } }
.basket-blanket { transform-box: view-box; transform-origin: 100px 60px; }
.basket-stage.is-open .basket-blanket { animation: blanket-off 600ms var(--ease-out) forwards; }
@keyframes blanket-off { to { transform: translate(130px, -170px) rotate(50deg); opacity: 0; } }
.basket-stage.is-open .basket-pup { animation: pup-pop 700ms var(--ease-bounce) 250ms forwards; }
@keyframes pup-pop { from { opacity: 1; transform: translateY(70px) scale(.4); } to { opacity: 1; transform: none; } }
.meet-names { display: flex; flex-direction: column; gap: 14px; }
.name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 15px; }
.name-card { height: 98px; border: 0; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-card);
  display: grid; place-content: center; justify-items: center; gap: 2px; font: inherit;
  font-size: var(--fs-24); font-weight: var(--fw-bold); color: var(--ink); }
.name-card .emoji { font-size: 44px; line-height: 1; }
.name-card[aria-pressed="true"] { box-shadow: 0 0 0 5px var(--sun), 0 0 24px rgba(255,200,61,.7);
  animation: pop 450ms var(--ease-bounce); }
.link-btn { border: 0; background: none; color: var(--ink-soft); font-size: var(--fs-14); min-height: 44px; font-weight: 700; }
.meet-type { display: flex; gap: 8px; }
.screen > .name-ask {
  position: absolute; inset: 0; z-index: 5; width: auto; max-width: none;
  display: grid; place-items: center; padding: 16px;
  background: rgba(42, 33, 28, .55);
}
.name-ask-card {
  width: min(343px, 100%); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-float);
  padding: 20px 16px 16px; display: grid; justify-items: center; gap: 12px;
  animation: pop 450ms var(--ease-bounce);
}
.name-ask-emoji { font-size: 80px; line-height: 1; }
.name-ask-q { margin: 0; font-size: var(--fs-32); font-weight: var(--fw-heavy); text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
.name-ask-actions { display: flex; gap: 12px; width: 100%; }
.name-ask-actions .btn-big { flex: 1; height: 112px; font-size: 36px; }

/* ================= Home ================= */
.home-top { height: 48px; }
.paws { display: flex; gap: 6px; }
.paw { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); box-shadow: inset 0 0 0 2px var(--empty-line);
  font-size: 12px; font-weight: var(--fw-bold); color: var(--ink-faint); line-height: 1; }
.paw.is-today  { box-shadow: inset 0 0 0 3px var(--ink); }
.paw.is-done   { background: var(--sun); box-shadow: none; font-size: 18px; }
.paw.is-double { background: var(--sun); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--sun);
                 font-size: 12px; letter-spacing: -2px; }
.paw.is-done.is-today, .paw.is-double.is-today { outline: 3px solid var(--ink); outline-offset: 2px; }
.paw.stamp { animation: stamp 500ms var(--ease-bounce); }
@keyframes stamp { 0% { transform: scale(2.4); opacity: 0; } 60% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1); } }
.paws--big .paw { width: 40px; height: 40px; }
.paws--big .paw.is-done { font-size: 20px; }
.paws--big .paw.is-double { font-size: 14px; }

.home-pup-area { position: relative; display: flex; justify-content: center; padding-top: 72px; }
.home-bowl { position: absolute; right: 0; bottom: 0; }
.pet-name { text-align: center; font-size: var(--fs-32); font-weight: var(--fw-heavy); line-height: 1.1; margin-top: 4px; }
.ex-row { display: flex; gap: 17px; }
.tile-row { display: flex; gap: 17px; margin-top: 16px; }
.ex-badge { position: absolute; top: -10px; left: -8px; width: 52px; height: 52px; border-radius: 50%;
  background: #fff; box-shadow: var(--sh-card); display: none; place-items: center; font-size: 30px; }
.btn-ex.is-done  .ex-badge,
.btn-ex.is-offer .ex-badge { display: grid; animation: pop var(--dur-slow) var(--ease-bounce); }
.btn-ex.is-offer { animation: offer-glow 3.2s var(--ease-in-out) infinite; }
@keyframes offer-glow {
  0%,100% { filter: drop-shadow(0 0 0 rgba(255,200,61,0)); }
  50%     { filter: drop-shadow(0 0 14px rgba(255,200,61,.95)); }
}

/* Treat bowl */
.bowl-wrap { display: flex; align-items: flex-end; gap: 2px; }
.bowl { position: relative; width: 72px; height: 40px; overflow: hidden;
  border: 4px solid var(--pup-fur-dark); border-top-width: 6px;
  border-radius: 6px 6px 40px 40px / 6px 6px 34px 34px; background: var(--surface-2); }
.bowl--big { width: 120px; height: 60px; }
.bowl-fill { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--fill, 0) * 100%);
  background: radial-gradient(circle at 30% 40%, #C9824A 0 3px, transparent 3.5px) 0 0 / 10px 8px, var(--pup-fur);
  transition: height 1.2s var(--ease-out); }
.bowl-bone { font-size: 22px; }

/* ================= Exercise screens ================= */
.screen.ex            { --ex-color: var(--plank); }
#screen-squats.ex     { --ex-color: var(--squat); }
.screen.ex.is-running { background: var(--ex-bg-run); }
.screen.ex.is-goal    { background: var(--ex-bg-goal); }
.screen.ex.is-record  { background: var(--ex-bg-record); }
.ex .phase { display: flex; flex-direction: column; align-items: center; width: 100%; flex: 1 1 auto; min-height: 0; }
.ex .phase > * { flex-shrink: 0; }
.ex.is-running .topbar .btn-icon { visibility: hidden; }

.tip-card { width: 100%; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-card); padding: 20px;
  display: grid; justify-items: center; gap: 8px; text-align: center; }
.tip-card .emoji { font-size: 88px; line-height: 1; }
.tip-card .text  { font-size: 28px; font-weight: var(--fw-bold); line-height: 1.15; }
.tip-card .side  { font-size: var(--fs-16); color: var(--ink-soft); }
.tip-dots { display: flex; gap: 8px; } .tip-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.tip-dots i.on { background: var(--ex-color); }
.tip-card.swap { animation: tip-swap 350ms var(--ease-out); }
@keyframes tip-swap { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.countdown { font-size: var(--fs-countdown); font-weight: var(--fw-heavy); line-height: 1; color: var(--ex-color); height: 200px;
  display: grid; place-items: center; }
.countdown.small { font-size: 120px; height: 130px; }
.countdown.tick { animation: count-pop 450ms var(--ease-bounce); }
@keyframes count-pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); } }
.get-ready { font-size: var(--fs-32); font-weight: var(--fw-heavy); color: var(--ex-color); text-align: center; }

.stop-hint { font-size: 96px; line-height: 1; opacity: .5; animation: invite 2.4s var(--ease-in-out) infinite; pointer-events: none; }
.early-row { display: flex; gap: 17px; }
.early-row .btn-big { height: 163px; font-size: 72px; }
.ready-go { width: 100%; height: 150px; font-size: 72px; }
.ready-go.ex-plank { background: var(--plank); box-shadow: var(--sh-plank); }
.ready-go.ex-squat { background: var(--squat); box-shadow: var(--sh-squat); }

/* Goal ring */
.ring-wrap { position: relative; width: var(--size); height: var(--size); margin: 26px auto 0; flex: none; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: rgba(255,255,255,.75); stroke-width: var(--stroke); }
.ring-fill  { fill: none; stroke: var(--ex-color); stroke-width: var(--stroke); stroke-linecap: round;
  transition: stroke-dashoffset 250ms linear, stroke var(--dur-slow) var(--ease-out); }
.ring-sparkle { fill: none; stroke: var(--sun); stroke-width: 4; stroke-dasharray: 2 18; stroke-linecap: round;
  opacity: 0; transform-box: view-box; transform-origin: center; }
.ring-bone { position: absolute; left: 50%; top: 0; translate: -50% -50%; width: 52px; height: 52px; border-radius: 50%;
  background: #fff; box-shadow: var(--sh-card); display: grid; place-items: center; font-size: 30px; z-index: 2; }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; }
.is-goal .ring-bone, .is-record .ring-bone { animation: pop var(--dur-slow) var(--ease-bounce), wiggle 600ms 450ms; }
.is-goal .ring-bone::after, .is-record .ring-bone::after { content: "✓"; position: absolute; right: -6px; bottom: -6px;
  width: 24px; height: 24px; border-radius: 50%; background: var(--plank); color: #fff;
  font-size: 15px; font-weight: 800; display: grid; place-items: center; }
.is-record .ring-fill { stroke: var(--sun); filter: drop-shadow(0 0 8px rgba(255,200,61,.8)); }
.is-record .ring-sparkle { opacity: 1; animation: spin 6s linear infinite; }
.record-cup { position: absolute; right: -8px; top: 40%; font-size: 56px; display: none; }
.is-record .record-cup { display: block; animation: pop var(--dur-slow) var(--ease-bounce), wiggle 600ms 450ms; }

.timer, .count { font-weight: var(--fw-heavy); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.timer { font-size: var(--fs-timer); color: var(--ink); }
.count { font-size: var(--fs-count); color: var(--squat); letter-spacing: -.04em; }
.tick    { animation: count-bump var(--dur-fast) var(--ease-out); }
@keyframes count-bump { from { transform: scale(1.12); } to { transform: scale(1); } }
.sparkle { animation: count-sparkle 600ms var(--ease-out); }
@keyframes count-sparkle { 0% { transform: scale(1.25); text-shadow: 0 0 0 #FFE08A; }
  40% { text-shadow: 0 0 24px #FFC83D, 0 0 48px #FFE08A; } 100% { transform: scale(1); text-shadow: none; } }

/* Squat-along Pup must be the biggest thing (read from 2 m): shrink less with stage than elsewhere */
.squat-pup { height: auto; }
.squat-pup .pup { width: calc(var(--pup-size) * (0.55 + var(--pup-scale, 1) * 0.45)); }
.plank-run-pup .pup { width: calc(var(--pup-size) * (0.55 + var(--pup-scale, 1) * 0.45)); }
.count-check-row { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 20px; }
.count-check-row .count { font-size: 140px; min-width: 150px; text-align: center; }

/* ================= Celebrate ================= */
#screen-celebrate { background: var(--bg-sunny); }
#screen-celebrate.is-record { background: var(--ex-bg-record); }
.cel-result { display: flex; align-items: center; justify-content: center; gap: 14px; height: 88px; }
.cel-chip { width: 72px; height: 72px; border-radius: var(--r-md); display: grid; place-items: center; overflow: hidden; }
.cel-chip.ex-plank { background: var(--plank); } .cel-chip.ex-squat { background: var(--squat); }
.cel-value { font-size: var(--fs-64); font-weight: var(--fw-heavy); line-height: 1; font-variant-numeric: tabular-nums; }
.cel-value small { font-size: 32px; }
.tier-badge { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 32px;
  animation: pop var(--dur-slow) var(--ease-bounce) 300ms both; }
.tier-0 { background: #FFD6DA; } .tier-1 { background: var(--plank-light); } .tier-2 { background: var(--sun); }
.cel-pup { margin-top: 64px; }
.cel-bowl { justify-content: center; margin-top: 8px; }
.cel-reward { min-height: 170px; display: grid; place-items: center; margin-top: 10px; position: relative; }
.cel-note { text-align: center; font-size: var(--fs-20); font-weight: 700; color: var(--ink-soft); min-height: 28px; }
.cel-actions { display: flex; gap: 17px; }
.cel-actions .btn-big { flex: 1; }
.cel-actions .btn-big--soft { font-size: 56px; }
.fade-in { animation: fade-in var(--dur-slow) var(--ease-out) both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.cards { display: flex; justify-content: center; gap: 15px; perspective: 900px; }
.card { width: 104px; height: 150px; padding: 0; border: 0; background: none; position: relative;
  animation: deal 450ms var(--ease-bounce) both; }
.card:nth-child(2) { animation-delay: 120ms; } .card:nth-child(3) { animation-delay: 240ms; }
.card-inner { position: absolute; inset: 0; transform-style: preserve-3d; -webkit-transform-style: preserve-3d;
  transition: transform var(--dur-hero) var(--ease-bounce); animation: card-wobble 2.6s var(--ease-in-out) infinite; }
.card:nth-child(2) .card-inner { animation-delay: -.8s; } .card:nth-child(3) .card-inner { animation-delay: -1.6s; }
.card-face { position: absolute; inset: 0; border-radius: 18px; display: grid; place-items: center;
  -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.card-back { border: 5px solid #fff; box-shadow: var(--sh-float); font-size: 48px;
  background: repeating-linear-gradient(45deg, var(--sun) 0 12px, #FFD66B 12px 24px); }
.card-front { transform: rotateY(180deg); background: #fff; box-shadow: var(--sh-float); }
.card-front .sticker { --size: 88px; }
.cards.is-picked .card:not(.is-chosen) { animation: card-away 400ms var(--ease-out) forwards; }
.card.is-chosen { z-index: 2; animation: none; transition: transform var(--dur-slow) var(--ease-out);
  transform: translateX(var(--to-center, 0px)) scale(1.5); }
.card.is-chosen .card-inner { animation: none; transform: rotateY(180deg); transition-delay: 250ms; }
.card.is-flying { transition: transform 700ms cubic-bezier(.5,-0.3,.7,1), opacity 700ms;
  transform: translate(var(--fly-x), var(--fly-y)) scale(.3) rotate(20deg); opacity: 0; }
@keyframes deal        { from { transform: translateY(80px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes card-wobble { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes card-away   { to { transform: translateY(120px) scale(.7); opacity: 0; } }
.book-catch { position: fixed; right: 16px; top: calc(var(--safe-top) + 12px); width: 64px; height: 64px; border-radius: 50%;
  background: #fff; box-shadow: var(--sh-card); display: grid; place-items: center; font-size: 40px; z-index: 40;
  animation: pop var(--dur-slow) var(--ease-bounce) both; }

.double-card { width: 100%; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-card);
  padding: 18px; display: grid; justify-items: center; gap: 10px; animation: pop var(--dur-slow) var(--ease-bounce) both; }
.double-card .title { font-size: var(--fs-32); font-weight: var(--fw-heavy); }
.gold-note { display: flex; align-items: center; gap: 10px; font-size: var(--fs-24); font-weight: 800; animation: pop var(--dur-slow) var(--ease-bounce) both; }

/* Big moment overlay */
.overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; }
.big-moment { background: rgba(42,33,28,.82); animation: fade-in 400ms var(--ease-out) both; flex-direction: column;
  padding: calc(var(--safe-top) + 16px) 16px calc(var(--safe-bottom) + 16px); display: flex; align-items: center; justify-content: center; }
.big-moment .spot { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(255,230,160,.35), transparent 55%); pointer-events: none; }
.bm-stage { position: relative; display: grid; place-items: center; min-height: 320px; width: 100%; max-width: 480px; }
.bm-title { position: relative; color: #fff; font-size: var(--fs-32); font-weight: var(--fw-heavy); text-align: center; margin: 12px 0 20px; }
.big-moment .btn-big { max-width: 343px; }
.sunburst { position: absolute; inset: -40px; border-radius: 50%; pointer-events: none; z-index: 0;
  background: repeating-conic-gradient(from 0deg, #FFE08A 0 10deg, transparent 10deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 35%, transparent 70%); mask: radial-gradient(circle, #000 35%, transparent 70%);
  animation: spin 12s linear infinite; }
.bm-subject { position: relative; z-index: 1; display: grid; place-items: center; }
.ring-burst { position: absolute; inset: 0; border-radius: 50%; border: 6px solid var(--sun); pointer-events: none;
  animation: ring-burst 700ms var(--ease-out) both; }
@keyframes spin       { to { transform: rotate(360deg); } }
@keyframes ring-burst { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }
.acc-drop { animation: acc-drop var(--dur-slow) var(--ease-bounce) both; }
@keyframes acc-drop { from { transform: translateY(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
.shake { animation: shake 1.2s steps(20) both; }
@keyframes shake { 0%,100% { translate: 0; } 25%,75% { translate: -3px 0; } 50% { translate: 3px 0; } }
.glow { filter: drop-shadow(0 0 24px #FFE08A); }
.mini-page { display: grid; grid-template-columns: repeat(3, 72px); gap: 10px; padding: 16px; background: var(--bg);
  border-radius: var(--r-lg); position: relative; animation: pop var(--dur-hero) var(--ease-bounce) both; }
.mini-page .sticker { --size: 72px; }
.mini-page .stamp-check { position: absolute; inset: 0; display: grid; place-items: center; font-size: 120px; animation: stamp 500ms var(--ease-bounce) 700ms both; }
.book-cover { width: 200px; height: 260px; border-radius: var(--r-lg); background: var(--st-sparkle); border: 6px solid var(--sun);
  display: grid; place-content: center; justify-items: center; animation: cover-flip 900ms var(--ease-bounce) both; }
.book-cover .e { font-size: 96px; line-height: 1; } .book-cover .n { font-size: 64px; font-weight: 800; }
@keyframes cover-flip { from { transform: perspective(600px) rotateY(-100deg); opacity: 0; } to { transform: none; opacity: 1; } }
.prize-gift { margin-top: 16px; font-size: 64px; padding: 8px 20px; border: 4px dashed var(--sun); border-radius: var(--r-lg); background: #FFFBEF; animation: pop var(--dur-slow) var(--ease-bounce) 900ms both; }
.drop-in { animation: drop-in 900ms var(--ease-bounce) both; }
@keyframes drop-in { from { transform: translateY(-300px) rotate(-180deg); } to { transform: none; } }

/* ================= Stickers ================= */
.sticker {
  --size: 132px; position: relative; width: var(--size); height: var(--size);
  display: grid; place-items: center; background: var(--c, var(--st-garden));
  border: calc(var(--size) * .06) solid #fff;
  border-radius: 50%; box-shadow: var(--sh-sticker);
  transform: rotate(var(--r, 0deg)); font-size: calc(var(--size) * .52); line-height: 1;
}
.sticker--square { border-radius: 28%; }
.sticker--blob   { border-radius: 58% 42% 55% 45% / 48% 58% 42% 52%; }
.sticker::before {
  content: ""; position: absolute; inset: 8% 40% 55% 12%; border-radius: 50%;
  background: rgba(255,255,255,.45); transform: rotate(-20deg); pointer-events: none; }
.sticker.is-locked { background: var(--empty); border-style: dashed; border-color: var(--empty-line); box-shadow: none; }
.sticker.is-locked::before { display: none; }
.sticker.is-locked span { filter: brightness(0); opacity: .12; }
.sticker.is-locked b { position: absolute; font-size: calc(var(--size) * .42); font-weight: var(--fw-heavy);
  color: #fff; text-shadow: 0 2px 0 var(--empty-line); }
.sticker.is-gold { border-color: var(--sun); overflow: hidden;
  box-shadow: 0 0 0 3px var(--sun-dark), 0 0 18px rgba(255,200,61,.9), var(--sh-sticker); }
.sticker.is-gold::after { content: ""; position: absolute; inset: -20%;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.75) 50%, transparent 60%);
  animation: shine 3s var(--ease-in-out) infinite; pointer-events: none; }
@keyframes shine { 0% { transform: translateX(-60%); } 60%,100% { transform: translateX(60%); } }
.book-2 .sticker:not(.is-locked) { border-color: #FFE08A; }
.book-2 .sticker:not(.is-locked) span { filter: saturate(1.4) drop-shadow(0 0 6px #fff) drop-shadow(0 0 2px #FFC83D); }

.rosette { --size: 96px; position: relative; isolation: isolate; width: var(--size); height: var(--size); border-radius: 50%;
  display: grid; place-content: center; justify-items: center; line-height: 1;
  background: radial-gradient(circle, #FFF3C4 0 56%, transparent 57%),
              repeating-conic-gradient(var(--sun) 0 15deg, var(--sun-dark) 15deg 30deg);
  box-shadow: var(--sh-sticker); }
.rosette .r-paw { font-size: 22px; }
.rosette .r-num { font-size: 32px; font-weight: var(--fw-heavy); color: var(--ink); }
.rosette::before, .rosette::after { content: ""; position: absolute; bottom: -18px; width: 20px; height: 34px;
  background: var(--sky); z-index: -1; clip-path: polygon(0 0,100% 0,100% 100%,50% 80%,0 100%); }
.rosette::before { left: 26%; transform: rotate(14deg); }  .rosette::after { right: 26%; transform: rotate(-14deg); }
.rosette.is-locked { filter: grayscale(1) opacity(.45); }
.rosette--big { --size: 160px; } .rosette--big .r-num { font-size: 56px; } .rosette--big .r-paw { font-size: 36px; }

#screen-stickers { background-color: var(--bg); background-image: radial-gradient(var(--line) 1.5px, transparent 1.5px); background-size: 22px 22px; }
.page-chip { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: var(--r-pill);
  padding: 6px 14px; box-shadow: var(--sh-card); }
.page-chip .e { font-size: 30px; line-height: 1; }
.page-dots { display: flex; gap: 6px; } .page-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.page-dots i.on { background: var(--ink); }
.book-chips { display: flex; gap: 6px; }
.book-chips button { height: 48px; min-width: 48px; border-radius: var(--r-sm); border: 0; background: var(--surface); box-shadow: var(--sh-card); font-weight: 800; font-size: 16px; }
.book-chips button[aria-pressed="true"] { background: var(--sun); }
.book-grid { display: grid; grid-template-columns: repeat(2, 132px); justify-content: center; gap: 24px 48px; margin-top: 16px; }
.book-grid.pup-page { grid-template-columns: repeat(3, 96px); gap: 34px 20px; margin-top: 28px; }
.book-grid button { border: 0; background: none; padding: 0; display: grid; place-items: center; }
.book-grid.turn-next { animation: turn-next var(--dur-base) var(--ease-out); }
.book-grid.turn-prev { animation: turn-prev var(--dur-base) var(--ease-out); }
@keyframes turn-next { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes turn-prev { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
.book-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.book-nav .count-label { font-size: var(--fs-24); font-weight: 700; }
.prize-strip { height: 72px; border: 3px dashed var(--sun); border-radius: var(--r-md); background: #FFFBEF; margin-top: 12px;
  display: flex; align-items: center; justify-content: center; gap: 10px; font-size: var(--fs-24); font-weight: var(--fw-bold); }
.zoom { background: rgba(59,42,32,.45); }
.zoom .sticker, .zoom .rosette { animation: pop var(--dur-slow) var(--ease-bounce) both; }
.wiggle { animation: wiggle 400ms var(--ease-in-out); }
@keyframes wiggle { 0%,100% { rotate: 0deg; } 25% { rotate: -8deg; } 75% { rotate: 8deg; } }

/* ================= Progress ================= */
.card-box { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-card); padding: 16px; margin-top: 12px; }
.path-card { position: relative; }
.path { display: block; overflow: visible; }
.path .stop circle { fill: var(--sun); stroke: #fff; stroke-width: 4; }
.path .stop text   { font: 800 16px var(--font); fill: var(--ink); text-anchor: middle; }
.path .stop.is-future circle { fill: var(--empty); }
.path .stop.is-future text   { fill: var(--ink-faint); }
.path .stop.is-current circle { filter: drop-shadow(0 0 8px rgba(255,200,61,.9)); }
.path-pup { position: absolute; }
.month-title { font-weight: 800; margin: 14px 0 6px; font-size: var(--fs-20); }
.month-grid { display: grid; grid-template-columns: repeat(7, 30px) 28px; gap: 6px 8px; justify-content: center; align-items: center; }
.month-grid .d { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: var(--ink-faint);
  box-shadow: inset 0 0 0 2px var(--empty-line); background: var(--surface); }
.month-grid .d.is-done { background: var(--sun); box-shadow: none; font-size: 15px; }
.month-grid .d.is-double { background: var(--sun); box-shadow: none; font-size: 10px; letter-spacing: -2px; }
.month-grid .d.is-today { outline: 3px solid var(--ink); outline-offset: 1px; }
.month-grid .d.blank { visibility: hidden; }
.month-grid .star { font-size: 22px; text-align: center; }
.month-grid .hd { font-size: 11px; font-weight: 800; color: var(--ink-soft); text-align: center; }
.trophies { display: flex; gap: 17px; margin-top: 12px; }
.trophy { flex: 1; height: 150px; border: 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-card);
  display: grid; place-content: center; justify-items: center; gap: 2px; color: var(--ink); padding: 8px; }
.trophy .top { display: flex; align-items: center; gap: 8px; font-size: 32px; }
.trophy .pic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; }
.trophy .pic.ex-plank { background: var(--plank); } .trophy .pic.ex-squat { background: var(--squat); }
.trophy .num { font-size: 56px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.trophy .unit { font-size: var(--fs-16); color: var(--ink-soft); font-weight: 700; }

/* ================= Parent Corner ================= */
#screen-parent { background: #F7F1E8; }
.pc-title { font-size: var(--fs-24); font-weight: 800; flex: 1; }
.chart { display: block; width: 100%; height: auto; }
.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: bar-grow 450ms var(--ease-out) both; }
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.chart-wrap { padding: 8px 12px 4px; border-bottom: 1px solid var(--line); }
.pc-footer { color: var(--ink-faint); font-size: var(--fs-12); text-align: center; margin: 24px 0 8px; }

/* ================= Gate ================= */
#gate { background: rgba(42,33,28,.6); z-index: 80; }
.gate-card { width: min(343px, calc(100vw - 32px)); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-float);
  padding: 20px; display: grid; justify-items: center; gap: 12px; }
.gate-hold { position: relative; width: 120px; height: 120px; border-radius: 50%; border: 0; background: var(--surface-2);
  font-size: 56px; display: grid; place-items: center; touch-action: none; }
.gate-hold svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.gate-hold circle { fill: none; stroke: var(--ink); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 339.29; stroke-dashoffset: 339.29;
  transition: stroke-dashoffset 200ms var(--ease-out); }
.gate-hold.is-holding circle { stroke-dashoffset: 0; transition: stroke-dashoffset 2s linear; }
.gate-q { font-size: var(--fs-32); font-weight: 800; }
.gate-answer { width: 160px; height: 64px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 40px; font-weight: 800;
  display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.keypad button { height: 64px; border-radius: 16px; border: 0; background: var(--surface); box-shadow: var(--sh-card); font-size: 28px; font-weight: 700; color: var(--ink); }
.keypad button:active { transform: translateY(2px); }
.keypad .ok { background: var(--go); color: #fff; }
.gate-cancel { border: 0; background: none; color: var(--ink-soft); font-weight: 700; min-height: 44px; font-size: 16px; }

/* ================= Effects ================= */
.fx-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 70; }
.confetti { position: absolute; top: -24px; left: var(--x); width: 10px; height: 14px; border-radius: 3px;
  animation: confetti-fall var(--dur) cubic-bezier(.25,.6,.4,1) var(--delay) both; will-change: transform; }
.confetti.round { width: 11px; height: 11px; border-radius: 50%; }
@keyframes confetti-fall {
  0%   { transform: translate3d(0,0,0) rotate(0deg); opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translate3d(var(--drift),110vh,0) rotate(var(--rot)); opacity: 0; } }
.float-emoji { position: absolute; bottom: -40px; left: var(--x); font-size: var(--fs, 32px);
  animation: float-up var(--dur) var(--ease-out) var(--delay) both; }
@keyframes float-up { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; }
  100% { transform: translate(var(--drift), -70vh) scale(1.1); opacity: 0; } }

.screen-enter { animation: screen-in var(--dur-base) var(--ease-out) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Short phones (e.g. SE) — squeeze the big layouts a little */
@media (max-height: 700px) {
  .home-pup-area { padding-top: 56px; }
  .btn-ex { height: 170px; }
  .btn-tile { height: 72px; }
  .cel-pup { margin-top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  /* EXCEPTION: the squat-along demo is content, not decoration. Keep it. */
  .pup[data-mood="squat"] :is(.pup-body, .acc-cape, .pup-head, .pup-neck, .pup-tail),
  .floor-shadow.is-squatting {
    animation-duration: var(--beat) !important; animation-iteration-count: infinite !important; }
}
