/* Feed the Monster: a candy-land backyard with Munch in the middle and food drifting across the sky. */
.game.monster { background: #c9f29b; }
.game.monster .mn-scene {
  flex: 1; position: relative; min-height: 0; overflow: hidden;
  background: linear-gradient(#ffb8e0, #ffe3f2 62%, #b9ec86 62%, #96d863);
}
.game.monster .mn-deco { position: absolute; font-size: 80px; bottom: 30%; }
.game.monster .mn-deco.d1 { left: 4%; }
.game.monster .mn-deco.d2 { right: 6%; font-size: 64px; }
.game.monster .mn-deco.d3 { right: 18%; bottom: 8%; font-size: 48px; }
.game.monster .mn-deco.d4 { left: 40%; top: 4%; bottom: auto; font-size: 56px; opacity: .7; }

.game.monster .mn-monster {
  position: absolute; left: 50%; bottom: 1%; width: min(330px, 46vh); z-index: 2;
  transform: translateX(-50%) scale(var(--grow, 1)); transform-origin: bottom center;
  transition: transform .5s cubic-bezier(.2, 1.6, .4, 1);
}
.game.monster .mn-svg { width: 100%; height: auto; display: block; overflow: visible; }
.game.monster .mn-monster.grow-pop { animation: mn-bounce .6s ease-out; }
.game.monster .mn-monster.mega .mn-svg { filter: drop-shadow(0 0 14px rgba(255, 210, 63, .8)); }
.game.monster .pupil { transition: transform .15s; }
.game.monster .lid { transform-box: fill-box; transform-origin: center top; animation: mn-blink 4.2s infinite; }
.game.monster .mn-glow { animation: mn-glow 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

/* Mouth faces */
.game.monster .mouth-open, .game.monster .mouth-sad, .game.monster .mouth-ew { display: none; }
.game.monster .mn-monster.open .mouth-idle, .game.monster .mn-monster.chomp .mouth-idle,
.game.monster .mn-monster.sad .mouth-idle, .game.monster .mn-monster.ew .mouth-idle { display: none; }
.game.monster .mn-monster.open .mouth-open { display: inline; }
.game.monster .mn-monster.chomp .mouth-open { display: inline; animation: mn-chomp .45s ease-in-out; transform-box: fill-box; transform-origin: center; }
.game.monster .mn-monster.sad .mouth-sad { display: inline; }
.game.monster .mn-monster.sad .lid { animation: none; transform: scaleY(.45); }
.game.monster .mn-monster.ew .mouth-ew { display: inline; }
.game.monster .mn-monster.ew .lid { animation: none; transform: scaleY(.6); }

/* Tummy meter */
.game.monster .mn-meter {
  position: absolute; left: 3%; bottom: 6%; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: #fff; border: 4px solid var(--ink); border-radius: 20px; padding: 8px 14px; box-shadow: var(--shadow); font-weight: 800;
}
.game.monster .mn-name { color: var(--grape); font-size: 18px; white-space: nowrap; }
.game.monster .mn-label { font-size: 14px; color: var(--ink-soft); }
.game.monster .mn-pips { display: flex; flex-direction: column-reverse; gap: 4px; }
.game.monster .pip { display: block; width: 40px; height: 22px; border: 3px solid var(--ink); border-radius: 8px; background: #eee; }
.game.monster .pip.on { background: var(--mint); animation: mn-pip .3s ease-out; }

/* Floating foods */
.game.monster .mn-foods { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.game.monster .mn-food { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; will-change: transform; }
.game.monster .mf-emoji { font-size: calc(64px * var(--mn-s, 1)); line-height: 1; filter: drop-shadow(0 4px 0 rgba(58, 42, 74, .2)); }
.game.monster .mf-word {
  background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 0 12px;
  font-size: calc(30px * var(--mn-s, 1)); font-weight: 800; letter-spacing: 2px; white-space: nowrap; box-shadow: 0 3px 0 rgba(58, 42, 74, .2);
  transition: opacity .15s;
}
.game.monster .mf-word span.done { color: var(--good); }
.game.monster .mf-word span.now { color: var(--coral-dark); text-decoration: underline 4px var(--coral); text-underline-offset: 6px; }
.game.monster .mn-food.silly .mf-word { background: #f1e6ff; }
.game.monster .mn-food.targeted { z-index: 1; }
.game.monster .mn-food.targeted .mf-word { background: #fff8d6; box-shadow: 0 0 0 4px var(--sun); }
.game.monster .mn-food.gone { opacity: 0; transition: opacity .5s; }

@keyframes mn-blink { 0%, 92%, 100% { transform: scaleY(0); } 95% { transform: scaleY(1); } }
@keyframes mn-chomp { 0% { transform: scaleY(1); } 35% { transform: scaleY(.08); } 65% { transform: scaleY(.85); } 100% { transform: scaleY(.1); } }
@keyframes mn-bounce { 0%, 100% { scale: 1; } 30% { scale: 1.18 .86; } 60% { scale: .92 1.1; } }
@keyframes mn-glow { 0%, 100% { opacity: .7; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.2); } }
@keyframes mn-pip { from { transform: scale(1.4); } to { transform: none; } }

@media (max-width: 640px) {
  .game.monster .mn-meter { transform: scale(.75); transform-origin: bottom left; }
  .game.monster .mf-emoji { font-size: 48px; }
  .game.monster .mf-word { font-size: 24px; }
}
