/* KOF Fluffy Friends Spa */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  min-height: 100dvh;
  font-family: system-ui, "Segoe UI", Arial, sans-serif;
  color: #22463d;
  background: linear-gradient(160deg, #dff7ee 0%, #ffffff 50%, #e6f8f1 100%);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.hidden { display: none !important; }
.spa {
  max-width: 560px; margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top, 0px)) 14px max(40px, env(safe-area-inset-bottom, 0px));
}
.spa-top { display: flex; justify-content: space-between; align-items: center; }
.spa-back {
  color: #fff; background: #0b1a2a; text-decoration: none; font-weight: 800;
  padding: 8px 14px; border-radius: 999px;
}
.spa-wallet {
  background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 1.05rem;
  box-shadow: 0 2px 10px rgba(40, 140, 110, 0.18);
}
.spa-wallet span { font-size: 0.85rem; color: #5c8a7d; }
.spa-title { text-align: center; margin: 14px 0 10px; font-size: 1.8rem; color: #2fa58a; }
.spa-sub { margin: 18px 4px 10px; font-size: 1.15rem; }
.spa-note { text-align: center; margin: 6px 8px; color: #5c8a7d; font-size: 0.95rem; }
.spa-btn {
  border: 0; border-radius: 14px; padding: 12px 16px; font-size: 1rem; font-weight: 800; cursor: pointer;
  background: #2fa58a; color: #fff; box-shadow: 0 3px 0 #1f7d67;
}
.spa-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #1f7d67; }
.spa-btn:disabled { background: #c5dcd4; box-shadow: none; color: #fff; cursor: default; }
.spa-btn.gift { display: block; width: 100%; background: #f5a623; box-shadow: 0 3px 0 #c47f0c; }
.spa-stage { text-align: center; margin-top: 14px; }
.spa-portrait-wrap {
  position: absolute; left: 0; top: 0; width: var(--pet, 150px); aspect-ratio: 1; margin: 0;
  border-radius: 28px; overflow: hidden; cursor: pointer;
  box-shadow: 0 8px 26px rgba(40, 140, 110, 0.25); border: 5px solid #fff;
}
.spa-portrait { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.spa-portrait-wrap.wiggle .spa-portrait { animation: spa-wiggle 0.45s ease; }
@keyframes spa-wiggle { 0%,100% { transform: scale(1); } 30% { transform: scale(1.04) rotate(-1.5deg); } 60% { transform: scale(1.02) rotate(1.5deg); } }
.spa-hearts { position: absolute; inset: 0; pointer-events: none; }
.spa-heart { position: absolute; font-size: 1.8rem; animation: spa-float 1.1s ease-out forwards; }
@keyframes spa-float { from { opacity: 1; transform: translate(-50%, 0) scale(0.8); } to { opacity: 0; transform: translate(-50%, -90px) scale(1.25); } }
.spa-name { margin: 10px 0 2px; font-size: 1.4rem; }
.spa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.spa-card {
  background: #fff; border-radius: 16px; padding: 6px 6px 10px; text-align: center; border: 3px solid transparent;
  box-shadow: 0 2px 10px rgba(40, 140, 110, 0.14); cursor: pointer; font: inherit; color: inherit;
}
.spa-card img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 12px; display: block; background: linear-gradient(180deg, #fff3f8, #e9f7f1); }
.spa-card .nm { display: block; font-weight: 800; margin-top: 6px; font-size: 0.95rem; }
.spa-card .st { display: block; font-size: 0.8rem; color: #5c8a7d; margin-top: 2px; }
.spa-card.picked { border-color: #2fa58a; }
.spa-card.locked img { filter: grayscale(0.85) brightness(0.8); }
.spa-card.can-buy .st { color: #2f9e6a; font-weight: 800; }
.spa-toast {
  position: fixed; z-index: 100; left: 50%; top: calc(max(10px, env(safe-area-inset-top, 0px)) + 4px); bottom: auto; transform: translateX(-50%);
  background: rgba(25, 70, 58, 0.97); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 1rem;
  width: max-content; max-width: min(92vw, 520px); text-align: center; pointer-events: none; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
}
.spa-kind { font-size: 0.95rem; color: #5c8a7d; font-weight: 600; }
.spa-btn.small { padding: 7px 12px; font-size: 0.9rem; margin-top: 4px; background: #8fd3b8; box-shadow: 0 3px 0 #5fae90; color: #234; }
.spa-names { max-height: 230px; overflow-y: auto; padding: 4px; background: rgba(255,255,255,0.6); border-radius: 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0 4px; }
.spa-name-chip { border: 2px solid #bfe8d9; background: #fff; border-radius: 999px; padding: 6px 10px; font: inherit; font-weight: 700; color: #22463d; cursor: pointer; }
.spa-name-chip.picked { background: #2fa58a; border-color: #2fa58a; color: #fff; }
.spa-gear { border: 0; background: #fff; border-radius: 999px; width: 44px; height: 44px; min-width: 44px; min-height: 44px; font-size: 1.2rem; cursor: pointer; box-shadow: 0 2px 10px rgba(40, 140, 110, 0.18); }
.spa-top-right { display: flex; gap: 8px; align-items: center; }
.spa-settings { background: #fff; border-radius: 18px; padding: 12px 14px; margin-top: 12px; box-shadow: 0 4px 16px rgba(40, 140, 110, 0.2); }
.spa-settings h2 { margin: 0 0 8px; font-size: 1.05rem; }
.spa-music { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.spa-music button { border: 2px solid #bfe8d9; background: #f4fcf9; border-radius: 12px; padding: 10px 8px; font: inherit; font-weight: 700; color: #22463d; cursor: pointer; }
.spa-music button.picked { background: #2fa58a; border-color: #2fa58a; color: #fff; }

/* S1.5 Playpen */
.pen { margin-top: 18px; background: rgba(255,255,255,0.7); border-radius: 20px; padding: 10px 12px 12px; text-align: center; }
.pen .spa-sub { margin-top: 2px; }
.pen-meter { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; font-weight: 800; color: #22463d; }
.pen-lbl { white-space: nowrap; }
.pen-bar { flex: 1; height: 16px; background: #e3f5ee; border-radius: 999px; overflow: hidden; border: 2px solid #bfe8d9; }
.pen-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff9ec7, #ff5fa2); border-radius: 999px; transition: width 0.4s ease; }
.pen-bar.full i { background: linear-gradient(90deg, #ff5fa2, #f5a623); }
.pen-acts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pen-acts button { border: 2px solid #bfe8d9; background: #fff; border-radius: 14px; padding: 8px 2px; font: inherit; font-size: 0.82rem; font-weight: 800; color: #22463d; cursor: pointer; }
.pen-acts button.open { border-color: #2fa58a; background: #e3f5ee; }
.pen-acts button.done { box-shadow: inset 0 -3px 0 #ff9ec7; }
.pen-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.pen-prop { position: absolute; left: 50%; top: 18%; font-size: 3rem; pointer-events: none; transform: translateX(-50%); }
.pen-prop.fly { animation: pen-fly 1.3s ease-out forwards; }
.pen-prop.nap { top: 8%; animation: pen-doze 2.4s ease-in-out forwards; }
@keyframes pen-fly { 0% { opacity: 0; transform: translate(-50%, 40px) scale(0.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -30px) scale(1.2); } }
@keyframes pen-doze { 0% { opacity: 0; } 20%,80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -20px); } }
.pen-friend { position: absolute; right: 6px; bottom: 6px; width: 38%; height: 38%; object-fit: cover; border-radius: 18px; border: 4px solid #fff; animation: pen-hop 0.6s ease-in-out 3; }
@keyframes pen-hop { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.spa-portrait-wrap.t-nap .spa-portrait { filter: brightness(0.82) saturate(0.9); transition: filter 0.4s; }
.spa-portrait-wrap.t-bounce { animation: t-bounce 1.1s ease; }
.spa-portrait-wrap.t-wiggle { animation: t-wiggle 1.1s ease; }
.spa-portrait-wrap.t-spin { animation: t-spin 1.1s ease-in-out; }
.spa-portrait-wrap.t-wave { animation: t-wave 1.1s ease-in-out; }
.spa-portrait-wrap.t-hoop { animation: t-hoop 1.1s ease; }
.spa-portrait-wrap.t-roll { animation: t-roll 1.2s ease-in-out; }
.spa-portrait-wrap.t-dance { animation: t-dance 1.2s ease-in-out; }
.spa-portrait-wrap.t-tilt { animation: t-tilt 1.2s ease-in-out; }
.spa-portrait-wrap.t-slide { animation: t-slide 1.2s ease-in-out; }
.spa-portrait-wrap.t-shake { animation: t-shake .45s ease-in-out 3; }
.spa-portrait-wrap.t-tumble .spa-portrait { animation: t-tumble 1.7s ease-in-out !important; transform-origin: 50% 85%; }
@keyframes t-shake { 0%,100% { transform: translateX(0) rotate(0); } 20% { transform: translateX(-7px) rotate(-4deg); } 40% { transform: translateX(7px) rotate(4deg); } 60% { transform: translateX(-6px) rotate(-3deg); } 80% { transform: translateX(5px) rotate(3deg); } }
@keyframes t-tumble { 0% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-10px) rotate(-70deg) translateY(4px); } 45%,75% { transform: rotate(-88deg) translateY(10px); } 100% { transform: rotate(0) translateY(0); } }
@keyframes t-bounce { 0%,100% { transform: translateY(0); } 25% { transform: translateY(-26px); } 50% { transform: translateY(0); } 70% { transform: translateY(-12px); } }
@keyframes t-wiggle { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-5deg); } 40% { transform: rotate(5deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(3deg); } }
@keyframes t-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes t-wave { 0%,100% { transform: rotate(0); } 20%,60% { transform: rotate(-9deg); } 40%,80% { transform: rotate(9deg); } }
@keyframes t-hoop { 0%,100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-40px) scale(0.9); } 60% { transform: translateY(-40px) scale(0.9) rotate(8deg); } }
@keyframes t-roll { 0% { transform: translateX(0) rotate(0); } 50% { transform: translateX(30px) rotate(180deg); } 100% { transform: translateX(0) rotate(360deg); } }
@keyframes t-dance { 0%,100% { transform: translate(0) rotate(0); } 25% { transform: translate(-12px, -10px) rotate(-6deg); } 50% { transform: translate(0, 0) rotate(0); } 75% { transform: translate(12px, -10px) rotate(6deg); } }
@keyframes t-tilt { 0%,100% { transform: rotate(0); } 30%,50% { transform: rotate(-16deg); } 70%,85% { transform: rotate(14deg); } }
@keyframes t-slide { 0%,100% { transform: translateX(0) skewX(0); } 40% { transform: translateX(-34px) skewX(8deg); } 70% { transform: translateX(26px) skewX(-6deg); } }
@media (prefers-reduced-motion: reduce) { .spa-portrait-wrap[class*="t-"], .spa-portrait-wrap.t-tumble .spa-portrait { animation: none !important; } .pen-friend { animation: none; } }
@media (max-width: 360px) { .pen-acts { grid-template-columns: repeat(3, 1fr); } }
.spa-stage .spa-name { margin: 0 0 4px; }
.spa-stage #spa-rename-btn { margin-bottom: 10px; }
.pen { margin-top: 10px; }

/* Fluffy 2: the room is the whole screen (edge to edge, cover-fit), the page floats over it, and the friend wanders anywhere on it. */
html, body { overflow-x: hidden; }
.spa-room {
  position: fixed; inset: 0; width: auto; height: 100dvh; z-index: 0;
  --pet: clamp(120px, min(34vw, 30dvh), 220px);
  overflow: hidden;
  background:
    radial-gradient(ellipse 38% 9% at 50% 84%, rgba(255, 158, 199, 0.55), rgba(255, 158, 199, 0) 70%),
    linear-gradient(180deg, #fff3d6 0%, #ffe3b8 54%, #d9a86b 54%, #e8bf8a 100%);
}
.spa-room::before {
  content: ""; position: absolute; left: 0; right: 0; top: 54%; height: 10px;
  background: linear-gradient(180deg, rgba(120, 70, 20, 0.28), rgba(120, 70, 20, 0));
  pointer-events: none;
}
.spa { position: relative; z-index: 1; }
.spa { pointer-events: none; }
.spa * { pointer-events: auto; }
.spa .spa-stage { pointer-events: none; }
.spa-stage { min-height: clamp(120px, calc(100dvh - 470px), 70dvh); margin-top: 0; }
.spa .spa-stage * { pointer-events: auto; }
.spa-title, .spa-stage .spa-name { background: rgba(255, 255, 255, 0.82); border-radius: 16px; padding: 6px 16px; width: fit-content; margin-left: auto; margin-right: auto; }
.spa-stage .spa-name { margin-top: 6px; }
.spa-gift, .spa-settings { border-radius: 16px; }
.pen { background: rgba(255, 255, 255, 0.86); }
.spa section[aria-label="Pick a friend"] { background: rgba(255, 255, 255, 0.9); border-radius: 20px; padding: 4px 10px 14px; margin-top: 16px; }
.spa-room .spa-portrait-wrap { border: 0; border-radius: 50%; box-shadow: none; overflow: visible; background: none; }
.spa-room .spa-portrait { -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 56%, transparent 72%); mask-image: radial-gradient(circle at 50% 50%, #000 56%, transparent 72%); filter: drop-shadow(0 6px 10px rgba(60, 30, 0, 0.25)); }
.spa-room .spa-portrait-wrap { z-index: 2; transition: left 2.4s ease-in-out, top 2.4s ease-in-out; }
.spa-room .spa-portrait-wrap.still { transition: none; }
.spa-room .spa-portrait { scale: 1 1; }
.spa-room .spa-portrait-wrap.face-left .spa-portrait { scale: -1 1; }
.spa-room .spa-portrait.cutout { -webkit-mask-image: none; mask-image: none; filter: drop-shadow(0 6px 6px rgba(60, 30, 0, 0.28)); }
.spa-room .spa-portrait-wrap::before { content: ""; position: absolute; left: 22%; right: 22%; bottom: 4%; height: 9%; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(70, 35, 10, 0.3), rgba(70, 35, 10, 0) 70%); transform-origin: 50% 50%; animation: p-shadow-idle 3.6s ease-in-out infinite; z-index: -1; }
.spa-room .spa-portrait-wrap.walking::before { animation: p-shadow-walk 0.56s ease-in-out infinite; }
/* Photo animals: whole body breathes and hops; head is a second clipped layer that tilts at the neck. */
.spa-room .spa-portrait.cutout { transform-origin: 50% 94%; animation: pb-idle 3.6s ease-in-out infinite; }
.spa-room .spa-portrait-wrap.walking .spa-portrait.cutout { animation: pb-walk 0.56s ease-in-out infinite; }
@keyframes pb-idle { 0%,100% { transform: scale(1, 1); } 50% { transform: scale(1.012, 1.03); } }
@keyframes pb-walk { 0%,100% { transform: scale(1.05, .93) rotate(-2deg); } 25% { transform: translateY(-14px) scale(.96, 1.06) rotate(0deg); } 50% { transform: scale(1.05, .93) rotate(2deg); } 75% { transform: translateY(-14px) scale(.96, 1.06) rotate(0deg); } }
@keyframes p-shadow-idle { 0%,100% { transform: scale(1, 1); opacity: 1; } 50% { transform: scale(1.04, 1); opacity: .9; } }
@keyframes p-shadow-walk { 0%,100% { transform: scale(1.12, 1); opacity: 1; } 25%,75% { transform: scale(.82, .9); opacity: .6; } 50% { transform: scale(1.12, 1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .spa-room .spa-portrait-wrap { transition: none; }
  .spa-room .spa-portrait.cutout, .spa-room .spa-portrait-wrap::before { animation: none !important; }
}

/* Fluffy 3: room picker and room looks */
.spa-rooms { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 8px 0 10px; }
.spa-room-btn { border: 2px solid #bfe8d9; background: #fff; border-radius: 999px; padding: 8px 14px; min-height: 44px; min-width: 44px; box-sizing: border-box; font: inherit; font-weight: 800; color: #22463d; cursor: pointer; }
.spa-room-btn.picked { background: #2fa58a; border-color: #2fa58a; color: #fff; }
.room-decor { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.room-deco { position: absolute; font-size: calc(var(--pet) * 0.3 * var(--s, 1)); line-height: 1; user-select: none; }
.room-deco.flicker { animation: room-flicker 1.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes room-flicker { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 30% { transform: scale(1.08, 0.94) rotate(-2deg); opacity: 0.9; } 60% { transform: scale(0.96, 1.08) rotate(2deg); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .room-deco.flicker { animation: none; } }
.spa-room.room-pond {
  background:
    radial-gradient(ellipse 36% 11% at 48% 53%, #7fd0ee 0%, #4fb4e0 70%, rgba(79, 180, 224, 0) 72%),
    linear-gradient(180deg, #d4f0ff 0%, #eaf9ff 46%, #9ad66f 46%, #7cc65a 100%);
}
.spa-room.room-pond::before { background: linear-gradient(180deg, rgba(40, 110, 30, 0.25), rgba(40, 110, 30, 0)); }
.spa-room.room-backyard {
  background:
    linear-gradient(180deg, #bfe6ff 0%, #e6f6ff 38%, #b9e08a 54%, #8ccf5e 100%);
}
.spa-room.room-backyard::before { background: linear-gradient(180deg, rgba(40, 110, 30, 0.25), rgba(40, 110, 30, 0)); }
.pen-meter b { min-width: 3.8em; text-align: right; }

/* Fluffy home scene: cozy room drawn in code (fireplace, framed duck, couch, snowy window), UI floats over it. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spa-room.room-home {
  --u: min(1vw, 1.3dvh);
  --wall-top: #f2b98c; --wall-bot: #f7d3a3; --wall-size: 100% 54%; --wall-rep: no-repeat; --fl-size: 100% 46%; --fl-rep: no-repeat;
  --wall-pat: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 3.2vmin, transparent 3.2vmin 6.4vmin);
  --fl-top: #c98e55; --fl-bot: #dfa96e;
  --fl-pat: repeating-linear-gradient(0deg, rgba(120, 70, 20, 0.14) 0 2px, transparent 2px 5.5dvh);
  background:
    var(--fl-pat) 0 54% / var(--fl-size) var(--fl-rep),
    var(--wall-pat) 0 0 / var(--wall-size) var(--wall-rep),
    linear-gradient(180deg, var(--wall-top) 0%, var(--wall-bot) 54%, var(--fl-top) 54%, var(--fl-bot) 100%);
}
/* Cozy room wallpaper and floor looks (index = position in WALLS / FLOORS in spa.js). The same classes paint the little picker swatches. */
.spa-room.wall-1, .look-sw.wall-1 { --wall-top: #8fc7ee; --wall-bot: #cfe9fb; }
.spa-room.wall-2, .look-sw.wall-2 { --wall-top: #8fd6b4; --wall-bot: #d3f3e2; }
.spa-room.wall-3, .look-sw.wall-3 { --wall-top: #b9a3ec; --wall-bot: #e4daf9; }
.spa-room.wall-4, .look-sw.wall-4 { --wall-top: #f7d46a; --wall-bot: #fdecb0; --wall-pat: radial-gradient(circle, rgba(255, 255, 255, 0.55) 0.7vmin, transparent 0.9vmin) ; --wall-size: 5vmin 5vmin; --wall-rep: repeat; }
.spa-room.wall-5, .look-sw.wall-5 { --wall-top: #1c2a55; --wall-bot: #3a4c88; --wall-pat: radial-gradient(circle, rgba(255, 244, 190, 0.9) 0.25vmin, transparent 0.4vmin) ; --wall-size: 6vmin 6vmin; --wall-rep: repeat; }
.spa-room.floor-1, .look-sw.floor-1 { --fl-top: #dcbb86; --fl-bot: #ecd2a6; }
.spa-room.floor-2, .look-sw.floor-2 { --fl-top: #6b4126; --fl-bot: #86552f; --fl-pat: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 2px, transparent 2px 5.5dvh); }
.spa-room.floor-3, .look-sw.floor-3 { --fl-top: #f08fb7; --fl-bot: #f7b8d2; --fl-pat: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0.5vmin, transparent 0.7vmin) ; --fl-size: 3vmin 3vmin; --fl-rep: repeat; }
.spa-room.floor-4, .look-sw.floor-4 { --fl-top: #e9e2d4; --fl-bot: #f7f2e8; --fl-pat: repeating-conic-gradient(rgba(60, 60, 80, 0.2) 0 25%, transparent 0 50%) ; --fl-size: 9vmin 9vmin; --fl-rep: repeat; }
.look-block.hidden { display: none; }
.look-h { margin: 8px 0 6px; font-size: 0.95rem; color: #22463d; }
.look-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.look-tile { border: 2px solid #bfe8d9; background: #fff; border-radius: 14px; padding: 6px 4px; font: inherit; font-size: 0.78rem; font-weight: 800; color: #22463d; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.look-tile.picked { border-color: #ff7eb3; background: #fff1f7; }
.look-price { font-size: 0.7rem; font-weight: 700; color: #4b7a6d; }
.look-tile.locked .look-price { color: #b4457a; }
.look-tile:active { transform: translateY(2px); }
.look-sw { --wall-size: 14px 14px; --wall-rep: repeat; --fl-size: 14px 14px; --fl-rep: repeat; display: block; width: 100%; height: 34px; border-radius: 8px; background: linear-gradient(180deg, var(--wall-top, #f2b98c), var(--wall-bot, #f7d3a3)); }
.look-sw[class*="wall-"] { background: var(--wall-pat, none) 0 0 / var(--wall-size) var(--wall-rep), linear-gradient(180deg, var(--wall-top, #f2b98c), var(--wall-bot, #f7d3a3)); }
.look-sw[class*="floor-"] { background: var(--fl-pat, none) 0 0 / var(--fl-size) var(--fl-rep), linear-gradient(180deg, var(--fl-top, #c98e55), var(--fl-bot, #dfa96e)); }
.room-scene { display: none; position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.room-home .room-scene { display: block; }
.scene-in { position: absolute; top: 0; bottom: 0; left: 50%; width: calc(100 * var(--u)); transform: translateX(-50%); }
.sc-fireplace { position: absolute; left: 4%; bottom: calc(46% - 1.5 * var(--u)); width: calc(30 * var(--u)); aspect-ratio: 200 / 170; }
.sc-picture { position: absolute; left: 7%; bottom: calc(46% - 1.5 * var(--u) + 30 * var(--u) * 0.85 + 1.5 * var(--u)); width: calc(14 * var(--u)); aspect-ratio: 120 / 100; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3)); pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sc-window {
  position: absolute; right: calc(4% + 15 * var(--u)); bottom: calc(46% - 4 * var(--u) + 52 * var(--u) * 130 / 300 + 3 * var(--u));
  width: calc(22 * var(--u)); height: calc(17 * var(--u)); overflow: hidden;
  border: calc(1.1 * var(--u)) solid #fff6e2; border-radius: calc(1.4 * var(--u)) calc(1.4 * var(--u)) 0 0;
  background: linear-gradient(180deg, #223f6e, #5d86b8); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3), inset 0 0 12px rgba(0, 0, 20, 0.35);
}
.sc-window i { position: absolute; left: 50%; top: 0; bottom: 0; width: calc(0.9 * var(--u)); margin-left: calc(-0.45 * var(--u)); background: #fff6e2; }
.sc-window::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: calc(0.9 * var(--u)); background: #fff6e2; }
/* Window snow: two tiled layers, each one tile taller than the window and slid down exactly one tile (transform only), so the loop is seamless and runs on the compositor. The window box is the only clipped element. */
.sc-window, .sc-window .snow { pointer-events: none; }
.snow { position: absolute; left: 0; right: 0; top: -23px; bottom: 0; background-repeat: repeat; }
.snow.s1 { background-image: radial-gradient(circle, #fff 1.6px, transparent 2.2px), radial-gradient(circle, #fff 1.3px, transparent 1.9px), radial-gradient(circle, #fff 1.5px, transparent 2.1px); background-position: 0 0, 9px 12px, 14px 5px; background-size: 19px 23px; animation: snow-fall-a 4s linear infinite; }
.snow.s2 { top: -17px; background-image: radial-gradient(circle, rgba(255, 255, 255, 0.8) 1px, transparent 1.6px), radial-gradient(circle, rgba(255, 255, 255, 0.8) 1.1px, transparent 1.7px), radial-gradient(circle, rgba(255, 255, 255, 0.7) 1px, transparent 1.6px); background-size: 13px 17px; background-position: 6px 4px, 0 12px, 10px 9px; animation: snow-fall-b 2.6s linear infinite; }
@keyframes snow-fall-a { from { transform: translateY(0); } to { transform: translateY(23px); } }
@keyframes snow-fall-b { from { transform: translateY(0); } to { transform: translateY(17px); } }
.flame { transform-origin: 100px 148px; animation: room-flicker 1.2s ease-in-out infinite; }
.tab-hidden .snow, .tab-hidden .flame { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .flame, .snow, .snow.s1, .snow.s2 { animation: none; } }

/* Floating UI: everything sits over the room and only the controls take taps. */
.spa { max-width: none; margin: 0; padding: 0; position: static; }
.spa-top { position: fixed; z-index: 5; top: 0; left: 0; right: 0; padding: max(10px, env(safe-area-inset-top, 0px)) 12px 0; }
.spa-back { background: rgba(255, 255, 255, 0.88); border-radius: 999px; padding: 8px 14px; min-height: 44px; min-width: 44px; box-sizing: border-box; display: inline-flex; align-items: center; }
.spa-wallet { background: rgba(255, 255, 255, 0.9); border-radius: 999px; padding: 6px 12px; }
.spa-gift { position: fixed; z-index: 5; top: calc(max(10px, env(safe-area-inset-top, 0px)) + 52px); left: 12px; width: auto; }
.spa-btn.gift { width: auto; padding: 8px 14px; font-size: 0.9rem; min-height: 44px; box-sizing: border-box; }
#spa-gift-note { display: none; }
.spa-stage { position: fixed; z-index: 5; top: calc(max(10px, env(safe-area-inset-top, 0px)) + 52px); left: 50%; transform: translateX(-50%); min-height: 0; text-align: center; pointer-events: none; }
.spa-stage .spa-name { margin: 0; font-size: 1.1rem; white-space: nowrap; }
@media (max-width: 520px) { .spa-stage { top: calc(max(10px, env(safe-area-inset-top, 0px)) + 96px); } .spa-gift { top: calc(max(10px, env(safe-area-inset-top, 0px)) + 52px); } }
.spa-settings { position: fixed; z-index: 6; top: calc(max(10px, env(safe-area-inset-top, 0px)) + 52px); right: 12px; width: min(300px, calc(100vw - 24px)); margin: 0; }
.spa-dock { position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; align-items: center; gap: 10px; padding: 8px 12px max(12px, env(safe-area-inset-bottom, 0px)); pointer-events: none; }
.spa-dock > * { pointer-events: auto; }
.spa-dock-btn, .dock-meter { border: 0; background: rgba(255, 255, 255, 0.92); border-radius: 999px; padding: 10px 16px; min-height: 44px; box-sizing: border-box; font: inherit; font-weight: 800; color: #22463d; box-shadow: 0 3px 10px rgba(60, 30, 0, 0.25); cursor: pointer; }
.dock-meter { cursor: default; }
.spa-sheet { position: fixed; z-index: 8; left: 50%; bottom: 0; transform: translateX(-50%); width: min(640px, 100vw); max-height: 72dvh; overflow-y: auto; background: rgba(255, 255, 255, 0.97); border-radius: 22px 22px 0 0; padding: 6px 14px max(18px, env(safe-area-inset-bottom, 0px)); box-shadow: 0 -6px 24px rgba(40, 20, 0, 0.3); }
.sheet-x { position: absolute; top: 8px; right: 10px; border: 0; background: #e3f5ee; border-radius: 999px; width: 34px; height: 34px; font-size: 1rem; font-weight: 800; cursor: pointer; color: #22463d; }
.spa section[aria-label="Pick a friend"] { background: none; }
.spa-pop { position: fixed; z-index: 9; inset: 0; background: rgba(30, 15, 0, 0.08); }
.pop-card { position: absolute; left: 0; top: 0; width: 0; height: 0; margin: 0; padding: 0; background: none; box-shadow: none; }
.pop-img { display: none; }
.pop-bubble { position: fixed; z-index: 2; width: min(250px, calc(100vw - 16px)); background: #fffdf6; border-radius: 20px; padding: 8px 14px 10px; text-align: center; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.32); animation: pop-zoom 0.25s ease-out; }
.pop-bubble::after { content: ""; position: absolute; left: var(--tail, 50%); bottom: -9px; width: 18px; height: 18px; background: #fffdf6; transform: translateX(-50%) rotate(45deg); border-radius: 0 0 5px 0; }
@keyframes pop-zoom { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pop-name { margin: 0 22px 2px; font-size: 1.05rem; }
.pop-x { position: absolute; top: 5px; right: 6px; border: 0; background: #e3f5ee; border-radius: 999px; width: 26px; height: 26px; font-size: 0.8rem; font-weight: 800; cursor: pointer; color: #22463d; }
.pop-bubble .pen-meter { margin: 2px 0 4px; gap: 6px; }
.pop-bubble .pen-bar { height: 12px; }
.pop-bubble .pen-meter b { min-width: 3.2em; font-size: 0.85rem; }
.pop-say { margin: 2px 0 0; color: #22463d; font-size: 0.92rem; font-weight: 700; line-height: 1.25; }
.pop-ring { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 2; }
.pop-tile { position: absolute; width: 60px; height: 60px; margin: -30px 0 0 -30px; left: 0; top: 0; border: 3px solid #fff; border-radius: 50%; padding: 0; font: inherit; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35); transform: translate(0, 0) scale(0.3); opacity: 0; transition: transform 0.32s cubic-bezier(0.3, 1.5, 0.5, 1), opacity 0.2s; transition-delay: calc(var(--i) * 45ms); }
.pop-tile em { font-style: normal; font-size: 1.45rem; line-height: 1; }
.pop-tile span { font-size: 0.62rem; font-weight: 900; line-height: 1.1; }
.spa-pop.ring-on .pop-tile { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(1); opacity: 1; }
.pop-tile[data-group="play"] { background: #ff8a3d; }
.pop-tile[data-group="sleep"] { background: #6c7ae0; }
.pop-tile[data-group="feed"] { background: #34b27b; }
.pop-tile[data-group="other"] { background: #d96bc4; }
.pop-tile.open { outline: 4px solid #22463d; }
.spa-pop.ring-on .pop-tile:active { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(0.92); }
.pop-tray { position: fixed; z-index: 2; left: 50%; bottom: calc(max(12px, env(safe-area-inset-bottom, 0px)) + 58px); transform: translateX(-50%); width: min(420px, calc(100vw - 16px)); display: flex; flex-direction: column; align-items: center; }
.pop-tray:empty { display: none; }
.pop-tray .pen-choices, .pop-tray .pop-sub { background: rgba(255, 253, 246, 0.97); border-radius: 18px; padding: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); margin: 6px 0 0; }
.pop-tray .pop-sub.hidden, .pop-tray .pen-choices.hidden { display: none; }
.pen-acts { display: block; }
.pop-sub { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pop-sub button { border: 2px solid #bfe8d9; background: #fff; border-radius: 14px; padding: 9px 12px; font: inherit; font-size: 0.95rem; font-weight: 800; color: #22463d; cursor: pointer; }
.pop-sub button.open { border-color: #2fa58a; background: #e3f5ee; }
.pop-sub button.done { box-shadow: inset 0 -3px 0 #ff9ec7; }
.pen { background: none; padding: 14px; margin-top: 0; }
.spa-back { color: #22463d; font-weight: 800; text-decoration: none; }
@media (min-width: 521px) { .spa-stage { left: 38%; } }

/* Name picker: suggestions, theme tabs, Random */
.name-sug-label { font-weight: 800; color: #22463d; margin: 6px 4px 4px; }
.name-sug-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px 6px; }
.name-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; -webkit-overflow-scrolling: touch; }
.name-tab { flex: 0 0 auto; border: 2px solid #bfe8d9; background: #fff; color: #22463d; border-radius: 999px; padding: 6px 12px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.name-tab.on { background: #2fa58a; border-color: #2fa58a; color: #fff; }
.name-random { display: block; margin: 8px auto 2px; border: 0; border-radius: 999px; padding: 10px 20px; font: inherit; font-weight: 800; color: #fff; background: #e8718f; cursor: pointer; }

/* Furniture: drawn in code, draggable anywhere in the room, saved per room. */
.room-furn { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.furn { position: absolute; pointer-events: auto; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; filter: drop-shadow(0 4px 4px rgba(60, 30, 0, 0.3)); }
.furn::before { content: ""; position: absolute; inset: -8px; }
.furn svg { width: 100%; height: 100%; display: block; overflow: visible; pointer-events: none; }
.furn.t-rug { filter: none; opacity: 0.92; }
.furn.drag { cursor: grabbing; filter: drop-shadow(0 12px 10px rgba(60, 30, 0, 0.4)); }
.furn.drag svg { transform: translateY(-5px) scale(1.03); }
.furn.sel { outline: 3px dashed rgba(255, 255, 255, 0.95); outline-offset: 4px; border-radius: 10px; }
.furn-x { display: none; position: absolute; top: -18px; right: -18px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #ff6b6b; color: #fff; font-weight: 900; font-size: 1rem; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); z-index: 3; }
.furn.sel .furn-x { display: block; }
.furn-paint { display: none; position: absolute; top: -18px; left: -18px; width: 36px; height: 36px; padding: 2px; border: 0; border-radius: 50%; background: #fff; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); z-index: 3; }
.furn-paint svg { width: 100%; height: 100%; display: block; }
.furn.sel .furn-paint { display: block; }
.paint-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.paint-swatch { border: 2px solid #bfe8d9; background: #fff; border-radius: 14px; padding: 8px 4px; font: inherit; font-size: 0.8rem; font-weight: 800; color: #22463d; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.paint-swatch i { display: block; width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #bfe8d9, 0 2px 4px rgba(0, 0, 0, 0.2); }
.paint-swatch.orig i { background: conic-gradient(#ff6b6b, #ffd25e, #4fb36b, #4f8fd6, #8f7ae0, #ff6b6b); }
.paint-swatch:active { transform: translateY(2px); }
.room-bathroom .room-decor { z-index: 0; }
.furn-help { margin: 0 0 8px; font-size: 0.9rem; color: #5c8a7d; font-weight: 600; }
.furn-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.furn-tile { border: 2px solid #bfe8d9; background: #fff; border-radius: 14px; padding: 8px 4px; font: inherit; font-size: 0.8rem; font-weight: 800; color: #22463d; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.furn-tile svg { width: 100%; height: 44px; display: block; }
.furn-tile:active { transform: translateY(2px); }
@media (max-width: 440px) { .spa-dock { gap: 6px; padding-left: 6px; padding-right: 6px; } .spa-dock-btn, .dock-meter { padding: 9px 10px; font-size: 0.85rem; } }

/* Drag animals */
.spa-portrait-wrap { touch-action: none; }
.spa-room .spa-portrait-wrap.held { cursor: grabbing; z-index: 12 !important; animation: p-held 0.2s ease-in-out infinite; }
.spa-room .spa-portrait-wrap.held::before { opacity: 0.4; transform: scale(0.7, 0.8); animation: none; }
.spa-room .spa-portrait-wrap.dropped { animation: p-drop 1.1s ease-out; }
@keyframes p-held { 0%,100% { rotate: -7deg; translate: 0 -6px; } 50% { rotate: 7deg; translate: 0 -10px; } }
@keyframes p-drop { 0% { translate: 0 -26px; scale: .94 1.08; } 30% { translate: 0 0; scale: 1.14 .84; } 52% { translate: 0 -22px; scale: .97 1.05; } 72% { translate: 0 0; scale: 1.07 .92; } 86% { translate: 0 -7px; scale: 1 1; } 100% { translate: 0 0; scale: 1 1; } }
@media (prefers-reduced-motion: reduce) { .spa-room .spa-portrait-wrap.held, .spa-room .spa-portrait-wrap.dropped { animation: none; } }
.spa-card.rare { border-color: #e6b800; }
.spa-card.rare .st { color: #a8860a; }
.say-bubble { z-index: 7; width: auto; max-width: min(250px, calc(100vw - 16px)); padding: 7px 12px; font-weight: 700; font-size: 0.92rem; color: #22463d; pointer-events: none; display: none; }

/* Kitchen sheet */
.spa-sheet.kit { background: repeating-linear-gradient(45deg, #fff8ee 0 14px, #ffeedd 14px 28px); }
.kit-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 6px; }
.kit-pick { border: 2px solid #f1c27a; background: #fff; border-radius: 14px; padding: 12px 8px; font: inherit; font-weight: 800; color: #5a3a12; cursor: pointer; min-height: 48px; }
.kit-pick.fav { border-color: #f5a623; background: #fff3d6; }
.kit-stage { text-align: center; margin-top: 8px; }
.kit-step { margin: 0 0 6px; font-weight: 700; color: #5a3a12; min-height: 1.4em; }
.kit-bowl { font-size: 2.6rem; min-height: 64px; line-height: 1.2; }
.kit-bowl.stir { animation: kit-stir 0.35s ease; }
@keyframes kit-stir { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-12deg) scale(1.08); } 75% { transform: rotate(12deg) scale(1.08); } }
.kit-item.kit-word { width: auto; min-width: 104px; padding: 0 14px; font-size: 1.05rem; font-weight: 800; color: #5a3a12; }
.kit-items { display: flex; justify-content: center; gap: 10px; margin: 6px 0 10px; }
.kit-item { font-size: 2rem; width: 64px; height: 64px; border-radius: 16px; border: 2px solid #f1c27a; background: #fff; cursor: pointer; }
.kit-item:disabled { opacity: 0.3; cursor: default; }
@media (prefers-reduced-motion: reduce) { .kit-bowl.stir { animation: none; } }

/* Stickers */
.spa-dock-btn, .dock-meter { white-space: nowrap; }
@media (max-width: 440px) { .spa-dock { gap: 4px; padding-left: 4px; padding-right: 4px; } .spa-dock-btn, .dock-meter { padding: 8px 7px; font-size: 0.74rem; } }
.stk-pack { text-align: center; margin: 4px 0 8px; }
.stk-odds { margin: 6px 0 0; font-size: 0.78rem; color: #4a6b62; line-height: 1.35; }
.stk-reveal { display: flex; justify-content: center; gap: 10px; margin: 6px 0 10px; }
.stk-card { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 92px; min-height: 96px; padding: 6px 4px; border-radius: 16px; background: #fff7e0; box-shadow: 0 3px 10px rgba(60, 30, 0, 0.2); text-align: center; }
.stk-card em { font-style: normal; font-size: 2.2rem; line-height: 1.1; }
.stk-card small { font-size: 0.72rem; font-weight: 800; color: #22463d; }
.stk-card b { font-size: 0.68rem; color: #b36b00; }
.stk-card.back { background: #ffd25e; animation: stk-wob 0.5s ease-in-out infinite alternate; }
.stk-card.front { animation: stk-flip 0.35s ease-out; }
.stk-card.rar1 { background: #e4f1ff; box-shadow: 0 0 0 2px #6aa7d8, 0 3px 10px rgba(60, 30, 0, 0.2); }
.stk-card.rar2 { background: #fff0a8; box-shadow: 0 0 0 3px #f2a93b, 0 0 16px #ffd25e; }
.stk-card.fresh::after { content: "NEW"; font-size: 0.6rem; font-weight: 900; color: #fff; background: #e8665a; border-radius: 999px; padding: 1px 6px; margin-top: 2px; }
@keyframes stk-wob { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes stk-flip { from { transform: scaleX(0.1); } to { transform: scaleX(1); } }
.stk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; padding-bottom: 6px; }
.stk-chip { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; border-radius: 14px; padding: 8px 2px 6px; background: #eef7f3; font: inherit; color: #22463d; cursor: pointer; }
.stk-chip .stk-em { font-size: 1.9rem; line-height: 1.1; }
.stk-chip small { font-size: 0.68rem; font-weight: 800; }
.stk-chip i { font-style: normal; font-size: 0.6rem; color: #7a5a00; }
.stk-chip.locked .stk-em { filter: brightness(0); opacity: 0.22; }
.stk-chip.locked small { color: #8aa59c; }
.stk-chip.rar1.owned { background: #e4f1ff; }
.stk-chip.rar2.owned { background: #fff0a8; box-shadow: 0 0 0 2px #f2a93b; }
.stk-chip.fresh::after { content: ""; position: absolute; top: 4px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: #e8665a; }
@media (prefers-reduced-motion: reduce) { .stk-card.back, .stk-card.front { animation: none; } }
/* Code-drawn scenery. Each piece stands on its base line (top is the base, lifted by its own height). */
.room-deco.art { font-size: 0; transform: translateY(-100%); width: calc(var(--pet, 150px) * var(--w, 1)); }
.room-deco.art svg { display: block; width: 100%; height: auto; }
.room-deco.art.art-fence { width: 100%; height: 15%; }
.room-deco.art.art-fence svg { height: 100%; }
.room-deco.art.art-kitchen { left: 0 !important; top: 0 !important; width: 100%; height: 100%; transform: none; }
.room-deco.art.art-bathroom { left: 0 !important; top: 0 !important; width: 100%; height: 100%; transform: none; }
.room-deco.art.art-kitchen svg { height: 100%; }
.room-deco.art.art-bathroom svg { height: 100%; }
.room-deco.art.art-pondbg { left: 0 !important; top: 0 !important; width: 100%; height: 100%; transform: none; }
.room-deco.art.art-pondbg svg { height: 100%; }
.room-pond .room-decor { z-index: 0; }
.room-deco.art.art-bedroom { left: 0 !important; top: 0 !important; width: 100%; height: 100%; transform: none; }
.room-deco.art.art-bedroom svg { height: 100%; }
.room-bedroom .room-decor { z-index: 0; }
.spa-room.room-bedroom {
  background: linear-gradient(180deg, #fff0f8 0%, #ffe6d4 46%, #f6d2b0 46%, #e4ae7e 100%);
}
.spa-room.room-bedroom::before {
  top: 46%;
  height: 16px;
  background: linear-gradient(180deg, rgba(150, 90, 110, 0.14), rgba(150, 90, 110, 0));
}
.room-deco.art.art-bedlights { left: 0 !important; width: 100%; height: auto; transform: none; }
.room-deco.art.art-bedlights svg { width: 100%; height: auto; }
.room-bedroom .art-bedmoon { animation: bed-drift 7s ease-in-out infinite; }
.room-bedroom .art-bedzzz { animation: bed-float 3.2s ease-in-out infinite; }
.room-bedroom .art-bedstars { animation: bed-twinkle 2.4s ease-in-out infinite; }
/* Fairy-light halos. The pulse is the animation; reduced motion leaves the painted glow in place. */
.room-bedroom .bed-lamp { animation: bed-glow 2.2s ease-in-out infinite; }
@keyframes bed-drift { 0%, 100% { transform: translateY(-100%) translateX(0); } 50% { transform: translateY(-112%) translateX(8px); } }
@keyframes bed-float { 0%, 100% { transform: translateY(-100%); } 50% { transform: translateY(-128%); } }
@keyframes bed-twinkle { 0%, 100% { transform: translateY(-100%); opacity: 1; } 50% { transform: translateY(-100%); opacity: 0.35; } }
@keyframes bed-glow { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .room-bedroom .art-bedmoon, .room-bedroom .art-bedzzz, .room-bedroom .art-bedstars, .room-bedroom .bed-lamp { animation: none; }
}
.tab-hidden .room-bedroom .art-bedmoon, .tab-hidden .room-bedroom .art-bedzzz, .tab-hidden .room-bedroom .art-bedstars, .tab-hidden .room-bedroom .bed-lamp { animation-play-state: paused; }
.spa-room.room-kitchen { background: #d3f1ea; }
.spa-room.room-kitchen::before { background: linear-gradient(180deg, rgba(255, 230, 170, 0.18), rgba(255, 230, 170, 0)); }
.spa-room .spa-portrait-wrap.k-chef::after { content: "\1F9D1\200D\1F373"; position: absolute; left: 50%; top: -6%; transform: translateX(-50%); font-size: calc(var(--pet, 150px) * 0.26); line-height: 1; pointer-events: none; z-index: 3; }
.spa-room .spa-portrait-wrap.k-bob { animation: k-bob 1.2s ease-in-out infinite; }
@keyframes k-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@media (prefers-reduced-motion: reduce) { .spa-room .spa-portrait-wrap.k-bob { animation: none; } }
.tab-hidden .spa-portrait-wrap.k-bob, .tab-hidden .room-deco.flicker { animation-play-state: paused; }

/* Daily spin, eggs and hats */
.spa-gift { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.spin-pill { position: fixed; z-index: 5; right: 12px; top: calc(max(10px, env(safe-area-inset-top, 0px)) + 52px); width: auto; padding: 8px 14px; min-height: 44px; box-sizing: border-box; font-size: 0.9rem; }
.spin-stage { position: relative; width: min(190px, 50vw); margin: 4px auto 0; }
.spin-pointer { position: absolute; left: 50%; top: -12px; transform: translateX(-50%); font-size: 1.4rem; color: #d6336c; z-index: 2; line-height: 1; }
.spin-wheel { width: 100%; aspect-ratio: 1; }
.spin-svg { width: 100%; height: 100%; display: block; border-radius: 50%; box-shadow: 0 3px 12px rgba(60, 30, 0, 0.3); }
.spin-result { min-height: 2.6em; text-align: center; font-weight: 800; color: #22463d; margin: 6px 0; }
.spin-h { margin: 8px 0 4px; font-size: 1rem; color: #22463d; }
.spin-nest, .spin-hats { display: flex; gap: 8px; flex-wrap: wrap; }
.nest-slot, .hat-chip { border: 2px solid #cfe9df; background: #f3fbf8; border-radius: 14px; min-width: 44px; height: 46px; padding: 0 6px; font-size: 1.4rem; cursor: pointer; font-family: inherit; }
.nest-slot.empty { opacity: 0.5; cursor: default; }
.nest-slot.ready { border-color: #ffb703; background: #fff7dd; }
.nest-slot.cracking { animation: nest-wobble 0.4s ease-in-out 3; }
.hat-chip.locked { opacity: 0.45; cursor: default; filter: grayscale(1); }
.hat-chip.worn { border-color: #22463d; background: #e3f5ee; }
.spa-btn.done { opacity: 0.6; }
.spa-hat { position: absolute; transform: translateX(-50%); line-height: 1; pointer-events: none; z-index: 3; user-select: none; }
@keyframes nest-wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { .nest-slot.cracking { animation: none; } }

/* Crew: up to 3 friends in the room */
.crew-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0 2px; }
.crew-chip { display: inline-flex; align-items: center; background: #eaf6f1; border: 2px solid transparent; border-radius: 999px; overflow: hidden; }
.crew-chip.on { border-color: #2fa58a; background: #d6f1e7; }
.crew-chip button { border: 0; background: none; font: inherit; font-weight: 800; color: #22463d; padding: 8px 12px; min-height: 44px; cursor: pointer; }
.crew-chip .crew-x { padding: 8px 10px; border-left: 2px solid rgba(47, 165, 138, 0.25); }
.crew-hint { text-align: center; font-size: 0.85rem; color: #5c8a7d; margin: 2px 0 8px; }
.spa-card.in-crew { box-shadow: 0 0 0 3px rgba(47, 165, 138, 0.35); }

/* Name tags, speech bubbles and the Call button. */
.slot-tag { position: absolute; left: 50%; top: 86%; transform: translateX(-50%); z-index: 6; max-width: 92%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 0.78rem; font-weight: 800; line-height: 1.2; color: #fff; background: rgba(34, 70, 61, 0.82); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); cursor: pointer; touch-action: manipulation; pointer-events: auto; }
.slot-tag.hidden { display: none; }
.spa-portrait-wrap.is-active .slot-tag { background: rgba(255, 138, 31, 0.92); }
.spa-room .spa-portrait-wrap.has-bub { z-index: 9; }
.spa-bubble { position: absolute; left: 50%; bottom: 92%; transform: translateX(-50%); z-index: 7; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 12px; border-radius: 16px; background: #fff; color: #22463d; font-size: 0.85rem; font-weight: 800; box-shadow: 0 3px 8px rgba(60, 30, 0, 0.25); pointer-events: none; animation: bubble-pop 0.25s ease-out; }
@keyframes bubble-pop { from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.85); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }
.spa-bubble.fight { white-space: normal; width: max-content; max-width: 124px; overflow: visible; text-align: center; line-height: 1.15; }
.spa-bubble.fight.hi { bottom: 140%; }
.spa-bubble.long { white-space: normal; width: max-content; max-width: 190px; overflow: visible; text-align: center; line-height: 1.2; }
@media (prefers-reduced-motion: reduce) { .spa-bubble { animation: none; } }
.call-btn { position: fixed; right: 10px; bottom: 72px; z-index: 8; display: flex; align-items: center; gap: 4px; border: 0; border-radius: 999px; padding: 9px 13px; font: inherit; font-size: 0.85rem; font-weight: 800; color: #fff; background: #ff8a1f; box-shadow: 0 3px 10px rgba(60, 30, 0, 0.3); cursor: pointer; touch-action: manipulation; }
.call-btn.hidden { display: none; }

/* Welcome intro */
.spa-replay { width: 100%; border: 2px solid #bfe8d9; background: #f4fcf9; border-radius: 12px; padding: 10px 8px; font: inherit; font-weight: 700; color: #22463d; cursor: pointer; }
a.lib-open { display: flex; align-items: center; justify-content: center; min-height: 44px; box-sizing: border-box; text-decoration: none; text-align: center; }
a.lib-fab {
  position: fixed; z-index: 6; left: 10px; bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  min-height: 44px; min-width: 44px; padding: 8px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.95); color: #22463d; font-weight: 800; text-decoration: none;
  box-shadow: 0 3px 10px rgba(60, 30, 0, 0.25);
}
.intro { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(34, 70, 61, 0.6); }
.intro-card { position: relative; width: min(380px, 100%); max-height: calc(100dvh - 28px); overflow-y: auto; background: #fffdf6; border-radius: 24px; padding: 38px 16px 16px; text-align: center; box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4); color: #22463d; }
.intro-skip { position: absolute; top: 8px; right: 10px; border: 0; background: transparent; font: inherit; font-weight: 800; color: #5b7d73; padding: 6px 10px; cursor: pointer; border-radius: 10px; }
.intro button:focus-visible { outline: 3px solid #ff8a3d; outline-offset: 2px; }
.intro-title { margin: 0 0 6px; font-size: 1.35rem; line-height: 1.2; }
.intro-sub { margin: 0 0 10px; font-weight: 700; color: #4d6f65; }
.intro-sub2 { margin: 10px 0 6px; font-size: 1rem; }
.intro-wave-row { display: flex; justify-content: center; gap: 8px; margin: 8px 0 4px; }
.intro-wave { width: 30%; max-width: 100px; aspect-ratio: 1; object-fit: contain; transform-origin: 50% 90%; animation: intro-wave 1.4s ease-in-out infinite; }
@keyframes intro-wave { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg) translateY(-6px); } }
.intro-pick-row { display: flex; justify-content: center; gap: 8px; }
.intro-pick { flex: 1; border: 3px solid #bfe8d9; background: #fff; border-radius: 16px; padding: 6px 4px; font: inherit; font-weight: 800; color: #22463d; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.intro-pick img { width: 100%; max-width: 84px; aspect-ratio: 1; object-fit: contain; }
.intro-pick.on { border-color: #ff8a3d; background: #fff1e4; }
.intro-name-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.intro-tour { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.intro-tour-row { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 16px; border: 3px solid transparent; transition: background 0.25s, border-color 0.25s, transform 0.25s; }
.intro-tour-row.hl { background: #fff1e4; border-color: #ff8a3d; transform: scale(1.03); }
.intro-tile { width: 48px; height: 48px; flex: none; border: 3px solid #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 1.4rem; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); }
.intro-tile.t0 { background: #ff8a3d; }
.intro-tile.t1 { background: #6c7ae0; }
.intro-tile.t2 { background: #34b27b; }
.intro-tile.t3 { background: #d96bc4; }
.intro-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.intro-dots { display: flex; gap: 6px; }
.intro-dot { width: 10px; height: 10px; border-radius: 50%; background: #cfe3dc; }
.intro-dot.on { background: #2fa58a; }
.intro-next { border: 0; background: #ff8a3d; color: #fff; font: inherit; font-weight: 900; font-size: 1.05rem; padding: 12px 24px; border-radius: 999px; cursor: pointer; box-shadow: 0 3px 0 #c9651f; }
@media (prefers-reduced-motion: reduce) { .intro-wave { animation: none; } .intro-tour-row { transition: none; } }

.slot-hit { position: absolute; inset: 0; z-index: 1; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; pointer-events: none; }
.slot-hit:focus-visible { outline: 3px solid #ff8a3d; outline-offset: -2px; }

.spa-zzz { position: absolute; z-index: 30; font-weight: 900; color: #2f5fe0; pointer-events: none; -webkit-text-stroke: 3px #fff; paint-order: stroke fill; text-shadow: 0 2px 6px rgba(20, 40, 120, 0.45); animation: spa-zzz-float 3.2s ease-out forwards; }
@keyframes spa-zzz-float { from { opacity: 0; transform: translate(0, 0) scale(.7); } 15% { opacity: 1; } 70% { opacity: 1; } to { opacity: 0; transform: translate(34px, -120px) scale(1.2) rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { .spa-zzz { animation: none; opacity: .9; } }
/* Smaller Friends and Furniture menus: shorter sheet, tighter tiles. */
#sheet-friends, #sheet-furn, #sheet-rooms, #sheet-paint, #sheet-homes, #sheet-stickers, #sheet-names { width: min(500px, 100vw); max-height: 42dvh; padding-top: 4px; }
#sheet-friends .spa-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
#sheet-friends .spa-grid { gap: 5px; align-items: start; }
#sheet-friends .spa-card { padding: 3px 3px 5px; border-width: 2px; border-radius: 12px; }
#sheet-friends .spa-card img { border-radius: 9px; }
#sheet-friends .spa-card .nm { font-size: 0.74rem; margin-top: 3px; }
#sheet-friends .spa-card .st { font-size: 0.64rem; margin-top: 0; }
#sheet-friends .crew-chip button { padding: 4px 10px; min-height: 36px; font-size: 0.9rem; }
#sheet-furn .furn-grid { gap: 5px; margin-bottom: 4px; }
#sheet-furn .furn-tile, #sheet-furn .paint-swatch { padding: 4px 3px; border-radius: 10px; font-size: 0.7rem; }
#sheet-furn .furn-tile svg { height: 28px; }
#sheet-furn .paint-swatch i { width: 24px; height: 24px; }
#sheet-furn .look-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-bottom: 4px; }
#sheet-furn .look-tile { padding: 3px 3px; border-radius: 10px; font-size: 0.68rem; gap: 2px; }
#sheet-furn .look-h { margin: 4px 0 3px; font-size: 0.85rem; }
#sheet-furn .look-sw { height: 20px; }
#sheet-furn .furn-help { font-size: 0.8rem; margin-bottom: 4px; }
/* Mud on a friend: painted through the friend's own silhouette (mask set in JS), never on the grass. */
.dirt-fx { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; mix-blend-mode: multiply; -webkit-mask-size: cover; mask-size: cover; -webkit-mask-position: center; mask-position: center; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.dirt-fx.dirty-1 { background: radial-gradient(circle at 28% 70%, rgba(120,78,36,.55) 0 7%, transparent 8%), radial-gradient(circle at 66% 82%, rgba(120,78,36,.5) 0 5%, transparent 6%), linear-gradient(rgba(150,105,60,.12), rgba(150,105,60,.12)); }
.dirt-fx.dirty-2 { background: radial-gradient(circle at 28% 70%, rgba(110,70,30,.62) 0 10%, transparent 11%), radial-gradient(circle at 66% 82%, rgba(110,70,30,.6) 0 8%, transparent 9%), radial-gradient(circle at 50% 38%, rgba(110,70,30,.5) 0 7%, transparent 8%), radial-gradient(circle at 76% 52%, rgba(110,70,30,.5) 0 5%, transparent 6%), linear-gradient(rgba(150,105,60,.28), rgba(150,105,60,.28)); }
.dirt-fx.dirty-3 { background: radial-gradient(circle at 28% 70%, rgba(95,60,25,.7) 0 14%, transparent 15%), radial-gradient(circle at 66% 82%, rgba(95,60,25,.68) 0 11%, transparent 12%), radial-gradient(circle at 50% 38%, rgba(95,60,25,.6) 0 10%, transparent 11%), radial-gradient(circle at 76% 52%, rgba(95,60,25,.6) 0 8%, transparent 9%), radial-gradient(circle at 24% 34%, rgba(95,60,25,.55) 0 7%, transparent 8%), radial-gradient(circle at 54% 64%, rgba(95,60,25,.55) 0 9%, transparent 10%), linear-gradient(rgba(140,95,50,.42), rgba(140,95,50,.42)); }
.dirt-fx.hidden { display: none; }
/* Bath fun: a sponge or towel that follows the finger, bubbles per stroke, shower drops. */
.wash-tool { position: absolute; width: 46px; height: 32px; margin: -16px 0 0 -23px; border-radius: 10px; pointer-events: none; z-index: 3; transform: rotate(-12deg); }
.wash-tool.sponge { background: #ffd84a; border: 3px solid #e0a800; }
.wash-tool.towel { background: #7fd0ee; border: 3px solid #3b9fd0; }
.wash-tool.hidden { display: none; }
.wash-suds { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: #fff; border: 3px solid #6cc3ea; pointer-events: none; z-index: 2; opacity: 0; }
.wash-suds.pop { animation: wash-suds-pop 1.1s ease-out forwards; }
.wash-drop { position: absolute; top: -14px; width: 10px; height: 14px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #6cc3ea; pointer-events: none; z-index: 3; opacity: 0; }
.wash-pad.rinsing .wash-drop { animation: wash-drop-fall 0.9s linear infinite; }
.wash-pad.rinsing .wash-bubbles i { animation: wash-bubble-away 1.3s ease-in forwards; }
@keyframes wash-suds-pop { 0% { transform: scale(.4); opacity: 0; } 25% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes wash-drop-fall { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(210px); opacity: 0; } }
@keyframes wash-bubble-away { 0% { transform: scale(1); opacity: 1; } 70% { transform: scale(1.3); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .wash-suds.pop { animation: none; opacity: .9; }
  .wash-pad.rinsing .wash-drop { animation: none; opacity: .8; top: 30%; }
  .wash-pad.rinsing .wash-bubbles i { animation: none; opacity: 0; }
}
.fight-prop { position: absolute; z-index: 13; transform: translate(-50%, -50%); font-size: 2.8rem; pointer-events: none; animation: fight-prop-wobble .5s ease-in-out infinite alternate; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
@keyframes fight-prop-wobble { from { transform: translate(-50%, -50%) rotate(-12deg); } to { transform: translate(-50%, -50%) rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { .fight-prop { animation: none; } }

/* Teleport poof: sparkles and a puff at the friend's spot (Wash). */
.poof { position: fixed; z-index: 60; transform: translate(-50%, -50%); font-size: 3rem; letter-spacing: -.2em; pointer-events: none; animation: poof-pop .8s ease-out forwards; }
@keyframes poof-pop { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; } 30% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .poof { animation: none; opacity: .9; } }
/* Look at a saved home: read-only overlay with its own room, no controls but Close. */
.home-look { position: fixed; inset: 0; z-index: 95; }
.home-look .look-stage { z-index: 0; pointer-events: none; }
.home-look .furn { pointer-events: none; cursor: default; touch-action: auto; }
.home-look .furn::before { display: none; }
.look-crew { position: absolute; left: 0; right: 0; bottom: 14dvh; display: flex; justify-content: center; gap: 2vmin; z-index: 900; }
.look-friend { width: min(22vw, 20dvh); height: auto; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(60, 30, 0, 0.3)); }
.look-crew.many { flex-wrap: wrap; align-items: flex-end; gap: 0; padding: 0 2vw; }
.look-crew.many .look-friend { width: min(14vw, 12dvh); margin: 0 -1vw; }
.look-title { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); max-width: 70vw; padding: 8px 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: #22463d; font-weight: 900; text-align: center; z-index: 1000; }
.look-rooms { position: absolute; left: 0; right: 0; bottom: max(10px, env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0 8px; z-index: 1001; }
.look-room-btn { min-height: 44px; padding: 8px 12px; border: 2px solid #bfe8d9; border-radius: 999px; background: #fff; color: #22463d; font: inherit; font-weight: 800; cursor: pointer; }
.look-room-btn.picked { background: #2fa58a; border-color: #2fa58a; color: #fff; }
.look-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; min-height: 44px; padding: 8px 16px; border: 0; border-radius: 999px; background: #ff6b6b; color: #fff; font: inherit; font-weight: 900; cursor: pointer; z-index: 1001; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
.furn-locked .furn { pointer-events: none; cursor: default; }
.furn-locked .furn .furn-x, .furn-locked .furn .furn-paint { display: none; }
#sheet-furn #furn-lock { margin: 2px 0 8px; }
.room-ball { position: absolute; z-index: 12; transform: translate(-50%, -50%); font-size: 2.2rem; line-height: 1; pointer-events: none; transition: left .9s cubic-bezier(.3,.6,.5,1), top .9s cubic-bezier(.3,.6,.5,1); filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.room-ball > span { display: block; }
.room-ball > span.hop { animation: ball-hop .9s ease-out; }
@keyframes ball-hop { 0% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-34px) rotate(200deg); } 55% { transform: translateY(0) rotate(400deg); } 72% { transform: translateY(-12px) rotate(520deg); } 100% { transform: translateY(0) rotate(720deg); } }
@media (prefers-reduced-motion: reduce) { .room-ball > span.hop { animation: none; } }
.fight-prop.big { font-size: 6rem; }
/* Fluffy room life: pond koi and ripples, backyard clouds and a bird. Static markup, CSS transform and opacity only. */
.room-life, .room-life * { pointer-events: none; }
.room-life { position: absolute; inset: 0; z-index: 1; }
.life-pond, .life-yard { display: none; position: absolute; inset: 0; }
.room-pond .life-pond, .room-backyard .life-yard { display: block; }
.life-pond .koi { position: absolute; width: 6.6%; height: 2.6%; top: 50.6%; }
.life-pond .koi svg, .life-yard .cloud svg, .life-yard .bird svg { display: block; width: 100%; height: 100%; }
.koi.k1 { left: 33%; animation: koi-swim-a 15s ease-in-out infinite; }
.koi.k2 { left: 40%; top: 52.4%; animation: koi-swim-b 19s ease-in-out -7s infinite; }
.koi.k3 { left: 46%; top: 54.2%; animation: koi-swim-a 23s ease-in-out -12s infinite; }
@keyframes koi-swim-a { 0% { transform: translate(0, 0) scaleX(1); } 48% { transform: translate(300%, -12%) scaleX(1); } 50% { transform: translate(300%, -12%) scaleX(-1); } 98% { transform: translate(0, 8%) scaleX(-1); } 100% { transform: translate(0, 0) scaleX(1); } }
@keyframes koi-swim-b { 0% { transform: translate(0, 0) scaleX(-1); } 48% { transform: translate(-80%, 10%) scaleX(-1); } 50% { transform: translate(-80%, 10%) scaleX(1); } 98% { transform: translate(260%, -8%) scaleX(1); } 100% { transform: translate(260%, -8%) scaleX(-1); } }
.life-pond .ripple { position: absolute; width: 5%; height: 1.4%; border: 2px solid rgba(255, 255, 255, 0.75); border-radius: 50%; opacity: 0; }
.ripple.r1 { left: 52%; top: 51.4%; animation: ripple-out 4s ease-out infinite; }
.ripple.r2 { left: 38%; top: 54.4%; animation: ripple-out 5.5s ease-out -2s infinite; }
@keyframes ripple-out { from { transform: scale(0.4); opacity: 0.8; } to { transform: scale(1.7); opacity: 0; } }
.life-yard .cloud { position: absolute; }
.cloud.c1 { left: 4%; top: 7%; width: 20%; height: 9%; --to: 520%; animation: cloud-drift 60s linear infinite; }
.cloud.c2 { left: 40%; top: 17%; width: 14%; height: 6%; --to: 720%; animation: cloud-drift 85s linear -30s infinite; }
@keyframes cloud-drift { from { transform: translateX(-130%); } to { transform: translateX(var(--to)); } }
.life-yard .bird { position: absolute; left: 0; top: 24%; width: 6%; height: 3%; animation: bird-glide 26s linear -9s infinite; }
@keyframes bird-glide { 0% { transform: translate(-150%, 0); } 25% { transform: translate(450%, -40%); } 50% { transform: translate(900%, 10%); } 75% { transform: translate(1350%, -30%); } 100% { transform: translate(1800%, 0); } }
.tab-hidden .koi, .tab-hidden .ripple, .tab-hidden .cloud, .tab-hidden .bird { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .koi, .koi.k1, .koi.k2, .koi.k3, .ripple, .ripple.r1, .ripple.r2, .cloud, .cloud.c1, .cloud.c2, .bird, .life-yard .bird { animation: none; } .life-pond .ripple { opacity: 0.5; } }
/* Node budget: display:none markup never paints, so it must not declare an animation either. Inactive-room life nodes, the home window scene when away from home, and the hidden pen friend count as zero animated nodes. */
#spa-room:not(.room-pond) .life-pond *, #spa-room:not(.room-backyard) .life-yard *, #spa-room:not(.room-home) .room-scene * { animation-name: none; }
.pen-friend.hidden { animation: none; }

.homes-list { display: grid; gap: 6px; margin: 6px 0 8px; }
.home-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 2px solid #bfe8d9; background: #fff; border-radius: 14px; padding: 6px 10px; }
.home-row.here { border-color: #ff7eb3; background: #fff1f7; }
.home-nm { font-weight: 800; font-size: 0.9rem; color: #22463d; }
.home-nm.empty { color: #8aa79d; font-weight: 700; }
.home-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.home-b { border: 0; background: #e3f5ee; border-radius: 10px; padding: 5px 9px; font: inherit; font-size: 0.8rem; font-weight: 800; color: #22463d; cursor: pointer; }
.home-name-row, .home-restore-row, .home-code-box { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.home-name-row select, .home-restore-row select, .home-restore-row input, .home-code-box input { flex: 1 1 120px; min-width: 0; border: 2px solid #bfe8d9; border-radius: 10px; padding: 7px 8px; font: inherit; font-size: 0.9rem; background: #fff; color: #22463d; }

/* Bath time */
.paw-print { position: absolute; z-index: 1; pointer-events: none; font-size: 1rem; opacity: .4; }
.spa-sheet.wash { background: linear-gradient(#eaf8ff, #d6f0fb); }
.wash-pad { position: relative; width: 200px; height: 200px; margin: 6px auto 8px; border-radius: 24px; background: #fff; border: 3px solid #9fd6f2; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.wash-img { width: 150px; height: 150px; object-fit: contain; pointer-events: none; }
.wash-dirt { position: absolute; left: 0; right: 0; top: 0; bottom: 0; pointer-events: none; }
.wash-dirt i { position: absolute; width: 44px; height: 44px; }
.wash-dirt i svg, .wash-bubbles i svg, .wash-btns .tool-ico { width: 100%; height: 100%; display: block; }
.wash-dirt .d1 { left: 22%; top: 46%; } .wash-dirt .d2 { right: 20%; top: 38%; } .wash-dirt .d3 { left: 40%; top: 66%; }
.wash-dirt i.hidden, .wash-bubbles i.hidden { display: none; }
.wash-bubbles { position: absolute; left: 0; right: 0; top: 0; bottom: 0; pointer-events: none; }
.wash-bubbles i { position: absolute; width: 34px; height: 34px; }
.wash-bubbles .b1 { left: 10%; top: 6%; } .wash-bubbles .b2 { right: 12%; top: 14%; width: 26px; height: 26px; } .wash-bubbles .b3 { left: 26%; top: 38%; width: 28px; height: 28px; } .wash-bubbles .b4 { right: 22%; top: 52%; } .wash-bubbles .b5 { left: 12%; top: 66%; width: 24px; height: 24px; }
.wash-btns { display: flex; gap: 8px; justify-content: center; margin-top: 6px; }
.wash-btns .spa-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 12px; }
.wash-btns .tool-ico { width: 52px; height: 40px; }
.wash-btns .spa-btn:disabled { opacity: .45; }
