/* Header - Estructura con 3 columnas */
.header {
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 50%, #d4af37 100%);
    background-size: 200% 200%;
    animation: golden-shimmer 3s ease 1;
    color: #000;
    padding: 12px 15px;
    padding-top: max(12px, env(safe-area-inset-top, 12px));
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    min-height: 80px;
}

.header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
}

/* Grupo de configuración/cerrar sesión junto al fueguito */
.user-action-btns {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.user-action-btns .settings-btn,
.user-action-btns .referral-btn,
.user-action-btns .logout-btn {
    padding: 4px 7px;
    font-size: 13px;
    line-height: 1;
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
    overflow: visible;
}

@keyframes golden-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Plataforma a la izquierda - DISEÑO ELEGANTE CON FONDO NEGRO */
.platform-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 3;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #000000 100%);
    padding: 8px 16px;
    border-radius: 15px;
    border: 2px solid #d4af37;
    box-shadow: 
        0 0 20px rgba(212, 175, 55, 0.8),
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.platform-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
    animation: platform-shine 3s infinite;
}

@keyframes platform-shine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.platform-label {
    color: #d4af37;
    font-weight: bold;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
    position: relative;
    z-index: 1;
}

.jugaygana-btn {
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 30%, #d4af37 60%, #b8941f 100%);
    background-size: 200% 200%;
    animation: golden-shimmer 2s ease infinite;
    color: #000;
    font-size: 13px;
    padding: 8px 18px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 900;
    box-shadow: 
        0 4px 20px rgba(212, 175, 55, 0.7),
        0 0 15px rgba(255, 215, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    white-space: nowrap;
    border: 2px solid #ffd700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.jugaygana-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 
        0 8px 30px rgba(212, 175, 55, 0.9),
        0 0 25px rgba(255, 215, 0, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: #fff;
}

.jugaygana-btn:active {
    transform: scale(1.02) translateY(0);
}

/* Reembolsos en el centro */
.refund-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 10px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 9px;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 70px;
}

.refund-label-short {
    display: none;
}

.refund-label-full {
    display: block;
    text-align: center;
}

.refund-btn.daily {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    color: #000;
}

.refund-btn.weekly {
    background: linear-gradient(135deg, #9d4edd 0%, #6603a8 100%);
    color: #fff;
}

.refund-btn.monthly {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: #fff;
}

.refund-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.refund-amount {
    font-size: 12px;
    font-weight: bold;
    margin-top: 2px;
}

.refund-timer {
    font-size: 8px;
    margin-top: 1px;
}

/* Fueguito */
.fire-btn {
    background: linear-gradient(135deg, #ff4500 0%, #ff6347 50%, #ff8c00 100%);
    border: 3px solid #ffd700;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.8), 0 0 40px rgba(255, 140, 0, 0.4);
    transition: all 0.3s ease;
    animation: fire-pulse 1s ease 3;
}

@keyframes fire-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 69, 0, 0.8), 0 0 40px rgba(255, 140, 0, 0.4); }
    50% { transform: scale(1.15); box-shadow: 0 0 30px rgba(255, 69, 0, 1), 0 0 60px rgba(255, 140, 0, 0.6); }
}

.fire-btn:hover:not(:disabled) {
    transform: scale(1.2);
    box-shadow: 0 0 30px rgba(255, 69, 0, 1), 0 0 60px rgba(255, 140, 0, 0.8);
}

.fire-btn:disabled {
    animation: none;
    opacity: 0.6;
    border-color: #999;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.fire-streak {
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 5px #ff4500, 0 0 10px #ff0000;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 1px 4px;
    margin-top: 2px;
}

