/* Manitas Pop: six ways to use the finger or the mouse. */
body {
  --sky1: #9fdcff;
  --sky2: #fff5d6;
  --hill1: #9be27a;
  --hill2: #5cc45a;
  --pipo: #ff8a3d;
  --pipo2: #ffb36b;
}
.emo { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; line-height: 1; font-style: normal; }
.mp-field { position: relative; width: min(96vw, 760px); height: min(60vh, 520px); touch-action: none; }

/* 1 · Bubbles */
.mp-bubble { position: absolute; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); border: 0; padding: 0; border-radius: 50%; cursor: pointer; touch-action: manipulation;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.95) 0 9%, rgba(255, 255, 255, 0.25) 10% 40%, rgba(160, 220, 255, 0.3) 60%, rgba(120, 170, 255, 0.5) 100%), conic-gradient(from 200deg, rgba(255, 120, 200, 0.28), rgba(255, 230, 120, 0.22), rgba(120, 255, 200, 0.22), rgba(120, 170, 255, 0.28), rgba(255, 120, 200, 0.28));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.85), inset -8px -10px 18px rgba(130, 90, 255, 0.35), 0 8px 18px rgba(40, 60, 120, 0.18);
  animation: mp-float var(--t, 3.2s) ease-in-out infinite alternate; animation-delay: var(--dl, 0s); }
.mp-bubble .emo { font-size: calc(var(--s) * 0.46); display: block; filter: drop-shadow(0 3px 2px rgba(42, 31, 92, 0.2)); }
.mp-bubble::after { content: ""; position: absolute; right: 20%; bottom: 18%; width: 14%; height: 8%; border-radius: 50%; background: rgba(255, 255, 255, 0.7); transform: rotate(-35deg); }
.mp-bubble.drift { animation: mp-drift var(--t, 6s) ease-in-out infinite alternate; }
.mp-bubble.gone { animation: mp-pop 0.28s ease-out forwards; pointer-events: none; }
@keyframes mp-float { from { transform: translateY(-8px); } to { transform: translateY(8px); } }
@keyframes mp-drift { 0% { transform: translate(calc(var(--dx) * -1), -10px); } 100% { transform: translate(var(--dx), 10px); } }
@keyframes mp-pop { to { transform: scale(1.5); opacity: 0; } }

