/* =========================================
   MINIJUEGO CLICKER STYLES
   ========================================= */

.leaderboard-container {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    padding: 1.5rem;
    border-radius: 16px;
    min-width: 200px;
    z-index: 50;
    animation: slideUp 1s ease-out forwards;
}

.leaderboard-container h4 {
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}

#leaderboard-list {
    list-style: none;
    font-size: 0.9rem;
}

#leaderboard-list li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: #cbd5e1;
}

#leaderboard-list li span.score-val {
    font-weight: bold;
    color: var(--secondary);
}

.clicker-wrapper {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.floating-score {
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
    margin-bottom: 0.5rem;
    transition: transform 0.1s;
}

.clicker-btn-container {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.radial-timer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(rgba(248, 113, 113, 0.7) var(--progress, 0%), transparent 0);
    pointer-events: none;
    z-index: 5;
    mix-blend-mode: overlay;
}

.countdown-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 900;
    color: #f87171;
    text-shadow: 0 0 10px rgba(0,0,0,0.8), 0 0 5px rgba(248, 113, 113, 0.8);
    pointer-events: none;
    z-index: 6;
    opacity: 0;
}

.countdown-text.visible {
    opacity: 1;
    animation: popText 0.5s ease-out forwards;
}

@keyframes popText {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.ferluis-clicker.bounce-active {
    animation: bounceClick 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceClick {
    0% { transform: scale(1); }
    40% { transform: scale(0.8); box-shadow: 0 0 30px var(--primary); }
    75% { transform: scale(1.15); box-shadow: 0 0 10px rgba(248, 113, 113, 0.4); }
    100% { transform: scale(1); box-shadow: 0 0 20px rgba(248, 113, 113, 0.4); }
}

.ferluis-clicker {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(248, 113, 113, 0.4);
    border: 2px solid var(--primary);
    transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
    user-select: none;
    -webkit-user-drag: none;
}

.ferluis-clicker:active {
    transform: scale(0.9);
    box-shadow: 0 0 30px var(--primary);
}

.ferluis-clicker:hover { transform: scale(1.05); }

/* Animación del +1 */
.click-popup {
    position: absolute;
    color: #4ade80;
    font-weight: bold;
    font-size: 1.2rem;
    pointer-events: none;
    animation: floatUpFade 0.8s forwards;
    z-index: 60;
}

@keyframes floatUpFade {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-40px); opacity: 0; }
}

/* Animación de Fracaso */
.fail-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 900;
    color: #ef4444;
    text-transform: uppercase;
    text-shadow: 0 0 30px rgba(239, 68, 68, 0.8), 4px 4px 0px rgba(0,0,0,0.8);
    z-index: 1000;
    pointer-events: none;
    text-align: center;
    line-height: 1.1;
    animation: failPopIn 2.5s ease-out forwards;
}

@keyframes failPopIn {
    0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0; filter: blur(10px); }
    10% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; filter: blur(0px); }
    20% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; filter: blur(5px); }
}

/* =========================================
   MODALES (Nombre y Genéricos)
   ========================================= */
.name-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.name-modal-overlay.active {
    display: flex;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }

.name-modal, .comment-modal {
    animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modalSlideIn {
    from { transform: scale(0.8) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.name-modal h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 15px var(--primary-glow);
}

.modal-input {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    color: white;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    margin-bottom: 1.5rem;
}

.modal-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-btn {
    padding: 0.7rem 2rem;
    font-size: 0.95rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn-cancel {
    background: transparent;
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.modal-btn-cancel:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

/* Responsividad para móviles del minijuego */
@media (max-width: 768px) {
    .container { order: 1; margin-bottom: 2rem; }
    .clicker-wrapper { position: relative; bottom: auto; right: auto; order: 2; margin-bottom: 2rem; }
    .leaderboard-container { position: relative; bottom: auto; left: auto; order: 3; width: 90%; max-width: 400px; margin-bottom: 2rem; }
    .clicker-btn-container { width: 100px; height: 100px; }
}
