/* =========================================================================
   creatures.css — presentation for Kido.creatures.render() output.
   A .kido-creature wraps either an inline SVG (now) or an <img> (future
   raster/photo), sized to its container, with a silhouette mode + lightweight
   state animations so the SAME asset serves guess/reveal/idle/react in every
   game. Per-limb rigs (walk/fly) live inside individual art where authored.
   ========================================================================= */
.kido-creature {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; line-height: 1; overflow: visible;
}
.kido-creature > svg {
  width: 100%; height: 100%; display: block; overflow: visible;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .20));
}
.kido-creature > .creature-img {
  width: 100%; height: 100%; display: block;
  object-fit: contain;
  border-radius: 18px;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .20));
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), filter .3s ease;
}
.kido-creature .creature-emoji { font-size: 1em; line-height: 1; }
.kido-creature > .creature-img.is-flipped { scale: -1 1; }   /* Change #28: face the same way as its pair */
.kido-creature > .creature-sil { width: 100%; height: 100%; display: block; object-fit: contain; }   /* Change #28 shadow cut-outs */

/* In flat game containers the creature REPLACES an emoji glyph */
#sb-info-emoji .kido-creature,
.slot__key .kido-creature,
.slot__drop .kido-creature,
.chip .kido-creature,
.mem-face--front .kido-creature,
.shadow-sil .kido-creature,
.shadow-reveal .kido-creature,
.sg-big .kido-creature { width: 1.15em; height: 1.15em; }

.showcase .kido-creature {
  width: clamp(135px, 22vw, 210px) !important;
  height: clamp(135px, 22vw, 210px) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.opt--pic .kido-creature {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.showcase .creature-img,
.chip .creature-img,
.slot__key .creature-img,
.slot__drop .creature-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  border-radius: 18px !important;
  display: block !important;
}

.opt--pic .creature-img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  border-radius: clamp(14px, 8%, 20px) !important;
  display: block !important;
}

.opt--pic .kido-creature > svg {
  width: 90% !important;
  height: 90% !important;
  max-width: 100% !important;
  max-height: 100% !important;
}

.ttt__cell .kido-creature {
  width: 78%;
  height: 78%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ttt__cell .creature-img {
  width: 100%;
  height: 100%;
  border-radius: 14px;
}
.mem-face--front .kido-creature .creature-img {
  width: 100%;
  height: 100%;
  max-width: 72px;
  max-height: 72px;
  border-radius: 12px;
}

/* Dedicated Animal Choice Card in scene-animalsound */
.animal-choice-card {
  background: #FFFFFF;
  border-radius: clamp(26px, 12%, 36px);
  box-shadow: 0 18px 40px rgba(43, 33, 81, .16), 0 4px 12px rgba(0, 0, 0, .08), inset 0 0 0 3.5px rgba(255, 255, 255, .95);
  padding: clamp(8px, 4%, 14px);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s ease;
  animation: animal-card-float 4s ease-in-out infinite;
}
.animal-choice-card:hover {
  transform: translate(-50%, -50%) translateY(-6px) scale(1.05) !important;
  box-shadow: 0 24px 48px rgba(43, 33, 81, .24), 0 0 0 5px #FFC24B;
}
.animal-choice-card:active {
  transform: translate(-50%, -50%) scale(.94) !important;
}
.animal-choice-card .kido-creature {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.animal-choice-card .creature-img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: clamp(20px, 10%, 28px);
  object-fit: cover;
  box-shadow: none;
  display: block;
}
.animal-choice-card .kido-creature > svg {
  width: 88%;
  height: 88%;
}

@keyframes animal-card-float {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-6px); }
}

/* Speaker button in Flagship Scene 5 */
.scene-speaker-btn {
  position: absolute;
  top: 18px; left: 18px;
  width: 56px; height: 56px;
  border: none; border-radius: 50%;
  background: transparent;
  cursor: pointer; padding: 0;
  outline: none;
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .22));
}
.scene-speaker-btn:hover { transform: scale(1.1); }
.scene-speaker-btn:active { transform: scale(.92); }
.scene-speaker-btn.is-playing .speaker-wave-1 { animation: speaker-wave 0.8s ease-in-out infinite; }
.scene-speaker-btn.is-playing .speaker-wave-2 { animation: speaker-wave 0.8s ease-in-out infinite 0.2s; }
.scene-speaker-btn .speaker-svg {
  width: 100%; height: 100%;
  display: block;
}

