/* Global light theme overrides (frontend) */
body.light {
    background: #f6f8fc !important;
    color: #0f172a !important;
}

body.light::after {
    opacity: 0.12 !important;
}

body.light .rr-navbar {
    background: rgba(255, 255, 255, 0.94) !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

body.light .rr-brand-name,
body.light .rr-navbar,
body.light .rr-header-cta .rr-user-pill {
    color: #0f172a !important;
}

body.light .rr-header-cta .rr-user-pill {
    border-color: #cbd5e1 !important;
}

body.light .rr-theme-toggle {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #f97316 !important;
}

body.light .rr-footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

body.light .rr-footer,
body.light .rr-footer a {
    color: #334155 !important;
}

body.light .card,
body.light .rr-card,
body.light .modal-content,
body.light .rr-modal-container {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

/* Auth modal stays dark in light theme */
body.light .rr-auth-modal {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%) !important;
    border-color: rgba(249, 115, 22, 0.3) !important;
    color: #f8fafc !important;
}
body.light .rr-auth-option--secondary {
    color: #f8fafc !important;
}
body.light .rr-auth-option--primary {
    color: #0f172a !important;
}

body.light .rr-auth-overlay {
    background: rgba(15, 23, 42, 0.35) !important;
}

body.light .rr-auth-title,
body.light .rr-auth-subtitle,
body.light .rr-form-group label,
body.light .rr-link-btn,
body.light .rr-auth-footer span,
body.light .rr-forgot-link {
    color: inherit !important;
}

body.light .rr-input-wrapper {
    background: rgba(15, 23, 42, 0.5) !important;
    border-color: rgba(148, 163, 184, 0.3) !important;
}

body.light .rr-input-wrapper input {
    color: #f8fafc !important;
}

body.light .hub-hero {
    background: transparent !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

body.light .hub-section {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-color: rgba(226, 232, 240, 0.6) !important;
    color: #0f172a !important;
}

/* Mobile: hub-section totalmente transparente para exibir particulas */
@media (max-width: 768px) {
    body.light .hub-section {
        background: transparent !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-color: transparent !important;
    }
    body.light .hub-hero {
        background: transparent !important;
    }
}

/* Hub-specific .card containers: semi-transparent em light theme */
body.light .hub-section .card,
body.light .hub-section .rr-card,
body.light .rr-inicio-shell.card {
    background: rgba(255, 255, 255, 0.78) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Mobile: cards do hub totalmente transparentes para ver particulas */
@media (max-width: 768px) {
    body.light .hub-section .card,
    body.light .hub-section .rr-card,
    body.light .rr-inicio-shell.card,
    body.light .rr-inicio-shell .card-body {
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

body.light .hub-side-card,
body.light .hub-profile-popout__panel {
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

body.light .hub-mobile-tabbar__nav {
    background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(241,245,249,0.88) 100%) !important;
    border-color: rgba(249, 115, 22, 0.25) !important;
    box-shadow:
        0 -2px 12px rgba(0, 0, 0, 0.06),
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 0 14px color-mix(in srgb, var(--hub-active-color, #f97316) 20%, transparent),
        inset 0 0 10px color-mix(in srgb, var(--hub-active-color, #f97316) 8%, transparent) !important;
}

body.light .hub-mobile-tabbar__btn {
    color: #334155 !important;
}

body.light .hub-mobile-tabbar__btn.active {
    color: var(--hub-tab-accent, #f97316) !important;
}

body.light .hub-brand-center__name,
body.light .hub-brand-overlay__name {
    color: #0f172a !important;
    text-shadow: none !important;
}

body.light .hub-brand-overlay {
    background: rgba(255, 255, 255, 0.82) !important;
    border-bottom-color: rgba(37, 99, 235, 0.12) !important;
    box-shadow: 0 1px 8px rgba(15, 23, 42, 0.06) !important;
}

body.light .hub-brand-overlay.is-scrolled {
    background: rgba(255, 255, 255, 0.92) !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.10) !important;
}

body.light .text-muted,
body.light .hub-winner-type,
body.light .hub-side-card__text,
body.light .hub-side-card__kicker {
    color: #64748b !important;
}

body.light .rr-inicio-card,
body.light .rr-inicio-slip,
body.light .rr-inicio-pix__card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

body.light .rr-inicio-pix {
    background: rgba(15, 23, 42, 0.35) !important;
}

body.light .rr-inicio-card__name,
body.light .rr-inicio-head__title,
body.light .rr-inicio-slip__title {
    color: #0f172a !important;
}

body.light .rr-inicio-card__stats,
body.light .rr-inicio-head__meta,
body.light .rr-inicio-slip__row {
    color: #475569 !important;
}

body.light .rr-inicio-pix__code {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

body.light .table {
    color: #0f172a !important;
}

body.light .table thead th {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light .table tbody td {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

/* Screen loader (preloader) in light mode */
body.light .rr-preloader {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f8fafc 100%) !important;
}

body.light[data-user-premium="1"] .rr-preloader {
    background: linear-gradient(135deg, #f8fbff 0%, #e6efff 50%, #f8fbff 100%) !important;
}

body.light .rr-preloader__canvas {
    opacity: 0.45;
}

body.light .rr-preloader__title {
    color: #0f172a !important;
}

body.light .rr-preloader__subtitle {
    color: #64748b !important;
}

body.light[data-user-premium="1"] .rr-preloader__subtitle--premium {
    color: #2563eb !important;
}

body.light .rr-preloader__progress-bar {
    background: rgba(15, 23, 42, 0.1) !important;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.12) !important;
}

/* Stats "Ver mais" competitor modal in light theme */
body.light #competitorModal.x1-arena-modal {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f8fafc 100%) !important;
    color: #0f172a !important;
}

body.light #competitorModal.x1-arena-modal::before {
    background:
        radial-gradient(ellipse 80% 50% at 20% 0%, rgba(37, 99, 235, 0.18), transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(14, 165, 233, 0.14), transparent 50%),
        radial-gradient(ellipse 50% 50% at 50% 50%, rgba(37, 99, 235, 0.08), transparent 60%) !important;
}

body.light #competitorModal .x1-arena-header-bg {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0)) !important;
}

body.light #competitorModal #epicModalBacklight {
    background: radial-gradient(ellipse at center top, rgba(37, 99, 235, 0.45) 0%, transparent 80%) !important;
    opacity: 0.45 !important;
}

body.light #competitorModal .x1-arena-modal__close {
    background: rgba(248, 250, 252, 0.95) !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

body.light #competitorModal #epicModalPhotoCircle {
    border-color: #dbeafe !important;
    background: #f8fafc !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16) !important;
}

body.light #competitorModal #epicModalName {
    color: #0f172a !important;
    text-shadow: none !important;
    background: none !important;
    -webkit-text-fill-color: #0f172a !important;
}

body.light #competitorModal #epicClaimProfileBtn {
    color: #334155 !important;
    border-color: #cbd5e1 !important;
    background: rgba(255, 255, 255, 0.86) !important;
}

body.light #competitorModal .x1-arena-modal__badge--premium {
    background: rgba(37, 99, 235, 0.12) !important;
    border-color: rgba(37, 99, 235, 0.28) !important;
    color: #1d4ed8 !important;
}

body.light #competitorModal .x1-arena-modal__content {
    background: rgba(255, 255, 255, 0.82) !important;
    backdrop-filter: blur(8px);
}

body.light #competitorModal .x1-arena-modal__step {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

body.light #competitorModal .x1-arena-modal__step.is-active {
    background: rgba(37, 99, 235, 0.12) !important;
    border-color: rgba(37, 99, 235, 0.3) !important;
    color: #1d4ed8 !important;
}

body.light #competitorModal .stats-chip,
body.light #competitorModal .detail-card {
    background: #f8fafc !important;
    border-color: #dbeafe !important;
}

