/* ===============================
   🔵 RESET GLOBAL
   ================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    /* Quita flash gris al tocar en iOS */
    transition: 0.25s ease;
    font-family: Arial, Helvetica, sans-serif;
}

/* ===============================
   🔵 SAFE AREAS (VARIABLES)
   ================================ */
:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

/* ===============================
   🔵 BODY GLOBAL & FULLSCREEN FIX
   ================================ */
/* ===============================
   🔵 BODY GLOBAL & FULLSCREEN FIX
   ================================ */
html {
    height: 100%;
    width: 100%;
    background-color: #0f1215;
    overscroll-behavior-y: none;
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    overflow-x: hidden;
    /* 🔥 FORCE NO SCROLL */
}

body {
    color: white;
    background-color: #0f1215;
    width: 100%;
    /* Ensure full width */
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow-x: hidden;
    /* Double safety */
    position: relative;
}

/* --- BLOQUEO DE SELECCIÓN (App Feel Definitive iOS/Android) --- */
html,
body {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    /* Prevent iOS context menu on long press */
}

/* Permitir selección de texto solo en elementos de entrada */
input,
textarea,
select,
[contenteditable="true"] {
    user-select: text;
    -webkit-user-select: text;
    -webkit-touch-callout: default;
}

body:not(.home-page) {
    background-color: #0f1215;
}

/* ===============================
   🔵 CONTENEDOR PRINCIPAL (Aquí aplicamos el Notch)
   ================================ */
main.page-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 100%;
    width: 100%;
    /* Force constraint */
    max-width: 100%;
    /* Hard limit (changed from vw to avoid scrollbar overflow) */

    padding-top: 0;
    padding-bottom: calc(20px + var(--safe-bottom));
    padding-left: calc(15px + var(--safe-left));
    padding-right: calc(15px + var(--safe-right));

    position: relative;
    z-index: 2;
    box-sizing: border-box;
    /* Include padding in width */
}

/* Fondo borroso fijo detrás de todo */
.background-blur {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    /* Switch from 100vw to 100% to avoid scrollbar width issues */
    height: 100%;
    /* Switch from 100vh */
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(circle at top, #1a2a3a 0%, #000000 90%);
}

/* ===============================
   🔵 ELEMENTOS BASE
   ================================ */
a {
    color: inherit;
    text-decoration: none;
}

input,
select,
button {
    font-family: inherit;
    outline: none;
}

.glass {
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
}

/* ===============================
   🔵 BOTÓN ATRÁS (Ajustado al Notch)
   ================================ */
.back-btn {
    position: fixed;
    /* Se adapta dinámicamente */
    top: calc(var(--safe-top) + 15px);
    left: calc(var(--safe-left) + 15px);

    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.30);
    /* Más transparente */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    backdrop-filter: blur(12px);

    /* Resplandor */
    box-shadow: 0 0 12px rgba(0, 180, 255, 0.25);
    z-index: 9999;
    transition: 0.25s ease;
}

.icon-back {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 0 2px rgba(0, 200, 255, 0.5));
}

.back-btn:active {
    transform: scale(0.92);
    background: rgba(0, 0, 0, 0.6);
}

/* ===============================
   🔵 FOOTER GLOBAL (EFECTO CRISTAL REAL)
   ================================ */
.global-footer {
    position: relative;
    width: 100%;
    z-index: 10;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    /* Un poco más sutil */

    /* Padding generoso */
    padding-top: 30px;
    padding-bottom: calc(20px + var(--safe-bottom));

    /* Separación superior automática para empujar al fondo si hay poco contenido */
    margin-top: auto;

    /* Sin bordes ni fondos molestos, integrado en el scroll */
    background: transparent;
    border-top: none;
}


/* ===============================
   🔵 TARJETAS BASE
   ================================ */
.card {
    padding: 20px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

/* =========================================================
   🎬 TRANSICIONES DE PÁGINA (PAGE LOADER)
   ========================================================= */

/* 🚀 SUPER SMOOTH TRANSITIONS */
body {
    opacity: 0;
    /* Starts hidden */
    /* REMOVED TRANSFORM to fix position:fixed context issues */
    transition: opacity 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity;
}

body.loaded {
    opacity: 1;
}

body.fade-out {
    opacity: 0;
    pointer-events: none;
}

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

    100% {
        background-position: -100% 0;
    }
}

/* ===============================
   🔔 NOTIFICATION BELL (GLOBAL)
   ================================ */
.notif-btn {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 15px);
    right: 20px !important;
    /* 🔥 FORCE RIGHT */
    left: auto !important;
    /* 🔥 FORCE NO LEFT */

    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    backdrop-filter: blur(12px);
    box-shadow: 0 0 12px rgba(108, 92, 231, 0.55);
    cursor: pointer;
    z-index: 99999;
    /* Higher than back button */
    transition: 0.25s ease;
    text-decoration: none;
    font-size: 20px;
}

.notif-btn:active {
    transform: scale(0.92);
    background: rgba(0, 0, 0, 0.60);
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #FF3B30;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #1a1e2c;
    z-index: 10000;
}

/* ===============================
   👑 VIP GOLD THEME (SOCIO EXCLUSIVO)
   ================================ */
/* 
body.vip-theme .background-blur {
    background: radial-gradient(circle at top, #2c2005 0%, #000000 90%);
} 
*/

body.vip-theme .card,
body.vip-theme .menu-card,
body.vip-theme .social-icon-btn {
    border: 1px solid rgba(241, 196, 15, 0.4) !important;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.1);
}

body.vip-theme .menu-icon {
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

body.vip-theme h1,
body.vip-theme h2,
body.vip-theme .panel-title {
    color: #f1c40f !important;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.3);
}

/* Crown Overlay for Logo */
body.vip-theme .vip-crown-overlay {
    position: absolute;
    top: 27px;
    left: 21%;
    /* Android: Left -5px (was 22%) */
    transform: translateX(-50%) rotate(15deg);
    font-size: 42px;
    /* Bigger */
    line-height: 1;
    /* Fix for emoji vertical metrics */
    filter: drop-shadow(0 0 5px gold);
    z-index: 100;
    pointer-events: none;
    animation: floatingCrown 3s ease-in-out infinite;
}

/* 🍎 iOS SPECIFIC OVERRIDE */
@supports (-webkit-touch-callout: none) {
    body.vip-theme .vip-crown-overlay {
        top: 87px !important;
        left: 18% !important;
    }

    /* 📱 iPad Specific Correction (Bajar 15px + 10px extra = 112px) */
    @media (min-width: 768px) {
        body.vip-theme .vip-crown-overlay {
            top: 112px !important;
            /* iPad: Down 10px more */
            left: 20% !important;
        }
    }
}

/* 💻 PC/DESKTOP OVERRIDE (Large Screens) */
@media (min-width: 1024px) {
    body.vip-theme .vip-crown-overlay {
        top: 72px;
        /* PC: Down a bit more (was 67px) */
        left: 16% !important;
        /* PC: Left a bit more (was 17%) */
    }
}

@keyframes floatingCrown {

    0%,
    100% {
        transform: translateX(-50%) rotate(-10deg) translateY(0);
    }

    50% {
        transform: translateX(-50%) rotate(-10deg) translateY(-5px);
    }
}