/* ============================================================
   Room backgrounds (floor line at ~64% of the screen)
   ============================================================ */
.room-bg-living {
  background:
    radial-gradient(ellipse at 50% 64%, rgba(255, 255, 255, .5), transparent 60%),
    linear-gradient(180deg, #fff5e4 0%, #ffe4ec var(--floor, 64%), #f3d2b3 var(--floor, 64%), #e4b890 100%);
}
.room-bg-kitchen {
  background:
    repeating-linear-gradient(90deg, rgba(254, 215, 170, .28) 0 18px, transparent 18px 36px),
    linear-gradient(180deg, #fffbeb 0%, #fef3c7 var(--floor, 64%), #f59e0b var(--floor, 64%), #fde68a 66%, #fcd34d 100%);
}
.room-bg-bathroom {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .35) 0 2px, transparent 2px 32px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .35) 0 2px, transparent 2px 32px),
    linear-gradient(180deg, #e0f2fe 0%, #bae6fd var(--floor, 64%), #7dd3fc var(--floor, 64%), #38bdf8 100%);
}
.room-bg-catroom {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 237, 213, .9) 0%, transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .25) 0 2px, transparent 2px 36px),
    linear-gradient(180deg, #fff7ed 0%, #ffedd5 var(--floor, 64%), #fdba74 var(--floor, 64%), #c2813f 100%);
}
.room-bg-wardrobe {
  background:
    radial-gradient(circle at 50% 25%, rgba(255, 255, 255, .7) 0%, transparent 55%),
    linear-gradient(180deg, #faf5ff 0%, #f3e8ff var(--floor, 64%), #e9d5ff var(--floor, 64%), #d8b4fe 100%);
}
.room-bg-balcony { background: linear-gradient(180deg, #fbcfe8 0%, #ddd6fe 46%, #c4b5fd var(--floor, 64%), #6d28d9 var(--floor, 64%), #4c1d95 100%); }
.room-bg-park { background: linear-gradient(180deg, #e0f2fe 0%, #fce7f3 var(--floor, 64%), #86efac var(--floor, 64%), #4ade80 100%); }
.room-bg-gym {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .3) 0 3px, transparent 3px 46px),
    linear-gradient(180deg, #f0fdfa 0%, #ccfbf1 var(--floor, 64%), #5eead4 var(--floor, 64%), #2dd4bf 66%, #99f6e4 66%, #5eead4 100%);
}
.room-bg-study {
  background:
    radial-gradient(ellipse at 78% 30%, rgba(254, 240, 138, .45), transparent 55%),
    repeating-linear-gradient(90deg, rgba(180, 83, 9, .1) 0 2px, transparent 2px 54px),
    linear-gradient(180deg, #fffbeb 0%, #fdecc8 var(--floor, 64%), #d6a26a var(--floor, 64%), #c08552 100%);
}

/* crossfade layer used while switching rooms */
.scene-bg-fade { position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease; }
.scene-bg-fade.is-in { opacity: 1; }

/* window-theme moods from the shop (tint the whole room) */
#scene-bg[data-window="win_sakura"] { filter: hue-rotate(-12deg) saturate(1.15); }
#scene-bg[data-window="win_sakura"]::before,
#scene-bg[data-window="win_sunset"]::before,
#scene-bg[data-window="win_aurora"]::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#scene-bg[data-window="win_sakura"]::before { background: linear-gradient(180deg, rgba(255, 182, 193, .35), transparent var(--floor, 64%)); }
#scene-bg[data-window="win_sunset"]::before { background: linear-gradient(180deg, rgba(251, 146, 60, .4), rgba(244, 114, 182, .25) 45%, transparent var(--floor, 64%)); }
#scene-bg[data-window="win_aurora"]::before { background: linear-gradient(180deg, rgba(15, 23, 42, .7), rgba(19, 78, 74, .45) 36%, rgba(49, 46, 129, .2) var(--floor, 64%), transparent var(--floor, 64%)); }

@keyframes catnipRainbow {
  0% { filter: hue-rotate(0deg) saturate(1.25); }
  50% { filter: hue-rotate(180deg) saturate(1.5); }
  100% { filter: hue-rotate(360deg) saturate(1.25); }
}
.theme-catnip #scene-bg { animation: catnipRainbow 3s linear infinite; }

@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-4px, 3px); }
  50% { transform: translate(4px, -3px); }
  75% { transform: translate(-3px, -2px); }
}
.shake-screen .stage { animation: screenShake .25s ease-in-out 4; }

/* ============================================================
   Props
   ============================================================ */
.room-prop { position: absolute; z-index: 2; }
.room-prop svg { width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 3px 4px rgba(90, 50, 20, .15)); }
.room-prop-interactive { cursor: pointer; transition: transform .18s var(--ease-spring); }
.room-prop-interactive.is-pressed, .room-prop-interactive:active { transform: scale(.92); }
.prop-caption {
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: var(--fs-xs);
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .92);
  color: var(--ink-2);
  box-shadow: var(--sh-1);
}

