:root {
  color-scheme: light;
  font-family: ui-rounded, "Avenir Next", system-ui, sans-serif;
  color: #33263c;
  background: #fff9f3;
  --ink: #33263c;
  --muted: #695a70;
  --violet: #66428b;
  --lavender: #eee4fa;
  --line: #e8dceb;
  --mint: #91c9ab;
  --rose: #e4a4a8;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, summary { font: inherit; }
button, summary { cursor: pointer; touch-action: manipulation; }
button { min-height: 44px; border-radius: 13px; border: 1px solid transparent; padding: .6rem .85rem; font-weight: 750; }
button:hover { filter: brightness(.96); }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 3px solid #9462bf; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2 { text-wrap: balance; }
.skip { position: fixed; top: .75rem; left: .75rem; z-index: 3; transform: translateY(-200%); background: white; padding: .65rem; }
.skip:focus { transform: none; }
.shell { max-width: 1480px; margin: auto; padding: 0 clamp(1rem, 3.7vw, 3.5rem); }
.topbar, footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.topbar { padding: 1.3rem 0; }
.brand { display: inline-flex; align-items: center; gap: .7rem; font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 900; letter-spacing: -.04em; color: var(--ink); text-decoration: none; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; background: var(--lavender); color: var(--violet); font-size: 1.35rem; }
.secondary { background: #fffdfb; color: var(--ink); border-color: var(--line); }
#collection-count { color: var(--violet); background: var(--lavender); padding: .15rem .42rem; border-radius: 7px; margin-left: .3rem; font-size: .875rem; }
.board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(296px, 330px); align-items: start; gap: 1rem; }
.garden { container-type: inline-size; position: relative; isolation: isolate; overflow: hidden; min-height: min(675px, 77vh); border-radius: 27px; background: #b3d7af; box-shadow: 0 12px 32px #44332115; }
.yard, .shade, .puppies { position: absolute; inset: 0; width: 100%; height: 100%; }
.puppies { z-index: 0; }
.play-ball {
  position: absolute;
  left: 69%;
  top: 72%;
  width: clamp(19px, 3.4cqw, 35px);
  aspect-ratio: 1;
  translate: -50% -55%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 29% 24%, #fffad9c7 0%, #fffad938 21%, transparent 43%),
    conic-gradient(from 15deg, #fae486 0% 26%, #f5908c 27% 52%, #fae486 53% 76%, #f5908c 77%);
  box-shadow: inset -3px -4px 5px #7b3d572e, 1px 4px 4px #30392255;
  pointer-events: none;
}
.yard { object-fit: cover; object-position: center 62%; z-index: -3; }
.yard-video { opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.yard-video.is-playing { opacity: 1; }
.shade { background: #d2d2e8; z-index: -2; opacity: 0; transition: opacity .9s ease; }
.garden.over .shade { opacity: .43; }
.scene-copy { position: absolute; left: clamp(1rem, 3vw, 2.7rem); right: clamp(1rem, 3vw, 2.7rem); top: clamp(1rem, 4.1vw, 3rem); width: fit-content; max-width: calc(100% - 2 * clamp(1rem, 3vw, 2.7rem)); padding: clamp(1rem, 2.1vw, 1.7rem); border-radius: 22px; color: #3d3050; background: #fff9eef0; border: 1px solid #fffdf8; box-shadow: 0 8px 22px #41274712; z-index: 1; }
.place { color: #6f4a87; font-size: .875rem; font-weight: 850; letter-spacing: .12em; }
.place span { margin-right: .3rem; }
h1 { margin: .4rem 0 .75rem; font-size: clamp(2.15rem, 4.4vw, 5rem); font-weight: 900; line-height: .98; letter-spacing: -.065em; }
.scene-copy p:last-child { font-weight: 650; line-height: 1.4; }
.garden.active .scene-copy { padding: .85rem 1.05rem; }
.garden.active h1 { display: none; }
.garden.active .place { margin-bottom: .25rem; }
.scene-tools { position: absolute; z-index: 2; display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: .5rem; bottom: clamp(.8rem, 2vw, 1.5rem); left: clamp(.8rem, 2vw, 1.5rem); right: clamp(.8rem, 2vw, 1.5rem); }
.screen-button, .garden-status { color: #352442; border: 1px solid #fff9ef; border-radius: 12px; background: #fff8eeeF; font-weight: 750; }
.garden-status { padding: .66rem .82rem; font-size: .92rem; }
#garden-status-icon { margin-right: .34rem; }
.garden:fullscreen, .garden.projected { width: 100%; height: 100%; border-radius: 0; }
.garden.projected { position: fixed; inset: 0; z-index: 5; }
body:has(.garden.projected) { overflow: hidden; }
.puppy { position: absolute; left: var(--x); top: var(--y); width: var(--puppy-size, clamp(62px, 20%, 205px)); margin: 0; transform: translate(-50%, -88%); animation: arrive .55s ease-out both; text-align: center; }
.puppy.fleeing { animation: flee 1.15s cubic-bezier(.4, .1, .7, 1) both; z-index: 1; }
@keyframes flee {
  from { transform: translate(-50%, -88%); }
  to { transform: translate(calc(-50% + var(--exit-x)), -103%); }
}
.puppy img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 5px 3px #3b442748); }
.puppy figcaption { position: absolute; bottom: -.2rem; left: 50%; transform: translateX(-50%); inline-size: max-content; max-inline-size: min(10em, 46cqw); text-wrap: balance; overflow-wrap: anywhere; background: #fffbf3; padding: .15rem .5rem; border-radius: 10px; font-size: clamp(.72rem, 1.3vw, 1rem); font-weight: 850; opacity: 0; pointer-events: none; transition: opacity .6s ease; }
.puppy.label-fresh figcaption { opacity: 1; }
@media (hover: hover) {
  .puppy:hover figcaption { opacity: 1; }
}
.puppy.rare-arriving .puppy-motion::before {
  content: "";
  position: absolute;
  inset: 8% -8% -2%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #fff7a9aa 4%, #ffdc7570 47%, #ffd97e00 73%);
  z-index: -1;
  pointer-events: none;
  animation: rare-shimmer 1s ease-in-out 2;
}
.rare-sparkle {
  position: absolute;
  inset: 19% 12% auto auto;
  color: #fff1a3;
  font-size: clamp(.8rem, 2.5cqw, 2rem);
  line-height: 1;
  text-shadow: -.9em .54em 0 #fff0a7, .46em .88em 0 #ffd166, 0 0 .45em #a85c2e;
  pointer-events: none;
  animation: rare-shimmer 1s ease-in-out 2;
}
.unlock-badge {
  position: absolute;
  left: 50%;
  bottom: calc(100% + .25rem);
  translate: -50% 0;
  width: max-content;
  border: 1px solid #b8dbc5;
  border-radius: 999px;
  background: #e5f5ea;
  color: #254b38;
  padding: .2rem .52rem;
  font-size: .75rem;
  font-weight: 850;
  box-shadow: 0 2px 9px #1c422c37;
  pointer-events: none;
}
.rare-badge {
  position: absolute;
  left: 50%;
  top: 8%;
  translate: -50% 0;
  padding: .16rem .46rem;
  border-radius: 999px;
  background: #ffed9c;
  color: #59400f;
  font-size: .78rem;
  font-weight: 900;
  box-shadow: 0 2px 9px #82500b44;
  pointer-events: none;
  animation: rare-shimmer 1s ease-in-out 2;
}
@keyframes rare-shimmer {
  0%, 100% { opacity: .74; scale: 1; }
  48% { opacity: 1; scale: 1.12; }
}
@media (prefers-reduced-motion: reduce) {
  .puppy.rare-arriving .puppy-motion::before, .rare-sparkle, .rare-badge { animation: none; }
}
.puppy[data-rarity="Rare"] figcaption { background: #fff1b8; }
.puppy[data-rarity="Uncommon"] figcaption { background: #f0e1ff; }
@keyframes arrive { from { opacity: 0; transform: translate(-50%, -68%) scale(.75); } to { opacity: 1; transform: translate(-50%, -88%); } }
.panel { padding: 1.2rem; border: 1px solid var(--line); border-radius: 25px; background: #fffdfb; box-shadow: 0 9px 27px #4934500a; }
.panel-heading { display: flex; align-items: center; gap: .65rem; margin-bottom: 1.2rem; }
.panel-heading h2 { font-size: 1.25rem; letter-spacing: -.035em; }
.panel-heading p, .privacy, #meter-help { font-size: .875rem; color: var(--muted); line-height: 1.45; }
.panel-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--lavender); color: var(--violet); font-size: 1.3rem; font-weight: 850; }
.monitor { border-radius: 16px; padding: .85rem; background: #f8f2fb; }
.monitor-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; }
#level-number { color: var(--violet); font-variant-numeric: tabular-nums; }
.track { position: relative; margin: .7rem 0 .55rem; height: 12px; }
meter { appearance: none; display: block; height: 12px; width: 100%; background: #e6d9ef; border-radius: 15px; }
meter::-webkit-meter-bar { background: #e6d9ef; border: 0; border-radius: 15px; height: 12px; }
meter::-webkit-meter-optimum-value { background: var(--mint); border-radius: 15px; }
meter::-moz-meter-bar { background: var(--mint); border-radius: 15px; }
.goal-line { position: absolute; left: 39%; top: -3px; height: 18px; width: 3px; border-radius: 3px; background: var(--violet); }
.presets { padding: 0; border: 0; margin: 1.1rem 0; min-width: 0; }
.presets legend { font-weight: 800; margin-bottom: .45rem; }
.choices { display: flex; gap: .32rem; }
.choices button { flex: 1; padding: .35rem .25rem; font-size: .875rem; background: #fff; color: var(--ink); border-color: var(--line); line-height: 1.2; }
.choices button[aria-pressed="true"] { background: var(--lavender); color: #4b2b6f; border-color: #c5abdc; }
.settings { border-block: 1px solid var(--line); margin-bottom: 1rem; }
.settings summary { padding: .75rem 0; font-weight: 750; color: #4b3659; }
.settings-body { display: grid; gap: .65rem; padding-bottom: .85rem; }
.settings label { font-weight: 700; font-size: .875rem; }
.settings output { float: right; }
.settings input, .settings select { width: 100%; display: block; margin: .4rem 0 0; accent-color: var(--violet); }
.settings select, .settings input[type="number"] { border: 1px solid var(--line); min-height: 40px; padding: .4rem .5rem; background: #fffdfb; color: var(--ink); border-radius: 8px; }
.actions { display: grid; gap: .55rem; }
.primary { color: #fff; background: var(--violet); }
.privacy, .error { margin-top: .8rem; }
.error { color: #8d3551; font-size: .875rem; }
.text-button { background: transparent; color: var(--violet); padding-inline: 0; text-decoration: underline; }
footer { padding: 1.15rem 0 1.6rem; color: var(--muted); font-size: .9rem; }
dialog { color: var(--ink); background: #fffdfb; border: 1px solid var(--line); border-radius: 24px; width: min(740px, calc(100% - 1.5rem)); max-height: 88dvh; padding: clamp(1rem, 3vw, 1.8rem); overscroll-behavior: contain; }
dialog::backdrop { background: #2f223e95; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .45rem; }
#book-progress, #report-caption, .report-note { color: var(--muted); line-height: 1.45; }

.book-overview { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; }
#book-progress { font-weight: 800; }
#book-quiet, .book-rule { color: var(--muted); font-size: .875rem; line-height: 1.45; }
.book-rule { margin-top: .5rem; }
.book-footer { margin-top: 1.15rem; border-top: 1px solid var(--line); }
.book-footer .text-button { font-size: .84rem; }
.reset-confirm { width: min(420px, calc(100% - 1.5rem)); }
.reset-confirm p { margin: .65rem 0 1.25rem; color: var(--muted); }
.reset-actions { display: flex; justify-content: flex-end; gap: .6rem; }
.breed-groups { display: grid; gap: 1.3rem; margin-top: 1.15rem; }
.breed-group h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; margin-bottom: .5rem; font-size: 1.1rem; }
.breed-group h3 span { color: var(--muted); font-size: .875rem; font-weight: 550; }
.breed-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(119px, 1fr)); gap: .6rem; }
.breed-card { text-align: center; padding: .65rem .4rem; border-radius: 14px; background: #f6eef9; }
.breed-card[data-rarity="Rare"] { background: #fff4d5; }
.breed-card[data-rarity="Uncommon"] { background: #eedffb; }
.breed-card img { display: block; width: 84px; height: 84px; margin: 0 auto .3rem; }
.breed-card.is-hidden img { filter: brightness(0) invert(57%); }
.breed-card strong { display: block; font-size: .875rem; line-height: 1.25; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.report-stats { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }
.report-stat { flex: 1 0 128px; display: grid; gap: .1rem; background: #f6edf9; padding: .8rem; border-radius: 12px; }
.report-stat strong { font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.timeline { display: flex; margin: .55rem 0; overflow: hidden; border-radius: 7px; height: 32px; background: #f2e9f5; }
.timeline span { min-width: 0; flex: var(--share) 0 0; background: linear-gradient(to top, var(--mint) var(--within), var(--rose) var(--within)); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .875rem; }
.legend span { color: #357150; }
.legend span:nth-child(2) { color: #a6535e; margin-left: .4rem; }
.report-note { font-size: .875rem; margin: .8rem 0; }
@media (max-width: 825px) {
  .board { grid-template-columns: 1fr; }
  .garden { min-height: clamp(390px, 68vh, 630px); }
}
@media (max-width: 430px) {
  .topbar { padding: .85rem 0; }
  .brand-mark { width: 35px; height: 35px; border-radius: 11px; }
  #collection { font-size: .875rem; padding-inline: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.play-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.start-button { width: 100%; min-height: 58px; font-size: 1.12rem; box-shadow: 0 5px 16px #33263c4d; }
.start-button span { margin-right: .3rem; font-size: .9em; }
.garden.paused .shade { opacity: .22; }
.puppy-motion { position: relative; }
.puppy .sitting, .puppy .upright, .puppy .scared { display: none; }
.puppy .walking {
  transform: scaleX(var(--facing, 1));
  animation: bound .82s ease-in-out infinite;
}
.garden.paused .puppy .walking, .garden.startled .puppy .walking {
  position: absolute;
  inset: 0;
  visibility: hidden;
  animation-play-state: paused;
}
.garden.paused .puppy .upright { display: block; transform: scale(1.13); transform-origin: center 95%; }
.garden.startled .puppy .scared { display: block; }
.garden:not(.paused):not(.startled) .puppy:is(.looking, :not(.walk-ready)):not(.fleeing) .walking { display: none; }
.garden:not(.paused):not(.startled) .puppy:is(.looking, :not(.walk-ready)):not(.fleeing) .sitting { display: block; }
@keyframes bound {
  0%, 100% { translate: 0 0; scale: 1.025 .975; }
  48% { translate: 0 -4%; scale: .99 1.01; }
}
.garden .puppy.fleeing .walking {
  display: block;
  position: static;
  visibility: visible;
  transform: scaleX(var(--exit-facing));
  animation: bound .32s ease-in-out infinite;
}
.garden .puppy.fleeing .scared, .garden .puppy.fleeing .upright { display: none; }
.noise-message {
  display: none;
  position: absolute;
  z-index: 1;
  inset: clamp(1rem, 4vh, 2.75rem) 1rem auto;
  width: min(calc(100% - 2rem), 590px);
  margin-inline: auto;
  padding: clamp(.7rem, 1.9vh, 1.2rem) clamp(.9rem, 2vw, 1.65rem);
  background: #fff8f1f5;
  border: 1px solid #fffdf6;
  border-radius: 22px;
  color: #452e56;
  text-align: center;
  box-shadow: 0 9px 28px #4c315826;
  pointer-events: none;
}
.garden.over .noise-message { display: grid; place-items: center; gap: .35rem; }
.garden.over .scene-copy { opacity: 0; pointer-events: none; }
.noise-message p { font-size: clamp(1.35rem, 3.2vw, 2.8rem); font-weight: 900; letter-spacing: -.04em; line-height: 1.06; text-wrap: balance; }
.quiet-paw {
  position: relative;
  width: clamp(60px, 11vh, 115px);
  aspect-ratio: 1;
  color: #a65884;
  transform: rotate(-9deg);
}
.quiet-paw i, .quiet-paw span { position: absolute; display: block; background: currentColor; }
.quiet-paw i { width: 21%; height: 29%; border-radius: 50%; }
.quiet-paw i:nth-child(1) { left: 1%; top: 31%; transform: rotate(-29deg); }
.quiet-paw i:nth-child(2) { left: 23%; top: 10%; transform: rotate(-13deg); }
.quiet-paw i:nth-child(3) { right: 30%; top: 8%; transform: rotate(11deg); }
.quiet-paw i:nth-child(4) { right: 5%; top: 25%; transform: rotate(27deg); }
.quiet-paw span { left: 19%; bottom: 4%; width: 58%; height: 51%; border-radius: 54% 54% 43% 43% / 67% 67% 36% 36%; }
@media (max-width: 430px) {
  .noise-message { inset-block-start: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .puppy.fleeing { visibility: hidden; }
  .garden:not(.startled):not(.paused) .puppy .walking { display: none; }
  .garden:not(.startled):not(.paused) .puppy .sitting { display: block; }
}