/* 2 · Doors */
.mp-houses { display: flex; gap: min(4vw, 28px); justify-content: center; align-items: flex-end; flex-wrap: wrap; }
.mp-house { position: relative; width: var(--w); height: calc(var(--w) * 1.22); cursor: pointer; touch-action: manipulation; }
.mp-house svg { width: 100%; height: 100%; overflow: visible; display: block; }
.mp-house .door { transform-box: fill-box; transform-origin: 0% 50%; transition: transform 0.55s cubic-bezier(0.3, 1.4, 0.5, 1); }
.mp-house.open .door { transform: perspective(300px) rotateY(-75deg) scaleX(0.35); }
.mp-house.knock svg { animation: mp-knock 0.25s; }
.mp-house .who { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%) scale(0); font-size: calc(var(--w) * 0.36); transition: transform 0.45s cubic-bezier(0.3, 1.8, 0.5, 1) 0.2s; pointer-events: none; }
.mp-house.open .who { transform: translateX(-50%) scale(1); }
.mp-toc { position: absolute; top: -8%; right: -10%; background: #fff; color: #5b2fa0; font-weight: 800; font-size: calc(var(--w) * 0.16); border-radius: 999px; padding: 2px 10px; box-shadow: 0 4px 0 rgba(42, 31, 92, 0.2); animation: pq-in 0.3s; pointer-events: none; }
@keyframes mp-smoke { 0% { transform: translateY(4px); opacity: 0.2; } 50% { opacity: 0.9; } 100% { transform: translateY(-6px); opacity: 0; } }
.mp-house .smoke { animation: mp-smoke 2.6s ease-out infinite; }
@keyframes mp-knock { 30% { transform: rotate(-3deg); } 70% { transform: rotate(3deg); } }

/* 3 & 5 · Drag */
.mp-homes, .mp-tray { display: flex; flex-wrap: wrap; justify-content: center; gap: min(4vw, 26px); }
.mp-home { position: relative; width: var(--h); height: var(--h); border-radius: 26%; background: radial-gradient(circle at 50% 30%, #fff, #eef7ff 70%); border: 4px solid #fff; box-shadow: 0 6px 0 rgba(42, 31, 92, 0.15), 0 10px 18px rgba(42, 31, 92, 0.12); display: flex; align-items: center; justify-content: center; }
.mp-home svg { width: 86%; height: 86%; }
.mp-home.full { background: radial-gradient(circle at 50% 30%, #fff, #dcffcc 70%); border-color: #8fe07a; }
.mp-piece { --pick: var(--p); cursor: grab; }
.mp-piece .emo { font-size: calc(var(--p) * 0.62); }
.mp-piece.placed { box-shadow: none; background: none; }
.mp-fig { position: relative; width: min(62vw, 46vh, 330px); aspect-ratio: 1 / 1.15; }
.mp-fig > svg { width: 100%; height: 100%; display: block; }
.mp-slot { position: absolute; width: var(--z); height: var(--z); margin: calc(var(--z) / -2) 0 0 calc(var(--z) / -2); border-radius: 50%; border: 4px dashed rgba(91, 47, 160, 0.55); background: rgba(255, 255, 255, 0.35); display: flex; align-items: center; justify-content: center; }
.mp-slot.full { border-color: transparent; background: none; }
.mp-slot .emo { font-size: calc(var(--z) * 0.8); }
.mp-slot .ghost { opacity: 0.22; filter: grayscale(1); }
.mp-tray .mp-piece { --p: min(17vw, 12vh, 92px); }

/* 4 · Paths */
.mp-path { position: relative; width: min(96vw, 760px); height: min(56vh, 470px); touch-action: none; }
.mp-path svg { width: 100%; height: 100%; display: block; overflow: visible; }
.mp-path .edge { fill: none; stroke: #5fb84a; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 6px 0 rgba(42, 31, 92, 0.12)); }
.mp-path .road { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mp-path .road2 { fill: none; stroke: #fdf1d4; stroke-linecap: round; stroke-linejoin: round; }
.mp-path .dots { fill: none; stroke: #d8b77a; stroke-linecap: round; stroke-dasharray: 0.1 26; }
.mp-path .done { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mp-path .goal { font-size: 54px; text-anchor: middle; dominant-baseline: central; }
.mp-path .rider { cursor: grab; }
.mp-path .rider text { font-size: 50px; text-anchor: middle; dominant-baseline: central; }
.mp-path .rider circle { fill: rgba(255, 255, 255, 0.85); stroke: #ffd23f; stroke-width: 5; }

/* 6 · Rub */
.mp-window { position: relative; width: min(84vw, 52vh, 440px); aspect-ratio: 1; border-radius: 22px; overflow: hidden; border: 14px solid #c8925a; box-shadow: inset 0 0 0 3px #8a5a32, 0 0 0 3px #8a5a32, 0 10px 0 #8a5a32, 0 18px 28px rgba(42, 31, 92, 0.25); touch-action: none; background: linear-gradient(#bfe8ff 0 60%, #8fd16e 60%); }
.mp-window::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(125deg, transparent 18%, rgba(255, 255, 255, 0.35) 18% 24%, transparent 24% 28%, rgba(255, 255, 255, 0.25) 28% 30%, transparent 30%); }
.mp-window .pic::before { content: ""; position: absolute; left: 8%; top: 8%; width: 18%; height: 18%; border-radius: 50%; background: #ffe14d; box-shadow: 0 0 0 8px rgba(255, 225, 77, 0.3); }
.mp-window .pic { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: min(46vw, 28vh, 230px); }
.mp-window canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; transition: opacity 0.8s; }
.mp-window canvas.clear { opacity: 0; }
.mp-sponge { position: fixed; z-index: 30; font-size: 48px; pointer-events: none; transform: translate(-50%, -60%) rotate(-12deg); }

/* Stage buttons */
.art .emo { font-size: 62px; }
.art svg { width: 100%; height: 100%; }

/* Six games on the home screen: three per row, a bit smaller. */
.pq-stages { max-width: 560px; gap: min(3.5vw, 18px) min(4vw, 22px); }
.pq-stage-btn { width: min(25vw, 19vh, 140px); }
@media (max-height: 700px) { .pq-home .pq-pipo, .pq-home .pipo { transform: scale(0.8); } }
@media (orientation: portrait) { .mp-path { width: min(80vw, 46vh * 0.65 + 40px); height: min(58vh, 520px); } }