/* living */
.prop-window { top: 6px; left: 10px; width: clamp(56px, 18vw, 92px); }
.window-frame { fill: #fef3c7; stroke: #d6a96a; stroke-width: 3; }
.window-sky { fill: #bae6fd; transition: fill 1s; }
.window-sun { fill: #fde047; transition: opacity 1s, transform 1s; }
.window-moon { fill: #fef9c3; opacity: 0; transition: opacity 1s; }
.window-stars { fill: #fff; opacity: 0; transition: opacity 1s; }
.window-cloud { fill: rgba(255, 255, 255, .9); }
.window-bar { fill: #fef3c7; }
.window-curtain { fill: none; stroke: #fda4af; stroke-width: 7; stroke-linecap: round; opacity: .85; }
.is-night .window-sky, .is-sleeping .window-sky { fill: #1e1b4b; }
.is-night .window-sun, .is-sleeping .window-sun { opacity: 0; }
.is-night .window-moon, .is-sleeping .window-moon,
.is-night .window-stars, .is-sleeping .window-stars { opacity: 1; }
.is-night .window-cloud, .is-sleeping .window-cloud { opacity: .25; }

.prop-frame { top: 8px; right: 10px; width: clamp(60px, 19vw, 84px); }
.prop-cat-tree { position: absolute; bottom: 16%; left: 4px; width: clamp(54px, 17vw, 84px); z-index: 1; }
.prop-box { bottom: 3%; left: 6px; width: clamp(70px, 22vw, 100px); z-index: 3; }
.prop-plant { bottom: 4%; right: 10px; width: clamp(36px, 11vw, 52px); z-index: 3; }

/* kitchen */
.prop-fridge { top: 6px; left: 10px; width: clamp(52px, 16vw, 74px); }
.prop-shelf { top: 14px; right: 10px; width: clamp(80px, 26vw, 120px); }
.prop-bowl { bottom: 3%; right: 8px; width: clamp(70px, 22vw, 100px); z-index: 3; }

/* bathroom */
.prop-shower { top: 4px; left: 8px; width: clamp(56px, 18vw, 84px); }
.shower-drops circle { animation: drip 1.4s linear infinite; }
.shower-drops circle:nth-child(2n) { animation-delay: .5s; }
.shower-drops circle:nth-child(3n) { animation-delay: .9s; }
@keyframes drip { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(26px); opacity: 0; } }
.prop-tub { bottom: 3%; left: 4px; width: clamp(90px, 30vw, 140px); z-index: 3; }
.prop-litter { bottom: 3%; right: 6px; width: clamp(72px, 23vw, 104px); z-index: 3; }
@keyframes stinkWave {
  0%, 100% { transform: translateY(0) scale(.95); opacity: .75; }
  50% { transform: translateY(-6px) scale(1.08); opacity: 1; }
}
.stink-anim { animation: stinkWave 1.1s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

/* wardrobe */
.prop-mirror { top: 6px; left: 10px; width: clamp(48px, 15vw, 70px); }
.mirror-glass { fill: #e0f2fe; animation: mirrorShine 4s ease-in-out infinite; }
@keyframes mirrorShine { 50% { fill: #fce7f3; } }
.prop-rack { top: 10px; right: 8px; width: clamp(84px, 27vw, 124px); }

/* balcony */
.prop-lights { top: 0; left: 0; right: 0; height: 44px; }
.prop-lights svg { width: 100%; height: 100%; filter: none; }
.string-bulbs circle { fill: #fde68a; animation: bulb 2s ease-in-out infinite; }
.string-bulbs circle:nth-child(2n) { fill: #f9a8d4; animation-delay: .7s; }
.string-bulbs circle:nth-child(3n) { fill: #a5f3fc; animation-delay: 1.3s; }
@keyframes bulb { 50% { opacity: .45; } }
.prop-moon { top: 44px; right: 18px; width: 40px; }
.prop-railing { bottom: 22%; left: 0; right: 0; height: 36px; z-index: 1; opacity: .8; }
.prop-railing svg { width: 100%; height: 100%; filter: none; }

/* park */
.prop-sakura { top: -4px; left: -8px; width: clamp(96px, 32vw, 150px); }
.prop-sun { top: 6px; right: 6px; width: clamp(90px, 30vw, 130px); }
.prop-sun svg { animation: cloudDrift 12s ease-in-out infinite alternate; }
@keyframes cloudDrift { to { transform: translateX(-14px); } }

/* gym */
.prop-gym-rack { top: 8px; left: 8px; width: clamp(80px, 25vw, 120px); }
.prop-gym-cups { top: 12px; right: 8px; width: clamp(96px, 29vw, 140px); }
.gym-cups path { fill: rgba(255, 255, 255, .55); stroke: #94a3b8; stroke-width: 1.5; transition: fill .4s; }
.gym-cups path.is-on { fill: #38bdf8; stroke: #0284c7; }
.prop-gym-treadmill { bottom: 9%; left: 2%; width: clamp(100px, 31vw, 156px); }
.gym-led { fill: #134e4a; }
.prop-gym-treadmill.is-running .gym-led { fill: #5eead4; animation: bulb .8s ease-in-out infinite; }
.prop-gym-treadmill.is-running .gym-belt { animation: gymBelt .35s linear infinite; }
@keyframes gymBelt { to { stroke-dashoffset: 14; } }

/* study */
.prop-study-shelf { top: 8px; left: 8px; width: clamp(84px, 26vw, 124px); }
.prop-study-clock { top: 12px; right: 12px; width: clamp(54px, 16vw, 78px); }
.prop-study-desk { bottom: 9%; right: 2%; width: clamp(124px, 38vw, 186px); }
.study-glow { opacity: 0; transition: opacity .6s; }
.study-bulb { transition: fill .6s; }
.prop-study-desk.is-lit .study-glow { opacity: .8; }
.prop-study-desk.is-lit .study-bulb { fill: #fde047; }
.prop-study-clock.is-ticking .study-clock-hand { transform-origin: 35px 38px; animation: studyHand 60s linear infinite; }
@keyframes studyHand { to { transform: rotate(360deg); } }
.prop-gym-scale { bottom: 7%; right: 6%; width: clamp(46px, 13vw, 66px); }

/* follow-along workout panel over the stage */
.workout-hud {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  width: min(92%, 380px);
  padding: 10px 12px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--sh-2);
  text-align: center;
}
.workout-hud-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-xs); font-weight: 800; color: var(--ink-2); }
.workout-hud-move { font-size: var(--fs-lg); font-weight: 900; margin-top: 4px; }
.workout-hud-time { font-size: 40px; font-weight: 900; line-height: 1.05; color: #0f766e; font-variant-numeric: tabular-nums; }
.workout-hud.is-rest .workout-hud-time { color: var(--sky); }
.workout-hud-reps { font-size: var(--fs-sm); font-weight: 800; color: var(--ink-2); min-height: 1.2em; }
.workout-hud-next { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; }
.workout-hud .meter-track { margin: 8px 0; height: 6px; }
.workout-hud .meter-fill { display: block; height: 100%; background: #14b8a6; transition: width .3s; }
.workout-hud-btns { display: flex; gap: 8px; }
.workout-hud-btns .btn { flex: 1; }
@media (orientation: landscape) and (max-height: 540px) {
  .workout-hud { padding: 6px 10px; }
  .workout-hud-time { font-size: 28px; }
}

/* rug */
.floor-rug {
  position: absolute;
  bottom: 2%;
  left: 50%;
  transform: translateX(-50%);
  width: min(78vw, 420px);
  height: clamp(44px, 9cqh, 80px);
  border-radius: 50%;
  border: 5px dashed rgba(255, 255, 255, .7);
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, .2);
  background: #fda4af;
  opacity: .9;
  z-index: 1;
  transition: background .5s;
}
.floor-rug[data-rug="rug_lavender"] { background: #d8b4fe; }
.floor-rug[data-rug="rug_matcha"] { background: #6ee7b7; }
.floor-rug[data-rug="rug_butter"] { background: #fde68a; }

.cucumber {
  position: absolute;
  bottom: 10%;
  right: 18%;
  font-size: 42px;
  z-index: 3;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .25));
  animation: sneak .38s ease-out;
}
@keyframes sneak { from { transform: translateX(60px); opacity: 0; } }

.score-banner {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  padding: 4px 14px;
  border-radius: var(--r-pill);
  background: var(--primary-grad);
  color: #fff;
  font-weight: 900;
  font-size: var(--fs-sm);
  box-shadow: var(--sh-2);
  pointer-events: none;
}

@media (max-height: 640px) {
  .prop-window, .prop-frame, .prop-fridge, .prop-shower, .prop-mirror { transform: scale(.85); transform-origin: top left; }
  .prop-frame { transform-origin: top right; }
}
@media (orientation: landscape) and (max-height: 540px) {
  .room-prop svg { max-height: 30cqh; width: auto; }
}

/* ---------------- the cat's own room ---------------- */
.catroom-slot { font-size: clamp(54px, 18vw, 92px); line-height: 1; background: none; border: 0; padding: 0; cursor: pointer; }
/* the bed is drawn in two layers around the cat: back (behind) and front lip (over a cat lying in it) */
.catroom-bed, .catroom-bed-front { z-index: 2; background: none; border: 0; padding: 0; left: 50%; bottom: 6%; width: min(68vw, 310px); }
.catroom-bed { cursor: pointer; }
.catroom-bed:active, .catroom-bed.is-pressed { transform: none; }
.catroom-bed svg, .catroom-bed-front svg { display: block; width: 100%; height: 100%; max-height: none; }
.catroom-bed-front { pointer-events: none; }
.catroom-bed-front.is-occupied { z-index: 4; }
.catroom-bed .bed-cushion { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .5s var(--ease-out); }
.catroom-bed[data-bed="bed_plush"].is-occupied .bed-cushion, .catroom-bed[data-bed="bed_cloud"].is-occupied .bed-cushion { transform: scale(1.04, .8); }
.catroom-bed .bed-glow { transform-box: fill-box; transform-origin: center; }
.catroom-bed.is-occupied .bed-glow { animation: bedGlow 2.4s ease-in-out infinite; filter: drop-shadow(0 0 6px #fde047); }
@keyframes bedGlow { 50% { transform: scale(1.35); opacity: .75; } }
.catroom-bed.is-hinted { animation: bedHint .5s var(--ease-spring); }
@keyframes bedHint { 40% { transform: scale(1.04, .96); } }
.catroom-floor { left: 6px; bottom: 6%; z-index: 3; }
.catroom-wall { right: 10%; top: 12%; z-index: 1; font-size: clamp(48px, 15vw, 80px); }
/* drawn pieces (cat/decor-art.js) fill the width the room layout gives them */
.catroom-slot svg { display: block; width: 100%; height: auto; max-height: none; overflow: visible; filter: drop-shadow(0 3px 2px rgba(90, 50, 20, .12)); }
.catroom-corner { right: 6px; bottom: 6%; z-index: 3; }
.catroom-slot .decor-swing { transform-box: fill-box; transform-origin: 0 50%; animation: decorSwing 1.8s ease-in-out infinite; }
@keyframes decorSwing { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg); } }
@media (prefers-reduced-motion: reduce) { .catroom-slot .decor-swing { animation: none; } }
.catroom-slot.is-empty { opacity: .45; font-size: clamp(32px, 10vw, 48px); filter: grayscale(1); }
.catroom-slot.is-empty::after { content: "+"; position: absolute; right: -4px; bottom: -4px; font-size: 18px; font-weight: 800; background: #fff; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; filter: none; }
.catroom-shelf { left: 50%; top: 22%; transform: translateX(-50%); z-index: 1; display: flex; align-items: flex-end; gap: 2px; min-width: 64px; padding: 0 6px 6px; border-bottom: 6px solid #a16207; border-radius: 0 0 4px 4px; box-shadow: 0 4px 0 -1px #713f12; cursor: pointer; }
.catroom-shelf.is-empty { display: none; }
.catroom-keepsake { font-size: clamp(22px, 7vw, 32px); line-height: 1; background: none; border: 0; padding: 0 1px; cursor: pointer; filter: drop-shadow(0 2px 2px rgba(90, 50, 20, .2)); transition: transform .18s var(--ease-spring); }
.catroom-keepsake.is-pressed { transform: translateY(-3px) scale(1.1); }
.catroom-shelf-hint { font-size: 22px; opacity: .5; }

/* ---------------- weather ----------------
   Outdoors (lawn, balcony): full-screen canvas from weather-fx.js + a sky tint.
   Indoors: no particles; rain/snow only shows through the living-room window. */
.weather-layer { position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: 0; transition: opacity .6s; }
.weather-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
#app-shell[data-outdoor="1"]:is([data-weather="rain"], [data-weather="snow"]) .weather-canvas { display: block; }
#app-shell[data-outdoor="1"][data-weather="rain"] .weather-layer {
  opacity: 1; background: linear-gradient(180deg, rgba(71, 85, 105, .32), rgba(71, 85, 105, .14) var(--floor, 64%), rgba(71, 85, 105, .06));
}
#app-shell[data-outdoor="1"][data-weather="snow"] .weather-layer {
  opacity: 1; background: linear-gradient(180deg, rgba(203, 213, 225, .35), rgba(255, 255, 255, .12) 60%, rgba(255, 255, 255, .22));
}
#app-shell[data-outdoor="1"][data-weather="cloudy"] .weather-layer { opacity: 1; background: linear-gradient(180deg, rgba(100, 116, 139, .18), transparent 58%); }
/* indoors the light just turns a little cooler */
#app-shell[data-outdoor="0"]:is([data-weather="rain"], [data-weather="cloudy"]) .weather-layer { opacity: 1; background: linear-gradient(180deg, rgba(100, 116, 139, .1), transparent 50%); }

/* the living-room window */
.window-wx > g { display: none; }
.wx-clouds ellipse { fill: #7c8ba0; opacity: .9; }
.wx-rain line { stroke: rgba(255, 255, 255, .85); stroke-width: 1.3; stroke-linecap: round; animation: winRain .62s linear infinite; }
.wx-rain line.wx-slow { stroke-width: 1; opacity: .6; animation-duration: .85s; }
.wx-snow circle { fill: #fff; animation: winSnow 6s linear infinite; }
.wx-snow circle:nth-child(2n) { animation-duration: 7.5s; }
.wx-glass ellipse { fill: rgba(255, 255, 255, .7); stroke: rgba(148, 163, 184, .7); stroke-width: .4; animation: winBead 5s ease-in infinite; }
.wx-glass ellipse:nth-child(2) { animation-delay: -1.8s; animation-duration: 6.5s; }
.wx-glass ellipse:nth-child(3) { animation-delay: -3.6s; animation-duration: 5.8s; }
@keyframes winRain { from { transform: translate(0, 0); } to { transform: translate(-25px, 112px); } }
@keyframes winSnow {
  0% { transform: translate(0, 0); }
  25% { transform: translate(3px, 28px); }
  50% { transform: translate(-2px, 56px); }
  75% { transform: translate(3px, 84px); }
  100% { transform: translate(0, 112px); }
}
@keyframes winBead { 0%, 30% { transform: translateY(0); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(40px); opacity: 0; } }

#app-shell:is([data-weather="rain"], [data-weather="cloudy"], [data-weather="snow"]) .wx-clouds { display: inline; }
#app-shell[data-weather="cloudy"] .wx-clouds ellipse { fill: #e2e8f0; opacity: .95; }
#app-shell[data-weather="rain"] .wx-rain,
#app-shell[data-weather="rain"] .wx-glass { display: inline; }
#app-shell[data-weather="snow"] .wx-snow { display: inline; }
#app-shell[data-weather="rain"]:not(.is-night):not(.is-sleeping) .window-sky { fill: #a3b1c2; }
#app-shell[data-weather="snow"]:not(.is-night):not(.is-sleeping) .window-sky { fill: #d5dee9; }
#app-shell[data-weather="cloudy"]:not(.is-night):not(.is-sleeping) .window-sky { fill: #c9d9ea; }
#app-shell:is([data-weather="rain"], [data-weather="snow"]) .window-sun { opacity: 0; }
#app-shell[data-weather="cloudy"] .window-sun { opacity: .55; }
#app-shell:is([data-weather="rain"], [data-weather="snow"]) .window-moon,
#app-shell:is([data-weather="rain"], [data-weather="snow"]) .window-stars { opacity: 0; }
#app-shell[data-weather="rain"] .window-cloud { fill: #94a3b8; }
.is-night .wx-clouds ellipse, .is-sleeping .wx-clouds ellipse { fill: #334155; }
/* outdoors the park sun hides behind the weather */
.prop-sun { transition: opacity .6s, filter .6s; }
#app-shell:is([data-weather="rain"], [data-weather="snow"]) .prop-sun { opacity: .35; filter: grayscale(.85); }

@media (prefers-reduced-motion: reduce) { .weather-layer, .window-wx * { animation: none !important; } }

/* ---------------- fish mini-game ---------------- */
.fg-overlay { position: fixed; inset: 0; z-index: 9000; background: linear-gradient(180deg, #bae6fd, #7dd3fc 70%, #38bdf8); display: flex; flex-direction: column; touch-action: none; user-select: none; }
.fg-bar { display: flex; justify-content: space-between; align-items: center; padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 6px; font-size: 22px; font-weight: 800; color: #0c4a6e; }
.fg-tip { text-align: center; margin: 0 0 4px; color: #075985; font-weight: 700; }
.fg-field { position: relative; flex: 1; overflow: hidden; }
.fg-item { position: absolute; transform: translate(-50%, 0); background: none; border: 0; padding: 8px; font-size: 44px; line-height: 1; cursor: pointer; }
.fg-item.is-hit { transition: transform .25s, opacity .25s; transform: translate(-50%, -30px) scale(1.4); opacity: 0; font-size: 28px; font-weight: 800; color: #0c4a6e; }

/* ---------- hide-and-seek hideouts & the daily stash (interactions/seek.js) ---------- */
.seek-spot {
  width: 54px; height: 54px; margin: -27px 0 0 -27px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .55); box-shadow: 0 3px 8px rgba(90, 50, 20, .15);
  font-size: 32px; line-height: 54px; text-align: center; z-index: 3;
}
.seek-spot.is-off { display: none; }
.seek-spot.is-stash { animation: stashWiggle 4s ease-in-out infinite; }
.seek-spot.is-sparkle::after {
  content: '✨'; position: absolute; right: -6px; top: -8px; font-size: 16px; line-height: 1;
  animation: meterBlink 1.4s ease-in-out infinite;
}
.seek-spot.is-peek::before {
  content: '🐾'; position: absolute; left: 50%; top: -18px; font-size: 18px; line-height: 1;
  animation: seekPeek 1.6s ease-out forwards;
}
.seek-spot.is-wrong { animation: seekNope .4s ease; }
@keyframes stashWiggle { 0%, 88%, 100% { transform: rotate(0); } 92% { transform: rotate(-8deg); } 96% { transform: rotate(8deg); } }
@keyframes seekPeek { 0% { transform: translate(-50%, 10px); opacity: 0; } 30%, 70% { transform: translate(-50%, 0); opacity: 1; } 100% { transform: translate(-50%, 10px); opacity: 0; } }
@keyframes seekNope { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }


/* ============================================================
   Rooms, round two: each its own floor, a baseboard, day and night everywhere
   ============================================================ */
/* the wall meets the floor: a baseboard on that line (outdoors there is none) */
/* (--floor is set in px on #app-shell by room/stage.js: the same line in every room, measured on the stage) */
#scene-bg::before {
  content: ""; position: absolute; left: 0; right: 0; top: calc(var(--floor, 64%) - 6px); height: 12px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .7) 0 4px, rgba(120, 72, 40, .14) 4px 7px, rgba(120, 72, 40, 0) 12px);
}
.room-bg-park::before, .room-bg-balcony::before { display: none; }

/* the floor under the cat: the pink rug belongs to the living room and the cat's room */
#app-shell[data-room="bathroom"] .floor-rug {
  width: min(58vw, 300px); border-radius: 26px; border: 4px solid #fff; box-shadow: none; opacity: .95;
  background: repeating-linear-gradient(90deg, #e0f2fe 0 16px, #bae6fd 16px 32px);
}
#app-shell[data-room="gym"] .floor-rug {
  width: min(70vw, 360px); border-radius: 14px; border: 3px solid #7c3aed; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .12); opacity: .95;
  background: repeating-linear-gradient(0deg, #a78bfa 0 10px, #8b5cf6 10px 12px);
}
#app-shell[data-room="kitchen"] .floor-rug {
  width: min(64vw, 330px); border-radius: 12px; border: 4px solid #fff7ed; box-shadow: none;
  background: repeating-conic-gradient(#fef3c7 0 25%, #fdba74 0 50%) 0 0 / 28px 28px;
}
#app-shell[data-room="study"] .floor-rug {
  width: min(72vw, 380px); border-radius: 16px; border: 4px double #1e3a8a; box-shadow: none; background: #93c5fd;
}
#app-shell[data-room="balcony"] .floor-rug {
  width: min(62vw, 320px); border-radius: 50%; border: 0; box-shadow: inset 0 0 0 6px rgba(120, 72, 40, .25);
  background: repeating-radial-gradient(circle, #fde68a 0 6px, #f59e0b 6px 8px); opacity: .85;
}
#app-shell[data-room="wardrobe"] .floor-rug { border-style: solid; background: radial-gradient(circle, #fbcfe8, #f9a8d4); }
/* the lawn: no rug, a softer patch of grass where the cat sits */
#app-shell[data-room="park"] .floor-rug { border: 0; box-shadow: none; background: radial-gradient(ellipse, rgba(21, 128, 61, .35), rgba(21, 128, 61, 0) 70%); }

/* the furniture that matters in a room is big enough to see, next to the cat */
.prop-tub { width: clamp(124px, 40vw, 190px); }
.prop-study-desk { width: clamp(150px, 46vw, 220px); }
.prop-gym-treadmill { width: clamp(126px, 39vw, 196px); }
.prop-gym-rack { width: clamp(96px, 30vw, 140px); }
.prop-fridge { width: clamp(64px, 20vw, 92px); }
.prop-shelf { width: clamp(96px, 30vw, 140px); }

/* new pieces */
.prop-towel { top: 18px; right: 12px; width: clamp(80px, 25vw, 120px); }
.prop-bunting { top: 0; left: 0; right: 0; height: 46px; }
.prop-bunting svg, .prop-park-far svg, .prop-park-path svg { width: 100%; height: 100%; filter: none; }
.prop-park-far { left: 0; right: 0; top: calc(58% - 46px); height: 50px; z-index: 0; }
.prop-park-path { left: 27%; top: 58%; width: 46%; height: 42%; z-index: 0; }
.prop-park-bush { bottom: 2%; width: clamp(80px, 24vw, 120px); z-index: 3; }
.prop-park-bush.is-left { left: -6px; }
.prop-park-bush.is-right { right: -6px; }
.prop-pot { bottom: 3%; width: clamp(48px, 14vw, 70px); z-index: 3; }
.prop-pot.is-left { left: 8px; }
.prop-pot.is-right { right: 8px; }

/* day and night in every room */
/* indoors at night: the navy dusk plus a warm lamp glow around the cat */
.is-night #scene-bg:not(.room-bg-park):not(.room-bg-balcony)::after {
  background: radial-gradient(ellipse at 50% var(--floor, 64%), rgba(255, 196, 120, .45), rgba(255, 196, 120, 0) 45%), linear-gradient(180deg, rgba(30, 27, 75, .6), rgba(49, 46, 129, .4));
}
/* the lawn: a night sky with stars, the sun goes down, the grass darkens */
.is-night .room-bg-park, .is-sleeping .room-bg-park {
  background:
    radial-gradient(circle at 18% 12%, #fff 0 1.5px, transparent 2px), radial-gradient(circle at 46% 22%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 72% 8%, #fff 0 1.5px, transparent 2px), radial-gradient(circle at 86% 30%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 80% 14%, #fef9c3 0 16px, rgba(254, 249, 195, .25) 17px 30px, transparent 31px),
    linear-gradient(180deg, #1e1b4b 0%, #4338ca var(--floor, 64%), #15803d var(--floor, 64%), #14532d 100%);
}
.is-night .prop-sun, .is-sleeping .prop-sun { opacity: 0; }
.is-night .prop-park-far, .is-sleeping .prop-park-far { filter: brightness(.55); }
/* the terrace: blue sky and unlit bulbs by day; the purple evening and glowing lights at night */
.room-bg-balcony { background: linear-gradient(180deg, #bae6fd 0%, #e0f2fe 46%, #fce7f3 var(--floor, 64%), #b45309 var(--floor, 64%), #92400e 100%); }
.is-night .room-bg-balcony, .is-sleeping .room-bg-balcony { background: linear-gradient(180deg, #312e81 0%, #6d28d9 46%, #a78bfa var(--floor, 64%), #78350f var(--floor, 64%), #451a03 100%); }
#app-shell:not(.is-night):not(.is-sleeping) .prop-moon { opacity: 0; }
#app-shell:not(.is-night):not(.is-sleeping) .string-bulbs circle { animation: none; opacity: .35; }
.is-night .string-bulbs circle { filter: drop-shadow(0 0 4px #fde68a); }

/* the cat's room: an empty spot only shows while you are arranging it */
.catroom-slot.is-empty { visibility: hidden; }
body.has-sheet .catroom-slot.is-empty { visibility: visible; }

/* bath time: the cat is in the tub (the small tub by the wall makes way) */
.tub-front { position: absolute; left: 50%; bottom: -3%; width: 112%; height: 36%; transform: translateX(-50%); opacity: 0;
  pointer-events: none; z-index: 5; transition: opacity .25s; }
.tub-front svg { width: 100%; height: 100%; display: block; overflow: visible; }
.tub-front.is-in { opacity: 1; }
/* wet through: the coat a shade darker and flatter until it is blown dry */
#cow-cat-svg.is-wet { filter: drop-shadow(0 6px 9px rgba(60, 30, 20, .18)) brightness(.93) contrast(1.06) saturate(.9); }
#app-shell.is-bathing .prop-tub { opacity: 0; transition: opacity .25s; }

/* ---- the bath, step by step ---- */
/* the small tub by the wall: empty and dry until the water is drawn, then it fills and (warm or hot) steams */
.prop-tub .tub-fill { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); opacity: 0; transition: transform 1.6s ease-out, opacity .4s; }
.prop-tub .tub-dry-foam { opacity: 0; transition: opacity .6s .9s; }
.prop-tub .tub-steam-small { opacity: 0; }
#app-shell.has-bathwater .prop-tub .tub-fill { transform: scaleY(1); opacity: 1; }
#app-shell.has-bathwater .prop-tub .tub-dry-foam { opacity: 1; }
#app-shell.has-bathwater[data-water="warm"] .prop-tub .tub-steam-small,
#app-shell.has-bathwater[data-water="hot"] .prop-tub .tub-steam-small { opacity: .7; animation: steamRise 2.4s ease-in-out infinite; }
/* the tub the cat sits in: a moving water line, foam that piles up with the lather (--foam 0…1) */
.tub-front { --foam: 0; }
.tub-front .tub-wave { animation: tubWave 2.2s linear infinite; }
.tub-front .tub-wave.is-back { animation-duration: 3.1s; animation-direction: reverse; }
.tub-front .tub-foam circle { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .5s cubic-bezier(.2, 1.4, .4, 1), opacity .4s; }
.tub-front .tub-foam .foam-more { opacity: var(--foam); transform: scale(calc(.4 + var(--foam) * .7)); }
.tub-front .tub-foam circle:not(.foam-more) { transform: scale(calc(.75 + var(--foam) * .4)); }
.tub-front .tub-drips { opacity: 0; }
.tub-front.is-splash .tub-drips { animation: tubSplash .6s ease-out; }
.tub-front .tub-steam { position: absolute; left: 10%; right: 10%; bottom: 70%; height: 60%; pointer-events: none; opacity: 0; transition: opacity .6s; }
.tub-front[data-water="warm"] .tub-steam { opacity: .45; }
.tub-front[data-water="hot"] .tub-steam { opacity: .85; }
.tub-steam i { position: absolute; bottom: 0; width: 18%; height: 70%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, .85), transparent);
  filter: blur(3px); animation: steamPuff 3s ease-in infinite; }
.tub-steam i:nth-child(1) { left: 6%; } .tub-steam i:nth-child(2) { left: 30%; animation-delay: .8s; }
.tub-steam i:nth-child(3) { left: 55%; animation-delay: 1.5s; } .tub-steam i:nth-child(4) { left: 78%; animation-delay: 2.2s; }
@keyframes tubWave { from { transform: translateX(0); } to { transform: translateX(-40px); } }
@keyframes tubSplash { 0% { opacity: 1; transform: translateY(-40px); } 100% { opacity: 0; transform: translateY(10px); } }
@keyframes steamRise { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: .7; } 100% { transform: translateY(-12px); opacity: 0; } }
@keyframes steamPuff { 0% { transform: translateY(0) scale(.6); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-120%) scale(1.4); opacity: 0; } }
/* soaked through: darker, sleeker (the fur lies flat), dripping */
#cow-cat-svg.is-soaked { filter: drop-shadow(0 6px 9px rgba(60, 30, 20, .2)) brightness(.86) contrast(1.12) saturate(.85); }
#cow-cat-svg.is-soaked #fluffy-body-tufts, #cow-cat-svg.is-soaked #fluffy-head-tufts { opacity: 0; }
/* the towel, rubbed back and forth */
.bath-towel { position: absolute; left: 50%; top: 30%; width: 92%; height: 46%; transform: translateX(-50%); pointer-events: none; z-index: 6;
  transition: opacity .3s, transform .3s; }
.bath-towel svg { width: 100%; height: 100%; display: block; overflow: visible; }
.bath-towel.is-hidden { opacity: 0; transform: translateX(-50%) translateY(-30px); }
.bath-towel.is-rubbing svg { animation: towelRub .32s ease-in-out infinite alternate; }
@keyframes towelRub { from { transform: translateX(-4%) rotate(-2deg); } to { transform: translateX(4%) rotate(2deg); } }
/* the steps and how far along the one in hand is, over the stage */
.bath-hud { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 64px); transform: translateX(-50%); z-index: 30; width: min(94%, 420px);
  display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.bath-hud.is-hidden { display: none; }
.bath-steps { display: flex; gap: 3px; padding: 5px; border-radius: 999px; background: rgba(255, 255, 255, .86); box-shadow: 0 4px 14px rgba(15, 23, 42, .12); }
.bath-step { flex: 1; text-align: center; font-size: 11px; font-weight: 700; padding: 4px 0; border-radius: 999px; color: #94a3b8; white-space: nowrap; }
.bath-step.is-done { color: #0284c7; }
.bath-step.is-now { background: #0ea5e9; color: #fff; box-shadow: 0 2px 8px rgba(14, 165, 233, .35); }
.bath-meter { align-self: center; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 14px; background: rgba(255, 255, 255, .9);
  box-shadow: 0 4px 14px rgba(15, 23, 42, .12); font-size: 13px; color: #334155; min-width: min(80%, 300px); }
.bath-meter[hidden] { display: none; }
.bath-meter b { white-space: nowrap; }
.bath-meter em { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; color: #0284c7; }
.bath-meter-bar { flex: 1; height: 10px; border-radius: 5px; background: #e2e8f0; overflow: hidden; }
.bath-meter-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7dd3fc, #0ea5e9); transition: width .25s; }
.bath-meter.is-done .bath-meter-bar i { background: linear-gradient(90deg, #86efac, #22c55e); }
.bath-meter.is-done em { color: #16a34a; }
.bath-hint { align-self: center; padding: 4px 12px; border-radius: 999px; background: rgba(15, 23, 42, .72); color: #fff; font-size: 12px; font-weight: 700; }
.bath-hint:empty { display: none; }
.bath-hint.is-urgent { background: #e11d48; animation: hintPulse .6s ease-in-out infinite alternate; }
@keyframes hintPulse { to { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) {
  .tub-front .tub-wave, .tub-steam i, .bath-towel.is-rubbing svg, .bath-hint.is-urgent, #app-shell.has-bathwater .prop-tub .tub-steam-small { animation: none; }
}


/* ============================================================
   The photo wall
   ============================================================ */
/* the living room's window: a real window now, not a stamp */
.prop-window { width: clamp(78px, 24vw, 124px); }

.photo-wall {
  position: absolute; top: clamp(70px, 14%, 120px); left: 50%; transform: translateX(-50%); width: min(52vw, 260px);
  z-index: 1; background: none; border: 0; padding: 0; cursor: pointer;
}
.pw-string { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 24px; overflow: visible; }
.pw-row { position: relative; display: flex; justify-content: space-around; padding-top: 8px; }
.pw-photo {
  position: relative; width: 28%; aspect-ratio: 4 / 5; padding: 4px 4px 14px; background: #fff; border-radius: 3px;
  box-shadow: 0 4px 8px rgba(90, 50, 20, .22); transform: rotate(var(--tilt, 0deg)); transform-origin: 50% 0;
  animation: pwSway 5s ease-in-out infinite alternate;
}
.pw-photo:nth-child(2) { margin-top: 10px; animation-delay: -1.6s; }
.pw-photo img, .pw-empty { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 2px; background: #fde2e4; }
.pw-empty { display: flex; align-items: center; justify-content: center; font-size: 18px; background: repeating-linear-gradient(45deg, #fff1f2 0 6px, #ffe4e6 6px 12px); }
.pw-cap { position: absolute; left: 0; right: 0; bottom: 1px; font-size: 8px; font-weight: 700; color: var(--ink-3, #a39890); text-align: center; white-space: nowrap; overflow: hidden; }
.pw-peg { position: absolute; top: -7px; left: 50%; width: 6px; height: 12px; margin-left: -3px; border-radius: 2px; background: #f59e0b; box-shadow: 0 0 0 1.5px #92400e; }
@keyframes pwSway { from { transform: rotate(calc(var(--tilt, 0deg) - 1.5deg)); } to { transform: rotate(calc(var(--tilt, 0deg) + 1.5deg)); } }

/* the cat's wall shelf, under the window; the cat jumps up and sits on its cushion */
.prop-shelf-wall { left: 3%; top: 40%; width: clamp(110px, 34vw, 170px); z-index: 2; background: none; border: 0; padding: 0; }
.prop-shelf-wall.is-hinted { animation: bedHint .5s var(--ease-spring); }

/* the other rooms' high spots: mid-wall, on the side away from the near things */
.room-perch { z-index: 2; background: none; border: 0; padding: 0; width: clamp(110px, 34vw, 170px); top: 42%; }
.room-perch svg { overflow: visible; }
.room-perch.is-hinted { animation: bedHint .5s var(--ease-spring); }

/* a timer card (workout / 番茄) sits at the top of the stage: TA's pill moves to the bottom corner */
#stage-area:has(.workout-hud) .together-pill { top: auto; bottom: 8px; }
/* the kitchen's food bowl, big enough to read next to the cat */
.prop-bowl { width: clamp(96px, 30vw, 140px); }

/* ============================================================
   Painted backdrops (js/backdrop.js): wallpaper, wainscot, a floor in perspective, furniture behind the cat
   ============================================================ */
.backdrop { position: absolute; inset: 0; pointer-events: none; }
.bd-wall { position: absolute; left: 0; right: 0; top: 0; height: var(--floor, 64%); }
.bd-wains { position: absolute; left: 0; right: 0; bottom: calc(100% - var(--floor, 64%)); border-top: 7px solid; box-sizing: border-box; }
.bd-floorbox { position: absolute; left: 0; right: 0; top: var(--floor, 64%); bottom: 0; }
.bd-floor { display: block; width: 100%; height: 100%; }
.bd-base { position: absolute; left: 0; right: 0; top: calc(var(--floor, 64%) - 5px); height: 9px; box-shadow: 0 3px 5px rgba(80, 40, 10, .18); }
#scene-bg:has(> .backdrop .bd-base)::before { display: none; }
.bd-piece { position: absolute; transform: translate(-50%, calc(-100% + var(--sink, 0px))); }
.bd-piece > svg { display: block; width: 100%; height: auto; overflow: visible; }
.bd-piece.is-far > svg { height: 100%; }
/* lamps: a warm glow above the night shade */
.bd-glow { z-index: 1; }
.bd-glow > svg { visibility: hidden; }
.bd-glow > i {
  position: absolute; width: calc(var(--gr) * 2); height: calc(var(--gr) * 2); margin: calc(var(--gr) * -1) 0 0 calc(var(--gr) * -1);
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 238, 170, .8), rgba(255, 220, 140, .25) 45%, rgba(255, 220, 140, 0) 70%);
  opacity: 0; transition: opacity 1.2s ease;
}
.is-night .bd-glow > i { opacity: 1; }
.is-sleeping .bd-glow > i { opacity: .35; }
/* outdoors at night: the hills and the city go dark, the windows light up */
.bd-windows { opacity: 0; transition: opacity 1.2s ease; }
.is-night .bd-windows, .is-sleeping .bd-windows { opacity: 1; }
.is-night .bd-piece.is-far, .is-sleeping .bd-piece.is-far { filter: brightness(.5) saturate(.8); }
.is-night .bd-park .bd-floor, .is-sleeping .bd-park .bd-floor { opacity: .5; }

/* ============================================================
   Things the cat does with the furniture
   ============================================================ */
/* the food bowl: nothing in it while the cat is hungry */
.prop-bowl .bowl-food { transition: opacity .4s; }
.prop-bowl.is-empty .bowl-food { opacity: 0; }
/* the cat room's little house: two eyes in the dark doorway while the cat hides in it */
.house-eyes { position: absolute; left: 50%; top: 66%; width: 24%; display: flex; justify-content: space-between; translate: -50% 0; pointer-events: none; animation: houseEyesIn .3s ease-out; }
.house-eyes i { width: 34%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 50% 45%, #141419 0 28%, #fde047 30% 100%); box-shadow: 0 0 6px rgba(253, 224, 71, .8); animation: houseBlink 2.6s infinite; }
@keyframes houseEyesIn { from { opacity: 0; } }
@keyframes houseBlink { 0%, 44%, 52%, 100% { scale: 1 1; } 48% { scale: 1 .1; } }
/* cooking: the pot on the counter rattles */
.room-item.is-cooking { animation: potRattle .16s linear infinite; }
@keyframes potRattle { 0%, 100% { rotate: 0deg; } 25% { rotate: .5deg; } 75% { rotate: -.5deg; } }
.cook-dish { font-size: 34px; }
/* a dish cooked and waiting for the cat: the pot keeps steaming */
.room-item.has-dish::before, .room-item.has-dish::after { content: '♨️'; position: absolute; left: 24%; top: 10%; font-size: 22px; line-height: 1;
  translate: -50% -100%; pointer-events: none; animation: potSteam 2.2s ease-out infinite; }
.room-item.has-dish::after { left: 30%; font-size: 16px; animation-delay: 1.1s; }
@keyframes potSteam { 0% { opacity: 0; transform: translateY(6px) scale(.7); } 25% { opacity: .95; } 100% { opacity: 0; transform: translateY(-34px) scale(1.15); } }
@media (prefers-reduced-motion: reduce) {
  .room-item.is-cooking, .house-eyes i { animation: none; }
  .room-item.has-dish::before { animation: none; opacity: .9; }
  .room-item.has-dish::after { display: none; }
}

/* ---- what the cat left behind in a room (cat/traces.js) ---- */
.trace-layer { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.trace { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; border: 0; background: rgba(255, 255, 255, .55);
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 8px rgba(60, 30, 20, .15); animation: traceIn .4s cubic-bezier(.2, 1.4, .4, 1) both; }
.trace::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px dashed rgba(251, 113, 133, .55); animation: traceRing 2.4s linear infinite; }
.trace.is-tidied { animation: traceOut .3s ease-in forwards; }
@keyframes traceIn { from { transform: translate(-50%, -50%) scale(0); opacity: 0; } }
@keyframes traceOut { to { transform: translate(-50%, -80%) scale(.4); opacity: 0; } }
@keyframes traceRing { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .trace, .trace::after { animation: none; } }
