/* ───────── Casa: cuartos con foto real ───────── */
.room {
  position: relative; overflow: hidden; border-radius: 28px; box-shadow: var(--shadow);
  aspect-ratio: 4 / 5; max-height: 72vh; width: 100%; background: #2a2230; touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
}
.room-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: filter 0.6s; }
.room-shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(20, 12, 28, 0.5) 0%, rgba(20, 12, 28, 0) 26%, rgba(20, 12, 28, 0) 62%, rgba(20, 12, 28, 0.45) 100%); }
.room-top { position: absolute; left: 14px; right: 14px; top: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; z-index: 3; }
.room-top .pet-name { font-size: 1.6rem; line-height: 1.1; }
.room-top .stage-sub { color: rgba(255, 255, 255, 0.9); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); }
.room .bubble { top: 70px; }
.room .pet-wrap { position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%); width: 58%; height: auto; aspect-ratio: 260 / 278; margin: 0; z-index: 2;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.35)); }
.room .pet-wrap.jump { animation: jumpX 0.6s cubic-bezier(.3, 1.6, .5, 1); }
.room .pet-wrap.snooze { animation: snoozeX 2.4s ease-in-out; }
.room .pet-wrap.shake { animation: shakeX 0.5s; }
@keyframes jumpX {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(1, 1); }
  20% { transform: translateX(-50%) scale(1.1, 0.88); }
  50% { transform: translateX(-50%) translateY(-28px) scale(0.94, 1.08); }
  80% { transform: translateX(-50%) scale(1.06, 0.94); }
}
@keyframes snoozeX { 0%, 100% { transform: translateX(-50%) rotate(0); } 30%, 70% { transform: translateX(-50%) rotate(-6deg) translateY(4px); } }
@keyframes shakeX { 0%, 100% { transform: translateX(-50%); } 25% { transform: translateX(calc(-50% - 8px)); } 75% { transform: translateX(calc(-50% + 8px)); } }
.room .companion { bottom: 5%; right: 4%; width: 22%; height: auto; aspect-ratio: 1; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.3)); }
.room-arrow {
  position: absolute; top: 46%; z-index: 3; width: 38px; height: 54px; border: none; border-radius: 14px;
  background: rgba(255, 255, 255, 0.78); color: var(--ink); font-size: 1.9rem; line-height: 1; padding: 0 0 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); backdrop-filter: blur(4px);
}
.room-arrow.left { left: 8px; }
.room-arrow.right { right: 8px; }
.room-label {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 1; white-space: nowrap;
  background: rgba(20, 12, 28, 0.5); color: #fff; font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
}
.room-away {
  position: absolute; left: 12%; right: 12%; top: 44%; z-index: 2; text-align: center;
  background: rgba(255, 255, 255, 0.88); border-radius: 18px; padding: 12px; font-weight: 600;
}
.room.dark .room-bg { filter: brightness(0.28) saturate(0.6) hue-rotate(200deg); }
.room.dark .room-shade { background: radial-gradient(ellipse at 50% 80%, rgba(80, 90, 160, 0.15), rgba(5, 5, 25, 0.55)); }
.room.dark .pet-wrap { filter: brightness(0.7) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.5)); }
.zzz { position: absolute; left: 60%; top: 38%; z-index: 3; color: #fff; font-family: 'Titan One', sans-serif; pointer-events: none; }
.zzz span { position: absolute; opacity: 0; animation: zzz 3s ease-in infinite; font-size: 1.4rem; }
.zzz span:nth-child(2) { animation-delay: 1s; font-size: 1.1rem; }
.zzz span:nth-child(3) { animation-delay: 2s; font-size: 1.8rem; }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(40px, -70px); } }

