:root {
  --ink: #4a3427;
  --muted: #8f7b67;
  --cream: #fffaf1;
  --panel: rgba(255, 252, 244, 0.94);
  --line: rgba(126, 95, 60, 0.18);
  --green: #98bf55;
  --green-deep: #5f8f2d;
  --sky: #9edcf4;
  --coral: #f16f66;
  --blue: #72b6d4;
  --lavender: #9b95d8;
  --gold: #f6bd43;
  --shadow: 0 16px 34px rgba(88, 67, 45, 0.18);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { overflow-x: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Meiryo", system-ui, sans-serif;
  background: #f8f0e2;
}

button {
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.mofumaro-guide {
  position: relative;
  padding: 100px 28px 112px;
  color: #f8f3e8;
  background: #203229;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.guide-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.guide-intro {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(360px, 1.2fr);
  gap: 64px;
  align-items: end;
}

.guide-eyebrow {
  margin: 0 0 12px;
  color: #a9cf8e;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.guide-intro h2 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(38px, 5vw, 66px);
  letter-spacing: 0;
}

.guide-intro > p {
  margin: 0;
  color: rgba(248, 243, 232, 0.72);
  font-size: 16px;
  line-height: 2;
}

.guide-basics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 58px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.guide-basics article {
  min-height: 235px;
  padding: 26px 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.guide-basics article:last-child { border-right: 0; }
.guide-basics article > span { color: #a9cf8e; font-size: 12px; font-weight: 900; }
.guide-basics h3 { margin: 22px 0 10px; font-size: 22px; }
.guide-basics p { margin: 0; color: rgba(248, 243, 232, 0.66); font-size: 13px; line-height: 1.9; }

.guide-details {
  margin-top: 56px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.guide-details details { border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
.guide-details summary {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  list-style: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}
.guide-details summary::-webkit-details-marker { display: none; }
.guide-details summary b { color: #a9cf8e; font-size: 26px; transition: transform 0.25s ease; }
.guide-details details[open] summary b { transform: rotate(45deg); }
.guide-details details > div {
  max-width: 900px;
  padding: 0 0 30px;
  color: rgba(248, 243, 232, 0.7);
  font-size: 14px;
  line-height: 2;
}
.guide-details details > div p { margin: 0 0 12px; }
.guide-details details > div p:last-child { margin-bottom: 0; }
.guide-closing { margin: 36px 0 0; color: #c9dda9; font-size: 13px; font-weight: 900; line-height: 1.8; }

.farewell-zone {
  margin-top: 70px;
  padding-top: 34px;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(340px, 0.8fr);
  gap: 54px;
  align-items: end;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.farewell-zone h3 { margin: 0 0 12px; font-size: 22px; }
.farewell-zone > div > p:not(.guide-eyebrow) { margin: 0; color: rgba(248, 243, 232, 0.62); font-size: 13px; line-height: 1.9; }
.farewell-action { display: grid; gap: 9px; }
.farewell-action button {
  min-height: 50px;
  padding: 11px 18px;
  border: 1px solid rgba(255, 213, 204, 0.42);
  border-radius: 6px;
  background: transparent;
  color: #ffd5cc;
  font-weight: 900;
}
.farewell-action button:disabled { cursor: not-allowed; color: rgba(248, 243, 232, 0.42); border-color: rgba(255, 255, 255, 0.14); }
.farewell-action small { color: rgba(248, 243, 232, 0.54); line-height: 1.65; }
.farewell-action > p { min-height: 1.4em; margin: 0; color: #c9dda9; font-size: 12px; font-weight: 800; }

.farewell-window { width: min(560px, 100%); }
.farewell-window h2 { margin: 0 42px 10px 0; font-size: clamp(25px, 4vw, 34px); line-height: 1.45; }
.farewell-warning { margin: 0; color: #b34235; font-size: 18px; font-weight: 900; }
.farewell-rules { margin: 24px 0; padding: 17px 18px; border-left: 3px solid #d26d5e; background: #fff4f0; }
.farewell-rules p { margin: 0 0 7px; color: #71564f; font-size: 13px; line-height: 1.75; }
.farewell-rules p:last-child { margin-bottom: 0; }
.farewell-form { display: grid; gap: 10px; }
.farewell-form label { color: #66544a; font-size: 13px; font-weight: 900; }
.farewell-form input[type="password"] { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid rgba(126, 95, 60, 0.3); border-radius: 6px; background: #fff; color: var(--ink); font: inherit; }
.farewell-form input[type="password"]:focus { outline: 3px solid rgba(210, 109, 94, 0.17); border-color: #c85c4e; }
.farewell-pet-picker { min-width: 0; margin: 0 0 8px; padding: 0; border: 0; }
.farewell-pet-picker legend { margin-bottom: 9px; color: #66544a; font-size: 13px; font-weight: 900; }
.farewell-pet-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.farewell-pet-choice {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 76px;
  padding: 13px 14px 12px 40px;
  align-content: center;
  border: 1px solid rgba(126, 95, 60, 0.24);
  border-radius: 6px;
  background: #fffdf8;
  cursor: pointer;
}
.farewell-pet-choice input { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; margin: 0; transform: translateY(-50%); accent-color: #a84438; }
.farewell-pet-choice strong { overflow-wrap: anywhere; color: #453a34; font-size: 15px; }
.farewell-pet-choice small { margin-top: 3px; color: #89766d; font-size: 11px; font-weight: 700; }
.farewell-pet-choice:has(input:checked) { border-color: #b55245; background: #fff2ed; box-shadow: 0 0 0 2px rgba(181, 82, 69, 0.1); }
.farewell-form button { min-height: 50px; margin-top: 4px; padding: 10px 16px; border-radius: 6px; background: #a84438; color: #fff; font-weight: 900; }
.farewell-form button:disabled { cursor: wait; opacity: 0.58; }
.farewell-form > p { min-height: 1.5em; margin: 0; color: #b34235; font-size: 12px; font-weight: 800; line-height: 1.6; }

@media (max-width: 900px) {
  .mofumaro-guide { padding: 72px 20px 82px; }
  .guide-intro { grid-template-columns: 1fr; gap: 24px; }
  .farewell-zone { grid-template-columns: 1fr; gap: 24px; }
  .guide-basics { grid-template-columns: 1fr 1fr; }
  .guide-basics article { min-height: 210px; }
  .guide-basics article:nth-child(2) { border-right: 0; }
  .guide-basics article:nth-child(-n + 2) { border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
}

@media (max-width: 560px) {
  .farewell-pet-choices { grid-template-columns: 1fr; }
  .guide-basics { grid-template-columns: 1fr; }
  .guide-basics article { min-height: 0; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
  .guide-basics article:nth-child(3) { border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
  .guide-basics article:last-child { border-bottom: 0; }
  .guide-details summary { min-height: 68px; font-size: 16px; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.app {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-rows: 72px 1fr;
  background: linear-gradient(#fff9ef, #f5ead8);
}

.topbar {
  position: relative;
  z-index: 90;
  display: grid;
  grid-template-columns: 230px 178px minmax(300px, 1fr) auto;
  align-items: center;
  gap: 18px;
  height: 72px;
  padding: 0 18px;
  background: rgba(255, 251, 243, 0.96);
  border-bottom: 1px solid rgba(118, 89, 56, 0.14);
  box-shadow: 0 5px 18px rgba(88, 67, 45, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-stack {
  display: grid;
  gap: 1px;
  line-height: 1;
}

.brand-stack > span {
  font-size: 30px;
}

.portal-link {
  color: #856346;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-decoration: none;
  white-space: nowrap;
}

.portal-link:hover {
  color: #c46338;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 4px solid #503a2c;
  border-radius: 14px 14px 17px 17px;
  position: relative;
  background: #fffdf8;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  top: 13px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #503a2c;
}

.brand-mark::before { left: 10px; }
.brand-mark::after { right: 10px; }

.tabs {
  display: flex;
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 48px;
  min-width: 176px;
  padding: 0 12px;
  border-radius: 8px;
  background: #f1eadf;
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: inset 0 -2px 0 rgba(104, 81, 55, 0.08);
}

.tab small {
  flex: 0 0 auto;
  margin-left: 0;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(122, 99, 71, 0.12);
  color: #84694a;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.wallet {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.wallet-item {
  min-width: 150px;
  height: 46px;
  padding: 0 10px 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: inset 0 -2px 0 rgba(104, 81, 55, 0.05);
  font-size: 23px;
  font-weight: 900;
}

.wallet-item > span { font-size: 27px; line-height: 1; }
.wallet-item.heart > span { color: #f66e68; }
.wallet-item.coin > span { color: var(--gold); }
.wallet-item.gem > span { color: #69bff5; }
.wallet-item button {
  background: transparent;
  font-size: 25px;
  font-weight: 900;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audio-toggle {
  position: relative;
  color: #7c6247;
}

.audio-toggle.is-on {
  color: #4f7b40;
  background: linear-gradient(180deg, #fffdf6, #edf8dc);
  border-color: rgba(103, 146, 70, 0.32);
}

.audio-toggle.is-on::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #87c85d;
  box-shadow: 0 0 0 3px rgba(135, 200, 93, 0.16);
}

.account-pill {
  position: relative;
  min-height: 50px;
  max-width: 330px;
  padding: 6px 8px 6px 11px;
  display: grid;
  grid-template-columns: 12px minmax(92px, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(126, 95, 60, 0.18);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: inset 0 -2px 0 rgba(104, 81, 55, 0.05);
}

.account-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d8cfc4;
}

.account-pill[data-auth="user"] .account-dot { background: #73bf74; }

.account-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.account-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.account-copy strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-pill a,
.account-pill summary,
.account-pill > button {
  min-width: 54px;
  padding: 7px 8px;
  border: 0;
  border-radius: 9px;
  background: #f3eadf;
  color: #6e4e32;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-decoration: none;
}

.account-pill summary {
  display: block;
  list-style: none;
  cursor: pointer;
}

.account-pill summary::-webkit-details-marker { display: none; }

.account-pill[data-auth="user"] #loginLink,
.account-pill[data-auth="user"] #registerLink {
  display: none;
}

.account-pill[data-auth="guest"] #logoutLink {
  display: none;
}

.login-details { display: block; }

.login-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  z-index: 30;
  width: min(300px, calc(100vw - 24px));
  padding: 13px;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(126, 95, 60, 0.18);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 18px 45px rgba(73, 52, 33, 0.18);
}

.login-details:not([open]) .login-popover { display: none; }

.login-popover label {
  display: grid;
  gap: 5px;
  color: #6d5840;
  font-size: 12px;
  font-weight: 900;
}

.login-popover .login-remember,
.trial-login-form .login-remember {
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.login-remember input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  accent-color: #ef7064;
}

.login-popover input {
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(126, 95, 60, 0.18);
  border-radius: 10px;
  background: #fffaf2;
  color: #2f251c;
  font: inherit;
  font-size: 14px;
}

.login-submit {
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff725e, #ffb65e);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

#loginMessage {
  min-height: 16px;
  margin: 0;
  color: #786a5b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

#loginMessage[data-tone="error"] { color: #bd4d3d; }
#loginMessage[data-tone="success"] { color: #4d9460; }

.round-btn {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: #f8efe5;
  font-size: 24px;
  box-shadow: inset 0 -2px 0 rgba(104, 81, 55, 0.08);
}

.notification-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 11px;
  height: 11px;
  border: 2px solid #fffaf1;
  border-radius: 50%;
  background: #f16f66;
  box-shadow: 0 2px 6px rgba(132, 55, 44, 0.34);
}

.shop-btn {
  height: 72px;
  min-width: 140px;
  margin-right: -18px;
  padding: 0 24px;
  background: linear-gradient(#ff7c72, #f86d63);
  color: white;
  font-size: 23px;
  font-weight: 900;
  white-space: nowrap;
}

#nullStoneCount { white-space: nowrap; }

.shell {
  display: grid;
  grid-template-columns: minmax(720px, 1fr) 376px;
  align-items: stretch;
  min-height: 0;
}

.room {
  position: relative;
  overflow: hidden;
  height: calc(100vh - 72px);
  min-height: 760px;
  --stage-bg: url("assets/room-background.png");
  background-image:
    linear-gradient(to bottom, rgba(255, 248, 235, 0.02), rgba(82, 55, 24, 0.12)),
    var(--stage-bg);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}

.room::before {
  content: none;
}

.room::after {
  content: none;
}

.app.is-moon-lantern-scene .room::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(circle 190px at 52% 61%, rgba(255, 235, 168, 0.08) 0 38%, rgba(12, 18, 37, 0.52) 72%, rgba(7, 10, 24, 0.68) 100%);
  animation: lanternGlow 4.8s ease-in-out infinite;
}

@keyframes lanternGlow {
  0%, 100% { opacity: .88; }
  50% { opacity: 1; }
}

.app[data-home-phase="late-night"] .room {
  background-image:
    linear-gradient(to bottom, rgba(18, 24, 45, 0.24), rgba(29, 21, 23, 0.28)),
    var(--stage-bg);
}

.app[data-home-phase="night"] .room {
  background-image:
    linear-gradient(to bottom, rgba(255, 221, 155, 0.04), rgba(82, 55, 24, 0.10)),
    var(--stage-bg);
}

.app[data-home-phase="morning"] .room {
  background-image:
    linear-gradient(to bottom, rgba(255, 239, 196, 0.08), rgba(82, 55, 24, 0.08)),
    var(--stage-bg);
}

.room-select {
  position: absolute;
  z-index: 4;
  left: 16px;
  top: 20px;
  height: 56px;
  min-width: 275px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  padding: 0 18px;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.95);
  box-shadow: 0 9px 20px rgba(87, 61, 36, 0.15);
  font-size: 20px;
  font-weight: 900;
}

.room-select small {
  margin-left: auto;
  color: #8a765f;
  font-size: 14px;
  font-weight: 800;
}

.living-moment-badge {
  position: absolute;
  z-index: 5;
  left: 20px;
  top: 84px;
  max-width: min(390px, calc(100% - 40px));
  padding: 8px 11px;
  border-left: 3px solid rgba(102, 133, 82, .64);
  background: rgba(255, 253, 247, .78);
  color: #5f5649;
  box-shadow: 0 5px 16px rgba(74, 55, 36, .08);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  backdrop-filter: blur(8px);
}

.living-moment-badge[hidden] { display: none; }

.room-life-traces {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.room-trace {
  position: absolute;
  display: block;
  width: 34px;
  height: 20px;
  opacity: .5;
  filter: drop-shadow(0 2px 2px rgba(70, 53, 36, .12));
}

.room-trace.spot-window { left: 48%; top: 34%; }
.room-trace.spot-bed { right: 16%; bottom: 34%; }
.room-trace.spot-rug { left: 35%; bottom: 30%; }
.room-trace.spot-bowl { left: 18%; bottom: 29%; }
.room-trace.spot-door { left: 7%; bottom: 32%; }

.room-trace.trace-pawprints {
  background:
    radial-gradient(circle at 22% 62%, rgba(102, 77, 52, .42) 0 14%, transparent 16%),
    radial-gradient(circle at 38% 28%, rgba(102, 77, 52, .34) 0 9%, transparent 11%),
    radial-gradient(circle at 54% 67%, rgba(102, 77, 52, .38) 0 13%, transparent 15%),
    radial-gradient(circle at 72% 32%, rgba(102, 77, 52, .3) 0 9%, transparent 11%);
  transform: rotate(-12deg);
}

.room-trace.trace-soft-fluff::before,
.room-trace.trace-soft-fluff::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 7px;
  border-radius: 50%;
  border-top: 1px solid rgba(245, 228, 196, .94);
  transform: rotate(18deg);
}
.room-trace.trace-soft-fluff::after { left: 13px; top: 7px; transform: rotate(-22deg); }

.room-trace.trace-bowl-crumbs {
  width: 24px;
  height: 14px;
  background:
    radial-gradient(circle at 16% 54%, #b88955 0 8%, transparent 10%),
    radial-gradient(circle at 49% 26%, #9f7448 0 7%, transparent 9%),
    radial-gradient(circle at 79% 68%, #c39862 0 9%, transparent 11%);
}

.room-trace.trace-bed-dent {
  width: 70px;
  height: 22px;
  border-radius: 50%;
  box-shadow: inset 0 5px 8px rgba(66, 79, 92, .18);
  opacity: .3;
}

.room-trace.trace-ball-shift {
  width: 18px;
  height: 5px;
  border-radius: 50%;
  background: rgba(70, 62, 51, .24);
  transform: translateX(36px);
}

.room-trace.trace-window-glow,
.room-trace.trace-rug-warmth {
  width: 88px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 226, 153, .32), transparent 70%);
  filter: blur(2px);
}

.app[data-habitat="garden"] .room-select,
.app[data-habitat="walk"] .room-select {
  background: rgba(255, 253, 248, 0.9);
}

.app[data-habitat="garden"] .room-bed,
.app[data-habitat="garden"] .bowl,
.app[data-habitat="walk"] .room-bed,
.app[data-habitat="walk"] .bowl {
  display: none;
}

.round-window {
  position: absolute;
  left: 45%;
  top: 5%;
  width: 330px;
  height: 330px;
  transform: translateX(-50%);
  border: 16px solid #b88854;
  border-radius: 50%;
  background: linear-gradient(#a6def5 0 58%, #8fc979 59% 100%);
  box-shadow: inset 0 0 0 5px rgba(255,255,255,.4), 0 12px 18px rgba(100, 70, 37, 0.18);
  overflow: hidden;
}

.wall-decor,
.round-window,
.door,
.kennel,
.plant,
.plant-left,
.shelf-scene,
.floor-lines {
  display: none;
}

.round-window::before,
.round-window::after {
  content: "";
  position: absolute;
  background: rgba(255,255,255,.92);
  border-radius: 999px;
}

.round-window::before {
  left: 36px;
  top: 65px;
  width: 118px;
  height: 45px;
  box-shadow: 42px -8px 0 -5px rgba(255,255,255,.9);
}

.round-window::after {
  right: 46px;
  top: 88px;
  width: 84px;
  height: 32px;
}

.window-cross {
  position: absolute;
  z-index: 2;
  background: #b88854;
  opacity: .92;
}

.window-cross.x { left: 50%; top: 0; width: 12px; height: 100%; transform: translateX(-50%); }
.window-cross.y { left: 0; top: 50%; width: 100%; height: 12px; transform: translateY(-50%); }

.hill {
  position: absolute;
  bottom: 62px;
  width: 160px;
  height: 56px;
  border-radius: 50%;
  background: rgba(72, 150, 82, 0.45);
}

.hill-a { left: 20px; }
.hill-b { right: 12px; bottom: 56px; }

.door {
  position: absolute;
  left: 0;
  top: 0;
  width: 145px;
  height: 520px;
  background:
    radial-gradient(circle at 78% 45%, #c99b4a 0 9px, #80532a 10px 14px, transparent 15px),
    repeating-linear-gradient(90deg, rgba(23, 80, 98, 0.2) 0 2px, transparent 2px 38px),
    linear-gradient(#87b7c8, #6a9cad);
  border-right: 9px solid rgba(98, 71, 43, 0.16);
  box-shadow: inset -16px 0 25px rgba(54, 62, 56, 0.15);
}

.kennel {
  position: absolute;
  left: 205px;
  top: 330px;
  width: 208px;
  height: 160px;
  border-radius: 82px 82px 14px 14px;
  background: linear-gradient(#bd8c55, #906239);
  box-shadow: 0 11px 16px rgba(87, 61, 36, 0.2);
}

.kennel-hole {
  position: absolute;
  left: 43px;
  bottom: 17px;
  width: 122px;
  height: 94px;
  border-radius: 60px 60px 10px 10px;
  background: #4a3525;
}

.kennel-cushion {
  position: absolute;
  left: 55px;
  bottom: 20px;
  width: 100px;
  height: 33px;
  border-radius: 50%;
  background: #609a7b;
}

.plant-left {
  position: absolute;
  left: 70px;
  bottom: 238px;
  width: 68px;
  height: 72px;
  border-radius: 0 0 12px 12px;
  background: #d1a357;
}

.plant-left::before {
  content: "";
  position: absolute;
  left: -22px;
  right: -22px;
  top: -52px;
  height: 72px;
  background:
    radial-gradient(ellipse at 20% 70%, #83b75e 0 18%, transparent 19%),
    radial-gradient(ellipse at 42% 32%, #6eaa57 0 20%, transparent 21%),
    radial-gradient(ellipse at 68% 62%, #79b75e 0 19%, transparent 20%);
}

.shelf-scene {
  position: absolute;
  right: 115px;
  top: 270px;
  width: 140px;
  height: 14px;
  border-radius: 99px;
  background: #a87543;
  box-shadow: 0 8px 10px rgba(90, 60, 30, 0.16);
}

.tiny-pot {
  position: absolute;
  left: 24px;
  bottom: 14px;
  width: 34px;
  height: 30px;
  border-radius: 0 0 8px 8px;
  background: #c7924f;
}

.tiny-pot::before,
.tiny-pot.second::before {
  content: "";
  position: absolute;
  left: -15px;
  top: -38px;
  width: 62px;
  height: 45px;
  background:
    radial-gradient(ellipse at 26% 58%, #74aa52 0 18%, transparent 19%),
    radial-gradient(ellipse at 54% 22%, #8abf5e 0 18%, transparent 19%),
    radial-gradient(ellipse at 77% 65%, #6fa851 0 18%, transparent 19%);
}

.tiny-pot.second {
  left: 80px;
  transform: scale(.8);
}

.vine {
  position: absolute;
  top: -5px;
  width: 92px;
  height: 230px;
  background:
    radial-gradient(ellipse at 35% 10%, #80a94e 0 11%, transparent 12%),
    radial-gradient(ellipse at 62% 23%, #6c9c45 0 10%, transparent 11%),
    radial-gradient(ellipse at 40% 38%, #7faf52 0 11%, transparent 12%),
    radial-gradient(ellipse at 65% 54%, #6d9944 0 10%, transparent 11%),
    radial-gradient(ellipse at 37% 70%, #88b45a 0 11%, transparent 12%);
  opacity: .92;
}

.vine-left { left: 165px; }
.vine-right { right: 38px; height: 300px; }

.room-bed {
  position: absolute;
  right: 55px;
  top: 405px;
  width: 360px;
  height: 115px;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  opacity: 0;
}

.room-bed::before {
  content: none;
}

.room-bed::after {
  content: none;
}

.floor-lines {
  position: absolute;
  inset: 69% 0 0;
  background: linear-gradient(105deg, transparent 0 48%, rgba(255,255,255,.3) 49% 51%, transparent 52%);
}

.rug {
  position: absolute;
  z-index: 1;
  left: 24%;
  bottom: 190px;
  width: 295px;
  height: 86px;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

.toy,
.bowl {
  position: absolute;
  z-index: 3;
}

.ball {
  left: 58%;
  bottom: 285px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  opacity: 0;
}

.bowl {
  left: 195px;
  bottom: 272px;
  width: 148px;
  height: 58px;
  border-radius: 0 0 56px 56px;
  background: transparent;
  box-shadow: none;
  opacity: 0;
}

.bowl::before {
  content: none;
}

.pet-wrap {
  position: absolute;
  z-index: 3;
  left: 46%;
  bottom: 292px;
  width: 340px;
  height: 310px;
  transform: translateX(-50%);
  transform-origin: center bottom;
  transition:
    left 2.35s cubic-bezier(.16,.84,.2,1),
    bottom 2.35s cubic-bezier(.16,.84,.2,1),
    transform 1.25s ease;
}

.companion-pet-wrap {
  position: absolute;
  z-index: 3;
  left: 68%;
  bottom: 292px;
  width: 310px;
  height: 285px;
  transform: translateX(-50%);
  transform-origin: center bottom;
  transition: left 2.4s cubic-bezier(.16,.84,.2,1), bottom 2.4s cubic-bezier(.16,.84,.2,1), transform 1.25s ease;
  cursor: pointer;
  will-change: left, transform;
}

.companion-pet-wrap[hidden] { display: none !important; }

.companion-pet-image {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: var(--mofu-coat-filter, ) drop-shadow(0 17px 14px rgba(89, 65, 40, .23));
  transform-origin: center bottom;
  animation: companionBreath 5.7s ease-in-out infinite;
  visibility: visible;
  transition: none;
}

.companion-pet-motion-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: 0 0;
  filter: var(--mofu-coat-filter, ) drop-shadow(0 17px 14px rgba(89, 65, 40, .23));
  transform-origin: center bottom;
  transition: none;
  will-change: background-position;
  backface-visibility: hidden;
}

.companion-pet-wrap.is-ludo-idle .companion-pet-motion-layer,
.companion-pet-wrap.is-ludo-action .companion-pet-motion-layer { opacity: 1; visibility: visible; }
.companion-pet-wrap.is-ludo-idle .companion-pet-image,
.companion-pet-wrap.is-ludo-action .companion-pet-image { opacity: 0; visibility: hidden; animation: none; }

.companion-pet-shadow {
  position: absolute;
  z-index: 1;
  left: 21%;
  right: 21%;
  bottom: 4px;
  height: 28px;
  border-radius: 50%;
  background: rgba(76, 55, 36, .2);
  filter: blur(8px);
}

.companion-pet-signal {
  position: absolute;
  z-index: 4;
  inset: 2% 8% auto;
  height: 42px;
  opacity: 0;
  pointer-events: none;
}

.app[data-pack-count="2"] .pet-wrap {
  width: 310px;
  height: 285px;
}

.pair-event-caption {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 248px;
  width: min(620px, calc(100% - 40px));
  min-height: 42px;
  padding: 10px 18px;
  transform: translateX(-50%);
  border: 1px solid rgba(126, 95, 60, .18);
  border-radius: 8px;
  background: rgba(255, 253, 247, .92);
  box-shadow: 0 10px 28px rgba(75, 52, 30, .15);
  color: #5d4938;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  pointer-events: none;
}

.pair-event-caption[hidden] { display: none !important; }

.pair-scene-image {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 218px;
  width: min(650px, 58%);
  height: 430px;
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
  transform-origin: center bottom;
  filter: drop-shadow(0 18px 15px rgba(89, 65, 40, .23));
  pointer-events: none;
}

.pair-scene-image[hidden] { display: none !important; }
.app[data-pair-asset] .pet-wrap,
.app[data-pair-asset] .companion-pet-wrap { opacity: 0; pointer-events: none; }

@keyframes pairAssetNap {
  0%, 100% { transform: translateX(-50%) scale(1, 1); }
  50% { transform: translateX(-50%) translateY(3px) scale(1.008, .992); }
}
@keyframes pairAssetJump {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(1, 1); }
  12% { transform: translateX(-50%) translateY(7px) scale(1.06, .91); }
  42% { transform: translateX(-50%) translateY(-70px) scale(.97, 1.06); }
  72% { transform: translateX(-50%) translateY(-18px) scale(1.01, 1); }
  84% { transform: translateX(-50%) translateY(3px) scale(1.08, .9); }
}
@keyframes pairAssetTug {
  0%, 100% { transform: translateX(-50%) rotate(0deg) scale(1); }
  35% { transform: translateX(-51.5%) rotate(-.7deg) scale(1.015, .985); }
  70% { transform: translateX(-48.5%) rotate(.7deg) scale(.985, 1.015); }
}
@keyframes pairAssetJealous {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(0deg); }
  45% { transform: translateX(-49%) translateY(-5px) rotate(.8deg); }
  68% { transform: translateX(-50.5%) translateY(1px) rotate(-.3deg); }
}
@keyframes pairAssetMakeup {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) translateY(2px) scale(1.018, .988); }
}

.app[data-pair-asset="nap"] .pair-scene-image { animation: pairAssetNap 5.5s ease-in-out infinite; }
.app[data-pair-asset="mirror"] .pair-scene-image { animation: pairAssetJump 2.15s cubic-bezier(.2,.8,.2,1) infinite; }
.app[data-pair-asset="tug"] .pair-scene-image { animation: pairAssetTug 1.45s ease-in-out infinite; }
.app[data-pair-asset="jealous"] .pair-scene-image { animation: pairAssetJealous 2.8s ease-in-out infinite; }
.app[data-pair-asset="make-up"] .pair-scene-image { animation: pairAssetMakeup 4.5s ease-in-out infinite; }

@keyframes companionBreath {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1, 1); }
  48% { transform: translate3d(0, 3px, 0) scale(1.015, .985); }
}

@keyframes pairGreetingMain {
  0%, 100% { transform: translateX(-50%) rotate(0deg) scale(var(--pet-pair-scale, 1)); }
  44%, 68% { transform: translateX(-43%) rotate(3deg) scale(1.02) scale(var(--pet-pair-scale, 1)); }
}
@keyframes pairGreetingCompanion {
  0%, 100% { transform: translateX(-50%) rotate(0deg) scale(var(--pet-pair-scale, 1)); }
  44%, 68% { transform: translateX(-57%) rotate(-3deg) scale(1.02) scale(var(--pet-pair-scale, 1)); }
}
@keyframes pairMirrorMain {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(1, 1) scale(var(--pet-pair-scale, 1)); }
  22% { transform: translateX(-50%) translateY(-42px) scale(.96, 1.06) scale(var(--pet-pair-scale, 1)); }
  42% { transform: translateX(-50%) translateY(0) scale(1.08, .91) scale(var(--pet-pair-scale, 1)); }
}
@keyframes pairMirrorCompanion {
  0%, 18%, 100% { transform: translateX(-50%) translateY(0) scale(1, 1) scale(var(--pet-pair-scale, 1)); }
  40% { transform: translateX(-50%) translateY(-42px) scale(.96, 1.06) scale(var(--pet-pair-scale, 1)); }
  60% { transform: translateX(-50%) translateY(0) scale(1.08, .91) scale(var(--pet-pair-scale, 1)); }
}
@keyframes pairTugMain {
  0%, 100% { transform: translateX(-50%) rotate(0deg) scale(var(--pet-pair-scale, 1)); }
  45% { transform: translateX(-43%) rotate(2deg) scale(1.03, .98) scale(var(--pet-pair-scale, 1)); }
}
@keyframes pairTugCompanion {
  0%, 100% { transform: translateX(-50%) rotate(0deg) scale(var(--pet-pair-scale, 1)); }
  45% { transform: translateX(-57%) rotate(-2deg) scale(1.03, .98) scale(var(--pet-pair-scale, 1)); }
}
@keyframes pairFollowMain {
  0%, 100% { transform: translateX(-50%) translate3d(-70px, 0, 0) scale(var(--pet-pair-scale, 1)); }
  25% { transform: translateX(-50%) translate3d(0, -22px, 0) scale(var(--pet-pair-scale, 1)); }
  50% { transform: translateX(-50%) translate3d(70px, 0, 0) scale(var(--pet-pair-scale, 1)); }
  75% { transform: translateX(-50%) translate3d(0, 10px, 0) scale(var(--pet-pair-scale, 1)); }
}
@keyframes pairFollowCompanion {
  0%, 100% { transform: translateX(-50%) translate3d(70px, 0, 0) scale(var(--pet-pair-scale, 1)); }
  25% { transform: translateX(-50%) translate3d(0, 10px, 0) scale(var(--pet-pair-scale, 1)); }
  50% { transform: translateX(-50%) translate3d(-70px, 0, 0) scale(var(--pet-pair-scale, 1)); }
  75% { transform: translateX(-50%) translate3d(0, -22px, 0) scale(var(--pet-pair-scale, 1)); }
}
@keyframes pairSneeze {
  0%, 36%, 100% { transform: translateX(-50%) rotate(0deg) scale(var(--pet-pair-scale, 1)); }
  42% { transform: translateX(-50%) rotate(-6deg) scale(.96, 1.04) scale(var(--pet-pair-scale, 1)); }
  48% { transform: translateX(-50%) rotate(7deg) scale(1.05, .94) scale(var(--pet-pair-scale, 1)); }
  55% { transform: translateX(-50%) rotate(-2deg) scale(var(--pet-pair-scale, 1)); }
}

.app[data-pair-event="greeting"] .pet-wrap { left: 44% !important; animation: pairGreetingMain 3.1s ease-in-out infinite; }
.app[data-pair-event="greeting"] .companion-pet-wrap { left: 59% !important; animation: pairGreetingCompanion 3.1s ease-in-out infinite; }
.app[data-pair-event="nap"] .pet-wrap { left: 45% !important; bottom: 272px !important; transform: translateX(-50%) scale(.91) scale(var(--pet-pair-scale, 1)) !important; }
.app[data-pair-event="nap"] .companion-pet-wrap { left: 59% !important; bottom: 272px; transform: translateX(-50%) scale(.91) scale(var(--pet-pair-scale, 1)); }
.app[data-pair-event="mirror"] .pet-wrap { left: 42% !important; animation: pairMirrorMain 2.1s ease-in-out infinite; }
.app[data-pair-event="mirror"] .companion-pet-wrap { left: 64% !important; animation: pairMirrorCompanion 2.1s ease-in-out infinite; }
.app[data-pair-event="tug"] .pet-wrap { left: 44% !important; animation: pairTugMain 1.65s ease-in-out infinite; }
.app[data-pair-event="tug"] .companion-pet-wrap { left: 61% !important; animation: pairTugCompanion 1.65s ease-in-out infinite; }
.app[data-pair-event="jealous"] .pet-wrap { left: 48% !important; }
.app[data-pair-event="jealous"] .companion-pet-wrap { left: 50% !important; z-index: 5; transform: translateX(-50%) scale(1.06) scale(var(--pet-pair-scale, 1)); }
.app[data-pair-event="follow"] .pet-wrap { left: 47% !important; animation: pairFollowMain 3.6s linear infinite; }
.app[data-pair-event="follow"] .companion-pet-wrap { left: 59% !important; animation: pairFollowCompanion 3.6s linear infinite; }
.app[data-pair-event="make-up"] .pet-wrap { left: 45% !important; transform: translateX(-50%) rotate(2deg) scale(.98) scale(var(--pet-pair-scale, 1)) !important; }
.app[data-pair-event="make-up"] .companion-pet-wrap { left: 58% !important; transform: translateX(-50%) rotate(-2deg) scale(.98) scale(var(--pet-pair-scale, 1)); }
.app[data-pair-event="guard"] .pet-wrap { left: 46% !important; bottom: 270px !important; transform: translateX(-50%) scale(.9) scale(var(--pet-pair-scale, 1)) !important; }
.app[data-pair-event="guard"] .companion-pet-wrap { left: 61% !important; }
.app[data-pair-event="distance"] .pet-wrap { left: 34% !important; transform: translateX(-50%) scale(.92) scale(var(--pet-pair-scale, 1)) !important; }
.app[data-pair-event="distance"] .companion-pet-wrap { left: 73% !important; transform: translateX(-50%) scale(.92) scale(var(--pet-pair-scale, 1)); }
.app[data-pair-event="sneeze"] .pet-wrap,
.app[data-pair-event="sneeze"] .companion-pet-wrap { animation: pairSneeze 2.2s ease-in-out infinite; }
.app[data-pair-event="share"] .pet-wrap { left: 44% !important; }
.app[data-pair-event="share"] .companion-pet-wrap { left: 61% !important; }

.pet {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: url("assets/mofumaro.png") center bottom / contain no-repeat;
  box-shadow: none;
  filter:
    drop-shadow(0 18px 16px rgba(89, 65, 40, var(--pet-depth-shadow, .22)))
    drop-shadow(0 4px 4px rgba(255, 255, 255, .24))
    sepia(var(--pet-sepia, 0))
    brightness(var(--pet-brightness, 1))
    saturate(var(--pet-saturation, 1));
  transform-origin: center bottom;
  animation: breathe 5.2s ease-in-out infinite;
}

.pet.has-life-sprite {
  background: none !important;
  animation: none !important;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.pet-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform-origin: bottom center;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  transform-style: preserve-3d;
  contain: layout paint;
}

.pet.has-life-sprite .pet-stage {
  animation: none !important;
}

.pet-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  user-select: none;
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform: translateZ(0);
  image-rendering: auto;
  filter: var(--mofu-coat-filter, none);
}

.pet-base {
  opacity: 1;
  visibility: visible;
  transition: none;
}

.pet-motion-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: 0 0;
  transform: translateZ(0);
  transform-origin: center bottom;
  transition: none;
  will-change: background-position;
  backface-visibility: hidden;
  filter: var(--mofu-coat-filter, none);
}

.pet.has-life-sprite.is-ludo-idle .pet-motion-layer { opacity: 1; visibility: visible; }
.pet.has-life-sprite.is-ludo-idle .pet-base { opacity: 0; visibility: hidden; }
.pet.has-life-sprite.is-ludo-idle .pet-cue { opacity: 0 !important; }
.pet.has-life-sprite.is-ludo-idle .pet-pattern { visibility: hidden; }
.pet.has-life-sprite.is-ludo-action .pet-motion-layer { opacity: 1; visibility: visible; }
.pet.has-life-sprite.is-ludo-action .pet-base { opacity: 0; visibility: hidden; }
.pet.has-life-sprite.is-ludo-action .pet-cue { opacity: 0 !important; }
.pet.has-life-sprite.is-ludo-action .pet-pattern { visibility: hidden; }

.app.is-rainbow-bubble-scene .pet-base {
  animation: itemBubbleFloat 1.05s ease-in-out infinite;
}

.app.is-cloud-cushion-scene .pet-base {
  animation: itemSleepBreath 3.8s ease-in-out infinite;
}

.app.is-forest-music-scene .pet-base {
  animation: itemMusicSway 1.8s ease-in-out infinite;
}

.app.is-treasure-scene .pet-base {
  animation: itemTreasureShuffle .46s ease-in-out infinite;
}

@keyframes itemBubbleFloat {
  0%, 100% { transform: translate3d(-2px, 1px, 0) rotate(-.5deg); }
  50% { transform: translate3d(3px, -4px, 0) rotate(.8deg); }
}

@keyframes itemSleepBreath {
  0%, 100% { transform: scale3d(1, 1, 1) translateY(0); }
  50% { transform: scale3d(1.018, .986, 1) translateY(2px); }
}

@keyframes itemMusicSway {
  0%, 100% { transform: translateX(-3px) rotate(-1.2deg); }
  50% { transform: translateX(3px) rotate(1.2deg); }
}

@keyframes itemTreasureShuffle {
  0%, 100% { transform: translate3d(-2px, 0, 0) rotate(-.7deg); }
  50% { transform: translate3d(2px, -1px, 0) rotate(.7deg); }
}

.pet-cue {
  opacity: 0;
}

.bgm-style {
  border: 1px solid rgba(90, 74, 56, 0.16);
  border-radius: 999px;
  background: #fffdf7;
  color: #5a4a38;
  font-size: 11px;
  padding: 6px 8px;
  cursor: pointer;
}

/* Aura layers: sprite clones behind the body whose drop-shadow hugs the
   alpha silhouette of whatever pose is showing — alignment is structural. */
.aura-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  will-change: opacity, filter;
  backface-visibility: hidden;
}

@keyframes auraBreath {
  0%, 100% { opacity: var(--aura-min, 0.4); }
  50% { opacity: var(--aura-max, 0.85); }
}

@keyframes auraFlame {
  0%, 100% { transform: scale(1, 1) rotate(0deg); }
  28% { transform: scale(1.012, 1.045) rotate(0.4deg); }
  55% { transform: scale(0.992, 1.018) rotate(-0.35deg); }
  80% { transform: scale(1.018, 1.055) rotate(0.25deg); }
}

.pet.has-life-sprite[data-life-action]:not([data-life-action=""]) .pet-stage,
.pet.has-life-sprite[data-life-action]:not([data-life-action=""]) .pet-cue {
  animation: none !important;
}

@keyframes lifeIdleBreath {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1, 1); }
  18% { transform: translate3d(.25%, -.35%, 0) rotate(.18deg) scale(.998, 1.006); }
  42% { transform: translate3d(-.18%, .18%, 0) rotate(-.14deg) scale(1.004, .996); }
  68% { transform: translate3d(.14%, -.22%, 0) rotate(.1deg) scale(.999, 1.004); }
}

@keyframes lifeFullJoyJump {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1, 1); }
  6% { transform: translate3d(0, 2%, 0) rotate(-.35deg) scale(1.035, .965); }
  12% { transform: translate3d(0, 4.2%, 0) rotate(-1.1deg) scale(1.12, .86); }
  18% { transform: translate3d(0, -7%, 0) rotate(.7deg) scale(1.03, 1.02); }
  26% { transform: translate3d(0, -29%, 0) rotate(2.2deg) scale(.94, 1.13); }
  36% { transform: translate3d(0, -48%, 0) rotate(.8deg) scale(.98, 1.06); }
  48% { transform: translate3d(0, -58%, 0) rotate(-1.8deg) scale(1.02, .99); }
  58% { transform: translate3d(0, -50%, 0) rotate(-2.3deg) scale(1.01, 1); }
  68% { transform: translate3d(0, -30%, 0) rotate(-.8deg) scale(.99, 1.04); }
  76% { transform: translate3d(0, -11%, 0) rotate(.9deg) scale(.985, 1.055); }
  83% { transform: translate3d(0, 0, 0) rotate(.35deg) scale(1.15, .84); }
  89% { transform: translate3d(0, -4%, 0) rotate(-.28deg) scale(.97, 1.07); }
  95% { transform: translate3d(0, 1.2%, 0) rotate(.12deg) scale(1.025, .98); }
  100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1, 1); }
}

@keyframes lifeFullJoyFace {
  0%, 20% { opacity: 0; }
  34%, 72% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes lifeEatYummy {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1, 1); filter: saturate(1.02); }
  16% { transform: translate3d(0, 1.2%, 0) rotate(.18deg) scale(1.018, .982); }
  31% { transform: translate3d(0, -1.8%, 0) rotate(-.16deg) scale(.99, 1.012); }
  48% { transform: translate3d(0, .9%, 0) rotate(.12deg) scale(1.012, .988); }
  68% { transform: translate3d(0, -1.1%, 0) rotate(-.1deg) scale(.995, 1.008); }
  84% { transform: translate3d(0, .45%, 0) rotate(.05deg) scale(1.004, .997); }
}

@keyframes lifeCuddleSoft {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1, 1); filter: saturate(1.03); }
  22% { transform: translate3d(-.9%, -1.2%, 0) rotate(-.45deg) scale(1.018, .992); }
  46% { transform: translate3d(.55%, .6%, 0) rotate(.22deg) scale(1.006, .998); }
  70% { transform: translate3d(-.35%, -1%, 0) rotate(-.18deg) scale(1.012, .994); }
}

@keyframes lifeApproachSoft {
  0% { transform: translate3d(-2.2%, 1.2%, 0) rotate(-.8deg) scale(.985, 1.008); }
  24% { transform: translate3d(-.6%, -1.1%, 0) rotate(.35deg) scale(1.015, .99); }
  48% { transform: translate3d(1.1%, .4%, 0) rotate(-.18deg) scale(1.026, .986); }
  74% { transform: translate3d(.35%, -1%, 0) rotate(.2deg) scale(1.018, .992); }
  100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1.01, .995); }
}

.pet-fx {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: visible;
  pointer-events: none;
}

.pet-fx span {
  position: absolute;
  display: block;
  font-size: 22px;
  line-height: 1;
  will-change: transform, opacity;
}

.pet::before,
.pet::after {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.pet::before {
  left: 23%;
  top: 31%;
  width: 58%;
  height: 45%;
  border-radius: 50%;
  opacity: var(--spot-mark-opacity, 0);
  background:
    radial-gradient(circle at 22% 32%, rgba(122, 103, 146, .42) 0 5%, transparent 6%),
    radial-gradient(circle at 74% 38%, rgba(122, 103, 146, .34) 0 4%, transparent 5%),
    radial-gradient(circle at 48% 72%, rgba(122, 103, 146, .28) 0 4%, transparent 5%);
  mix-blend-mode: multiply;
}

.pet::after {
  content: "♥";
  left: 48%;
  top: 46%;
  transform: translateX(-50%) rotate(-8deg);
  opacity: var(--heart-mark-opacity, 0);
  color: #f28a9e;
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 4px 12px rgba(255, 255, 255, .62);
  mix-blend-mode: multiply;
}

.pet > span {
  display: none;
}

.micro-face {
  position: absolute;
  z-index: 4;
  left: 38%;
  top: 34%;
  width: 24%;
  height: 18%;
  pointer-events: none;
  opacity: .72;
  transform:
    translate(var(--gaze-x, 0px), var(--gaze-y, 0px))
    rotate(calc(var(--pet-focus-tilt, 0deg) * .45));
  transition: transform .9s cubic-bezier(.18,.82,.25,1), opacity .45s ease;
  display: none;
}

.micro-eye {
  position: absolute;
  top: 31%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .88);
  box-shadow:
    0 0 4px rgba(255, 255, 255, .75),
    0 2px 4px rgba(56, 39, 24, .08);
  opacity: .55;
  animation: microGlint var(--blink-duration, 4.2s) ease-in-out infinite;
  transition: height .35s ease, width .35s ease, transform .45s ease, opacity .35s ease;
}

.micro-eye-left { left: 28%; }
.micro-eye-right { right: 28%; }

.micro-mouth {
  position: absolute;
  left: 50%;
  top: 64%;
  width: 24px;
  height: 10px;
  border-bottom: 3px solid rgba(74, 52, 39, .68);
  border-radius: 0 0 999px 999px;
  transform: translateX(-50%);
  transition: width .35s ease, height .35s ease, border-radius .35s ease, border-color .35s ease, transform .35s ease;
  display: none;
}

.micro-tear {
  display: none;
  position: absolute;
  top: 49%;
  width: 5px;
  height: 9px;
  border-radius: 65% 65% 75% 75%;
  background: rgba(112, 190, 218, .58);
  filter: blur(.15px);
}

.micro-tear-left { left: 23%; transform: translateY(-3px) rotate(12deg); }
.micro-tear-right { right: 23%; transform: translateY(-2px) rotate(-12deg); }

.app[data-micro-expression="soft"] .micro-mouth {
  display: block;
  width: 22px;
  height: 12px;
}

.app[data-micro-expression="sparkle"] .micro-eye {
  width: 7px;
  height: 7px;
  opacity: .88;
  box-shadow:
    0 0 0 3px rgba(255, 247, 203, .22),
    0 5px 12px rgba(246, 189, 67, .2);
}

.app[data-micro-expression="focused"] .micro-eye {
  opacity: .72;
  transform: translateY(1px) scaleX(1.08);
}

.app[data-micro-expression="scan"] .micro-face {
  animation: gazeScan 5.8s ease-in-out infinite;
}

.app[data-micro-expression="sideEye"] .micro-eye {
  opacity: .42;
  transform: translateX(4px) translateY(1px) scaleX(1.18);
}

.app[data-micro-expression="sideEye"] .micro-mouth {
  display: block;
  width: 18px;
  height: 8px;
  border-radius: 999px 999px 0 0;
  border-bottom: 0;
  border-top: 3px solid rgba(74, 52, 39, .58);
  transform: translateX(-50%) translateY(3px);
}

.app[data-micro-expression="teary"] .micro-eye {
  opacity: .28;
  transform: translateY(2px) scaleX(.9);
}

.app[data-micro-expression="teary"] .micro-mouth {
  display: block;
  width: 15px;
  border-radius: 999px 999px 0 0;
  border-bottom: 0;
  border-top: 3px solid rgba(74, 52, 39, .58);
}

.app[data-micro-expression="teary"] .micro-tear {
  display: block;
  opacity: .32;
}

.app[data-micro-expression="sleepy"] .micro-eye {
  opacity: 0;
  transform: translateY(3px) scaleX(1.1);
}

.app[data-micro-expression="sleepy"] .micro-mouth {
  display: none;
}

.app[data-micro-expression="drowsyFight"] .micro-mouth {
  display: none;
}

.app[data-micro-expression="angry"] .micro-eye,
.app[data-micro-expression="annoyed"] .micro-eye {
  width: 8px;
  height: 3px;
  opacity: .62;
  border-radius: 999px;
  background: rgba(73, 48, 34, .62);
  box-shadow: none;
}

.app[data-micro-expression="angry"] .micro-eye-left,
.app[data-micro-expression="annoyed"] .micro-eye-left {
  transform: translateY(1px) rotate(12deg);
}

.app[data-micro-expression="angry"] .micro-eye-right,
.app[data-micro-expression="annoyed"] .micro-eye-right {
  transform: translateY(1px) rotate(-12deg);
}

.app[data-micro-expression="angry"] .micro-mouth,
.app[data-micro-expression="annoyed"] .micro-mouth,
.app[data-micro-expression="flat"] .micro-mouth {
  display: block;
  width: 18px;
  height: 8px;
  border-bottom: 0;
  border-top: 3px solid rgba(74, 52, 39, .62);
  border-radius: 999px 999px 0 0;
  transform: translateX(-50%) translateY(3px);
}

.app[data-micro-expression="expectant"] .micro-eye,
.app[data-micro-expression="question"] .micro-eye {
  width: 7px;
  height: 7px;
  opacity: .76;
}

.app[data-micro-expression="expectant"] .micro-mouth,
.app[data-micro-expression="content"] .micro-mouth,
.app[data-micro-expression="happySquint"] .micro-mouth,
.app[data-micro-expression="proud"] .micro-mouth {
  display: block;
  width: 26px;
  height: 12px;
}

.app[data-micro-expression="happySquint"] .micro-eye {
  height: 3px;
  width: 9px;
  border-radius: 999px;
  opacity: .58;
}

.app[data-micro-expression="shy"] .micro-face {
  opacity: .5;
  transform:
    translate(calc(var(--gaze-x, 0px) - 5px), var(--gaze-y, 0px))
    rotate(calc(var(--pet-focus-tilt, 0deg) * .45 - .5deg));
}

.app[data-micro-expression="shy"] .micro-mouth {
  display: block;
  width: 12px;
  height: 7px;
  border-color: rgba(74, 52, 39, .42);
}

.app[data-micro-expression="startled"] .micro-eye {
  width: 8px;
  height: 8px;
  opacity: .84;
  animation: none;
}

.app[data-micro-expression="startled"] .micro-mouth {
  display: block;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(74, 52, 39, .46);
  border-radius: 50%;
  transform: translateX(-50%) translateY(0);
}

.app[data-micro-expression="drowsyFight"] .micro-eye {
  width: 9px;
  height: 3px;
  opacity: .4;
  animation-duration: 2.2s;
}

.app[data-micro-expression="faraway"] .micro-face {
  opacity: .54;
  animation: gazeScan 8s ease-in-out infinite;
}

.app[data-micro-expression="flat"] .micro-eye {
  width: 9px;
  height: 3px;
  opacity: .38;
  border-radius: 999px;
  animation: none;
}

.app[data-life-phase="considering"] .micro-face {
  animation: tinyHesitation 1.4s ease-in-out infinite;
}

.app[data-expression="happy"] .pet {
  background-image: url("assets/mofumaro-happy.png");
}

.app[data-expression="sleep"] .pet {
  background-image: url("assets/mofumaro-sleep.png");
}

.app[data-expression="play"] .pet {
  background-image: url("assets/mofumaro-play.png");
}

.app[data-expression="curious"] .pet {
  background-image: url("assets/mofumaro-curious.png");
}

.app[data-expression="sad"] .pet {
  background-image: url("assets/mofumaro-sad.png");
}

.app[data-expression="grumpy"] .pet {
  background-image: url("assets/mofumaro-grumpy.png");
}

.app[data-action-cue="gobbleFood"] .pet,
.app[data-action-cue="savorFood"] .pet,
.app[data-action-cue="nibbleFood"] .pet {
  background-image: url("assets/actions/mofumaro-action-eat-yummy.png");
}

.app[data-action-cue="plateWait"] .pet {
  background-image: url("assets/actions/mofumaro-action-plate-wait.png");
}

.app[data-action-cue="lookUpExpectant"] .pet,
.app[data-action-cue="lookUp"] .pet {
  background-image: url("assets/actions/mofumaro-action-look-up-expectant.png");
}

.app[data-action-cue="hesitateApproach"] .pet {
  background-image: url("assets/actions/mofumaro-action-hesitate-approach.png");
}

.app[data-action-cue="foodAnticipation"] .pet {
  background-image: url("assets/actions/mofumaro-action-food-anticipation.png");
}

.app[data-action-cue="approach"] .pet,
.app[data-action-cue="purrMelt"] .pet,
.app[data-action-cue="cheekRub"] .pet,
.app[data-action-cue="bellyRelax"] .pet,
.app[data-action-cue="attentionBeg"] .pet {
  background-image: url("assets/actions/mofumaro-action-cuddle-soft.png?v=posefix1");
  background-position: center bottom;
  background-size: contain;
}

.app[data-action-cue="ownerApproach"] .pet {
  background-image: url("assets/actions/mofumaro-action-approach-soft.png");
}

.app[data-action-cue="chaseBall"] .pet,
.app[data-action-cue="followGame"] .pet,
.app[data-action-cue="zoomies"] .pet {
  background-image: url("assets/actions/mofumaro-action-chase-ball.png");
}

.app[data-action-cue="sleepyBallLook"] .pet {
  background-image: url("assets/actions/mofumaro-action-sleepy-ball-look.png");
}

.app[data-action-cue="sulk"] .pet,
.app[data-action-cue="refuseLook"] .pet,
.app[data-action-cue="loseInterest"] .pet,
.app[data-action-cue="changeMindSleep"] .pet {
  background-image: url("assets/actions/mofumaro-action-sulk.png");
}

.app[data-action-cue="turnAwayGrumpy"] .pet {
  background-image: url("assets/actions/mofumaro-action-turn-away-grumpy.png");
}

.app[data-action-cue="puffGrumpy"] .pet {
  background-image: url("assets/actions/mofumaro-action-puff-grumpy.png");
}

.app[data-action-cue="grumpyPet"] .pet,
.app[data-action-cue="resistBedtime"] .pet,
.app[data-action-cue="refusePlay"] .pet {
  background-image: url("assets/actions/mofumaro-action-grumpy-refuse.png");
}

.app[data-action-cue="groom"] .pet {
  background-image: url("assets/actions/mofumaro-action-groom.png");
}

.app[data-action-cue="startle"] .pet {
  background-image: url("assets/actions/mofumaro-action-startle.png");
}

.app[data-action-cue="dozeOff"] .pet,
.app[data-action-cue="autoNap"] .pet {
  background-image: url("assets/actions/mofumaro-action-doze-off.png");
}

.app[data-action-cue="drowsyNod"] .pet {
  background-image: url("assets/actions/mofumaro-action-drowsy-nod.png");
}

.app[data-action-cue="bigJoyJump"] .pet {
  background-image: url("assets/actions/mofumaro-action-big-joy-jump.png");
}

.app[data-action-cue="happyBounce"] .pet {
  background-image: url("assets/actions/mofumaro-action-happy-bounce.png");
}

.app[data-action-cue="starTwirl"] .pet {
  background-image: url("assets/actions/mofumaro-action-star-twirl.png");
}

.app[data-action-cue="grassPounce"] .pet {
  background-image: url("assets/actions/mofumaro-action-grass-pounce.png");
}

.app[data-action-cue="proudHop"] .pet {
  background-image: url("assets/actions/mofumaro-action-proud-hop.png");
}

.app[data-action-cue="rollOver"] .pet {
  background-image: url("assets/actions/mofumaro-action-roll-over.png");
}

.app[data-action-cue="flatRelax"] .pet {
  background-image: url("assets/actions/mofumaro-action-flat-relax.png");
}

.app[data-action-cue="dashStart"] .pet {
  background-image: url("assets/actions/mofumaro-action-dash-start.png");
}

.app[data-action-cue="backTurnSulk"] .pet {
  background-image: url("assets/actions/mofumaro-action-back-turn-sulk.png");
}

.app[data-action-cue="fullJoyJump"] .pet {
  background-image: url("assets/actions/mofumaro-action-full-joy-jump.png");
}

.app[data-action-cue="settleAfterCare"] .pet {
  background-image: url("assets/actions/mofumaro-action-cuddle-soft.png?v=posefix1");
}

.pet-shadow {
  position: absolute;
  left: 42px;
  right: 42px;
  bottom: 0;
  height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, rgba(84, 69, 48, var(--pet-shadow-strength, 0.18)) 0 38%, rgba(84, 69, 48, .08) 58%, transparent 72%);
  filter: blur(2px);
  transform: scaleX(1.05);
}

.ear {
  position: absolute;
  top: 13px;
  width: 54px;
  height: 58px;
  border-radius: 70% 42% 60% 40%;
  background: #fff9e8;
  z-index: -1;
}

.ear-left { left: 14px; transform: rotate(-20deg); }
.ear-right { right: 14px; transform: rotate(20deg) scaleX(-1); }

.fur {
  position: absolute;
  border-radius: 50%;
  background: #fffdf2;
}

.puff-a { width: 55px; height: 50px; left: 42px; top: -12px; }
.puff-b { width: 64px; height: 55px; left: 82px; top: -24px; }
.puff-c { width: 52px; height: 48px; right: 35px; top: -10px; }
.puff-d { width: 43px; height: 40px; left: 24px; top: 18px; }

.eye {
  position: absolute;
  top: 80px;
  width: 14px;
  height: 20px;
  border-radius: 50%;
  background: #2d2722;
  transition: height .25s ease, transform .25s ease;
}

.eye-left { left: 78px; }
.eye-right { right: 78px; }

.nose {
  position: absolute;
  left: 50%;
  top: 105px;
  width: 5px;
  height: 4px;
  border-radius: 50%;
  background: #4a3427;
  transform: translateX(-50%);
}

.blush {
  position: absolute;
  top: 118px;
  width: 27px;
  height: 10px;
  border-radius: 50%;
  background: rgba(241, 111, 102, 0.22);
}

.blush-left { left: 55px; }
.blush-right { right: 55px; }

.tail {
  position: absolute;
  right: -36px;
  top: 86px;
  width: 62px;
  height: 45px;
  border-radius: 50%;
  background: #fffdf2;
  transform-origin: 8px 22px;
  animation: tail 2.4s ease-in-out infinite;
}

.paw {
  position: absolute;
  bottom: 3px;
  width: 38px;
  height: 24px;
  border-radius: 50%;
  background: #efe9d7;
}

.paw-left { left: 64px; }
.paw-right { right: 64px; }

.signal {
  position: absolute;
  left: 50%;
  top: -18px;
  width: 54px;
  height: 38px;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
}

.signal.show {
  opacity: 1;
  animation: pop .8s ease forwards;
}

.signal::before,
.signal::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--coral);
  transform: rotate(45deg);
  border-radius: 5px 5px 0 5px;
}

.signal::before { left: 4px; top: 12px; }
.signal::after { right: 5px; top: 2px; transform: rotate(45deg) scale(.75); opacity: .75; }

.mote {
  position: absolute;
  z-index: 4;
  width: 20px;
  height: 20px;
  opacity: 0;
  pointer-events: none;
}

.mote::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: #f46f65;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.55);
}

.mote-a { left: 18%; top: 28%; }
.mote-b { right: 18%; top: 35%; }
.mote-c { left: 48%; top: 8%; }

.app[data-effect="hearts"] .mote::before {
  border-radius: 5px 5px 0 5px;
  transform: rotate(45deg);
  background: #f46f65;
}

.app[data-effect="spark"] .mote::before {
  border-radius: 2px;
  background: #f6bd43;
  transform: rotate(45deg);
}

.app[data-effect="zzz"] .mote::before {
  content: "Z";
  inset: auto;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #72b6d4;
  font-size: 24px;
  font-weight: 900;
  transform: none;
}

.app[data-effect="tears"] .mote::before {
  inset: 1px 5px 3px;
  border-radius: 60% 60% 70% 70%;
  background: linear-gradient(#b7e9ff, #65badf);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.55);
  transform: rotate(12deg);
}

.app[data-effect="tears"] .mote {
  display: none;
}

.app[data-effect="startle"] .pet {
  animation: startle .18s linear 5;
}

.app[data-effect="hearts"] .mote,
.app[data-effect="spark"] .mote,
.app[data-effect="zzz"] .mote,
.app[data-effect="tears"] .mote {
  animation: floatMote 1.8s ease-out forwards;
}

.app[data-effect="hearts"] .mote-b,
.app[data-effect="spark"] .mote-b,
.app[data-effect="zzz"] .mote-b,
.app[data-effect="tears"] .mote-b { animation-delay: .18s; }

.app[data-effect="hearts"] .mote-c,
.app[data-effect="spark"] .mote-c,
.app[data-effect="zzz"] .mote-c,
.app[data-effect="tears"] .mote-c { animation-delay: .34s; }

.app[data-mood="sleepy"] .eye { height: 3px; transform: translateY(9px); }
.app[data-mood="sleepy"] .pet { animation-duration: 6.8s; }
.app[data-mood="sleepyBall"] .pet { animation: sleepyBallLook 4.8s ease-in-out infinite; }
.app[data-mood="play"] .pet { animation: hop 1.25s ease-in-out infinite alternate; }
.app[data-mood="happy"] .pet { animation: cuddle 1.7s ease-in-out infinite alternate; }
.app[data-mood="shy"] .tail { animation-duration: 3.6s; }
.app[data-mood="shy"] .pet { animation: shyHesitate 4.2s ease-in-out infinite; }
.app[data-mood="approach"] .pet { animation: approachBreath 3.4s ease-in-out infinite; }
.app[data-mood="ownerApproach"] .pet { animation: ownerApproach 3.8s ease-in-out infinite; }
.app[data-mood="curious"] .pet { animation: curiousTilt 3.8s ease-in-out infinite; }
.app[data-mood="sad"] .pet { animation: sadPulse 4.8s ease-in-out infinite; }
.app[data-mood="grumpy"] .pet { animation: grumpySway 4.2s ease-in-out infinite; }
.app[data-mood="turnAway"] .pet { animation: turnAwayHold 4.8s ease-in-out infinite; }
.app[data-mood="eat"] .pet { animation: munchBounce 1.7s ease-in-out infinite; }
.app[data-mood="plateWait"] .pet { animation: plateWait 4.4s ease-in-out infinite; }
.app[data-mood="stuffed"] .pet { animation: stuffedSettle 4.4s ease-in-out infinite; }
.app[data-mood="melt"] .pet { animation: meltRelax 3.6s ease-in-out infinite; }
.app[data-mood="chase"] .pet { animation: chaseDash 1.6s ease-in-out infinite; }
.app[data-mood="toy"] .pet { animation: toyWrestle 2.2s ease-in-out infinite; }
.app[data-mood="tucked"] .pet { animation: tuckedSleep 6.4s ease-in-out infinite; }
.app[data-mood="angry"] .pet,
.app[data-mood="impatient"] .pet { animation: angryPuff 2.8s ease-in-out infinite; }
.app[data-mood="inspect"] .pet,
.app[data-mood="listen"] .pet { animation: inspectLean 3.6s ease-in-out infinite; }
.app[data-mood="wander"] .pet,
.app[data-mood="patrol"] .pet { animation: slowStep 5.8s ease-in-out infinite; }
.app[data-mood="window"] .pet { animation: windowGaze 7.2s ease-in-out infinite; }
.app[data-mood="stretch"] .pet { animation: stretchBody 3.8s ease-in-out infinite; }
.app[data-mood="groom"] .pet,
.app[data-mood="pillow"] .pet { animation: selfCareRock 3.4s ease-in-out infinite; }
.app[data-mood="startled"] .pet { animation: startle .18s linear 5; }
.app[data-mood="beg"] .pet { animation: begBounce 2.6s ease-in-out infinite; }
.app[data-mood="lookUpExpectant"] .pet { animation: lookUpBreath 4.4s ease-in-out infinite; }
.app[data-mood="hesitateApproach"] .pet { animation: hesitantStep 5.2s ease-in-out infinite; }
.app[data-mood="foodAnticipation"] .pet { animation: anticipationWait 4.8s ease-in-out infinite; }
.app[data-mood="puffGrumpy"] .pet { animation: grumpyPuffHold 4.6s ease-in-out infinite; }
.app[data-mood="drowsyNod"] .pet { animation: drowsyNod 5.4s ease-in-out infinite; }
.app[data-mood="settleAfterCare"] .pet { animation: settleAfterCare 4.6s ease-in-out infinite; }
.app[data-mood="bored"] .pet { animation: boredSink 5.8s ease-in-out infinite; }
.app[data-mood="guard"] .pet { animation: guardHold 4.2s ease-in-out infinite; }
.app[data-mood="proud"] .pet { animation: proudLift 3.4s ease-in-out infinite; }
.app[data-mood="spin"] .pet { animation: happySpin 1.9s ease-in-out infinite; }
.app[data-mood="joyJump"] .pet { animation: bigJoyJump 1.28s cubic-bezier(.18,.88,.2,1) infinite; }
.app[data-mood="bounce"] .pet { animation: happyBounce 1.05s ease-in-out infinite; }
.app[data-mood="twirl"] .pet { animation: starTwirl 1.55s ease-in-out infinite; }
.app[data-mood="pounce"] .pet { animation: grassPounce 1.3s ease-in-out infinite; }
.app[data-mood="rollOver"] .pet { animation: rollOverWobble 1.85s ease-in-out infinite; }
.app[data-mood="flatRelax"] .pet { animation: flatRelaxMelt 3.8s ease-in-out infinite; }
.app[data-mood="dashStart"] .pet { animation: dashStartTense 1.35s cubic-bezier(.18,.78,.22,1) infinite; }
.app[data-mood="backTurnSulk"] .pet { animation: backTurnSulkHold 3.4s ease-in-out infinite; }
.app[data-mood="fullJoyJump"] .pet { animation: fullJoyJump 1.12s cubic-bezier(.14,.9,.18,1) infinite; }
.app[data-action-cue="lookUp"] .pet { animation: lookUpBreath 2.6s ease-in-out infinite; }
.app[data-action-cue="pawBall"] .pet,
.app[data-action-cue="nudgeBall"] .pet { animation: pawReach 1.8s ease-in-out infinite; }
.app[data-action-cue="rollOver"] .pet { animation: rollOverWobble 1.85s ease-in-out infinite; }
.app[data-action-cue="flatRelax"] .pet { animation: flatRelaxMelt 3.8s ease-in-out infinite; }
.app[data-action-cue="dashStart"] .pet { animation: dashStartTense 1.35s cubic-bezier(.18,.78,.22,1) infinite; }
.app[data-action-cue="backTurnSulk"] .pet { animation: backTurnSulkHold 3.4s ease-in-out infinite; }
.app[data-action-cue="fullJoyJump"] .pet { animation: fullJoyJump 1.12s cubic-bezier(.14,.9,.18,1) infinite; }
.app[data-action-cue="yawnFight"] .pet { animation: sleepyBob 3.2s ease-in-out infinite; }
.app[data-action-cue="tinyCry"] .pet { animation: tinyCryShake 3.2s ease-in-out infinite; }

.app[data-gait-style="bouncy"][data-mood="calm"] .pet { animation: hop 2.4s ease-in-out infinite alternate; }
.app[data-gait-style="careful"][data-mood="calm"] .pet { animation: grumpySway 5.8s ease-in-out infinite; }
.app[data-gait-style="slow"][data-mood="calm"] .pet { animation-duration: 7.2s; }
.app[data-gait-style="clingy"][data-mood="calm"] .pet { animation: approachBreath 4.4s ease-in-out infinite; }

.dock {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 82px;
  transform: translateX(-50%);
  width: min(980px, calc(100% - 360px));
  min-width: 660px;
  height: 154px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  overflow: visible;
  border: 1px solid rgba(126, 95, 60, 0.22);
  border-radius: 8px;
  background: rgba(255, 252, 244, 0.94);
  box-shadow: 0 16px 35px rgba(75, 52, 30, 0.2);
}

.care-btn {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  background: transparent;
  border-right: 1px solid rgba(126, 95, 60, 0.18);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  transition: background .18s ease, transform .18s ease;
}

.care-btn:last-child { border-right: 0; }
.care-btn span:last-child {
  max-width: 100%;
  padding: 0 4px;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
}
.care-btn:hover {
  background: rgba(255, 244, 226, 0.72);
  transform: translateY(-2px);
}

.care-btn.is-choosing {
  background: #fff0d8;
  box-shadow: inset 0 0 0 2px rgba(222, 150, 54, .38);
}

.care-target-menu {
  --care-menu-left: 50%;
  position: absolute;
  z-index: 18;
  left: clamp(118px, var(--care-menu-left), calc(100% - 118px));
  bottom: calc(100% + 10px);
  width: min(236px, calc(100vw - 20px));
  padding: 9px;
  transform: translateX(-50%);
  border: 1px solid rgba(126, 95, 60, .22);
  border-radius: 8px;
  background: rgba(255, 252, 245, .98);
  box-shadow: 0 14px 32px rgba(75, 52, 30, .22);
}

.care-target-menu[hidden] { display: none !important; }

.care-target-menu::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  border-right: 1px solid rgba(126, 95, 60, .22);
  border-bottom: 1px solid rgba(126, 95, 60, .22);
  background: #fffaf1;
}

.care-target-menu > p {
  margin: 0 2px 7px;
  color: #7a6754;
  font-size: 11px;
  font-weight: 900;
  text-align: left;
}

.care-target-choices {
  display: grid;
  gap: 5px;
}

.care-target-choices button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 4px 7px;
  border: 1px solid rgba(126, 95, 60, .13);
  border-radius: 7px;
  background: #fffaf1;
  color: #4e3d2e;
  text-align: left;
}

.care-target-choices button:hover,
.care-target-choices button:focus-visible {
  border-color: rgba(225, 155, 59, .48);
  background: #fff0d8;
  outline: 0;
}

.care-target-choices strong,
.care-target-choices small { display: block; }
.care-target-choices strong { font-size: 13px; }
.care-target-choices small { margin-top: 1px; color: #81715f; font-size: 9px; font-weight: 800; }
.care-target-choices .target-pet-face { width: 40px; height: 40px; }

.icon {
  width: 70px;
  height: 58px;
  position: relative;
  display: block;
}

.icon.food::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 0;
  height: 38px;
  border-radius: 0 0 32px 32px;
  background: #e85e52;
  box-shadow: inset 0 -7px 0 rgba(119, 53, 38, 0.16);
}

.icon.food::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 5px;
  height: 28px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 20% 42%, #7a4d29 0 6px, transparent 7px),
    radial-gradient(circle at 50% 35%, #9d6734 0 7px, transparent 8px),
    radial-gradient(circle at 73% 48%, #8d5b30 0 6px, transparent 7px),
    #c78643;
}

.icon.hand::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 12px;
  width: 45px;
  height: 28px;
  border-radius: 999px;
  background: #ffd2ad;
  transform: rotate(-20deg);
}

.icon.hand::after {
  content: "♥";
  position: absolute;
  right: 2px;
  top: 0;
  color: #f35f5a;
  font-size: 28px;
}

.icon.treat::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 7px;
  width: 43px;
  height: 43px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 35%, #9b6a36 0 4px, transparent 5px),
    radial-gradient(circle at 58% 28%, #c58b4c 0 3px, transparent 4px),
    radial-gradient(circle at 66% 62%, #8b5a2e 0 4px, transparent 5px),
    #f1c36f;
  box-shadow: inset -5px -7px 0 rgba(148, 94, 45, 0.2);
}

.icon.treat::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff4c8;
  box-shadow: -8px 9px 0 -4px #ff8f7f, -22px 4px 0 -5px #8ed5cc;
}

.icon.call::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 18px;
  width: 42px;
  height: 28px;
  border-radius: 50%;
  background: #9ed9eb;
  box-shadow:
    8px -12px 0 -9px #5aa7c7,
    -8px -9px 0 -10px #5aa7c7,
    inset 0 -5px 0 rgba(51, 121, 150, 0.15);
}

.icon.call::after {
  content: "♪";
  position: absolute;
  right: 8px;
  top: 0;
  color: #4a95bb;
  font-size: 27px;
  font-weight: 900;
}

.icon.play::before {
  content: "";
  position: absolute;
  inset: 4px 10px;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 0 43%, rgba(255,255,255,.9) 44% 55%, transparent 56%),
    linear-gradient(135deg, #99bf48 0 50%, #d9f0a4 51%);
  box-shadow: inset -5px -7px 0 rgba(75, 123, 37, 0.18);
}

.icon.watch::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 14px;
  width: 54px;
  height: 30px;
  border-radius: 50% 50% 46% 46%;
  background: #ffe1b7;
  box-shadow: inset 0 -5px 0 rgba(162, 109, 68, 0.12);
}

.icon.watch::after {
  content: "";
  position: absolute;
  left: 28px;
  top: 23px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #5b4334;
  box-shadow:
    17px 0 0 #5b4334,
    8px 11px 0 -7px #f58d82;
}

.icon.sleep-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  bottom: 2px;
  width: 64px;
  height: 32px;
  border-radius: 22px;
  background: #74b6db;
  box-shadow:
    18px -14px 0 -2px #8dc7e8,
    36px -5px 0 0 #6faad1;
}

.icon.sleep-icon::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: -8px 5px 0 0 #e3a633;
}

.room-nav {
  position: absolute;
  z-index: 7;
  left: 15px;
  bottom: 10px;
  width: min(815px, calc(100% - 450px));
  height: 55px;
  display: grid;
  grid-template-columns: 1.05fr .9fr .95fr 1.25fr;
  overflow: hidden;
  border: 1px solid rgba(126, 95, 60, 0.24);
  border-radius: 8px;
  background: rgba(255, 252, 244, 0.76);
  box-shadow: 0 10px 24px rgba(75, 52, 30, 0.16);
}

.room-tab {
  background: transparent;
  border-right: 1px solid rgba(126, 95, 60, 0.15);
  color: #7f715f;
  font-size: 17px;
  font-weight: 900;
}

.room-tab.luxury-room-tab { color: #7a5c2e; }
.room-tab.is-locked { color: #9a8e7e; background: rgba(232, 226, 216, .58); }
.room-tab.is-locked span { color: #c89833; }
.app[data-habitat="luxury"] .room-select { background: rgba(255, 252, 242, .94); }
.app[data-habitat="luxury"] .room-bed,
.app[data-habitat="luxury"] .bowl { display: none; }

.room-tab:last-child { border-right: 0; }
.room-tab.is-active {
  color: #5c3a20;
  background: rgba(255,255,255,.8);
  box-shadow: inset 0 0 0 4px #f3c35c;
}

.side {
  z-index: 8;
  display: grid;
  grid-template-rows: auto auto auto auto auto 1fr;
  gap: 10px;
  padding: 18px 12px 14px;
  background: rgba(255, 248, 236, 0.93);
  border-left: 1px solid rgba(126, 95, 60, 0.16);
  box-shadow: -8px 0 22px rgba(75, 52, 30, 0.11);
}

.panel {
  border: 1px solid rgba(126, 95, 60, 0.14);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: inset 0 -2px 0 rgba(104, 81, 55, 0.04);
}

.profile {
  min-height: 158px;
  padding: 16px 14px;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 15px;
  align-items: center;
}

.mini-portrait {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 1px solid rgba(126, 95, 60, 0.16);
  background:
    var(--mini-portrait-image, url("assets/mofumaro.png")) center 60% / 118% auto no-repeat,
    radial-gradient(circle, rgba(255, 250, 241, 0.95), rgba(231, 219, 196, 0.9)),
    #fffaf1;
  box-shadow: inset -10px -12px 0 rgba(176, 142, 95, 0.1);
}

.name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

h1, h2, p { margin: 0; }

h1 {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 900;
  white-space: nowrap;
}

h2 {
  font-size: 22px;
  line-height: 1.15;
  font-weight: 900;
}

.profile p {
  margin-top: 9px;
  font-size: 19px;
  font-weight: 900;
}

.phase {
  color: var(--green-deep);
  font-size: 17px !important;
}

.edit-btn {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: #f3eadf;
  color: #8b643d;
  font-size: 20px;
}

.mood-card,
.stats,
.today,
.daily-photo,
.relationship,
.pair-status {
  padding: 14px 16px;
}

.mood-card {
  min-height: 76px;
}

.mood-card h2 {
  color: #8b765e;
  font-size: 12px;
  letter-spacing: 0;
}

.state-title {
  margin-top: 6px;
  color: #40362c;
  font-size: 18px;
  font-weight: 900;
}

.mood-card .hearts {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.health-notebook {
  padding: 0;
  overflow: hidden;
}

.health-notebook > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 12px 15px;
  cursor: pointer;
  list-style: none;
}

.health-notebook > summary::-webkit-details-marker { display: none; }
.health-notebook > summary span { min-width: 0; }
.health-notebook > summary strong,
.health-notebook > summary small { display: block; }
.health-notebook > summary strong { color: #594b3d; font-size: 15px; }
.health-notebook > summary small {
  margin-top: 3px;
  color: #887765;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}
.health-notebook > summary b {
  color: #8b765e;
  font-size: 15px;
  transition: transform .2s ease;
}
.health-notebook[open] > summary b { transform: rotate(180deg); }
.health-notebook-body {
  padding: 12px 15px 15px;
  border-top: 1px solid rgba(126, 95, 60, .12);
}

.daily-photo-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.daily-photo h2 { font-size: 16px; }
.daily-photo time { color: #8d7d69; font-size: 10px; font-weight: 900; }
.daily-photo figure { margin: 0; }
.daily-photo img {
  display: block;
  width: 100%;
  height: 126px;
  object-fit: contain;
  object-position: center bottom;
  border-radius: 6px;
  background: linear-gradient(180deg, #f5efe3, #eadfce);
}
#dailyPhotoImage { filter: var(--mofu-coat-filter, none); }
.daily-photo figcaption {
  margin-top: 7px;
  color: #685a4c;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.5;
}

.app[data-quiet-day="true"] .living-moment-badge {
  border-left-color: rgba(122, 119, 105, .5);
  color: #6c645b;
}

.today-item.is-living-habit {
  border-color: rgba(120, 151, 106, .2);
  background: rgba(244, 249, 239, .72);
}

.pair-status-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.pair-status-head h2 { font-size: 18px; }
.pair-status-head small { color: #8a765f; font-size: 10px; font-weight: 900; }
.pair-status-grid { display: grid; gap: 9px; }

.pair-pet-status {
  padding: 10px 0 0;
  border-top: 1px solid rgba(126, 95, 60, .13);
}

.pair-pet-status:first-child { padding-top: 0; border-top: 0; }
.pair-pet-status.is-away { opacity: .7; }

.pair-pet-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pair-pet-title strong { font-size: 15px; }
.pair-pet-title span {
  padding: 3px 6px;
  border-radius: 6px;
  background: #edf5e7;
  color: #5e8659;
  font-size: 9px;
  font-weight: 900;
}

.pair-pet-status > p {
  margin-top: 3px;
  color: #8a6b45;
  font-size: 10px;
  font-weight: 900;
}

.pair-pet-status > .pair-peer-feeling {
  margin-top: 5px;
  padding-left: 8px;
  border-left: 2px solid #e7b96e;
  color: #6f5c49;
  font-weight: 800;
  line-height: 1.45;
}

.pair-pet-status > small {
  display: block;
  margin: 3px 0 7px;
  color: #6e6255;
  font-size: 10px;
  font-weight: 800;
}

.pair-vitals-notebook {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(126, 95, 60, .1);
}
.pair-vitals-notebook > summary {
  color: #887765;
  cursor: pointer;
  font-size: 9px;
  font-weight: 900;
  list-style: none;
}
.pair-vitals-notebook > summary::-webkit-details-marker { display: none; }
.pair-vitals-notebook > summary::after { content: "  ⌄"; }
.pair-vitals-notebook[open] > summary::after { content: "  ⌃"; }

.pair-mini-stat {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 24px;
  gap: 5px;
  align-items: center;
  margin-top: 4px;
  font-size: 9px;
  font-weight: 900;
}

.pair-mini-stat i {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece5db;
}

.pair-mini-stat b { display: block; height: 100%; border-radius: inherit; background: #8fbd54; }
.pair-mini-stat.is-food b { background: #72c6d1; }
.pair-mini-stat.is-sleep b { background: #a39be4; }
.pair-mini-stat.is-stamina b { background: #ef9a61; }
.pair-mini-stat em { color: #7d7164; font-style: normal; text-align: right; }

.hearts {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.hearts span {
  width: 46px;
  height: 42px;
  position: relative;
}

.hearts span::before,
.hearts span::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 38px;
  border-radius: 26px 26px 0 0;
  background: #f46c62;
}

.hearts span::before { left: 20px; transform: rotate(-45deg); transform-origin: 0 100%; }
.hearts span::after { left: 0; transform: rotate(45deg); transform-origin: 100% 100%; }
.hearts .empty::before,
.hearts .empty::after { background: #ddd7cf; }

.stat + .stat { margin-top: 14px; }
.stat.compact { margin-top: 11px; }

.stat-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 900;
}

.meter {
  height: 18px;
  border-radius: 999px;
  background: #eee6dc;
  overflow: hidden;
}

.meter span {
  display: block;
  width: 50%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8cb94d, #a8c85c);
  transition: width .35s ease;
}

.food-meter span { background: linear-gradient(90deg, #8cb94d, #77c9d6); }
.meter.sleep span { background: linear-gradient(90deg, #9b95d8, #beb5ff); }

.today h2,
.relationship h2 {
  margin-bottom: 10px;
}

.today-summary {
  margin: -2px 0 10px;
  color: #7d6d5b;
  font-size: 13px;
  font-weight: 900;
}

.today-list {
  display: grid;
  gap: 8px;
}

.today-wish {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 9px 10px;
  border: 1px solid rgba(222, 167, 65, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff6d9, #fffaf0 62%, #eef7e4);
  box-shadow: inset 0 -2px 0 rgba(156, 112, 43, 0.05);
}

.today-wish.is-fulfilled {
  border-color: rgba(103, 164, 100, 0.3);
  background: linear-gradient(135deg, #eff8e6, #fffdf5);
}

.today-wish-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  color: #4d9360;
  font-size: 24px;
  font-weight: 900;
  box-shadow: inset 0 -3px 0 rgba(126, 95, 60, 0.08);
}

.today-wish strong,
.today-wish small,
.today-wish em {
  display: block;
}

.today-wish strong {
  color: #956d2f;
  font-size: 12px;
}

.today-wish.is-fulfilled strong { color: #4d8455; }

.today-wish small {
  margin-top: 2px;
  color: #4f4033;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

.today-wish em {
  margin-top: 5px;
  color: #9a8263;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.today-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(245, 250, 247, 0.92);
  border: 1px solid rgba(126, 95, 60, 0.08);
}

.today-item strong,
.today-item small {
  display: block;
}

.today-item strong {
  margin-bottom: 2px;
  font-size: 13px;
  color: #6f5d4d;
}

.today-item small {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.talk-panel {
  overflow: hidden;
}

.talk-toggle {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  color: var(--ink);
  text-align: left;
  background: linear-gradient(135deg, rgba(255, 252, 244, .98), rgba(238, 247, 230, .92));
}

.talk-toggle small,
.talk-toggle strong {
  display: block;
}

.talk-toggle small {
  margin-bottom: 2px;
  color: #8b775f;
  font-size: 9px;
  font-weight: 900;
}

.talk-toggle strong {
  font-size: 15px;
}

.talk-toggle-mark {
  font-size: 22px;
  transition: transform .2s ease;
}

.talk-toggle[aria-expanded="true"] .talk-toggle-mark {
  transform: rotate(180deg);
}

.talk-body {
  padding: 0 10px 10px;
  border-top: 1px solid rgba(126, 95, 60, .1);
}

.talk-log {
  min-height: 52px;
  max-height: 150px;
  overflow-y: auto;
  display: grid;
  align-content: end;
  gap: 5px;
  padding: 8px 1px;
}

.talk-message {
  max-width: 88%;
  padding: 6px 8px;
  border-radius: 7px;
  color: #5e5143;
  background: #f1ede5;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.4;
}

.talk-message.is-owner {
  justify-self: end;
  background: #eaf4df;
}

.talk-message.is-pet {
  justify-self: start;
  color: #5f4938;
  background: #fff2d8;
}

.talk-empty {
  align-self: center;
  color: #9a8872;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.talk-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 6px;
}

.talk-form input {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(126, 95, 60, .2);
  border-radius: 7px;
  outline: none;
  color: var(--ink);
  background: #fffefa;
  font: inherit;
  font-size: 12px;
}

.talk-form input:focus {
  border-color: #84ad65;
  box-shadow: 0 0 0 3px rgba(132, 173, 101, .14);
}

.talk-form button {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  color: #fff;
  background: #719d58;
  font-size: 18px;
}

.today-item.is-treasure-memory {
  background: linear-gradient(135deg, #fff7d9, #fffdf5);
  border-color: rgba(217, 155, 57, .25);
}

.today-item.is-first-memory {
  background: linear-gradient(135deg, #fff0ee, #fffaf4 58%, #eef8ee);
  border-color: rgba(239, 143, 135, .3);
}

.moment-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--moment-color, #73bf74) 18%, #fffaf1);
  border: 1px solid color-mix(in srgb, var(--moment-color, #73bf74) 28%, transparent);
  position: relative;
}

.moment-icon::before {
  font-size: 22px;
  line-height: 1;
}

.moment-icon.is-bowl::before { content: "🥣"; }
.moment-icon.is-hand::before { content: "✋"; }
.moment-icon.is-ball::before { content: "🎾"; }
.moment-icon.is-moon::before { content: "🌙"; }
.moment-icon.is-pause::before { content: "…"; font-weight: 900; color: #6d8084; }
.moment-icon.is-heart::before { content: "♡"; font-weight: 900; color: #f16f66; }
.moment-icon.is-garden::before { content: "🌳"; }
.moment-icon.is-walk::before { content: "👣"; }
.moment-icon.is-leaf::before { content: "🌿"; }

.friend-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 14px;
  align-items: center;
}

.locked-pet {
  height: 96px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f0eeeb;
  border: 1px dashed rgba(126, 95, 60, 0.24);
}

.locked-pet span {
  width: 62px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 32%, #efede8, #d4d1cb);
  opacity: .55;
}

.friend-row strong {
  display: block;
  margin-bottom: 13px;
  font-size: 18px;
  font-weight: 900;
}

.small-btn {
  min-width: 112px;
  height: 42px;
  border-radius: 8px;
  background: #f46f65;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}

.small-btn:disabled {
  background: #d9d3ca;
  color: #7c7166;
}

.companion-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.companion-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #f8f5ee;
  border: 1px solid rgba(126, 95, 60, 0.13);
}

.companion-face {
  width: 42px;
  height: 38px;
  border-radius: 50% 50% 46% 46%;
  background:
    radial-gradient(circle at 36% 42%, #392d24 0 4%, transparent 5%),
    radial-gradient(circle at 64% 42%, #392d24 0 4%, transparent 5%),
    radial-gradient(circle at 50% 55%, #5b4433 0 3%, transparent 4%),
    radial-gradient(circle at 48% 48%, #fff8e8, #f3dfb8);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.45);
}

.companion-item strong {
  display: block;
  margin: 0 0 2px;
  font-size: 15px;
  line-height: 1.15;
}

.companion-item small {
  display: block;
  color: #786f63;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

.companion-item.is-close { background: #f0faef; border-color: rgba(115, 191, 116, .28); }
.companion-item.is-owner { background: #fff2ef; border-color: rgba(244, 111, 101, .25); }
.companion-item.is-rival { background: #f2f4fa; border-color: rgba(122, 128, 164, .24); }
.companion-item.is-distant { background: #f4f2ef; }

.premium {
  width: 100%;
  min-height: 66px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 48px 1fr 18px;
  align-items: center;
  gap: 10px;
  border-color: rgba(86, 168, 200, 0.35);
  background: #eefaff;
  color: #5c4a36;
  font-size: 17px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.premium strong { min-width: 0; }

.premium strong small {
  display: block;
  color: #7a705f;
  font-size: 12px;
  line-height: 1.35;
}

.subscription-manage-label {
  display: block;
  margin-top: 4px;
  color: #287b67;
  font-size: 11px;
  font-weight: 900;
}

.premium.is-active-plan {
  border-color: rgba(92, 159, 105, .36);
  background: #eef8eb;
}

.crown {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #fff1b8;
  color: #d89b22;
  font-size: 27px;
}

.log {
  min-height: 0;
  padding: 11px 13px;
}

.label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.log ul {
  list-style: none;
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
}

.log li {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 31px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f3f8f7;
  color: #5b534a;
  font-size: 14px;
  font-weight: 900;
}

.log .dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--green);
}

.game-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(55, 42, 31, 0.46);
  backdrop-filter: blur(9px);
}

.game-modal[hidden] { display: none !important; }

.game-modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(126, 95, 60, 0.2);
  border-radius: 8px;
  background: #fffaf1;
  box-shadow: 0 30px 90px rgba(47, 31, 18, 0.3);
}

.modal-close {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(126, 95, 60, 0.16);
  border-radius: 50%;
  background: #f6ede1;
  color: #75583d;
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
}

.modal-eyebrow {
  margin: 0 48px 9px 0;
  color: #8b6948;
  font-size: 12px;
  font-weight: 900;
}

.modal-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.modal-title-row h2 { font-size: 29px; }

.modal-title-row p {
  margin-top: 6px;
  color: #7f6d5b;
  font-size: 14px;
  font-weight: 700;
}

.collection-count,
.shop-wallet {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid rgba(126, 95, 60, 0.15);
  border-radius: 8px;
  background: #f5ecdd;
  color: #6d5137;
  font-size: 14px;
  white-space: nowrap;
}

.latest-discovery {
  margin-top: 20px;
  padding: 15px;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(225, 172, 66, 0.32);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff7d9, #fffaf0 54%, #eef8e4);
  animation: discovery-arrive .7s cubic-bezier(.2,.75,.25,1) both;
}

.latest-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  font-size: 31px;
  box-shadow: inset 0 -4px 0 rgba(126, 95, 60, 0.08);
}

.latest-discovery small {
  color: #a0732b;
  font-size: 11px;
  font-weight: 900;
}

.latest-discovery strong {
  display: block;
  margin-top: 2px;
  font-size: 19px;
}

.latest-discovery p {
  margin-top: 4px;
  color: #77644f;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.discovery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.discovery-entry {
  min-height: 112px;
  padding: 12px 9px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  border: 1px solid rgba(126, 95, 60, 0.14);
  border-radius: 8px;
  background: #fffdf8;
  text-align: center;
}

.discovery-entry .entry-icon {
  font-size: 29px;
  line-height: 1;
}

.discovery-entry strong { font-size: 13px; }

.discovery-entry small {
  color: #95816c;
  font-size: 10px;
  font-weight: 800;
}

.discovery-entry.is-locked {
  background: #f4efe7;
  color: #b3a89a;
}

.discovery-entry.is-locked .entry-icon {
  filter: grayscale(1);
  opacity: .32;
}

.modal-footnote {
  margin-top: 14px;
  color: #8b7965;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
}

.shop-window { width: min(1080px, 100%); }
.shop-heading { align-items: center; }

.shop-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(126, 95, 60, 0.15);
}

.shop-product {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(126, 95, 60, 0.14);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
}

.shop-product.is-featured {
  grid-column: 1 / -1;
  grid-template-columns: minmax(220px, 34%) minmax(0, 1fr);
  background: #f5faf0;
  border-color: rgba(112, 150, 72, 0.27);
}

.shop-product-art {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  min-height: 0;
  border-radius: 8px;
  background: #fff6dc;
}

.shop-product-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.product-tag {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 6px 9px;
  border-radius: 6px;
  background: rgba(81, 58, 37, 0.84);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.shop-product-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.product-kind {
  color: #779b45;
  font-size: 12px;
  font-weight: 900;
}

.shop-product-copy h3 {
  margin: 7px 0 0;
  font-size: 20px;
}

.shop-product-copy > p:not(.product-kind):not(.shop-message) {
  margin-top: 10px;
  color: #75634f;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
}

.shop-product-copy > .product-disclosure {
  padding: 9px 10px;
  border-left: 3px solid #d66c58;
  background: #fff4ef;
  color: #8b4439;
  font-size: 12px;
  line-height: 1.55;
}

.product-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 15px;
}

.product-benefits span {
  padding: 6px 8px;
  border: 1px solid rgba(112, 150, 72, 0.2);
  border-radius: 6px;
  background: #f2f8e8;
  color: #5f7d3e;
  font-size: 11px;
  font-weight: 900;
}

.product-buy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
}

.product-price {
  color: #745529;
  font-size: 17px;
  white-space: nowrap;
}

.product-price span { color: #f1b83f; }

.shop-buy-btn {
  min-width: 150px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ef7064, #f3b949);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 9px 18px rgba(208, 105, 70, 0.19);
}

.shop-buy-btn:disabled {
  cursor: default;
  background: #d9d0c4;
  box-shadow: none;
}

.shop-message {
  min-height: 19px;
  margin-top: 11px;
  color: #75634f;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.5;
}

.shop-message[data-tone="error"] { color: #b84e3f; }
.shop-message[data-tone="success"] { color: #45885c; }

.stone-store-link {
  display: inline-block;
  margin-top: 5px;
  color: #775536;
  font-size: 12px;
  font-weight: 900;
}

.trade-planned {
  padding: 3px 5px;
  border-radius: 4px;
  background: #e9f3dd;
  color: #658445;
  font-size: 9px;
  font-weight: 900;
}

@keyframes discovery-arrive {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.encounter-intro {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: #080705;
  isolation: isolate;
  transition: opacity .42s ease;
}

.encounter-intro::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -42px;
  background: linear-gradient(rgba(8, 7, 5, .5), rgba(8, 7, 5, .72)), url("assets/video/mofumaro-first-encounter-poster.webp") center / cover no-repeat;
  filter: blur(24px) saturate(.82);
  transform: scale(1.08);
  opacity: .72;
}

.encounter-intro[hidden] { display: none !important; }
.encounter-intro.is-leaving { opacity: 0; }
html.has-encounter-intro,
html.has-encounter-intro body {
  overflow: hidden;
  overscroll-behavior: none;
}

.encounter-intro-stage {
  position: relative;
  width: min(1180px, 100%);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(255, 245, 224, .22);
  border-radius: 8px;
  background: #000;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .58);
}

.encounter-intro-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.encounter-intro-launch {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: clamp(20px, 5vw, 52px);
  background: linear-gradient(180deg, rgba(5, 4, 2, .02) 42%, rgba(5, 4, 2, .58));
}

.encounter-intro-launch[hidden] { display: none; }

.encounter-intro-start {
  min-width: min(300px, 82vw);
  min-height: 62px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 11px 28px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 8px;
  background: rgba(255, 249, 234, .94);
  color: #453526;
  box-shadow: 0 16px 46px rgba(0, 0, 0, .34);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.encounter-intro-start span { font-size: 18px; }
.encounter-intro-start small { color: #7a6858; font-size: 10px; }
.encounter-intro-start:disabled { opacity: .72; cursor: wait; }

.encounter-intro-skip,
.encounter-intro-sound {
  position: absolute;
  z-index: 3;
  top: 12px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 8px;
  background: rgba(16, 13, 10, .52);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.encounter-intro-skip { right: 12px; }
.encounter-intro-sound { left: 12px; }
.encounter-intro-sound[hidden] { display: none; }

.encounter-intro-progress {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: rgba(255, 255, 255, .16);
}

.encounter-intro-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: #fff3cf;
  transition: width .15s linear;
}

.encounter-intro-status {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: 13px;
  left: 18px;
  margin: 0;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-shadow: 0 1px 5px #000;
  pointer-events: none;
}

@media (orientation: portrait) {
  .encounter-intro { padding-inline: 0; }
  .encounter-intro-stage {
    width: 100%;
    overflow: visible;
    border-inline: 0;
    border-radius: 0;
  }
  .encounter-intro-video { border-block: 1px solid rgba(255, 245, 224, .18); }
  .encounter-intro-launch {
    inset: calc(100% + 14px) 0 auto;
    padding: 0;
    background: none;
  }
  .encounter-intro-start {
    min-width: min(260px, 76vw);
    min-height: 54px;
    padding: 8px 20px;
  }
  .encounter-intro-start span { font-size: 16px; }
  .encounter-intro-skip { top: 8px; right: 8px; }
  .encounter-intro-sound { top: 8px; left: 8px; }
  .encounter-intro-status { top: calc(100% + 82px); bottom: auto; }
}

.naming-overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(74, 52, 39, .32);
  backdrop-filter: blur(6px);
}

.naming-overlay[hidden] {
  display: none;
}

.naming-card {
  width: min(520px, 100%);
  max-height: min(92vh, 760px);
  overflow-y: auto;
  display: grid;
  gap: 14px;
  padding: 26px;
  border: 1px solid rgba(126, 95, 60, .22);
  border-radius: 8px;
  background: rgba(255, 252, 244, .98);
  box-shadow: 0 22px 54px rgba(72, 50, 30, .24);
}

.naming-card h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
}

.naming-card input {
  width: 100%;
  height: 54px;
  padding: 0 14px;
  border: 1px solid rgba(126, 95, 60, .24);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 22px;
  font-weight: 900;
}

.naming-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.naming-card button {
  height: 54px;
  border-radius: 8px;
  background: linear-gradient(#ff7c72, #f86d63);
  color: white;
  font-weight: 900;
  font-size: 18px;
}

.coat-picker {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.coat-picker-preview {
  width: 132px;
  height: 122px;
  object-fit: contain;
  object-position: center bottom;
  filter: var(--mofu-coat-filter, ) drop-shadow(0 10px 8px rgba(86, 59, 39, .16));
}

.coat-picker fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.coat-picker legend {
  margin: 0 0 7px;
  padding: 0;
  color: #5e4c3b;
  font-size: 12px;
  font-weight: 900;
}

.coat-swatches {
  display: flex;
  gap: 7px;
  max-width: 100%;
  padding: 2px 2px 7px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.naming-card .coat-swatch {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, .94);
  border-radius: 50%;
  background: var(--swatch-color);
  box-shadow: 0 0 0 1px rgba(88, 61, 41, .24), 0 4px 8px rgba(82, 56, 38, .13);
  cursor: pointer;
}

.naming-card .coat-swatch[aria-checked="true"] {
  box-shadow: 0 0 0 3px #ef756c, 0 5px 10px rgba(82, 56, 38, .16);
  transform: translateY(-1px);
}

.calico-coat-regions {
  display: grid;
  gap: 6px;
}

.calico-coat-regions[hidden] { display: none; }

@media (max-width: 520px) {
  .naming-overlay { padding: 12px; }
  .naming-card { padding: 18px; gap: 11px; }
  .naming-card h2 { font-size: 23px; }
  .coat-picker { grid-template-columns: 100px minmax(0, 1fr); gap: 10px; }
  .coat-picker-preview { width: 100px; height: 94px; }
}

.naming-pair-preview {
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 0;
  height: 102px;
  margin: 4px 0 12px;
}

.naming-pair-preview span {
  width: 102px;
  height: 94px;
  margin: 0 -8px;
  background: url("assets/mofumaro.png") center bottom / contain no-repeat;
  filter: drop-shadow(0 9px 8px rgba(90, 60, 36, .15));
}

.naming-pair-preview span:last-child {
  width: 92px;
  height: 84px;
  transform: scaleX(-1);
}

.subscription-plans {
  width: min(850px, 100%);
}

.subscription-lead {
  margin-top: 8px;
  color: #756553;
  font-weight: 700;
}

.subscription-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.subscription-plan-card {
  display: flex;
  min-height: 330px;
  flex-direction: column;
  padding: 22px;
  border: 1px solid rgba(126, 95, 60, .18);
  border-radius: 8px;
  background: #fffaf2;
  color: #4b3a2b;
}

.subscription-plan-card.is-luxury {
  border-color: rgba(192, 143, 48, .42);
  background: linear-gradient(145deg, #fff9df, #eef7f0 62%, #eef5fc);
  box-shadow: inset 0 0 0 3px rgba(240, 193, 94, .18);
}

.subscription-plan-card h3 {
  margin: 5px 0 0;
  font-size: 25px;
}

.plan-kicker {
  color: #8e7656;
  font-size: 12px;
  font-weight: 900;
}

.plan-price {
  display: block;
  margin-top: 8px;
  color: #d86456;
  font-size: 22px;
}

.plan-contract-state {
  min-height: 22px;
  margin-top: 8px;
  color: #2f7d58;
  font-size: 13px;
  font-weight: 900;
}

.subscription-plan-card ul {
  display: grid;
  gap: 9px;
  margin: 18px 0 22px;
  padding: 0;
  list-style: none;
  color: #665545;
  font-size: 14px;
  font-weight: 800;
}

.subscription-plan-card li::before {
  content: "✓";
  margin-right: 8px;
  color: #5d9d68;
  font-weight: 900;
}

.subscription-plan-card button {
  min-height: 50px;
  margin-top: auto;
  border-radius: 8px;
  background: #6a5947;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.subscription-plan-card.is-luxury button {
  background: linear-gradient(135deg, #d9a43d, #ef7064);
}

.subscription-plan-card button:disabled {
  cursor: default;
  background: #d9d4cc;
  color: #716b63;
  box-shadow: none;
  opacity: 1;
}

.subscription-plan-message {
  min-height: 20px;
  margin-top: 12px;
  color: #6d5840;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.subscription-cancel-note {
  margin: 12px auto 0;
  padding: 10px 12px;
  max-width: 640px;
  border: 1px solid rgba(88, 116, 103, .2);
  border-radius: 6px;
  background: #f2f7f4;
  color: #5d675f;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.6;
  text-align: center;
}

.subscription-cancel-link {
  display: block;
  margin: 10px auto 0;
  padding: 9px 14px;
  border: 1px solid rgba(115, 96, 79, .32);
  border-radius: 6px;
  background: #fff;
  color: #695a4e;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.subscription-resume-link {
  display: block;
  margin: 10px auto 0;
  padding: 10px 16px;
  border: 1px solid rgba(54, 126, 87, .38);
  border-radius: 6px;
  background: #edf8f1;
  color: #276844;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.subscription-cancel-panel {
  width: min(640px, 100%);
  margin: 14px auto 0;
  padding: 18px;
  border: 1px solid rgba(160, 76, 60, .28);
  border-radius: 8px;
  background: #fff7f4;
  color: #544139;
}

.subscription-cancel-panel h3 {
  margin: 0;
  font-size: 17px;
}

.subscription-cancel-danger {
  margin: 9px 0 0;
  color: #a13f34;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.6;
}

.subscription-cancel-warning {
  margin-top: 10px;
  color: #744b43;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.75;
}

.subscription-cancel-confirm,
.subscription-cancel-password {
  display: flex;
  margin-top: 13px;
  font-size: 13px;
  font-weight: 900;
}

.subscription-cancel-confirm {
  align-items: flex-start;
  gap: 9px;
  line-height: 1.55;
}

.subscription-cancel-confirm input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: #9a4c3f;
}

.subscription-cancel-password {
  flex-direction: column;
  gap: 7px;
}

.subscription-cancel-password input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(110, 80, 65, .28);
  border-radius: 6px;
  background: #fff;
  color: #44362f;
  font: inherit;
}

.subscription-cancel-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 9px;
  margin-top: 14px;
}

.subscription-cancel-actions button {
  min-height: 46px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 900;
}

.subscription-cancel-back {
  border: 1px solid rgba(110, 80, 65, .24);
  background: #fff;
  color: #695a4e;
}

.subscription-cancel-confirm-btn {
  background: #9a4c3f;
  color: #fff;
}

.subscription-resume-panel {
  border-color: rgba(54, 126, 87, .3);
  background: #f2faf5;
  color: #344d3d;
}

.subscription-resume-panel .subscription-cancel-warning {
  color: #35664a;
}

.subscription-resume-panel .subscription-cancel-confirm input {
  accent-color: #377f58;
}

.subscription-resume-confirm-btn {
  border: 1px solid #377f58;
  background: #377f58;
  color: #fff;
}

.subscription-cancel-confirm-btn:disabled,
.subscription-resume-confirm-btn:disabled {
  cursor: wait;
  opacity: .55;
}

.subscription-cancel-result {
  min-height: 20px;
  margin-top: 10px;
  color: #8f3f35;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.6;
}

.subscription-resume-result {
  color: #276844;
}

.target-picker {
  width: min(560px, 100%);
}

.target-picker-note {
  margin-top: 8px;
  color: #756553;
  font-size: 13px;
  font-weight: 800;
}

.target-choice-list {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.target-choice-list button {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 78px;
  padding: 8px 14px;
  border: 1px solid rgba(126, 95, 60, .18);
  border-radius: 8px;
  background: #fffaf1;
  color: #4e3d2e;
  text-align: left;
}

.target-choice-list button:hover { background: #fff3df; border-color: rgba(225, 155, 59, .42); }
.target-choice-list strong,
.target-choice-list small { display: block; }
.target-choice-list strong { font-size: 15px; }
.target-choice-list small { margin-top: 4px; color: #81715f; font-size: 11px; font-weight: 800; }

.target-pet-face {
  display: block;
  width: 60px;
  height: 60px;
  background: url("assets/mofumaro.png") center bottom / contain no-repeat;
  filter: drop-shadow(0 6px 5px rgba(90, 60, 36, .13));
}

.target-pet-face.is-pair {
  width: 64px;
  background:
    url("assets/mofumaro.png") 8px bottom / 44px auto no-repeat,
    url("assets/mofumaro-happy.png") 28px bottom / 40px auto no-repeat;
}

@keyframes companionEat {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  35% { transform: translateY(5px) rotate(-1deg) scale(1.025, .975); }
  68% { transform: translateY(2px) rotate(1deg) scale(.99, 1.01); }
}

@keyframes companionApproach {
  0% { transform: translateY(0) scale(.86); }
  55%, 100% { transform: translateY(4px) scale(1.08); }
}

@keyframes companionRun {
  0%, 100% { transform: translate3d(-42px, 0, 0) rotate(-3deg); }
  25% { transform: translate3d(0, -18px, 0) rotate(2deg); }
  50% { transform: translate3d(42px, 0, 0) rotate(3deg); }
  75% { transform: translate3d(0, 8px, 0) rotate(-2deg); }
}

@keyframes companionSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(185deg) scale(.92); }
  100% { transform: rotate(360deg) scale(1); }
}

@keyframes companionSoloWalk {
  0%, 100% { transform: translate3d(-18px, 2px, 0) rotate(-1deg) scale(.96); }
  35% { transform: translate3d(4px, -7px, 0) rotate(1.5deg) scale(1); }
  72% { transform: translate3d(26px, 1px, 0) rotate(-.5deg) scale(1.02); }
}

@keyframes companionLeaderPoint {
  0%, 100% { transform: translateY(2px) rotate(0deg) scale(.98); }
  32% { transform: translateY(-4px) rotate(-1.5deg) scale(1.035); }
  68% { transform: translateY(-2px) rotate(1deg) scale(1.02); }
}

@keyframes companionMoodFreeze {
  0% { transform: translateY(-8px) rotate(4deg) scale(1.04); }
  16% { transform: translateY(2px) rotate(-2deg) scale(.97); }
  24%, 72% { transform: translateY(2px) rotate(0deg) scale(.97); }
  84% { transform: translateY(0) rotate(.6deg) scale(.985); }
  100% { transform: translateY(2px) rotate(0deg) scale(.97); }
}

.companion-pet-wrap[data-companion-action="gobbleFood"] .companion-pet-image,
.companion-pet-wrap[data-companion-action="savorFood"] .companion-pet-image { animation: companionEat .72s ease-in-out infinite; }
.companion-pet-wrap[data-companion-action="ownerApproach"] .companion-pet-image { animation: companionApproach 2.2s ease-out both; }
.companion-pet-wrap[data-companion-action="runAround"] .companion-pet-image,
.companion-pet-wrap[data-companion-action="outdoorRomp"] .companion-pet-image { animation: companionRun 2.6s ease-in-out infinite; }
.companion-pet-wrap[data-companion-action="fastSpin"] .companion-pet-image { animation: companionSpin 1.35s linear infinite; }
.companion-pet-wrap[data-companion-action="happyBounce"] .companion-pet-image,
.companion-pet-wrap[data-companion-action="chaseBall"] .companion-pet-image { animation: pairMirrorCompanion 1.9s ease-in-out infinite; }
.companion-pet-wrap[data-companion-action="soloExpedition"] .companion-pet-image { animation: companionSoloWalk 3.2s ease-in-out infinite; }
.companion-pet-wrap[data-companion-action="leaderPatrol"] .companion-pet-image { animation: companionLeaderPoint 2.5s ease-in-out infinite; }
.companion-pet-wrap[data-companion-action="moodFlip"] .companion-pet-image { animation: companionMoodFreeze 3.3s cubic-bezier(.2,.7,.25,1) infinite; }

.trial-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(55, 42, 31, 0.48);
  backdrop-filter: blur(8px);
}

.trial-gate[hidden] {
  display: none !important;
}

.trial-card {
  width: min(560px, 100%);
  padding: 28px;
  border: 1px solid rgba(126, 95, 60, 0.22);
  border-radius: 10px;
  background: rgba(255, 252, 244, 0.98);
  box-shadow: 0 30px 90px rgba(47, 31, 18, 0.26);
  text-align: center;
}

.trial-pet {
  width: 148px;
  height: 120px;
  margin: 0 auto 12px;
  background: url("assets/mofumaro-sad.png") center / contain no-repeat;
  filter: drop-shadow(0 18px 18px rgba(90, 60, 36, 0.22));
}

.trial-pet.happy {
  background-image: url("assets/mofumaro-happy.png");
}

.trial-card h2 {
  margin-top: 8px;
  font-size: 26px;
}

.trial-card p {
  margin: 14px auto 0;
  max-width: 460px;
  color: #6f5e4d;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.8;
}

.trial-card .trial-note {
  margin-top: 12px;
  color: #8a765f;
  font-size: 13px;
  line-height: 1.55;
}

.trial-card .trial-decision-message {
  min-height: 20px;
  margin-top: 12px;
  color: #b14738;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.55;
}

.trial-card .trial-decision-message[data-tone="success"] {
  color: #208b6b;
}

.trial-card .trial-decision-message[data-tone="neutral"] {
  color: #786a5b;
}

.trial-journey-recap {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(218, 151, 119, 0.3);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff1e9, #fffdf7 52%, #edf7e8);
  text-align: left;
}

.trial-journey-recap[hidden] { display: none !important; }

.trial-card .trial-journey-recap > p {
  max-width: none;
  margin: 0 0 2px;
  color: #7d4f3c;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.4;
}

.trial-journey-recap div {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.trial-journey-recap span {
  color: #9b7a67;
  font-size: 11px;
  font-weight: 900;
}

.trial-journey-recap strong {
  color: #49372c;
  font-size: 12px;
  line-height: 1.45;
}

.trial-card .trial-journey-recap small {
  margin: 3px 0 0;
  color: #6e7958;
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 520px) {
  .trial-journey-recap div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.trial-login-panel {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(126, 95, 60, 0.18);
  border-radius: 10px;
  background: #fff8ed;
}

.trial-login-panel > p {
  margin-top: 0;
  font-size: 13px;
  line-height: 1.6;
}

.trial-login-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.trial-login-form > label:not(.login-remember) {
  display: grid;
  gap: 5px;
  color: #6d5840;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
}

.trial-login-form input:not([type="checkbox"]) {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(126, 95, 60, 0.18);
  border-radius: 8px;
  background: #fff;
  color: #2f251c;
  font: inherit;
}

#trialLoginSubmit {
  min-height: 46px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ef7064, #f5b957);
  color: #fff;
  font-weight: 900;
}

.trial-register-link {
  display: inline-block;
  margin-top: 12px;
  color: #785538;
  font-size: 13px;
  font-weight: 900;
}

.trial-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.trial-actions button {
  min-height: 50px;
  border-radius: 10px;
  font-weight: 900;
}

#keepMofumaroBtn {
  background: linear-gradient(135deg, #ef7064, #f5b957);
  color: white;
}

#newMofumaroBtn {
  border: 1px solid rgba(126, 95, 60, 0.18);
  background: #f7efe4;
  color: #6f5135;
}

.trial-card small {
  display: block;
  margin-top: 12px;
  color: #8b7b68;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
}

@keyframes breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(3px) scale(1.018, .985); }
}

@keyframes tail {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(14deg); }
}

@keyframes hop {
  from { transform: translateY(0) rotate(-2deg); }
  to { transform: translateY(-14px) rotate(2deg); }
}

@keyframes cuddle {
  from { transform: translateY(0) rotate(-1deg) scale(1); }
  to { transform: translateY(-5px) rotate(1deg) scale(1.025); }
}

@keyframes approachBreath {
  0%, 100% { transform: translateY(0) scale(1.01); }
  45% { transform: translateY(-4px) scale(1.035, .985); }
  70% { transform: translateY(1px) scale(1.015); }
}

@keyframes curiousTilt {
  0%, 100% { transform: translateY(0) rotate(calc(-1.2deg + var(--pet-focus-tilt, 0deg))); }
  45% { transform: translateY(-3px) rotate(calc(2deg + var(--pet-focus-tilt, 0deg))); }
  70% { transform: translateY(0) rotate(calc(.6deg + var(--pet-focus-tilt, 0deg))); }
}

@keyframes sadPulse {
  0%, 100% { transform: translateY(1px) scale(.995, 1.01); filter: saturate(.95); }
  55% { transform: translateY(5px) scale(.985, 1.018); filter: saturate(.88); }
}

@keyframes grumpySway {
  0%, 100% { transform: translateX(0) rotate(-1.4deg); }
  42% { transform: translateX(-3px) rotate(-2.4deg); }
  72% { transform: translateX(1px) rotate(-1deg); }
}

@keyframes munchBounce {
  0%, 100% { transform: translateY(1px) scale(1.01, .99); }
  28% { transform: translateY(4px) scale(1.035, .965); }
  56% { transform: translateY(0) scale(.995, 1.015); }
}

@keyframes stuffedSettle {
  0%, 100% { transform: translateY(3px) scale(1.01, .995); }
  50% { transform: translateY(7px) scale(1.035, .97); }
}

@keyframes meltRelax {
  0%, 100% { transform: translateY(2px) scale(1.02, .99) rotate(-.5deg); }
  50% { transform: translateY(8px) scale(1.055, .94) rotate(.4deg); }
}

@keyframes chaseDash {
  0%, 100% { transform: translateX(-5px) translateY(0) rotate(-2deg) scale(1.01); }
  45% { transform: translateX(7px) translateY(-8px) rotate(3deg) scale(1.035, .965); }
  75% { transform: translateX(2px) translateY(1px) rotate(.8deg) scale(1); }
}

@keyframes toyWrestle {
  0%, 100% { transform: translateX(0) translateY(0) rotate(-2deg) scale(1.01); }
  35% { transform: translateX(-4px) translateY(3px) rotate(-5deg) scale(1.035, .97); }
  70% { transform: translateX(5px) translateY(-4px) rotate(4deg) scale(1.02, .98); }
}

@keyframes tuckedSleep {
  0%, 100% { transform: translateY(2px) scale(1.01, .995); filter: saturate(.98); }
  50% { transform: translateY(5px) scale(1.025, .982); filter: saturate(.94); }
}

@keyframes shyHesitate {
  0%, 100% { transform: translateX(0) translateY(1px) rotate(-1deg) scale(.99); }
  36% { transform: translateX(-4px) translateY(0) rotate(-2deg) scale(.985, 1.01); }
  68% { transform: translateX(2px) translateY(-2px) rotate(.6deg) scale(1.005, .995); }
}

@keyframes angryPuff {
  0%, 100% { transform: translateX(0) translateY(0) scale(1.01, .99) rotate(-1deg); filter: saturate(.96); }
  32% { transform: translateX(-2px) translateY(-2px) scale(1.035, .965) rotate(-2deg); filter: saturate(.9); }
  58% { transform: translateX(2px) translateY(0) scale(1.015, .985) rotate(1deg); }
}

@keyframes inspectLean {
  0%, 100% { transform: translateY(0) rotate(calc(var(--pet-focus-tilt, 0deg) - .6deg)); }
  45% { transform: translateY(-2px) translateX(3px) rotate(calc(var(--pet-focus-tilt, 0deg) + 1.8deg)); }
}

@keyframes slowStep {
  0%, 100% { transform: translateX(-2px) translateY(0) rotate(-.8deg); }
  35% { transform: translateX(2px) translateY(-2px) rotate(.9deg); }
  70% { transform: translateX(0) translateY(1px) rotate(-.2deg); }
}

@keyframes windowGaze {
  0%, 100% { transform: translateY(0) rotate(-1.4deg); filter: saturate(.98); }
  50% { transform: translateY(1px) rotate(-2.6deg); filter: saturate(.94); }
}

@keyframes stretchBody {
  0%, 100% { transform: translateY(0) scale(1); }
  42% { transform: translateY(5px) scale(1.08, .9); }
  72% { transform: translateY(-2px) scale(.98, 1.03); }
}

@keyframes selfCareRock {
  0%, 100% { transform: translateX(0) rotate(-.6deg); }
  36% { transform: translateX(-3px) rotate(-2deg); }
  72% { transform: translateX(2px) rotate(1.2deg); }
}

@keyframes begBounce {
  0%, 100% { transform: translateY(0) scale(1.015); }
  48% { transform: translateY(-6px) scale(1.035, .975); }
}

@keyframes boredSink {
  0%, 100% { transform: translateY(2px) scale(.995, 1.005); filter: saturate(.96); }
  50% { transform: translateY(7px) scale(.98, 1.015); filter: saturate(.9); }
}

@keyframes guardHold {
  0%, 100% { transform: translateY(0) rotate(-1.2deg) scale(1.01); }
  48% { transform: translateY(-2px) rotate(-1.7deg) scale(1.018); }
}

@keyframes proudLift {
  0%, 100% { transform: translateY(0) scale(1.01); }
  50% { transform: translateY(-5px) scale(1.035, .985); }
}

@keyframes happySpin {
  0%, 100% { transform: translateY(0) rotate(-3deg) scale(1.01); }
  45% { transform: translateY(-5px) rotate(4deg) scale(1.03, .98); }
  72% { transform: translateY(1px) rotate(-1deg) scale(1.01); }
}

@keyframes bigJoyJump {
  0%, 100% { transform: translateY(0) scale(1.02, .99) rotate(-1deg); }
  32% { transform: translateY(-38px) scale(.98, 1.04) rotate(2.5deg); }
  58% { transform: translateY(-18px) scale(1.04, .97) rotate(-1.2deg); }
  78% { transform: translateY(3px) scale(1.08, .92) rotate(.5deg); }
}

@keyframes happyBounce {
  0%, 100% { transform: translateY(0) scale(1.08, .94); }
  38% { transform: translateY(-18px) scale(.98, 1.04); }
  68% { transform: translateY(1px) scale(1.05, .96); }
}

@keyframes starTwirl {
  0%, 100% { transform: translateX(0) translateY(0) rotate(-7deg) scale(1.01); }
  35% { transform: translateX(-6px) translateY(-8px) rotate(8deg) scale(1.035, .975); }
  70% { transform: translateX(5px) translateY(-3px) rotate(-4deg) scale(1.02); }
}

@keyframes grassPounce {
  0%, 100% { transform: translateX(0) translateY(0) rotate(-2deg) scale(1.01); }
  42% { transform: translateX(12px) translateY(-12px) rotate(4deg) scale(1.04, .97); }
  72% { transform: translateX(4px) translateY(2px) rotate(1deg) scale(1.06, .94); }
}

@keyframes rollOverWobble {
  0%, 100% { transform: translateX(-2px) translateY(1px) rotate(-16deg) scale(1.02); }
  34% { transform: translateX(10px) translateY(-7px) rotate(18deg) scale(1.04, .98); }
  68% { transform: translateX(3px) translateY(3px) rotate(-8deg) scale(.99, 1.02); }
}

@keyframes flatRelaxMelt {
  0%, 100% { transform: translateY(9px) scale(1.08, .9); filter: saturate(.98); }
  48% { transform: translateY(13px) scale(1.12, .86); filter: saturate(.94); }
  76% { transform: translateY(10px) scale(1.09, .89); }
}

@keyframes dashStartTense {
  0%, 100% { transform: translateX(-6px) translateY(2px) rotate(-5deg) scale(1.04, .96); }
  36% { transform: translateX(14px) translateY(-4px) rotate(4deg) scale(.98, 1.04); }
  58% { transform: translateX(-2px) translateY(3px) rotate(-3deg) scale(1.08, .93); }
  78% { transform: translateX(7px) translateY(-2px) rotate(2deg) scale(1.01); }
}

@keyframes backTurnSulkHold {
  0%, 100% { transform: translateX(4px) translateY(2px) rotate(1.2deg) scale(1.01); filter: saturate(.93); }
  42% { transform: translateX(8px) translateY(4px) rotate(-1.6deg) scale(1.015, .99); filter: saturate(.88); }
  72% { transform: translateX(6px) translateY(1px) rotate(.8deg); }
}

@keyframes fullJoyJump {
  0%, 100% { transform: translateY(3px) scale(1.08, .92) rotate(-2deg); }
  24% { transform: translateY(-62px) scale(.94, 1.09) rotate(5deg); }
  50% { transform: translateY(-34px) translateX(7px) scale(1.02) rotate(-4deg); }
  74% { transform: translateY(6px) scale(1.12, .88) rotate(1deg); }
}

@keyframes plateWait {
  0%, 100% { transform: translateY(1px) scale(1.01, .995); }
  38% { transform: translateY(-2px) translateX(-2px) scale(1.02, .99); }
  72% { transform: translateY(2px) scale(1.005, 1.002); }
}

@keyframes ownerApproach {
  0%, 100% { transform: translateX(-2px) translateY(0) scale(1.015); }
  42% { transform: translateX(4px) translateY(-4px) scale(1.035, .985); }
  76% { transform: translateX(1px) translateY(1px) scale(1.02, .995); }
}

@keyframes sleepyBallLook {
  0%, 100% { transform: translateY(3px) rotate(-.8deg) scale(1.005); filter: saturate(.96); }
  46% { transform: translateY(8px) rotate(.5deg) scale(.995, 1.01); filter: saturate(.91); }
  78% { transform: translateY(4px) translateX(2px) rotate(-.2deg); }
}

@keyframes turnAwayHold {
  0%, 100% { transform: translateX(1px) rotate(-1.2deg) scale(1.01); filter: saturate(.95); }
  45% { transform: translateX(5px) rotate(-2.1deg) scale(1.015, .99); filter: saturate(.9); }
  72% { transform: translateX(3px) rotate(-.7deg); }
}

@keyframes settleAfterCare {
  0%, 100% { transform: translateY(2px) scale(1.01, .995); filter: saturate(1.02); }
  50% { transform: translateY(5px) scale(1.025, .985); filter: saturate(1); }
}

@keyframes lookUpBreath {
  0%, 100% { transform: translateY(0) scale(1.01); }
  45% { transform: translateY(-4px) scale(1.03, .985); }
}

@keyframes hesitantStep {
  0%, 100% { transform: translateX(-3px) translateY(1px) rotate(-1deg) scale(.995, 1.005); }
  34% { transform: translateX(2px) translateY(-2px) rotate(.6deg) scale(1.012, .99); }
  58% { transform: translateX(0) translateY(0) rotate(-.4deg) scale(1.002); }
  74% { transform: translateX(-2px) translateY(1px) rotate(-.8deg); }
}

@keyframes anticipationWait {
  0%, 100% { transform: translateY(1px) scale(1.01, .995); }
  30% { transform: translateY(-4px) translateX(-1px) scale(1.025, .985); }
  54% { transform: translateY(0) translateX(1px) scale(1.01); }
  76% { transform: translateY(-2px) scale(1.018, .99); }
}

@keyframes grumpyPuffHold {
  0%, 100% { transform: translateY(1px) scale(1.018, .985) rotate(-.6deg); filter: saturate(.96); }
  38% { transform: translateY(-1px) scale(1.045, .955) rotate(-1.4deg); filter: saturate(.91); }
  68% { transform: translateX(2px) translateY(1px) scale(1.025, .975) rotate(.4deg); }
}

@keyframes drowsyNod {
  0%, 100% { transform: translateY(2px) rotate(-.4deg) scale(1.005); filter: saturate(.96); }
  32% { transform: translateY(8px) rotate(.8deg) scale(.995, 1.012); filter: saturate(.9); }
  52% { transform: translateY(4px) rotate(-.2deg); }
  78% { transform: translateY(9px) rotate(.6deg) scale(.99, 1.015); }
}

@keyframes pawReach {
  0%, 100% { transform: translateX(0) translateY(0) rotate(-.8deg); }
  42% { transform: translateX(5px) translateY(-4px) rotate(2deg); }
  70% { transform: translateX(1px) translateY(1px) rotate(.4deg); }
}

@keyframes sleepyBob {
  0%, 100% { transform: translateY(2px) rotate(-.6deg); }
  50% { transform: translateY(8px) rotate(.8deg); }
}

@keyframes tinyCryShake {
  0%, 100% { transform: translateX(0) translateY(2px); }
  35% { transform: translateX(-1px) translateY(4px); }
  70% { transform: translateX(1px) translateY(3px); }
}

@keyframes pop {
  0% { transform: translate(-50%, 14px) scale(.7); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translate(-50%, -28px) scale(1); opacity: 0; }
}

@keyframes floatMote {
  0% { transform: translateY(12px) scale(.55); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(-62px) scale(1.08); opacity: 0; }
}

@keyframes startle {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-5px) rotate(-1deg); }
  75% { transform: translateX(5px) rotate(1deg); }
}

@keyframes microGlint {
  0%, 72%, 100% { opacity: .5; transform: translateY(0) scale(1); }
  78% { opacity: .9; transform: translateY(-1px) scale(1.18); }
  84% { opacity: .38; transform: translateY(0) scale(.92); }
}

@keyframes tinyHesitation {
  0%, 100% {
    transform:
      translate(var(--gaze-x, 0px), var(--gaze-y, 0px))
      rotate(calc(var(--pet-focus-tilt, 0deg) * .35));
  }
  42% {
    transform:
      translate(calc(var(--gaze-x, 0px) - 2px), calc(var(--gaze-y, 0px) + 1px))
      rotate(calc(var(--pet-focus-tilt, 0deg) * .35 - .8deg));
  }
  72% {
    transform:
      translate(calc(var(--gaze-x, 0px) + 1px), var(--gaze-y, 0px))
      rotate(calc(var(--pet-focus-tilt, 0deg) * .35 + .4deg));
  }
}

@keyframes gazeScan {
  0%, 100% {
    transform:
      translate(var(--gaze-x, 0px), var(--gaze-y, 0px))
      rotate(calc(var(--pet-focus-tilt, 0deg) * .4));
  }
  38% {
    transform:
      translate(calc(var(--gaze-x, 0px) - 6px), calc(var(--gaze-y, 0px) + 1px))
      rotate(calc(var(--pet-focus-tilt, 0deg) * .4 - .5deg));
  }
  66% {
    transform:
      translate(calc(var(--gaze-x, 0px) + 7px), calc(var(--gaze-y, 0px) - 1px))
      rotate(calc(var(--pet-focus-tilt, 0deg) * .4 + .6deg));
  }
}

@media (max-width: 1599px) {
  .topbar {
    grid-template-columns: 190px 152px 1fr auto;
    gap: 10px;
  }

  .brand-stack > span { font-size: 25px; }
  .portal-link { font-size: 9px; }
  .tab { min-width: 152px; font-size: 16px; padding: 0 8px; gap: 5px; }
  .tab small { padding: 3px 5px; font-size: 9px; }
  .wallet-item { min-width: 104px; font-size: 18px; }
  .round-btn { display: none; }
  .discovery-btn { display: block; }
  .audio-toggle { display: block; }
  .bgm-style { display: none; }
  .shop-btn { min-width: 108px; font-size: 18px; }
  .shell { grid-template-columns: minmax(610px, 1fr) 312px; }
  .dock { width: min(760px, calc(100% - 320px)); min-width: 560px; height: 138px; }
  .care-btn { font-size: 13px; }
  .room-nav { width: min(650px, calc(100% - 345px)); }
}

@media (max-width: 860px) {
  .app {
    grid-template-rows: auto 1fr;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand brand"
      "wallet wallet"
      "actions actions";
    height: auto;
    min-height: 0;
    gap: 6px 8px;
    padding: 7px 9px 8px;
  }

  .tabs { display: none; }

  .brand {
    grid-area: brand;
    justify-content: flex-start;
    gap: 6px;
    min-width: 0;
  }

  .brand-mark { width: 31px; height: 31px; border-width: 3px; border-radius: 11px 11px 14px 14px; }
  .brand-mark::before,
  .brand-mark::after { top: 10px; width: 4px; height: 4px; }
  .brand-mark::before { left: 8px; }
  .brand-mark::after { right: 8px; }
  .brand-stack > span { font-size: 21px; }
  .portal-link { font-size: 8px; }

  .wallet {
    grid-area: wallet;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }

  .wallet-item {
    flex: 1;
    min-width: 0;
    height: 34px;
    padding: 0 9px;
    font-size: 13px;
    border-radius: 8px;
  }

  .wallet-item > span { font-size: 16px; }
  .wallet-item button { display: none; }

  .top-actions {
    grid-area: actions;
    justify-self: stretch;
    min-width: 0;
    display: grid;
    grid-template-columns: 40px 40px minmax(0, 1fr);
    gap: 6px;
    justify-content: stretch;
  }

  .account-pill {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    min-height: 36px;
    padding: 5px 8px;
    border-radius: 8px;
  }

  .account-copy small { font-size: 8px; }
  .account-copy strong { font-size: 11px; }
  .account-pill a,
  .account-pill button,
  .login-details summary { font-size: 10px; }

  .top-actions > .round-btn[aria-label="設定"] { display: none; }

  .bgm-style {
    width: 100%;
    min-width: 0;
  }

  .shop-btn {
    height: 38px;
    width: 100%;
    min-width: 0;
    margin-right: 0;
    border-radius: 8px;
    font-size: 14px;
  }

  .discovery-btn {
    width: 40px;
    height: 38px;
    border-radius: 8px;
  }

  .audio-toggle {
    width: 40px;
    height: 38px;
    border-radius: 8px;
  }

  .shell {
    display: block;
  }

  .room {
    height: auto;
    min-height: 630px;
  }

  .side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 8px;
    padding: 8px;
  }

  .profile,
  .pair-status,
  .today,
  .daily-photo,
  .talk-panel,
  .premium,
  .log { grid-column: 1 / -1; }

  .profile {
    min-height: 92px;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .mini-portrait { width: 68px; height: 68px; }
  h1 { font-size: 21px; }
  .profile p { margin-top: 4px; font-size: 13px; }
  .phase { font-size: 12px !important; }
  .mood-card,
  .stats,
  .today,
  .daily-photo,
  .relationship,
  .pair-status { padding: 10px; }
  .mood-card h2,
  .stats h2,
  .today h2 { font-size: 16px; }
  .hearts { grid-template-columns: repeat(5, 25px); gap: 2px; margin-top: 8px; }
  .hearts span { width: 25px; height: 24px; transform: scale(.55); transform-origin: left top; }
  .stat + .stat { margin-top: 8px; }
  .stat.compact { margin-top: 7px; }
  .stat-head { margin-bottom: 5px; font-size: 12px; }
  .meter { height: 10px; }
  .state-title { font-size: 15px; }
  .health-notebook > summary { min-height: 56px; padding: 9px 10px; }
  .daily-photo img { height: 150px; }
  .living-moment-badge {
    left: 12px;
    top: 72px;
    max-width: calc(100% - 24px);
    font-size: 11px;
  }

  .round-window {
    width: 245px;
    height: 245px;
    left: 58%;
    top: 7%;
  }

  .door { width: 92px; height: 430px; }
  .kennel { left: 118px; top: 286px; transform: scale(.72); transform-origin: left top; }
  .room-bed { right: 10px; top: 405px; transform: scale(.72); transform-origin: right top; }
  .bowl { left: 42px; bottom: 235px; transform: scale(.76); transform-origin: left bottom; }
  .ball { left: 65%; bottom: 275px; transform: scale(.72); }
  .pet-wrap {
    left: 51%;
    bottom: 255px;
    width: 310px;
    height: 282px;
    transform: translateX(-50%) scale(.8);
  }
  .app[data-pack-count="2"] .pet-wrap {
    left: 36% !important;
    width: 190px;
    height: 175px;
    transform: translateX(-50%) scale(.8);
  }
  .companion-pet-wrap {
    left: 69% !important;
    width: 190px;
    height: 175px;
    bottom: 255px;
    transform: translateX(-50%) scale(.8);
  }
  .app[data-pair-event="greeting"] .pet-wrap { left: 39% !important; }
  .app[data-pair-event="greeting"] .companion-pet-wrap { left: 62% !important; }
  .app[data-pair-event="mirror"] .pet-wrap { left: 34% !important; }
  .app[data-pair-event="mirror"] .companion-pet-wrap { left: 70% !important; }
  .app[data-pair-event="tug"] .pet-wrap { left: 37% !important; }
  .app[data-pair-event="tug"] .companion-pet-wrap { left: 66% !important; }
  .app[data-pair-event="jealous"] .pet-wrap { left: 43% !important; }
  .app[data-pair-event="jealous"] .companion-pet-wrap { left: 51% !important; }
  .app[data-pair-event="follow"] .pet-wrap { left: 38% !important; }
  .app[data-pair-event="follow"] .companion-pet-wrap { left: 66% !important; }
  .app[data-pair-event="make-up"] .pet-wrap { left: 41% !important; }
  .app[data-pair-event="make-up"] .companion-pet-wrap { left: 61% !important; }
  .app[data-pair-event="guard"] .pet-wrap { left: 40% !important; }
  .app[data-pair-event="guard"] .companion-pet-wrap { left: 65% !important; }
  .app[data-pair-event="distance"] .pet-wrap { left: 26% !important; }
  .app[data-pair-event="distance"] .companion-pet-wrap { left: 76% !important; }
  .app[data-pair-event="sneeze"] .pet-wrap { left: 36% !important; }
  .app[data-pair-event="sneeze"] .companion-pet-wrap { left: 69% !important; }
  .app[data-pair-event="share"] .pet-wrap { left: 39% !important; }
  .app[data-pair-event="share"] .companion-pet-wrap { left: 65% !important; }
  .pair-event-caption { bottom: 224px; font-size: 12px; }
  .pair-scene-image { bottom: 220px; width: 88%; height: 250px; }
  .dock {
    left: 10px;
    right: 10px;
    bottom: 55px;
    width: auto;
    min-width: 0;
    height: 132px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    transform: none;
  }
  .care-btn { min-width: 0; font-size: 12px; gap: 1px; }
  .care-btn:nth-child(4) { border-right: 0; }
  .care-btn:nth-child(-n + 4) { border-bottom: 1px solid rgba(126, 95, 60, 0.15); }
  .icon { width: 38px; height: 30px; transform: scale(.55); }
  .room-nav {
    left: 10px;
    right: 10px;
    bottom: 6px;
    width: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    height: 44px;
  }
  .room-tab { min-width: 0; padding: 0 3px; font-size: 11px; }

  .subscription-plan-grid { grid-template-columns: 1fr; }
  .subscription-plan-card { min-height: 0; }
  .subscription-cancel-actions { grid-template-columns: 1fr; }

  .game-modal { padding: 10px; }
  .game-modal-card {
    max-height: calc(100vh - 20px);
    padding: 22px 16px;
  }
  .modal-title-row { display: grid; gap: 10px; }
  .collection-count,
  .shop-wallet { justify-self: start; }
  .discovery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shop-product-grid { grid-template-columns: 1fr; }
  .shop-product,
  .shop-product.is-featured { grid-column: auto; grid-template-columns: 1fr; gap: 16px; }
  .shop-product-art { min-height: 0; aspect-ratio: 1 / 1; }
  .product-buy-row { align-items: stretch; flex-direction: column; }
  .shop-buy-btn { width: 100%; }
}

@media (max-width: 420px) {
  .pet-wrap {
    width: 300px;
    height: 274px;
    transform: translateX(-50%) scale(.78);
  }

  .app[data-pack-count="2"] .pet-wrap,
  .companion-pet-wrap {
    width: 180px;
    height: 166px;
    transform: translateX(-50%) scale(.78);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }

  .pet-motion-layer,
  .companion-pet-motion-layer { display: none !important; }

  .pet.has-life-sprite.is-ludo-idle .pet-base,
  .pet.has-life-sprite.is-ludo-action .pet-base,
  .companion-pet-wrap.is-ludo-idle .companion-pet-image,
  .companion-pet-wrap.is-ludo-action .companion-pet-image { opacity: 1; }
}

.transaction-toast {
  position: fixed;
  z-index: 120;
  top: 82px;
  left: 50%;
  width: min(620px, calc(100% - 28px));
  padding: 14px 18px;
  border: 1px solid rgba(51, 130, 91, .3);
  border-radius: 8px;
  background: rgba(246, 255, 249, .97);
  box-shadow: 0 18px 48px rgba(49, 35, 22, .2);
  color: #235d42;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.7;
  text-align: center;
  transform: translateX(-50%);
}

.transaction-toast[data-tone="pending"] {
  border-color: rgba(169, 117, 40, .3);
  background: rgba(255, 250, 234, .98);
  color: #795219;
}

.transaction-toast[data-tone="error"] {
  border-color: rgba(172, 73, 64, .3);
  background: rgba(255, 245, 243, .98);
  color: #9a3f37;
}

.transaction-toast[hidden] { display: none; }

@media (max-width: 700px) {
  .transaction-toast { top: 70px; font-size: 13px; }
}