body.light #competitorModal .text-white,
body.light #competitorModal .text-white-50,
body.light #competitorModal h4.text-white {
    color: #0f172a !important;
}

body.light #competitorModal .text-muted {
    color: #64748b !important;
}

body.light #competitorModal #epicModalLocked {
    background: rgba(248, 250, 252, 0.95) !important;
    border: 1px solid #dbeafe !important;
}

body.light #competitorModal #epicModalLocked h3 {
    color: #0f172a !important;
}

body.light #competitorModal #epicModalLocked p {
    color: #475569 !important;
}

body.light #competitorModal #epicModalLocked a {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.28) !important;
}

body.light #competitorModal .event-card {
    background: #f8fafc !important;
    border-color: #dbeafe !important;
}

body.light #competitorModal .event-info h4 {
    color: #0f172a !important;
}

body.light #competitorModal .event-info p {
    color: #64748b !important;
}

/* Advanced visual polish for "Ver mais" stats modal (dark + light) */
#competitorModal.rr-stats-epic-modal {
    --rrs-surface: rgba(15, 23, 42, 0.42);
    --rrs-surface-soft: rgba(15, 23, 42, 0.28);
    --rrs-border: rgba(148, 163, 184, 0.28);
    --rrs-text: #e2e8f0;
    --rrs-muted: #94a3b8;
    --rrs-accent: #3b82f6;
    --rrs-accent-soft: rgba(59, 130, 246, 0.2);
}

body.light #competitorModal.rr-stats-epic-modal {
    --rrs-surface: rgba(255, 255, 255, 0.92);
    --rrs-surface-soft: rgba(248, 250, 252, 0.9);
    --rrs-border: rgba(148, 163, 184, 0.35);
    --rrs-text: #0f172a;
    --rrs-muted: #64748b;
    --rrs-accent: #2563eb;
    --rrs-accent-soft: rgba(37, 99, 235, 0.16);
}

#competitorModal.rr-stats-epic-modal .x1-arena-modal__header {
    border-bottom: 1px solid var(--rrs-border);
}

