/* La camilla de Jorge: página del juego (sobre site.css y memory.css, que ponen la cabecera, el pie y el ranking). */

.c-play { gap: 14px; }

/* ---------- Antes de empezar ---------- */
.c-intro { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
  background: #FFFCF3; border: 4px solid #1A1A1F; border-radius: 26px; box-shadow: 7px 7px 0 #1A1A1F; padding: 20px 18px 22px; }
.c-intro .fis { width: min(200px, 46vw); height: auto; margin-bottom: -8px; }
.c-intro p { margin: 0; font-size: 17px; font-weight: 500; line-height: 1.5; text-wrap: balance; max-width: 440px; }
.c-reglas { display: grid; gap: 8px; width: 100%; max-width: 440px; text-align: left; }
.c-regla { display: flex; align-items: center; gap: 12px; background: #FFFFFF; border: 2px solid #1A1A1F; border-radius: 14px; padding: 8px 12px; font-size: 15px; line-height: 1.35; }
.c-regla .ic { flex: none; width: 40px; height: 40px; display: grid; place-items: center; font-size: 26px; line-height: 1; }
.c-big { font: 800 20px 'Lexend', system-ui, sans-serif; color: #1A1A1F; background: #FFD23F; border: 3px solid #1A1A1F; border-radius: 16px;
  padding: 14px 34px; box-shadow: 5px 5px 0 #1A1A1F; cursor: pointer; }
.c-big:active { transform: translate(2px, 2px); box-shadow: 3px 3px 0 #1A1A1F; }
.c-big[disabled] { opacity: .6; cursor: progress; }

/* ---------- Marcador ---------- */
.c-game { display: flex; flex-direction: column; gap: 9px; }
.c-hud { display: flex; align-items: center; gap: 8px; }
.c-hud .sp { flex: 1; }
.c-pill { display: flex; align-items: center; gap: 6px; background: #FFFFFF; border: 3px solid #1A1A1F; border-radius: 999px;
  box-shadow: 3px 3px 0 #1A1A1F; padding: 4px 12px; font-weight: 800; font-size: 15px; white-space: nowrap; }
.c-pill b { font: 400 20px 'Bagel Fat One', 'Arial Rounded MT Bold', sans-serif; font-variant-numeric: tabular-nums; }
.c-vidas { display: flex; gap: 3px; }
.c-vida { width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid #1A1A1F; background: #FFD23F; transition: background .2s; }
.c-vida.ida { background: #E4533D; }

/* ---------- La escena ---------- */
.c-escena { position: relative; height: clamp(190px, 36vh, 330px); display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.c-escena.sacude { animation: c-sacude .3s cubic-bezier(.36, .07, .19, .97); }   /* el golpe se nota en la sala */
@keyframes c-sacude { 0%, 100% { transform: translate(0, 0); } 15% { transform: translate(-4px, 2px); }
  35% { transform: translate(5px, -3px); } 55% { transform: translate(-3px, 1px); } 80% { transform: translate(2px, -1px); } }
.c-pac { position: relative; flex: 0 0 auto; height: 100%; transition: transform .6s cubic-bezier(.4, 0, .2, 1); }
.c-pac img { height: 100%; width: auto; display: block; }
.c-escena.curado .c-pac { transform: translateX(-18%); }
.c-escena.salta .c-pac img { animation: c-brinco .62s cubic-bezier(.3, 1.4, .5, 1) 2; }
@keyframes c-brinco { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-14px); } }

/* Las molestias */
.c-mol { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; pointer-events: none; animation: c-brota .4s cubic-bezier(.3, 1.5, .5, 1) both; }
.c-mol i, .c-mol u { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: block; }
.c-mol i { width: 38px; height: 38px; border-radius: 50%; background: #E4533D; opacity: .3; animation: c-latir 1.6s ease-in-out infinite; }
.c-mol u { width: 20px; height: 20px; background: #E4533D; text-decoration: none; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .35));
  clip-path: polygon(46% 0, 16% 52%, 42% 52%, 30% 100%, 84% 40%, 54% 40%, 72% 0); }
@keyframes c-brota { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }
@keyframes c-latir { 0%, 100% { opacity: .26; transform: translate(-50%, -50%) scale(1); } 50% { opacity: .5; transform: translate(-50%, -50%) scale(1.3); } }
.c-mol.tensa i { animation: c-latir .4s ease-in-out infinite; }          /* el dolor se dispara justo antes */
.c-mol.tensa { animation: c-tensa .42s ease-in-out forwards; }
@keyframes c-tensa { to { transform: scale(1.35); } }
.c-mol.estalla { animation: c-estalla .34s cubic-bezier(.3, 1.4, .5, 1) forwards; }
@keyframes c-estalla { 0% { transform: scale(1); } 40% { transform: scale(1.75); filter: brightness(2.4) saturate(.2); }
  100% { transform: scale(.3); opacity: 0; filter: brightness(3); } }

/* La curación: anillos de impacto, destello, chispas, el paciente acusa el golpe y al final suben unos brillos */
.c-anillo { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; border-radius: 50%; border: 5px solid #BFE6FA;
  transform: translate(-50%, -50%) scale(0); opacity: 0; pointer-events: none; }
.c-anillo.va { animation: c-anillo .66s cubic-bezier(.15, .75, .3, 1) forwards; }
.c-anillo.dos { border-color: #FFFFFF; border-width: 3px; }
.c-anillo.dos.va { animation-delay: .09s; animation-duration: .58s; }
@keyframes c-anillo { 0% { transform: translate(-50%, -50%) scale(0); opacity: 1; } 60% { opacity: .85; }
  100% { transform: translate(-50%, -50%) scale(9); opacity: 0; } }
.c-destello { position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at 50% 55%, rgba(255, 255, 255, .95) 0, rgba(255, 255, 255, .5) 38%, rgba(255, 255, 255, 0) 66%); }
.c-destello.va { animation: c-destello .26s ease-out forwards; }
@keyframes c-destello { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }
.c-chispa { position: absolute; left: var(--x); top: var(--y); width: 7px; height: 7px; border-radius: 50%; background: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(31, 58, 95, .35); pointer-events: none; transform: translate(-50%, -50%);
  animation: c-chispa .55s cubic-bezier(.2, .8, .4, 1) forwards; }
@keyframes c-chispa { 0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.2); } }
.c-brillo { position: absolute; left: var(--x); bottom: 0; font-size: 18px; line-height: 1; color: #FFD23F; -webkit-text-stroke: 1.5px #1A1A1F;
  pointer-events: none; opacity: 0; animation: c-brillo 1.1s ease-out var(--t, 0s) forwards; }
@keyframes c-brillo { 0% { opacity: 0; transform: translateY(0) scale(.4); } 25% { opacity: 1; transform: translateY(-30px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-90px) scale(.8) rotate(25deg); } }
.c-pac.acusa img { animation: c-acusa .85s cubic-bezier(.3, 1.2, .5, 1); }
@keyframes c-acusa { 0% { transform: scaleY(1) scaleX(1); } 14% { transform: scaleY(.9) scaleX(1.07) translateY(6px); }
  42% { transform: scaleY(1.07) scaleX(.95) translateY(-8px); } 70% { transform: scaleY(.98) scaleX(1.01) translateY(2px); }
  100% { transform: scaleY(1) scaleX(1); } }

/* Las manos del fisio */
.c-manos { position: absolute; left: var(--x); top: var(--y); width: var(--w, 86px); height: auto;
  transform: translate(-50%, -62%) scale(.5) rotate(-18deg); opacity: 0; pointer-events: none; z-index: 3; }
.c-manos.llegan { animation: c-manos-vienen .42s cubic-bezier(.3, 1.2, .5, 1) forwards; }
@keyframes c-manos-vienen { from { opacity: 0; transform: translate(60px, -30px) scale(.5) rotate(-24deg); }
  to { opacity: 1; transform: translate(-50%, -62%) scale(1) rotate(0); } }
.c-manos.aprietan { animation: c-manos-aprietan .5s cubic-bezier(.3, 1.1, .4, 1) forwards; }
@keyframes c-manos-aprietan { 0% { opacity: 1; transform: translate(-50%, -62%) scale(1); }
  30% { transform: translate(-50%, -56%) scale(.9); } 55% { transform: translate(-50%, -60%) scale(.97); }
  100% { opacity: 1; transform: translate(-50%, -62%) scale(1); } }
.c-manos.se-van { animation: c-manos-se-van .38s ease-in forwards; }
@keyframes c-manos-se-van { to { opacity: 0; transform: translate(46px, -46px) scale(.65) rotate(16deg); } }
.c-calor { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; pointer-events: none; z-index: 2; }
.c-calor i { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; opacity: 0; transform: scale(.3);
  background: radial-gradient(circle, rgba(255, 226, 140, .95) 0, rgba(255, 210, 63, .5) 45%, rgba(255, 210, 63, 0) 72%); }
.c-calor.va i { animation: c-calor .62s ease-out forwards; }
@keyframes c-calor { 0% { opacity: 0; transform: scale(.3); } 45% { opacity: 1; transform: scale(1.15); } 100% { opacity: 0; transform: scale(1.5); } }

.c-globo { position: absolute; right: 3%; bottom: 56%;
  /* el hueco sobre la cabeza del fisio, igual en cualquier pantalla: su altura menos su desplazamiento, más un dedo */
  bottom: calc(min(54%, 168px) - 2% + 12px); max-width: 48%; background: #FFFFFF; border: 3px solid #1A1A1F; border-radius: 16px;
  box-shadow: 3px 3px 0 #1A1A1F; padding: 6px 10px; font-size: 13px; font-weight: 700; line-height: 1.3; text-align: left;
  opacity: 0; transform: scale(.4) translateY(10px); transform-origin: 85% 100%; pointer-events: none; }
.c-globo::after { content: ""; position: absolute; right: 16px; bottom: -13px; border: 7px solid transparent; border-top: 11px solid #1A1A1F; }
.c-globo.va { animation: c-globo .34s cubic-bezier(.3, 1.5, .5, 1) forwards; }
@keyframes c-globo { to { opacity: 1; transform: scale(1) translateY(0); } }

.c-fisio { position: absolute; right: 0; bottom: -2%; height: 54%; max-height: 168px; width: auto; opacity: 0; transform: translateX(42%);
  transition: opacity .45s .3s, transform .7s .3s cubic-bezier(.3, 1.3, .5, 1); pointer-events: none; }
.c-escena.curado .c-fisio { opacity: 1; transform: translateX(0); }
.c-fisio.gesto { animation: c-gesto .95s cubic-bezier(.25, .9, .3, 1); }
@keyframes c-gesto { 0% { transform: translateX(0) rotate(0); } 30% { transform: translateX(3%) rotate(2deg); }
  55% { transform: translateX(-7%) rotate(-3deg); } 100% { transform: translateX(0) rotate(0); } }
.c-fisio.asiente { animation: c-asiente .6s ease-in-out; }
@keyframes c-asiente { 0%, 100% { transform: translateY(0) rotate(0); } 35% { transform: translateY(5px) rotate(2deg); } 70% { transform: translateY(-2px) rotate(-1deg); } }

.c-aviso { margin: 0; font-size: 15px; line-height: 1.4; color: #4A4A55; text-align: center; min-height: 1.3em; font-weight: 600; }

/* ---------- La camilla: el dibujo, y la palabra descansa sobre el acolchado ----------
   El dibujo tiene proporción fija (1000 × 300), así que la fila de letras se coloca en
   porcentaje sobre el acolchado y camilla.js le da el alto exacto a cada letra. */
.c-camilla { position: relative; width: 100%; }
.c-cam { width: 100%; height: auto; display: block; }
.c-palabra { position: absolute; left: 7%; right: 7%; top: 22.7%; height: 24%;
  display: flex; gap: 4px; justify-content: center; align-items: center; }
.c-letra { box-sizing: border-box; flex: 0 0 auto; height: var(--lh, 26px); width: calc(var(--lh, 26px) * .78);
  display: grid; place-items: center; background: #FFFFFF; border: 2.5px solid #1A1A1F; border-radius: 8px;
  box-shadow: 2px 2px 0 #1A1A1F; font: 400 calc(var(--lh, 26px) * .62)/1 'Bagel Fat One', 'Arial Rounded MT Bold', sans-serif; }
.c-letra.vacia { background: #BFE6FA; }
.c-letra.soplada { background: #E4533D; color: #FFFFFF; }

/* ---------- El teclado ---------- */
.c-teclado { display: grid; grid-template-columns: repeat(auto-fit, minmax(2rem, 1fr)); gap: 5px; margin-top: 4px; }
.c-tecla { font: 800 15px 'Lexend', system-ui, sans-serif; color: #1A1A1F; background: #FFFFFF; border: 2.5px solid #1A1A1F; border-radius: 10px;
  box-shadow: 2px 2px 0 #1A1A1F; padding: .55rem 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.c-tecla:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 0 0 0 #1A1A1F; }
.c-tecla.bien { background: #C9EFD9; }
.c-tecla.mal { background: #4A4A55; color: #FFFFFF; border-color: #4A4A55; box-shadow: none; opacity: .55; }
.c-tecla:disabled { cursor: default; }

/* ---------- Para madres y padres ---------- */
.c-parents { background: #FFFFFF; border: 3px solid #1A1A1F; border-radius: 20px; padding: 16px 18px 18px; font-size: 15px; line-height: 1.5; }
.c-parents h2 { margin: 0 0 8px; font-family: 'Bagel Fat One', 'Arial Rounded MT Bold', sans-serif; font-weight: 400; font-size: 20px; }
.c-parents ul { margin: 0 0 8px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.c-parents p { margin: 0; color: #4A4A55; }

/* ---------- El desenlace, dentro de la ventana de memory.css ---------- */
.g-stamp.soft { color: #1F3A5F; border-color: #1F3A5F; }
.c-say { display: flex; align-items: flex-start; gap: 10px; text-align: left; margin: 0; width: 100%; }
.c-say img { flex: none; width: 54px; height: 54px; border-radius: 50%; border: 3px solid #1A1A1F; background: #BFE6FA; object-fit: cover; }
.c-say p { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.4; }
.c-say small { display: block; font: 400 15px 'Bagel Fat One', 'Arial Rounded MT Bold', sans-serif; color: #1F3A5F; }
.c-sum { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: 100%; }
.c-sum li { display: flex; flex-direction: column; align-items: center; gap: 1px; background: #FFFFFF; border: 3px solid #1A1A1F; border-radius: 14px;
  padding: 7px 14px; font-size: 12px; font-weight: 700; color: #4A4A55; }
.c-sum b { font: 400 21px 'Bagel Fat One', 'Arial Rounded MT Bold', sans-serif; color: #1A1A1F; font-variant-numeric: tabular-nums; }
.g-list .c-mol-n { font-size: 13px; color: #4A4A55; font-variant-numeric: tabular-nums; }

/* ---------- Otro juego ---------- */
.c-other { display: flex; align-items: center; gap: 14px; background: #FFD23F; border: 3px solid #1A1A1F; border-radius: 20px;
  box-shadow: 5px 5px 0 #1A1A1F; padding: 12px 16px; text-decoration: none; color: #1A1A1F; }
.c-other img { flex: none; height: 57px; width: auto; }
.c-other .k { display: block; font-family: 'Gochi Hand', cursive; font-size: 19px; color: #1F3A5F; }
.c-other b { font-size: 16px; line-height: 1.3; }

@media (max-width: 1023px) {
  .c-intro { padding: 16px 14px 18px; border-radius: 22px; box-shadow: 5px 5px 0 #1A1A1F; }
  .c-escena { height: clamp(175px, 30vh, 260px); }
  .c-globo { font-size: 12px; }
}
@media (max-width: 380px) {
  .c-palabra { gap: 3px; }
  .c-tecla { padding: .45rem 0; font-size: 14px; }
  .c-teclado { grid-template-columns: repeat(auto-fit, minmax(1.7rem, 1fr)); gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .c-mol, .c-mol i, .c-anillo.va, .c-destello.va, .c-calor.va i, .c-globo.va, .c-manos.llegan, .c-manos.aprietan, .c-manos.se-van,
  .c-escena.sacude, .c-pac.acusa img, .c-escena.salta .c-pac img, .c-fisio.gesto, .c-fisio.asiente, .c-chispa, .c-brillo { animation: none; }
  .c-mol { opacity: 1; }
  .c-globo.va { opacity: 1; transform: none; }
  .c-manos.llegan, .c-manos.aprietan { opacity: 1; transform: translate(-50%, -62%); }
  .c-manos.se-van { opacity: 0; }
  .c-pac, .c-fisio { transition: none; }
}