/* Animal & Bird Card for Sound & Safari Games — Big, tactile, prominent cards */
.opt--animal-card {
  background: #FFFFFF !important;
  border: 4.5px solid #FFFFFF !important;
  border-radius: clamp(22px, 4vw, 32px) !important;
  padding: clamp(10px, 2vw, 16px) !important;
  box-shadow:
    0 18px 40px rgba(4, 28, 12, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.12),
    inset 0 2px 4px rgba(255, 255, 255, 0.95) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s ease, border-color .2s ease !important;
}
.opt--animal-card:hover {
  transform: translateY(-8px) scale(1.05) !important;
  border-color: #FDE047 !important;
  box-shadow:
    0 26px 52px rgba(4, 35, 14, 0.44),
    0 0 0 4px #FACC15,
    inset 0 2px 4px rgba(255, 255, 255, 0.95) !important;
}
.opt--animal-card:active {
  transform: scale(.96) !important;
}
.opt__pic-wrap {
  width: 100% !important;
  height: clamp(130px, 24vw, 220px) !important;
  margin: 0 auto;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.opt__pic-wrap .kido-creature {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.opt__pic-wrap .creature-img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: clamp(14px, 3vw, 22px) !important;
  object-fit: contain !important;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.18)) !important;
  transition: transform 0.22s ease !important;
}
.opt--animal-card:hover .creature-img {
  transform: scale(1.06) !important;
}

/* Soundboard tiles with real pictures - complete square box */
.board-tile .board-tile__emoji {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  overflow: hidden;
  background: #F8F9FD;
  font-size: clamp(74px, 20vw, 98px);
  user-select: none;
}
.board-tile .kido-creature {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.board-tile .creature-img {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 18px !important;
  object-fit: cover !important;
  display: block !important;
  box-shadow: none !important;
  background: #FFFFFF !important;
}
.board-tile .kido-creature > svg {
  width: 82% !important;
  height: 82% !important;
}

/* Silhouette: one asset serves GUESS (dark) + REVEAL (colour). Works on SVG,
   raster and emoji alike. */
.kido-creature.is-silhouette > svg,
.kido-creature.is-silhouette > .creature-img,
.kido-creature.is-silhouette > .creature-sil { filter: brightness(0) drop-shadow(0 8px 10px rgba(0, 0, 0, .28)); }
.kido-creature.is-silhouette .creature-emoji { filter: brightness(0); }

/* Lightweight visual states — no per-limb rig required. */
.kido-creature.is-idle { animation: creature-breathe 3.4s ease-in-out infinite; transform-origin: 50% 90%; }
.kido-creature.is-look { animation: creature-look 4s ease-in-out infinite; transform-origin: 50% 80%; }
.kido-creature.is-happy,
.kido-creature.is-react { animation: creature-pop .5s ease; }
.kido-creature.is-sleeping { opacity: .9; animation: creature-sleep 3.6s ease-in-out infinite; transform-origin: 50% 90%; }

@keyframes creature-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03, .985); } }
@keyframes creature-look { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-4deg); } 70% { transform: rotate(4deg); } }
@keyframes creature-pop { 0% { transform: scale(.9); } 45% { transform: scale(1.09); } 100% { transform: scale(1); } }
@keyframes creature-sleep { 0%, 100% { transform: rotate(-1deg) scale(1); } 50% { transform: rotate(1deg) scale(1.015); } }

.reduce-motion .kido-creature.is-idle,
.reduce-motion .kido-creature.is-look,
.reduce-motion .kido-creature.is-happy,
.reduce-motion .kido-creature.is-react,
.reduce-motion .kido-creature.is-sleeping,
.reduce-motion .animal-choice-card { animation: none !important; }

/* Realistic 3D Fruit & Shape Assets — ensure transparent backgrounds and crisp aspect ratio */
.creature-img[src*="fruits"],
.creature-img[src*="shapes"],
.kido-creature[data-creature="apple"] .creature-img,
.kido-creature[data-creature="banana"] .creature-img,
.kido-creature[data-creature="orange"] .creature-img,
.kido-creature[data-creature="strawberry"] .creature-img,
.kido-creature[data-creature="watermelon"] .creature-img,
.kido-creature[data-creature="grapes"] .creature-img,
.kido-creature[data-creature="mango"] .creature-img,
.kido-creature[data-creature="pineapple"] .creature-img,
.kido-creature[data-creature="cherry"] .creature-img,
.kido-creature[data-creature="carrot"] .creature-img {
  object-fit: contain !important;
  border-radius: 0 !important;
  background: transparent !important;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .26));
}