#competitorModal.rr-stats-epic-modal #epicModalName {
    letter-spacing: 0.05em !important;
}

#competitorModal.rr-stats-epic-modal .x1-arena-modal__content {
    padding-bottom: 4.5rem !important;
}

#competitorModal.rr-stats-epic-modal .x1-arena-modal__steps {
    width: fit-content;
    margin: 0.75rem auto 0.5rem !important;
    padding: 0.35rem !important;
    border-radius: 999px;
    background: var(--rrs-surface-soft) !important;
    border: 1px solid var(--rrs-border);
}

#competitorModal.rr-stats-epic-modal .stats-main-row {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem !important;
    padding: 0 0.75rem !important;
    margin-bottom: 1rem !important;
}

#competitorModal.rr-stats-epic-modal .stats-chip {
    position: relative;
    max-width: none !important;
    min-height: 82px;
    background: var(--rrs-surface) !important;
    border: 1px solid var(--rrs-border) !important;
    border-radius: 12px !important;
    padding: 0.55rem 0.35rem !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(8px);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    overflow: hidden;
}

#competitorModal.rr-stats-epic-modal .stats-chip::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, #60a5fa, #2563eb);
}

#competitorModal.rr-stats-epic-modal .stats-chip--boas::before {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

#competitorModal.rr-stats-epic-modal .stats-chip--erros::before {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

#competitorModal.rr-stats-epic-modal .stats-chip--armadas::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

#competitorModal.rr-stats-epic-modal .stats-chip--destrezas::before {
    background: linear-gradient(90deg, #0ea5e9, #2563eb);
}

#competitorModal.rr-stats-epic-modal .stats-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.2);
    border-color: rgba(37, 99, 235, 0.35) !important;
}

#competitorModal.rr-stats-epic-modal .stats-chip .text-muted {
    color: var(--rrs-muted) !important;
    font-weight: 600;
}

#competitorModal.rr-stats-epic-modal .rr-stats-detail-head {
    margin-bottom: 0.45rem !important;
}

#competitorModal.rr-stats-epic-modal .rr-stats-detail-head h4 {
    color: var(--rrs-text) !important;
    font-weight: 700;
    letter-spacing: 0.06em;
}

#competitorModal.rr-stats-epic-modal .rr-stats-detail-grid {
    gap: 0.52rem !important;
}

#competitorModal.rr-stats-epic-modal .detail-card {
    background: var(--rrs-surface) !important;
    border: 1px solid var(--rrs-border) !important;
    border-radius: 10px !important;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

#competitorModal.rr-stats-epic-modal .detail-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.16);
    border-color: rgba(37, 99, 235, 0.35) !important;
}

#competitorModal.rr-stats-epic-modal .detail-card[style*="239, 68, 68"] {
    background: rgba(239, 68, 68, 0.09) !important;
    border-color: rgba(239, 68, 68, 0.28) !important;
}

#competitorModal.rr-stats-epic-modal .detail-card .text-white,
#competitorModal.rr-stats-epic-modal .detail-card .fw-bold {
    color: var(--rrs-text) !important;
}

#competitorModal.rr-stats-epic-modal .detail-card .text-danger {
    color: #ef4444 !important;
}

#competitorModal.rr-stats-epic-modal .rr-stats-event-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    border: 1px solid var(--rrs-border);
    background: var(--rrs-surface);
    margin-bottom: 0.55rem;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

#competitorModal.rr-stats-epic-modal .rr-stats-event-card:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

#competitorModal.rr-stats-epic-modal .rr-stats-event-card__left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

#competitorModal.rr-stats-epic-modal .rr-stats-event-card__rank {
    min-width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--rrs-accent-soft);
    color: var(--rrs-accent);
    font-weight: 800;
    font-size: 0.75rem;
    border: 1px solid rgba(37, 99, 235, 0.25);
}

#competitorModal.rr-stats-epic-modal .rr-stats-event-card__meta {
    min-width: 0;
}

#competitorModal.rr-stats-epic-modal .rr-stats-event-card__meta h4 {
    margin: 0 0 0.2rem;
    color: var(--rrs-text);
    font-size: 0.92rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#competitorModal.rr-stats-epic-modal .rr-stats-event-card__meta p {
    margin: 0;
    color: var(--rrs-muted);
    font-size: 0.75rem;
}

#competitorModal.rr-stats-epic-modal .rr-stats-event-card__right {
    text-align: right;
    flex-shrink: 0;
}

#competitorModal.rr-stats-epic-modal .rr-stats-event-card__right strong {
    display: block;
    color: var(--rrs-accent);
    font-size: 1.1rem;
    line-height: 1;
}

#competitorModal.rr-stats-epic-modal .rr-stats-event-card__right small {
    color: var(--rrs-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (max-width: 860px) {
    #competitorModal.rr-stats-epic-modal .rr-stats-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    #competitorModal.rr-stats-epic-modal .stats-main-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
