/* ══════════════════════════════════════════════
   JACKPOT — Animación explosión caldero + ganador
   Añadir al final de minijuegos.css (o jackpot_css.css)
   ══════════════════════════════════════════════ */

/* ── OVERLAY DE EXPLOSIÓN (encima del caldero) ── */
.jp-explode-overlay {
    position: fixed;
    inset: 0;
    z-index: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* ── CALDERO EXPLOTANDO (clon animado) ────────── */
.jp-cauldron-explode {
    position: fixed;
    width: 160px;
    height: 160px;
    z-index: 801;
    pointer-events: none;
    animation: jp-cauldron-explode-anim 1s cubic-bezier(.34,1.56,.64,1) forwards;
    transform-origin: center bottom;
}
@keyframes jp-cauldron-explode-anim {
    0%   { transform: scale(1)    translateY(0);      opacity: 1; filter: brightness(1); }
    30%  { transform: scale(1.3)  translateY(-20px);  opacity: 1; filter: brightness(2) saturate(2); }
    60%  { transform: scale(1.6)  translateY(-40px);  opacity: .8; filter: brightness(3) saturate(3); }
    100% { transform: scale(2.2)  translateY(-80px);  opacity: 0; filter: brightness(4) saturate(4) blur(8px); }
}

/* ── FLASH DE LUZ ─────────────────────────────── */
.jp-flash {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(240,192,64,.9), rgba(124,58,237,.6), transparent 70%);
    z-index: 802;
    pointer-events: none;
    animation: jp-flash-anim .6s ease-out forwards;
}
@keyframes jp-flash-anim {
    0%   { opacity: 0; }
    20%  { opacity: 1; }
    100% { opacity: 0; }
}

/* ── MONEDAS SALIENDO DEL CALDERO ─────────────── */
.jp-burst-coin {
    position: fixed;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    pointer-events: none;
    z-index: 803;
    animation: jp-burst-coin-anim var(--dur, 1s) var(--delay, 0s) ease-out forwards;
    box-shadow: 0 0 12px var(--color, #f0c040), inset 0 1px 2px rgba(255,255,255,.3);
}
.jp-burst-coin--gold   { background: radial-gradient(circle at 35% 35%, #ffe066, #f0c040 50%, #b8860b); border: 2px solid #d4a010; --color:#f0c040; }
.jp-burst-coin--purple { background: radial-gradient(circle at 35% 35%, #c090ff, #7c3aed 50%, #4a1d96); border: 2px solid #9c6bef; --color:#9c6bef; }
.jp-burst-coin--green  { background: radial-gradient(circle at 35% 35%, #80ff9e, #4caf7d 50%, #1a6640); border: 2px solid #4caf7d; --color:#4caf7d; }
@keyframes jp-burst-coin-anim {
    0%   { transform: translate(0, 0) rotate(0deg) scale(.5);   opacity: 1; }
    60%  { opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) rotate(var(--rot, 720deg)) scale(1.2); opacity: 0; }
}

/* ── MONEDA DEL GANADOR (grande, sale del centro) ─ */
.jp-winner-coin {
    position: fixed;
    z-index: 810;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    animation: jp-winner-coin-appear 1.2s .8s cubic-bezier(.34,1.56,.64,1) forwards;
    opacity: 0;
}
@keyframes jp-winner-coin-appear {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(-180deg); }
    60%  { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(10deg); }
    80%  { transform: translate(-50%, -50%) scale(.95) rotate(-5deg); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}

/* Círculo con foto del ganador */
.jp-winner-coin-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #f0c040;
    box-shadow:
        0 0 0 6px rgba(240,192,64,.3),
        0 0 40px rgba(240,192,64,.6),
        0 0 80px rgba(240,192,64,.3);
    animation: jp-avatar-spin-in 1s .8s cubic-bezier(.34,1.56,.64,1) both,
               jp-avatar-glow 2s 1.8s ease-in-out infinite;
}
.jp-winner-coin-avatar--placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #f0c040);
    border: 4px solid #f0c040;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    box-shadow: 0 0 0 6px rgba(240,192,64,.3), 0 0 40px rgba(240,192,64,.6);
}
@keyframes jp-avatar-glow {
    0%, 100% { box-shadow: 0 0 0 6px rgba(240,192,64,.3), 0 0 40px rgba(240,192,64,.6), 0 0 80px rgba(240,192,64,.3); }
    50%       { box-shadow: 0 0 0 8px rgba(240,192,64,.5), 0 0 60px rgba(240,192,64,.8), 0 0 100px rgba(240,192,64,.4); }
}

/* Nick del ganador bajo la moneda */
.jp-winner-nick {
    margin-top: 14px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 20px rgba(240,192,64,.8), 0 2px 8px rgba(0,0,0,.8);
    letter-spacing: 1px;
    text-align: center;
    white-space: nowrap;
    animation: jp-nick-appear .5s 1.6s ease-out both;
    background: rgba(0,0,0,.6);
    padding: 6px 20px;
    border-radius: 30px;
    border: 1px solid rgba(240,192,64,.4);
    backdrop-filter: blur(8px);
}
@keyframes jp-nick-appear {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.jp-winner-prize {
    margin-top: 8px;
    font-family: 'Space Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #f0c040;
    text-shadow: 0 0 16px rgba(240,192,64,.8);
    animation: jp-nick-appear .5s 2s ease-out both;
    background: rgba(0,0,0,.6);
    padding: 4px 16px;
    border-radius: 20px;
    border: 1px solid rgba(240,192,64,.3);
    backdrop-filter: blur(8px);
}

/* Badge "¡GANADOR!" */
.jp-winner-badge {
    margin-top: 6px;
    font-family: 'Rajdhani', sans-serif;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #f0c040;
    background: rgba(240,192,64,.15);
    border: 1px solid rgba(240,192,64,.4);
    padding: 3px 14px;
    border-radius: 20px;
    animation: jp-nick-appear .5s 2.2s ease-out both;
}

/* Partículas de confeti */
.jp-confetti {
    position: fixed;
    width: 8px;
    height: 8px;
    z-index: 805;
    pointer-events: none;
    border-radius: 2px;
    animation: jp-confetti-fall var(--dur, 2s) var(--delay, 0s) linear forwards;
}
@keyframes jp-confetti-fall {
    0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) rotate(var(--rot, 720deg)); opacity: 0; }
}

/* Botón cerrar sobre la animación */
.jp-winner-close-btn {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 820;
    padding: 14px 40px;
    background: linear-gradient(135deg, #d4a010, #f0c040);
    border: none;
    border-radius: 12px;
    color: #3d2a00;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(240,192,64,.4);
    animation: jp-nick-appear .5s 2.5s ease-out both;
    transition: transform .2s, box-shadow .2s;
}
.jp-winner-close-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 12px 40px rgba(240,192,64,.6);
}

/* Backdrop oscuro detrás de todo */
.jp-winner-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    backdrop-filter: blur(6px);
    z-index: 799;
    animation: jp-fade-in .4s ease;
}
@keyframes jp-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
