/* Minijuegos de premio al acabar un nivel (04/11/2026, ver js/minijuegos.js) */
.mj-capa { position: fixed; inset: 0; z-index: 15; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(30, 24, 52, .55); }
.mj-capa[hidden] { display: none; }
.mj-carta {
  width: min(720px, 100%); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain;
  background: #FFFBF2; border-radius: 26px; box-shadow: 0 10px 0 rgba(0, 0, 0, .15), 0 20px 50px rgba(0, 0, 0, .3);
  padding: 14px 18px 20px; animation: mjEntra .35s cubic-bezier(.3, 1.4, .5, 1) both;
}
@keyframes mjEntra { from { transform: scale(.85); opacity: 0; } }
.mj-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.mj-titulo { font-size: 24px; font-weight: 900; color: var(--tinta, #2E2840); }
.mj-cerrar { width: 48px; height: 48px; flex: none; border: none; border-radius: 50%; background: #EFE7D6; font-size: 22px; color: var(--tinta, #2E2840); cursor: pointer; }
.mj-explica { margin: 0 0 10px; font-size: 18px; font-weight: 700; color: var(--tinta-suave, #6A6480); text-align: center; }
.mj-mini { min-height: 44px; padding: 4px 12px; border: 3px solid #E4DCCB; border-radius: 22px; background: #fff; font: inherit; font-size: 16px; font-weight: 800; color: var(--tinta, #2E2840); cursor: pointer; }

/* 🎈 Salva los globos */
.mj-globos-escena { position: relative; display: flex; justify-content: center; align-items: flex-end; height: 130px; margin-bottom: 6px; }
.mj-globos { position: absolute; top: 0; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; }
.mj-globo { font-size: 40px; display: inline-block; animation: mjFlota 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.35s); filter: hue-rotate(calc(var(--i) * 52deg)); }
.mj-globo.vuela { animation: mjVuela 1.2s ease-in forwards; }
@keyframes mjFlota { 50% { transform: translateY(-6px) rotate(3deg); } }
@keyframes mjVuela { to { transform: translateY(-220px) rotate(25deg) scale(.6); opacity: 0; } }
.mj-globos-guia { height: 78px; width: auto; position: relative; z-index: 1; }
.mj-pista { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 0 0 10px; padding: 10px 12px; background: #E3F2FF; border-radius: 18px; font-size: 19px; font-weight: 700; text-align: center; }
.mj-pista-dibujo { font-size: 38px; line-height: 1; }
.mj-pista-dibujo[hidden] { display: none; }
.mj-pista-texto { flex: 1 1 200px; }
.mj-palabra { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 4px 0 14px; }
.mj-letra { width: 42px; height: 54px; display: flex; align-items: center; justify-content: center; border-bottom: 5px solid var(--tinta, #2E2840); font-size: 34px; font-weight: 900; color: var(--tinta, #2E2840); }
.mj-letra.fija { border-bottom-color: transparent; }
.mj-letra.sale { animation: salto .4s; color: #1F7A4A; }
.mj-letra.perdida { color: var(--coral, #E2574C); }
.mj-teclado { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; }
.mj-tecla { min-height: 50px; border: 3px solid #E4DCCB; border-radius: 12px; background: #fff; font: inherit; font-size: 22px; font-weight: 900; color: var(--tinta, #2E2840); box-shadow: 0 3px 0 #E4DCCB; cursor: pointer; padding: 0; }
.mj-tecla.si { background: #DDF5E5; border-color: var(--hoja, #2E9E5B); color: #1E6B3A; }
.mj-tecla.no { background: #FFE1DC; border-color: #F3B8AE; color: #B5473A; opacity: .6; box-shadow: none; }

/* 🧩 Puzzle */
.mj-puzzle-zona { display: flex; gap: 12px; align-items: flex-start; justify-content: center; }
.mj-puzzle { display: grid; gap: 3px; width: min(520px, 100%); background: #2E2840; border: 4px solid #2E2840; border-radius: 14px; overflow: hidden; }
.mj-trozo { border: none; padding: 0; background-color: #ddd; background-repeat: no-repeat; cursor: pointer; transition: transform .15s; min-height: 0; }
.mj-trozo.elegido { outline: 5px solid var(--sol, #FFC83D); outline-offset: -5px; transform: scale(.94); }
.mj-puzzle.hecho { gap: 0; animation: salto .5s; }
.mj-modelo { width: 110px; border-radius: 10px; border: 3px solid #E4DCCB; flex: none; }

/* 🤫 Palabra prohibida */
.mj-modos { display: grid; gap: 12px; }
.mj-modos .btn { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0; font-size: 21px; }
.mj-modos small { font-size: 15px; font-weight: 600; opacity: .85; }
.mj-ronda { margin: 0 0 6px; text-align: center; font-weight: 800; color: var(--tinta-suave, #6A6480); }
.mj-luxi-dice { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.mj-luxi { height: 92px; width: auto; flex: none; }
.mj-luxi-dice > div { flex: 1; background: #fff; border: 3px solid #E4DCCB; border-radius: 20px; padding: 10px 14px; }
.mj-luxi-dice .mj-pista-texto { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.mj-prohibidas { margin: 0; font-size: 16px; font-weight: 700; color: #B5473A; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.mj-prohibidas span { color: var(--tinta-suave, #6A6480); }
.mj-prohibidas s { background: #FFE1DC; border-radius: 8px; padding: 1px 8px; text-decoration-thickness: 3px; }
.mj-opciones { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mj-opcion { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 64px; padding: 6px 10px; border: 3px solid #E4DCCB; border-radius: 18px; background: #fff; font: inherit; font-size: 19px; font-weight: 800; color: var(--tinta, #2E2840); box-shadow: 0 4px 0 #E4DCCB; cursor: pointer; overflow-wrap: anywhere; }
.mj-opcion b { font-size: 30px; }
.mj-opcion.si { background: #DDF5E5; border-color: var(--hoja, #2E9E5B); animation: salto .4s; }
.mj-opcion.no { background: #FFE1DC; opacity: .5; box-shadow: none; }
.mj-reloj { margin: 0 0 8px; text-align: center; font-size: 26px; font-weight: 900; }
.mj-reloj.poco b { color: var(--coral, #E2574C); }
.mj-tarjeta { background: #fff; border: 4px solid var(--sol, #FFC83D); border-radius: 22px; padding: 16px; text-align: center; margin-bottom: 12px; }
.mj-tarjeta-palabra { margin: 0 0 10px; font-size: 36px; font-weight: 900; }
.mj-tarjeta .mj-prohibidas { justify-content: center; font-size: 18px; }
.mj-botones { display: flex; gap: 10px; }
.mj-botones .btn { flex: 1; margin: 0; }

/* 🃏 Parejas */
.mj-cartas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mj-cartas.doce { grid-template-columns: repeat(4, 1fr); }
.mj-carta-p { position: relative; aspect-ratio: 1 / 1; border: none; padding: 0; background: none; cursor: pointer; perspective: 600px; }
.mj-carta-p span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 16px; backface-visibility: hidden; transition: transform .35s; font-weight: 900; padding: 4px; overflow-wrap: anywhere; line-height: 1.05; }
.mj-carta-p .dorso { background: linear-gradient(135deg, #7652C4, #3B98CD); color: #fff; font-size: 30px; box-shadow: 0 4px 0 rgba(0, 0, 0, .18); }
.mj-carta-p .cara { background: #fff; border: 3px solid #E4DCCB; transform: rotateY(180deg); font-size: clamp(13px, 3.2vw, 19px); color: var(--tinta, #2E2840); }
.mj-carta-p .cara.emoji { font-size: clamp(30px, 8vw, 46px); }
.mj-carta-p.abierta .dorso { transform: rotateY(180deg); }
.mj-carta-p.abierta .cara { transform: rotateY(360deg); }
.mj-carta-p.hecha .cara { background: #DDF5E5; border-color: var(--hoja, #2E9E5B); }

/* Final del minijuego */
.mj-fin { margin-top: 14px; padding: 14px; border-radius: 22px; background: #FFF3D6; text-align: center; animation: mjEntra .35s both; }
.mj-fin.gana { background: #DDF5E5; }
.mj-fin-guia { height: 96px; width: auto; }
.mj-fin-titulo { margin: 4px 0; font-size: 28px; font-weight: 900; }
.mj-fin-texto { margin: 0 0 6px; font-size: 19px; font-weight: 700; }
.mj-fin-monedas { margin: 0 0 10px; font-size: 24px; font-weight: 900; }
.mj-fin .btn { margin: 0 auto; }

/* Botón del final del nivel */
.btn-mj { background: linear-gradient(135deg, #7652C4, #3B98CD); color: #fff; box-shadow: 0 5px 0 #4B3290; animation: mjLate 1.6s ease-in-out infinite; }
@keyframes mjLate { 50% { transform: scale(1.04); } }

/* Móvil */
@media (max-width: 600px) {
  .mj-carta { padding: 10px 12px 16px; border-radius: 20px; }
  .mj-titulo { font-size: 20px; }
  .mj-teclado { grid-template-columns: repeat(7, 1fr); gap: 5px; }
  .mj-tecla { min-height: 46px; font-size: 20px; }
  .mj-letra { width: 30px; height: 44px; font-size: 26px; }
  .mj-modelo { display: none; }
  .mj-globos-escena { height: 112px; }
  .mj-globo { font-size: 32px; }
  .mj-opciones { grid-template-columns: 1fr 1fr; }
  .mj-opcion { font-size: 16px; min-height: 58px; }
  .mj-tarjeta-palabra { font-size: 28px; }
}