/* Promo Banner */
.promo-banner {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(135deg, #1a0033 0%, #2d0052 100%);
    border-top: 2px solid rgba(212, 175, 55, 0.5);
    border-bottom: 2px solid rgba(212, 175, 55, 0.5);
    overflow: hidden;
    z-index: 999;
}

.promo-track {
    display: flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    animation: scroll-left 40s linear infinite;
}

.promo-item {
    display: inline-block;
    color: #ffd700;
    font-size: 14px;
    font-weight: bold;
    padding: 0 30px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.promo-separator {
    display: inline-block;
    color: #d4af37;
    font-size: 18px;
    margin: 0 20px;
}

@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Botones del header derecho */
.header-right .jugaygana-btn {
    font-size: 11px;
    padding: 6px 12px;
}

.header-right .support-btn {
    font-size: 10px;
    padding: 5px 10px;
}

.header-right .info-btn {
    font-size: 12px;
    padding: 5px 8px;
}

/* PLATAFORMA button - user panel only */
.plataforma-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #d4af37 0%, #f7931e 100%);
    color: #000;
    font-weight: 700;
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.plataforma-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.5);
}

.header-right .user-name {
    font-size: 11px;
    padding: 4px 8px;
    max-width: 150px;
    overflow: visible;
    white-space: nowrap;
    color: #d4af37;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
}

.header-right .notification-btn {
    font-size: 11px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    border: none;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    gap: 5px;
}

.header-right .notification-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.header-right .notification-btn.active {
    background: linear-gradient(135deg, #00cc6a 0%, #00ff88 100%);
    color: #000;
    cursor: pointer;
}

.header-right .notification-btn.blocked {
    background: linear-gradient(135deg, #555 0%, #333 100%);
    color: #ccc;
    cursor: pointer;
}

/* Modo compacto: solo el emoji (cuando el usuario ya vio el texto al menos una vez).
   Mantiene el color verde/gris según el estado pero ocupa mucho menos espacio
   para no tapar el resto del menú. */
.header-right .notification-btn.compact {
    font-size: 16px;
    padding: 4px 8px;
    line-height: 1;
    min-width: 32px;
    text-align: center;
    gap: 0;
}
.header-right .notification-btn.compact.active {
    box-shadow: 0 0 0 1px rgba(0, 255, 136, 0.5) inset;
}
.header-right .notification-btn.compact.blocked {
    box-shadow: 0 0 0 1px rgba(220, 53, 69, 0.5) inset;
}

/* Botón de instalación APP */
.app-install-btn {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 50%, #00ff88 100%);
    background-size: 200% 200%;
    animation: app-btn-pulse 2s ease infinite, app-btn-shine 3s ease infinite;
    color: #000;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 900;
    font-size: 11px;
    border: 2px solid #00ff88;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.6), 0 4px 10px rgba(0, 0, 0, 0.3);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
    white-space: nowrap;
}

@keyframes app-btn-pulse {
    0%, 100% { 
        box-shadow: 0 0 15px rgba(0, 255, 136, 0.6), 0 4px 10px rgba(0, 0, 0, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 25px rgba(0, 255, 136, 0.9), 0 6px 15px rgba(0, 0, 0, 0.4);
        transform: scale(1.02);
    }
}

@keyframes app-btn-shine {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.app-install-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 255, 136, 1), 0 8px 20px rgba(0, 0, 0, 0.5);
    border-color: #fff;
}

.app-install-btn:active {
    transform: scale(0.98);
}

.app-install-btn.show {
    display: flex !important;
    animation: app-btn-appear 0.5s ease;
}

@keyframes app-btn-appear {
    from { 
        opacity: 0; 
        transform: scale(0.8) translateY(-10px);
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0);
    }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(0, 255, 136, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

.user-name {
    background: rgba(0, 0, 0, 0.3);
    color: #000;
    padding: 5px 10px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 11px;
}

.logout-btn {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 10px;
    cursor: pointer;
    font-weight: 700;
}

.settings-btn {
    background: rgba(0, 0, 0, 0.3);
    border: none;
    padding: 5px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.info-btn {
    background: linear-gradient(135deg, #00a8ff 0%, #0066cc 100%);
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #fff;
    font-weight: bold;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.info-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 168, 255, 0.5);
}

.cbu-user-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.5);
}

.support-btn {
    background: linear-gradient(135deg, #9d4edd 0%, #6603a8 100%);
    color: #fff;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 10px;
    text-decoration: none;
}

/* Botón Instalar App */
.install-btn {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    color: #000;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 10px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    animation: install-pulse 2s ease infinite;
}

@keyframes install-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); }
    50% { box-shadow: 0 0 20px rgba(0, 255, 136, 0.8); }
}