.room-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0; }
.room-tabs button {
  display: flex; flex-direction: column; align-items: center; gap: 1px; border: none; border-radius: 14px; padding: 6px 2px;
  background: #fff; box-shadow: 0 3px 0 #e6d8ee; font-size: 1.25rem; color: var(--muted); min-width: 0;
}
.room-tabs small { font-size: 0.66rem; font-weight: 600; }
.room-tabs button.active { background: var(--pink); color: #fff; box-shadow: 0 3px 0 var(--pink-dark); }
.room-actions .action-btn[data-ready] { background: #e3f6ff; box-shadow: 0 4px 0 #9fd6f2; animation: pulse 1.2s ease-in-out infinite; }
.room-actions .action-btn[aria-pressed='true'] { background: #fff0f7; box-shadow: 0 4px 0 var(--pink-light); }
@keyframes pulse { 50% { transform: scale(1.05); } }

/* Baño: espuma y regadera */
.room.sponge-mode { touch-action: none; cursor: none; }
.room.sponge-mode .pet-wrap { touch-action: none; }
.sponge-cursor { position: absolute; left: 0; top: 0; z-index: 5; font-size: 2.2rem; pointer-events: none; transform: translate(-100px, -100px); }
.suds { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.sud {
  position: absolute; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle at 32% 30%, #fff 0 22%, rgba(255, 255, 255, 0.75) 40%, rgba(200, 230, 255, 0.55) 70%, rgba(255, 255, 255, 0.9) 100%);
  box-shadow: inset -2px -2px 4px rgba(150, 190, 230, 0.5); animation: sudIn 0.25s ease-out;
}
@keyframes sudIn { from { transform: translate(-50%, -50%) scale(0); } }
.suds.rinse .sud { transition: transform 1s ease-in, opacity 1s; transform: translate(-50%, 160px); opacity: 0; }
.shower { position: absolute; inset: 0; z-index: 4; pointer-events: none; animation: showerOut 1.9s forwards; }
.shower i { position: absolute; top: -10%; width: 3px; height: 26px; border-radius: 2px; background: linear-gradient(transparent, rgba(170, 220, 255, 0.95)); animation: drop 0.55s linear infinite; }
@keyframes drop { to { transform: translateY(120vw); } }
@keyframes showerOut { 85% { opacity: 1; } 100% { opacity: 0; } }

/* Tocador */
.vanity .modal-pet { height: 190px; }
.vanity-card { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.vanity-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vanity-row > span { font-weight: 600; font-size: 0.9rem; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; background: var(--c); box-shadow: 0 0 0 2px #eadcf2; padding: 0; }
.swatch.on { box-shadow: 0 0 0 3px var(--pink); transform: scale(1.1); }

/* Minijuegos */
.game-list { display: flex; flex-direction: column; gap: 10px; }
.game-card { display: flex; align-items: center; gap: 12px; text-align: left; border: none; width: 100%; }
.game-card span:last-child { display: flex; flex-direction: column; gap: 2px; }
.game-emoji { font-size: 2.2rem; }
.game-screen {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #a9dcff, #e6f6ff 70%, #bdeaa8); padding-top: var(--safe-t); padding-bottom: var(--safe-b);
  user-select: none; -webkit-user-select: none;
}
.game-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(255, 255, 255, 0.85); }
.game-head b { flex: 1; }
.game-x { border: none; background: #fff; width: 36px; height: 36px; border-radius: 12px; font-size: 1rem; box-shadow: 0 2px 0 #e6d8ee; }
.game-stats { font-weight: 700; color: var(--pink-dark); white-space: nowrap; }
.game-area { position: relative; flex: 1; overflow: hidden; touch-action: none; }
.g-atrapa .g-player { position: absolute; left: 0; bottom: 6px; width: 80px; height: 88px; }
.g-atrapa .g-player svg { width: 100%; height: 100%; }
.g-item { position: absolute; left: 0; top: 0; font-size: 2rem; will-change: transform; }
.g-lives { position: absolute; top: 8px; left: 10px; font-size: 1.2rem; }
.g-hit { animation: hit 0.3s; }
@keyframes hit { 50% { background: rgba(255, 60, 60, 0.25); } }
.memo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 16px; max-width: 420px; margin: 0 auto; }
.memo-card { position: relative; aspect-ratio: 3 / 4; border: none; border-radius: 16px; background: #fff; box-shadow: 0 4px 0 #e6d8ee; font-size: 2.2rem; padding: 0; perspective: 600px; }
.memo-card span { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 16px; backface-visibility: hidden; transition: transform 0.3s; }
.memo-back { background: linear-gradient(160deg, var(--pink-light), var(--pink)); }
.memo-front { transform: rotateY(180deg); }
.memo-card.open .memo-back, .memo-card.done .memo-back { transform: rotateY(180deg); }
.memo-card.open .memo-front, .memo-card.done .memo-front { transform: rotateY(0); }
.memo-card.done { opacity: 0.6; }
.topo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 24px 16px; max-width: 420px; margin: 0 auto; }
.topo { position: relative; aspect-ratio: 1; border: none; padding: 0; border-radius: 50%; overflow: hidden;
  background: radial-gradient(ellipse at 50% 80%, #5a3b26 0 45%, #7b5236 46% 60%, #9bd67f 61%); touch-action: none; }
.topo-pet { position: absolute; left: 10%; width: 80%; top: 100%; transition: top 0.15s ease-out; }
.topo-pet svg { width: 100%; height: auto; }
.topo.up .topo-pet { top: 8%; }
.topo.gold .topo-pet { filter: sepia(1) saturate(4) hue-rotate(-10deg) brightness(1.1); }
.topo.hit .topo-pet { transform: scale(0.85); filter: brightness(1.3); }
.game-end { margin: auto; text-align: center; background: #fff; border-radius: 28px; padding: 22px; width: min(92%, 380px); box-shadow: var(--shadow); }
.game-end-pet { width: 130px; margin: 0 auto; }
.game-end-pet svg { width: 100%; height: auto; }
.game-score { font-family: 'Titan One', sans-serif; font-size: 2rem; color: var(--pink); margin: 4px 0; }
.game-end-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }

/* Tienda: casas y remodelaciones */
.segmented button { padding: 8px 2px; font-size: 0.78rem; line-height: 1.25; }
.segmented button { flex: 1 1 0; white-space: normal; word-break: keep-all; }
.house-list { display: flex; flex-direction: column; gap: 12px; }
.house-card {
  display: flex; flex-direction: column; text-align: left; border: none; padding: 0; overflow: hidden; border-radius: 22px;
  background: #fff; box-shadow: var(--shadow); border-top: 4px solid var(--r);
}
.house-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #eee; }
.house-card-info { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 14px 14px; }
.house-card-info b { font-size: 1.05rem; }
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.photo-card { position: relative; border: none; padding: 0; overflow: hidden; border-radius: 18px; background: #fff; box-shadow: var(--shadow); text-align: left; border-bottom: 4px solid var(--r); }
.photo-card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; background: #eee; }
.photo-card-info { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 8px 10px 10px; }
.photo-card-info b { font-size: 0.85rem; }
.photo-card.using { outline: 3px solid var(--pink); }
.room-preview { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 4 / 5; margin: 8px 0 12px; background: #eee; }
.room-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.room-preview-pet { position: absolute; left: 50%; bottom: 3%; width: 52%; transform: translateX(-50%); filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.35)); }
.room-preview-pet svg { width: 100%; height: auto; display: block; }
.house-front { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 18px; display: block; margin: 8px 0; background: #eee; }
.house-rooms { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 6px 0 12px; }
.house-rooms figure { margin: 0; text-align: center; }
.house-rooms img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; display: block; background: #eee; }
.house-rooms figcaption { font-size: 0.6rem; font-weight: 600; color: var(--muted); }
.house-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.house-mini button { border: 2px solid transparent; background: #fff; border-radius: 12px; padding: 3px; display: flex; flex-direction: column; gap: 2px; }
.house-mini button.active { border-color: var(--pink); }
.house-mini img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 9px; }
.house-mini small { font-size: 0.65rem; font-weight: 600; }
