/* --- VARIABLES Y RESET --- */
:root {
    --prophet-primary: #4c51bf;
    --prophet-secondary: #63b3ed;
    --prophet-dark: #1a202c;
    --prophet-light: #f8fafc;
    --prophet-success: #38b2ac;
    --prophet-danger: #e53e3e;
    --prophet-white: #ffffff;
}

/* --- CONTENEDOR BASE (RANKING Y PANEL) --- */
.prophet-leaderboard-card,
.prophet-user-panel {
    background: var(--prophet-white);
    border: 1px solid #eef0f2;
    border-radius: 24px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    max-width: 480px;
    margin: 20px auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

/* --- CABECERA Y STATUS (SEMÁFORO) --- */
.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.leaderboard-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--prophet-dark);
    letter-spacing: -0.5px;
}

.status-pill {
    font-size: 10px;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-ok {
    background: #e6fffa;
    color: var(--prophet-success);
    border: 1px solid var(--prophet-success);
}

.status-wait {
    background: #fff5f5;
    color: var(--prophet-danger);
    border: 1px solid #feb2b2;
}

/* --- LISTA DE CLASIFICACIÓN --- */
.rank-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rank-list li {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: var(--prophet-light);
    margin-bottom: 10px;
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    gap: 15px;
    /* Add space between elements */
}

.rank-list li:hover {
    transform: translateY(-2px);
    background: #f1f5f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.rank-list li.current-user {
    border: 2px solid var(--prophet-primary);
    background: #ebf4ff;
}

.rank-number {
    font-weight: 800;
    width: 30px;
    color: #94a3b8;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.rank-name {
    flex-grow: 1;
    font-weight: 600;
    color: #334155;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-value {
    font-weight: 800;
    color: var(--prophet-primary);
    background: var(--prophet-white);
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    margin-left: 10px;
    /* Space between points and tokens */
}

.rank-points {
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 8px;
    white-space: nowrap;
    margin-left: auto;
    /* Push tokens to the far right */
}

/* Adjustments for better display of 4 columns */
@media (max-width: 480px) {
    .rank-name {
        font-size: 0.85rem;
    }

    .rank-points,
    .rank-value {
        font-size: 0.8rem;
        padding: 4px 8px;
    }

    .rank-list li {
        gap: 8px;
        padding: 12px 14px;
    }
}

.rank-minutes {
    font-weight: 800;
    color: var(--prophet-primary);
    background: var(--prophet-white);
    padding: 5px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* --- PANEL DE USUARIO (DASHBOARD) --- */
.prophet-user-panel {
    background: var(--prophet-dark);
    color: var(--prophet-white);
    border: none;
}

/* grid para los stats del usuario */
.user-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 18px 10px;
    border-radius: 18px;
    text-align: center;
}

.stat-label {
    font-size: 11px;
    color: #a0aec0;
    display: block;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--prophet-secondary);
    line-height: 1;
}

/* --- BOTÓN DE RETIRO --- */
.swl-main-button {
    width: 100%;
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--prophet-white);
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.swl-main-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    filter: brightness(1.1);
}

.swl-main-button:active {
    transform: translateY(0);
}

/* Mensajes de alerta dentro del panel */
.swl-alert {
    font-size: 13px;
    color: #feb2b2;
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    background: rgba(229, 62, 62, 0.1);
    border-radius: 10px;
}

/* Info del ciclo */
.cycle-info {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 15px;
    text-align: center;
}

/* --- TOPBAR RECLAMO (ganadores) --- */
/* Body con topbar visible: dejar espacio arriba */
body.prophet-has-claim-topbar {
    padding-top: 52px;
}

body.prophet-has-claim-topbar.admin-bar {
    padding-top: 92px;
}

.prophet-claim-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    color: var(--prophet-white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.prophet-claim-topbar.prophet-topbar-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.prophet-claim-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 20px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    pointer-events: none;
}

.prophet-claim-topbar-text {
    font-size: 14px;
    font-weight: 600;
    pointer-events: auto;
}

.prophet-claim-topbar-text strong {
    color: var(--prophet-secondary);
}

.prophet-claim-topbar-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--prophet-white);
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    z-index: 10;
    pointer-events: auto;
}

.prophet-claim-topbar-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.prophet-claim-topbar-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 8px;
    z-index: 10;
    pointer-events: auto;
}

.prophet-claim-topbar-close:hover {
    color: #fff;
}

@media (max-width: 640px) {
    .prophet-claim-topbar-inner {
        padding-right: 44px;
    }

    .prophet-claim-topbar-close {
        right: 8px;
    }
}

/* --- ANIMACIÓN DE +1 PUNTO --- */
.prophet-point-fly {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: #00ff00 !important;
    font-size: 6rem !important;
    font-weight: 900 !important;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.9), 0 0 40px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    z-index: 2147483647 !important;
    animation: prophetPointFly 2.5s cubic-bezier(0.17, 0.89, 0.32, 1.49) forwards !important;
    font-family: 'Inter', sans-serif !important;
    display: block !important;
    visibility: visible !important;
    opacity: 0;
}

/* --- NOTIFICACIÓN DE PUNTO (TOPBAR) --- */
.prophet-point-notification {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 2147483647 !important;
    background: #00ff00 !important;
    color: #1a202c !important;
    text-align: center !important;
    padding: 15px 20px !important;
    font-weight: 900 !important;
    font-size: 1.2rem !important;
    box-shadow: 0 4px 20px rgba(0, 255, 0, 0.4) !important;
    transform: translateY(-100%) !important;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    font-family: 'Inter', sans-serif !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
}

.prophet-point-notification.is-active {
    transform: translateY(0) !important;
}

.prophet-point-notification svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

@keyframes prophetPointFly {
    0% {
        opacity: 0;
        transform: translate(-50%, 0%) scale(0.2);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.4);
    }

    80% {
        opacity: 1;
        transform: translate(-50%, -100%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -220%) scale(0.8);
    }
}