/*! Opina · © 2026 Matías Exequiel Oyola — OM Soluciones Bioquímicas. Todos los derechos reservados. */
/* ===== Mascota «Opi» y globos de diálogo ===== */
:root {
  --opi-blue: #006ec5;
  --opi-sky: #1fa8ee;
  --opi-blush: #ff8fa3;
  --say-bg: #ffffff;
  --say-line: #d6e4f3;
}

.mascot { position: relative; flex: none; width: var(--opi-size, 140px); aspect-ratio: 230 / 200; max-width: 100%; }
.opi { width: 100%; height: 100%; overflow: visible; display: block; }
.opi-body { transform-origin: 100px 190px; animation: opi-float 3.6s ease-in-out infinite; }
.opi-outline { fill: var(--opi-blue); stroke: var(--opi-blue); stroke-width: 26; stroke-linejoin: round; }
.opi-fill { fill: #fff; }
.opi-rays line { stroke: var(--opi-sky); stroke-width: 10; stroke-linecap: round; }
.opi-rays { transform-origin: 180px 50px; animation: opi-rays 2.4s ease-in-out infinite; }
.opi-face circle, .opi-face ellipse.opi-mouth-o { fill: var(--opi-blue); }
.opi-face path, .opi-brows line { fill: none; stroke: var(--opi-blue); stroke-width: 8; stroke-linecap: round; }
.opi-blush ellipse { fill: var(--opi-blush); opacity: .45; }
.opi-hand ellipse { fill: var(--opi-blue); }
.opi-hand { transform-origin: 204px 146px; opacity: 0; transition: opacity .25s; }
.opi-eyes-open { transform-origin: 100px 92px; animation: opi-blink 5s infinite; }

/* Partes que se muestran según el estado de ánimo */
.opi-blush, .opi-brows, .opi-eyes-closed, .opi-eyes-up, .opi-mouth, .opi-mouth-o { display: none; }
.mascot:not([data-mood]) .opi-mouth-big,
.mascot[data-mood="hello"] .opi-mouth-big,
.mascot[data-mood="happy"] .opi-mouth-big { display: inline; }
.mascot[data-mood="happy"] .opi-eyes-open { display: none; }
.mascot[data-mood="happy"] .opi-eyes-closed,
.mascot[data-mood="happy"] .opi-blush { display: inline; }
.mascot[data-mood="hello"] .opi-blush { display: inline; }
.mascot[data-mood="calm"] .opi-mouth-soft { display: inline; }
.mascot[data-mood="sad"] .opi-eyes-open circle { r: 8px; }
.mascot[data-mood="sad"] .opi-mouth-sad,
.mascot[data-mood="sad"] .opi-brows { display: inline; }
.mascot[data-mood="sad"] .opi-rays { opacity: .35; animation: none; }
.mascot[data-mood="sad"] .opi-body { animation-duration: 5s; }
.mascot[data-mood="think"] .opi-eyes-open { display: none; }
.mascot[data-mood="think"] .opi-eyes-up,
.mascot[data-mood="think"] .opi-mouth-o { display: inline; }

/* Animaciones de una vez */
.mascot.anim-wave .opi-hand { opacity: 1; animation: opi-wave .45s ease-in-out 4 alternate; }
.mascot.anim-jump .opi-body { animation: opi-jump .9s cubic-bezier(.3, 1.6, .5, 1) 2; }
.mascot.anim-nod .opi-body { animation: opi-nod .7s ease-in-out 2; }

@keyframes opi-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes opi-rays { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.12); opacity: .75; } }
@keyframes opi-blink { 0%, 93%, 100% { transform: scaleY(1); } 95%, 97% { transform: scaleY(.12); } }
@keyframes opi-wave { from { transform: rotate(-22deg); } to { transform: rotate(18deg); } }
@keyframes opi-jump { 0%, 100% { transform: translateY(0) scale(1); } 35% { transform: translateY(-22px) scale(1.04); } 60% { transform: translateY(0) scale(.97, 1.03); } }
@keyframes opi-nod { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-6deg); } }

/* ----- Globo de diálogo ----- */
.talk { display: flex; align-items: center; gap: clamp(10px, 2vw, 22px); min-width: 0; }
.say {
  position: relative; min-width: 0; background: var(--say-bg); border: 2px solid var(--say-line);
  border-radius: 26px; padding: clamp(12px, 2vh, 22px) clamp(16px, 2.4vw, 30px);
  box-shadow: 0 10px 26px -18px rgba(0, 60, 120, .45);
  animation: say-in .35s cubic-bezier(.2, 1.3, .4, 1);
}
.say::before {                                       /* piquito hacia la mascota */
  content: ""; position: absolute; left: -12px; top: 50%; width: 22px; height: 22px;
  background: var(--say-bg); border-left: 2px solid var(--say-line); border-bottom: 2px solid var(--say-line);
  transform: translateY(-50%) rotate(45deg); border-bottom-left-radius: 5px;
}
.say > * { margin: 0; }
.say-hi { display: block; color: var(--opi-blue); font-weight: 750; font-size: .5em; letter-spacing: .01em; margin-bottom: .15em; }
@keyframes say-in { from { opacity: 0; transform: translateX(-10px) scale(.96); } to { opacity: 1; transform: none; } }

/* Variante centrada (pantalla de gracias): globo arriba, mascota abajo */
.talk--stack { flex-direction: column-reverse; text-align: center; }
.talk--stack .say::before { left: 50%; top: auto; bottom: -12px; transform: translateX(-50%) rotate(-45deg); }

/* Sin mascota: textos simples, sin globo */
.no-mascot .mascot { display: none; }
.no-mascot .say { background: none; border: 0; box-shadow: none; padding: 0; animation: none; }
.no-mascot .say::before, .no-mascot .say-hi { display: none; }

@media (prefers-reduced-motion: reduce) {
  .opi-body, .opi-rays, .opi-eyes-open, .say { animation: none !important; }
  .mascot.anim-wave .opi-hand { animation: none; }
}
