/* =========================================================================
   cartas-tutorial.css — estilos del tutorial "¿cómo funciona?" de la sección CARTAS (cartas-tutorial.js)
   Todo vive en position:fixed sobre la pantalla del teléfono; mismo look que la burbuja del tutorial de batalla
   (onboarding-tutorial.css): nube blanca con borde negro, botón dorado y el Rey como guía.
   ========================================================================= */
.ct-root { position: fixed; inset: 0; z-index: 100000; pointer-events: none; opacity: 0; transition: opacity .25s ease; font-family: 'Nunito', sans-serif; }
.ct-root.ct-on { opacity: 1; }

/* velo: el hueco queda tocable; lo demás se bloquea con 4 (o 5) bloques transparentes */
.ct-dim { position: fixed; inset: 0; background: rgba(4, 8, 22, .76); pointer-events: auto; touch-action: none; }
.ct-blk { position: fixed; background: transparent; pointer-events: auto; touch-action: none; display: none; }
.ct-aro {
  position: fixed; box-sizing: border-box; display: none; pointer-events: none;
  border: 3px solid #FFD100; border-radius: 14px;
  box-shadow: 0 0 0 200vmax rgba(4, 8, 22, .76), 0 0 16px 3px rgba(255, 209, 0, .85);
  transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease;
  animation: ct-late 1.2s ease-in-out infinite;
}
@keyframes ct-late {
  0%, 100% { border-color: #FFD100; }
  50%      { border-color: #fff3a0; }
}

/* mano que enseña el gesto */
.ct-mano {
  position: fixed; left: 0; top: 0; width: 56px; margin-left: -26px; margin-top: -3px; display: none;
  pointer-events: none; transform-origin: 47% 4%; z-index: 4; filter: drop-shadow(0 6px 5px rgba(0, 0, 0, .5));
}

/* franja de aviso (siempre visible) y botón de salir */
.ct-banda {
  position: fixed; top: 0; box-sizing: border-box; z-index: 6; pointer-events: none; text-align: center;
  font-family: 'Lilita One', sans-serif; font-size: 11px; letter-spacing: .4px; line-height: 20px; height: 20px;
  color: #1a1300; background: linear-gradient(180deg, #FFE066, #FFB300); border-bottom: 2px solid #05070a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px;
}
.ct-salir {
  all: unset; box-sizing: border-box; position: fixed; top: 26px; z-index: 6; pointer-events: auto; cursor: pointer;
  font-family: 'Lilita One', sans-serif; font-size: 11px; letter-spacing: .4px; color: #fff;
  background: linear-gradient(180deg, #ff6a5a, #d42a1b); border: 2px solid #05070a; border-radius: 12px;
  padding: 3px 10px; box-shadow: 0 3px 0 #7d150c; touch-action: manipulation;
}
.ct-salir:active { transform: translateY(2px); box-shadow: 0 1px 0 #7d150c; }

/* aviso de monedas de práctica */
.ct-toast {
  position: fixed; top: 56px; z-index: 7; display: flex; justify-content: center; pointer-events: none;
  opacity: 0; transform: translateY(-8px); transition: opacity .25s ease, transform .25s ease;
}
.ct-toast.ct-on { opacity: 1; transform: translateY(0); }
.ct-toast span {
  font-family: 'Lilita One', sans-serif; font-size: 12px; color: #fff; padding: 5px 12px;
  background: linear-gradient(180deg, #52e86f, #1fa83a); border: 2px solid #05070a; border-radius: 14px;
  box-shadow: 0 3px 0 #0d5a1c; max-width: 92%; text-align: center;
}

/* personaje + nube de texto: se mueve (top) junto a la zona que explica */
.ct-guia {
  position: fixed; top: 100px; z-index: 5; display: flex; align-items: flex-end; box-sizing: border-box; pointer-events: auto;
  transition: top .5s cubic-bezier(.3, 1.25, .5, 1);
}
.ct-rey {
  flex: none; width: 50px; height: 130px; margin-right: 6px;
  filter: drop-shadow(3px 5px 6px rgba(0, 0, 0, .5));
  animation: ct-entra .55s cubic-bezier(.3, 1.4, .5, 1) both;
}
.ct-rey img {
  display: block; width: 100%; height: 100%; object-fit: contain; transform-origin: 0 60%;
  animation: ct-respira 3.4s ease-in-out infinite;
}
.ct-habla .ct-rey img { animation: ct-habla .42s ease-in-out infinite; }
@keyframes ct-entra { from { transform: translateX(-80px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes ct-respira { 0%, 100% { transform: translateX(0) scale(1); } 50% { transform: translateX(2px) scale(1.012); } }
@keyframes ct-habla { 0%, 100% { transform: translateX(1px) rotate(0) scale(1); } 50% { transform: translateX(3px) rotate(1.6deg) scale(1.03); } }

.ct-dialogo {
  position: relative; flex: 1; min-width: 0; box-sizing: border-box; background: #fff;
  border: 3px solid #05070a; border-radius: 18px; padding: 10px 12px 10px 12px;
  box-shadow: 0 4px 0 #05070a, 0 10px 22px rgba(0, 0, 0, .5);
}
.ct-dialogo::before {
  content: ''; position: absolute; left: -10px; bottom: 34px; width: 14px; height: 14px; background: #fff;
  border-left: 3px solid #05070a; border-bottom: 3px solid #05070a; border-radius: 0 0 0 4px; transform: rotate(45deg);
}
.ct-texto { position: relative; }
.ct-fantasma { visibility: hidden; }
.ct-escrito { position: absolute; left: 0; top: 0; right: 0; }
.ct-titulo { display: block; font-family: 'Lilita One', sans-serif; font-size: 16px; line-height: 1.15; color: #c25a00; margin-bottom: 3px; }
.ct-cuerpo { display: block; font-weight: 800; font-size: 12.5px; line-height: 1.32; color: #1c2430; }

.ct-pie { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 8px; }
.ct-sig {
  all: unset; box-sizing: border-box; cursor: pointer; white-space: nowrap; touch-action: manipulation;
  font-family: 'Lilita One', sans-serif; font-size: 15px; letter-spacing: .4px; color: #1a1300;
  background: linear-gradient(180deg, #FFE066, #FFB300); border: 3px solid #05070a; border-radius: 12px;
  padding: 4px 18px; box-shadow: 0 4px 0 #7a4b00; animation: ct-btn 1.1s ease-in-out infinite;
}
.ct-sig:active { transform: translateY(3px); box-shadow: 0 1px 0 #7a4b00; animation: none; }
@keyframes ct-btn { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.ct-saltarpaso {
  all: unset; cursor: pointer; font-weight: 800; font-size: 11px; color: #7b8696; text-decoration: underline; touch-action: manipulation;
}

/* pantallas muy bajas: letra y personaje más chicos para que la nube no tape la zona del paso */
@media (max-height: 640px) {
  .ct-rey { width: 38px; height: 100px; }
  .ct-cuerpo { font-size: 11.5px; }
  .ct-titulo { font-size: 14px; }
}
