/* ==========================================================================
   SBBL AURA ENGINE — Personalización 100% Procedimental por Código (CSS/SVG)
   Cero imágenes externas · Cero dependencia de diseñador gráfico
   ========================================================================== */

@keyframes sbblAuraSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes sbblAuraSpinReverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

@keyframes sbblShimmerText {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes sbblFoilSweep {
    0% { transform: translateX(-140%) skewX(-22deg); }
    100% { transform: translateX(240%) skewX(-22deg); }
}

@keyframes sbblOroPulse {
    0%, 100% { box-shadow: 0 0 12px rgba(255, 215, 0, 0.55), 0 0 26px rgba(255, 165, 0, 0.25); }
    50% { box-shadow: 0 0 22px rgba(255, 215, 0, 0.9), 0 0 40px rgba(255, 200, 0, 0.45); }
}

/* ── 1. NOMBRES E INSIGNIAS SVG INLINE ── */
.aura-name-wrap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    vertical-align: middle;
}

.aura-badge-svg {
    display: inline-block;
    flex-shrink: 0;
    vertical-align: -2px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85));
}

.aura-name-bronce {
    color: #e69b54 !important;
    text-shadow: 1px 1px 0 #000, 0 0 8px rgba(205, 127, 50, 0.55);
}

.aura-name-plata {
    background: linear-gradient(90deg, #b8e1ff 0%, #ffffff 35%, #7dd3fc 55%, #e2f1ff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: sbblShimmerText 4.5s linear infinite;
    filter: drop-shadow(1px 1px 0 #000) drop-shadow(0 0 6px rgba(125, 211, 252, 0.45));
}

.aura-name-oro {
    background: linear-gradient(90deg, #ffd700 0%, #fff7b2 25%, #ff9d00 50%, #ffe666 75%, #ffd700 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: sbblShimmerText 3.2s linear infinite;
    filter: drop-shadow(1px 1px 0 #000) drop-shadow(0 0 8px rgba(255, 215, 0, 0.65));
}

/* Pill compacta de Aura */
.aura-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 2px solid #000;
    transform: skewX(-8deg);
    box-shadow: 3px 3px 0 #000;
}
.aura-pill > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transform: skewX(8deg);
}
.aura-pill-bronce { background: linear-gradient(135deg, #8c4a19, #cd7f32); color: #fff; }
.aura-pill-plata  { background: linear-gradient(135deg, #38bdf8, #e0f2fe); color: #000; }
.aura-pill-oro    { background: linear-gradient(135deg, #f59e0b, #fef08a); color: #000; }

/* ── 2. ANILLOS PROCEDIMENTALES DE AVATAR (SIN IMÁGENES) ── */
.aura-avatar-bronce,
.aura-avatar-plata,
.aura-avatar-oro {
    position: relative;
    isolation: isolate;
}

.aura-avatar-bronce::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #8b4513, #e69b54, #cd7f32, #ffd2a1, #8b4513);
    z-index: -1;
    box-shadow: 0 0 14px rgba(205, 127, 50, 0.65);
}

.aura-avatar-plata::before {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #0ea5e9, #e0f2fe, #38bdf8, #ffffff, #0284c7, #0ea5e9);
    z-index: -1;
    animation: sbblAuraSpin 5s linear infinite;
    box-shadow: 0 0 18px rgba(125, 211, 252, 0.75);
}

.aura-avatar-oro::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #ff9900, #ffd700, #fff9c4, #f59e0b, #ffd700, #ff9900);
    z-index: -1;
    animation: sbblAuraSpin 4s linear infinite;
}

.aura-avatar-oro::after {
    content: '';
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 215, 0, 0.8);
    z-index: -2;
    animation: sbblAuraSpinReverse 12s linear infinite;
    pointer-events: none;
}

/* ── 3. ACABADOS DE TARJETAS COLECCIONABLES (FOIL & HOLOGRÁFICO 3D) ── */
.aura-card-bronce {
    position: relative;
    border-color: #cd7f32 !important;
    box-shadow: 6px 6px 0 rgba(205, 127, 50, 0.55), inset 0 0 18px rgba(205, 127, 50, 0.28) !important;
    background-image: radial-gradient(rgba(230, 155, 84, 0.14) 1px, transparent 1px);
    background-size: 14px 14px;
}

.aura-card-plata {
    position: relative;
    overflow: hidden;
    border-color: #7dd3fc !important;
    box-shadow: 6px 6px 0 rgba(56, 189, 248, 0.55), inset 0 0 22px rgba(192, 229, 251, 0.35) !important;
}

.aura-card-plata::after {
    content: '';
    position: absolute;
    inset: 0;
    width: 55%;
    background: linear-gradient(110deg, transparent 10%, rgba(224, 242, 254, 0.32) 48%, rgba(255, 255, 255, 0.55) 52%, transparent 90%);
    transform: translateX(-140%) skewX(-22deg);
    pointer-events: none;
    z-index: 6;
    transition: opacity 0.3s;
}

.aura-card-plata:hover::after {
    animation: sbblFoilSweep 1.15s ease-out;
}

.aura-card-oro {
    position: relative;
    overflow: hidden;
    border-color: #ffd700 !important;
    animation: sbblOroPulse 2.8s ease-in-out infinite;
    transform-style: preserve-3d;
    transition: transform 0.18s ease-out, box-shadow 0.25s ease;
    --mx: 50%;
    --my: 50%;
}

.aura-card-oro::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.32), transparent 55%),
        linear-gradient(125deg,
            rgba(255, 215, 0, 0.08) 0%,
            rgba(255, 0, 128, 0.12) 25%,
            rgba(0, 255, 204, 0.14) 50%,
            rgba(255, 215, 0, 0.18) 75%,
            rgba(255, 140, 0, 0.1) 100%);
    mix-blend-mode: color-dodge;
    opacity: 0.45;
    pointer-events: none;
    z-index: 6;
    transition: opacity 0.25s ease;
}

.aura-card-oro:hover::after {
    opacity: 0.9;
}

/* ── 4. CABECERAS PROCEDIMENTALES DE PERFIL (CAPAS CSS/SVG) ── */
.aura-hero-bronce {
    position: relative;
    background-image:
        linear-gradient(135deg, rgba(139, 69, 19, 0.72), rgba(20, 14, 10, 0.85)),
        repeating-linear-gradient(45deg, rgba(205, 127, 50, 0.16) 0 8px, transparent 8px 16px) !important;
}

.aura-hero-plata {
    position: relative;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(56, 189, 248, 0.45), transparent 55%),
        radial-gradient(circle at 80% 70%, rgba(224, 242, 254, 0.3), transparent 50%),
        repeating-linear-gradient(-35deg, rgba(125, 211, 252, 0.14) 0 4px, transparent 4px 18px),
        linear-gradient(135deg, #0b192c, #163a5f) !important;
}

.aura-hero-oro {
    position: relative;
    background-image:
        repeating-conic-gradient(from 0deg at 50% 100%, rgba(255, 215, 0, 0.16) 0deg 10deg, transparent 10deg 20deg),
        radial-gradient(circle at 50% 25%, rgba(255, 200, 0, 0.42), rgba(20, 12, 0, 0.92) 72%) !important;
}

/* ── 5. TARJETA EXPORTABLE BLADER CARD PNG ── */
.sbbl-export-card {
    width: 420px;
    max-width: 100%;
    margin: 0 auto;
    background: #0b1120;
    border: 4px solid #000;
    color: #fff;
    position: relative;
    overflow: hidden;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.85);
}

.sbbl-export-card.export-plata {
    border-color: #7dd3fc;
    background: linear-gradient(160deg, #0c1b33 0%, #091224 55%, #122d4c 100%);
}

.sbbl-export-card.export-oro {
    border-color: #ffd700;
    background: linear-gradient(160deg, #1a1202 0%, #0b0e18 55%, #2b1d02 100%);
}

.sbbl-export-card .export-header {
    padding: 16px 20px;
    border-bottom: 3px solid rgba(255, 255, 255, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sbbl-export-card .export-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.sbbl-export-card .export-stat-box {
    background: rgba(0, 0, 0, 0.65);
    border: 2px solid rgba(255, 255, 255, 0.12);
    padding: 10px 6px;
    text-align: center;
}

/* ── 6. SKINS CSS PARA PERFIL PÚBLICO (0 IMÁGENES, 0 CAMBIOS BD) ── */
.sbbl-themed-profile {
    position: relative;
    transition: background 0.3s ease;
}

/* 6A. CYBER X-DASH (Plata+) — HUD Neon Futurista */
.sbbl-themed-profile[data-profile-theme="cyber"] {
    --shonen-yellow: #00ffcc;
    --shonen-blue: #0ea5e9;
    --shonen-red: #ec4899;
    --panel-bg: #051423;
    background-color: #030b16;
    background-image:
        linear-gradient(rgba(0, 255, 204, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(14, 165, 233, 0.07) 1px, transparent 1px),
        radial-gradient(circle at 50% 0%, rgba(0, 255, 204, 0.16), transparent 65%);
    background-size: 28px 28px, 28px 28px, 100% 100%;
    border-radius: 8px;
}
.sbbl-themed-profile[data-profile-theme="cyber"] .command-panel {
    background: linear-gradient(165deg, rgba(6, 25, 43, 0.96) 0%, rgba(3, 12, 24, 0.98) 100%);
    border: 2px solid rgba(0, 255, 204, 0.55);
    border-radius: 3px;
    box-shadow: 0 0 22px rgba(0, 255, 204, 0.16), inset 0 0 24px rgba(14, 165, 233, 0.08);
}
.sbbl-themed-profile[data-profile-theme="cyber"] .command-panel:hover {
    border-color: #00ffcc;
    box-shadow: 0 0 28px rgba(0, 255, 204, 0.32), 0 0 12px rgba(236, 72, 153, 0.28);
}
.sbbl-themed-profile[data-profile-theme="cyber"] .panel-header {
    background: linear-gradient(90deg, #021220 0%, #072b42 55%, #021220 100%);
    border-bottom: 2px solid #00ffcc;
    letter-spacing: 2px;
}
.sbbl-themed-profile[data-profile-theme="cyber"] .pilot-name {
    color: #00ffcc;
    text-shadow: 0 0 14px rgba(0, 255, 204, 0.65), 2px 2px 0 #000;
}
.sbbl-themed-profile[data-profile-theme="cyber"] .pub-tab-btn,
.sbbl-themed-profile[data-profile-theme="cyber"] .season-tab,
.sbbl-themed-profile[data-profile-theme="cyber"] .btn-share,
.sbbl-themed-profile[data-profile-theme="cyber"] .podium-box,
.sbbl-themed-profile[data-profile-theme="cyber"] .combo-row {
    transform: none;
    border-color: rgba(0, 255, 204, 0.45);
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.2);
}
.sbbl-themed-profile[data-profile-theme="cyber"] .pub-tab-btn > *,
.sbbl-themed-profile[data-profile-theme="cyber"] .btn-share > *,
.sbbl-themed-profile[data-profile-theme="cyber"] .podium-box > *,
.sbbl-themed-profile[data-profile-theme="cyber"] .combo-row > * {
    transform: none;
}
.sbbl-themed-profile[data-profile-theme="cyber"] .pub-tab-btn.active,
.sbbl-themed-profile[data-profile-theme="cyber"] .season-tab.active {
    background: linear-gradient(90deg, #00ffcc, #0ea5e9);
    color: #021220;
    box-shadow: 0 0 18px rgba(0, 255, 204, 0.5);
}
.sbbl-themed-profile[data-profile-theme="cyber"] .pts-bar,
.sbbl-themed-profile[data-profile-theme="cyber"] .wr-bar-fill {
    background: linear-gradient(180deg, #00ffcc 0%, #0ea5e9 100%);
}
.sbbl-themed-profile[data-profile-theme="cyber"] .pts-bar.highlight {
    background: linear-gradient(180deg, #f472b6 0%, #ec4899 100%);
}

/* 6B. CRIMSON ATTACK (Plata+) — Velocidad Anime / Agresivo */
.sbbl-themed-profile[data-profile-theme="crimson"] {
    --shonen-yellow: #ff4d6d;
    --shonen-blue: #991b1b;
    --shonen-red: #ff1e42;
    --panel-bg: #17060a;
    background-color: #0d0306;
    background-image:
        repeating-linear-gradient(-45deg, rgba(255, 30, 66, 0.08) 0 12px, transparent 12px 26px),
        radial-gradient(circle at 80% 0%, rgba(255, 30, 66, 0.24), transparent 55%);
    border-radius: 6px;
}
.sbbl-themed-profile[data-profile-theme="crimson"] .command-panel {
    background: linear-gradient(155deg, #1f070d 0%, #0e0306 100%);
    border: 3px solid #000;
    border-left: 5px solid #ff1e42;
    border-radius: 0;
    box-shadow: 7px 7px 0 #7f1d1d;
}
.sbbl-themed-profile[data-profile-theme="crimson"] .command-panel:hover {
    box-shadow: 9px 9px 0 #ff1e42;
}
.sbbl-themed-profile[data-profile-theme="crimson"] .panel-header {
    background: linear-gradient(115deg, #5c0a18 0%, #140306 62%, #000 100%);
    border-bottom: 3px solid #ff1e42;
}
.sbbl-themed-profile[data-profile-theme="crimson"] .pilot-name {
    color: #fff;
    text-shadow: 3px 3px 0 #ff1e42, 6px 6px 0 #000;
}
.sbbl-themed-profile[data-profile-theme="crimson"] .pub-tab-btn.active,
.sbbl-themed-profile[data-profile-theme="crimson"] .season-tab.active {
    background: #ff1e42;
    color: #fff;
    border-color: #000;
    box-shadow: 4px 4px 0 #000;
}
.sbbl-themed-profile[data-profile-theme="crimson"] .podium-box {
    border-color: #7f1d1d;
    box-shadow: 4px 4px 0 #ff1e42;
}
.sbbl-themed-profile[data-profile-theme="crimson"] .pts-bar,
.sbbl-themed-profile[data-profile-theme="crimson"] .wr-bar-fill {
    background: linear-gradient(180deg, #ff4d6d 0%, #991b1b 100%);
}
.sbbl-themed-profile[data-profile-theme="crimson"] .pts-bar.highlight {
    background: linear-gradient(180deg, #fbbf24 0%, #f97316 100%);
}

/* 6C. EMERALD STAMINA (Plata+) — Blindaje Táctico Esmeralda */
.sbbl-themed-profile[data-profile-theme="emerald"] {
    --shonen-yellow: #4ade80;
    --shonen-blue: #059669;
    --shonen-red: #10b981;
    --panel-bg: #061a11;
    background-color: #03100a;
    background-image:
        radial-gradient(rgba(74, 222, 128, 0.14) 1.5px, transparent 1.5px),
        radial-gradient(circle at 20% 0%, rgba(16, 185, 129, 0.2), transparent 60%);
    background-size: 22px 22px, 100% 100%;
    border-radius: 10px;
}
.sbbl-themed-profile[data-profile-theme="emerald"] .command-panel {
    background: linear-gradient(165deg, #072216 0%, #03120b 100%);
    border: 2px solid #10b981;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 18px rgba(16, 185, 129, 0.18);
}
.sbbl-themed-profile[data-profile-theme="emerald"] .command-panel:hover {
    border-color: #4ade80;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75), 0 0 24px rgba(74, 222, 128, 0.3);
}
.sbbl-themed-profile[data-profile-theme="emerald"] .panel-header {
    background: linear-gradient(90deg, #022c22 0%, #065f46 50%, #022c22 100%);
    border-bottom: 2px solid #4ade80;
}
.sbbl-themed-profile[data-profile-theme="emerald"] .pilot-name {
    color: #4ade80;
    text-shadow: 2px 2px 0 #000, 0 0 16px rgba(74, 222, 128, 0.45);
}
.sbbl-themed-profile[data-profile-theme="emerald"] .pub-tab-btn,
.sbbl-themed-profile[data-profile-theme="emerald"] .season-tab,
.sbbl-themed-profile[data-profile-theme="emerald"] .podium-box {
    border-radius: 8px;
    border-color: #059669;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.sbbl-themed-profile[data-profile-theme="emerald"] .pub-tab-btn.active,
.sbbl-themed-profile[data-profile-theme="emerald"] .season-tab.active {
    background: linear-gradient(90deg, #10b981, #4ade80);
    color: #022c22;
    border-color: #4ade80;
}
.sbbl-themed-profile[data-profile-theme="emerald"] .pts-bar,
.sbbl-themed-profile[data-profile-theme="emerald"] .wr-bar-fill {
    background: linear-gradient(180deg, #4ade80 0%, #059669 100%);
}

/* 6D. ROYAL GOLD (Exclusivo Oro) — Campeón Imperial */
.sbbl-themed-profile[data-profile-theme="royal-gold"] {
    --shonen-yellow: #ffd700;
    --shonen-blue: #b45309;
    --shonen-red: #f59e0b;
    --panel-bg: #171003;
    background-color: #0b0802;
    background-image:
        repeating-linear-gradient(60deg, rgba(255, 215, 0, 0.06) 0 2px, transparent 2px 28px),
        repeating-linear-gradient(-60deg, rgba(255, 215, 0, 0.06) 0 2px, transparent 2px 28px),
        radial-gradient(circle at 50% 0%, rgba(255, 215, 0, 0.25), transparent 60%);
    border-radius: 8px;
}
.sbbl-themed-profile[data-profile-theme="royal-gold"] .command-panel {
    background: linear-gradient(170deg, #211704 0%, #0e0a02 65%, #1a1203 100%);
    border: 2px solid #ffd700;
    border-radius: 4px 18px 4px 18px;
    box-shadow: 0 0 26px rgba(255, 215, 0, 0.22), 6px 6px 0 #78350f;
}
.sbbl-themed-profile[data-profile-theme="royal-gold"] .command-panel:hover {
    box-shadow: 0 0 34px rgba(255, 215, 0, 0.4), 8px 8px 0 #b45309;
}
.sbbl-themed-profile[data-profile-theme="royal-gold"] .panel-header {
    background: linear-gradient(90deg, #0a0701 0%, #3b2705 50%, #0a0701 100%);
    border-bottom: 3px double #ffd700;
    color: #fef08a;
}
.sbbl-themed-profile[data-profile-theme="royal-gold"] .pilot-name {
    color: #ffd700;
    text-shadow: 0 0 18px rgba(255, 215, 0, 0.65), 2px 2px 0 #000, 4px 4px 0 #78350f;
}
.sbbl-themed-profile[data-profile-theme="royal-gold"] .pub-tab-btn.active,
.sbbl-themed-profile[data-profile-theme="royal-gold"] .season-tab.active {
    background: linear-gradient(90deg, #f59e0b, #ffd700, #fef08a);
    color: #1c1000;
    border-color: #ffd700;
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.45);
}
.sbbl-themed-profile[data-profile-theme="royal-gold"] .podium-box {
    border-color: rgba(255, 215, 0, 0.55);
    box-shadow: 4px 4px 0 #78350f;
}
.sbbl-themed-profile[data-profile-theme="royal-gold"] .pts-bar,
.sbbl-themed-profile[data-profile-theme="royal-gold"] .wr-bar-fill {
    background: linear-gradient(180deg, #fef08a 0%, #ffd700 45%, #b45309 100%);
}
.sbbl-themed-profile[data-profile-theme="royal-gold"] .event-row:hover,
.sbbl-themed-profile[data-profile-theme="royal-gold"] .combo-row:hover {
    border-color: #ffd700;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.22);
}

/* Medalla compacta de Antigüedad / Racha de Mecenas */
.tenure-badge {
    display: inline-block;
    font-family: 'Oswald', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    padding: 1px 6px;
    background: #000;
    color: #f8fafc;
    border: 1px solid rgba(255, 215, 0, 0.7);
    vertical-align: middle;
}

/* Destello de Aura en Stadium TV */
.tv-aura-oro {
    border-color: rgba(255, 215, 0, 0.85) !important;
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.25), inset 0 0 12px rgba(255, 215, 0, 0.12);
}
.tv-aura-plata {
    border-color: rgba(125, 211, 252, 0.75) !important;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.2);
}

/* Tarjeta Post-Torneo formato Story PNG */
.sbbl-story-card {
    width: 390px;
    max-width: 100%;
    margin: 0 auto;
    background: linear-gradient(160deg, #0b1326 0%, #050814 60%, #1a1203 100%);
    border: 4px solid #ffd700;
    color: #fff;
    padding: 24px 20px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.85);
}

/* Respeto por usuarios que desactivan animaciones */
@media (prefers-reduced-motion: reduce) {
    .aura-avatar-plata::before,
    .aura-avatar-oro::before,
    .aura-avatar-oro::after,
    .aura-name-plata,
    .aura-name-oro,
    .aura-card-oro {
        animation: none !important;
    }
}