.install-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.9);
}

.install-btn.hidden {
    display: none !important;
}

/* NOTIS: oculto por defecto; solo visible en modo standalone */
#notificationBtn {
    display: none !important;
}

@media (display-mode: standalone) {
    #notificationBtn {
        display: inline-flex !important;
    }
}

/* Dentro de la app instalada nunca mostrar el botón de instalar */
@media (display-mode: standalone) {
    #appInstallBtn,
    #installBtn,
    .pwa-install-btn {
        display: none !important;
    }
}

/* Mobile Drawer */
.mobile-menu-btn {
    display: none;
    background: rgba(0,0,0,0.3);
    border: 2px solid #d4af37;
    border-radius: 8px;
    color: #d4af37;
    font-size: 20px;
    padding: 6px 10px;
    cursor: pointer;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background: linear-gradient(180deg, #1a0033 0%, #0a0015 100%);
    z-index: 10000;
    transition: right 0.3s ease;
    padding: 20px;
    padding-top: 70px;
    overflow-y: auto;
    box-shadow: -5px 0 30px rgba(0,0,0,0.5);
    border-left: 1px solid #d4af37;
}

.mobile-drawer.open { right: 0; }

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: none;
}

.drawer-overlay.open { display: block; }

.drawer-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #d4af37;
    font-size: 24px;
    cursor: pointer;
}

.drawer-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.drawer-content > * {
    width: 100%;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; align-items: center; justify-content: center; font-size: 22px; padding: 8px 12px; }
    /* Hide everything in header-right except plataforma button and hamburger */
    .header-right > *:not(#plataformaBtn):not(.mobile-menu-btn) { display: none !important; }
    /* Show plataforma button prominently on mobile */
    #plataformaBtn { display: inline-flex !important; font-size: 12px; padding: 8px 14px; font-weight: 900; }
    /* Hide user-action-btns (settings/referral/logout) on mobile */
    .header-left .user-action-btns { display: none; }
    /* Hide individual refund buttons on mobile, show unified one instead */
    .header-center .refund-btn:not(.unified-refund-btn) { display: none !important; }
    .header-center .unified-refund-btn { display: flex !important; font-size: 11px; padding: 7px 10px; font-weight: 700; align-items: center; justify-content: center; background: linear-gradient(135deg, #c0392b, #e74c3c); color: #fff; border-radius: 10px; border: none; cursor: pointer; }
    /* Make header a single row on mobile: fire | plataforma | refunds | hamburger */
    .header {
        display: flex;
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 6px;
        padding: 8px 8px;
        min-height: 60px;
    }
    .header-left { flex-shrink: 0; }
    .header-center { flex: 1; display: flex; justify-content: center; gap: 4px; overflow: hidden; }
    .header-right { flex-shrink: 0; display: flex; align-items: center; gap: 4px; margin-left: auto; }
}

.drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.drawer-item:hover,
.drawer-item:active {
    background: rgba(212, 175, 55, 0.15);
    transform: translateX(4px);
}

.drawer-item-emoji {
    font-size: 20px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.drawer-user {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(212, 175, 55, 0.1) 100%);
    color: #d4af37;
    font-size: 16px;
    font-weight: 800;
    border: 1px solid rgba(212, 175, 55, 0.3);
    cursor: default;
    margin-bottom: 8px;
}

.drawer-logout {
    background: rgba(255, 68, 68, 0.1);
    color: #ff6666;
    border: 1px solid rgba(255, 68, 68, 0.2);
    margin-top: 8px;
}

.drawer-logout:hover {
    background: rgba(255, 68, 68, 0.2);
}
