/* MU Apocalipsis — identidad visual 2026-10-05 */
:root {
    --bg-deep: #0b0807;
    --bg-panel: #12100e;
    --bg-panel-hover: #211610;
    --bg-box: #120e0c;
    --border-gold: #cb9355;
    --border-gold-dk: #493022;
    --border-gold-bright: #ffc981;
    --border-dark: #493022;
    --text-main: #eee3d8;
    --text-light: #d5c8bc;
    --text-muted: #c7b9ab;
    --text-gold: #f1c58d;
    --text-gold-lt: #ffe0ae;
    --glow-gold: #d8813433;
    --gold-glow: #d8813433;
    --gold-glow-soft: #d881341a;
}
body {
    background-image:
        radial-gradient(ellipse at 50% 0%, #b84a1d26, transparent 62%),
        radial-gradient(ellipse at 0% 62%, #f0782415, transparent 54%),
        radial-gradient(ellipse at 100% 78%, #dc541512, transparent 52%),
        linear-gradient(180deg, #100a08e8, #080605f5), url('../img/brand/mu-apocalipsis-portada.webp');
    background-color: #080605;
    background-attachment: scroll;
    color: var(--text-main);
}
#wrapper { max-width: 1440px; background: #100b09eb; border-color: #cb935526; }
#site-header { position: relative; background: linear-gradient(110deg, #130d0a, #26150f 58%, #130d0a); padding: 18px 28px; }
#site-header::before { background: radial-gradient(ellipse at 20% 50%, #f2832820, transparent 65%); }
#site-logo { flex: 0 1 290px; }
#site-logo img.brand-logo { width: 290px; max-width: 100%; max-height: none; height: auto !important; filter: drop-shadow(0 3px 8px #0008); }
#header-user { min-width: 0; }
.hdr-login-form { flex-wrap: wrap; justify-content: flex-end; }
.hdr-input, .form-input { background: #100b09; border-color: #624331; color: #f6e7dc; }
.hdr-input::placeholder, .form-input::placeholder { color: var(--text-muted); opacity: 1; }
#main-nav { background: #17100d; border-color: #593523; }
#main-nav li.active a, #main-nav li a:hover { background: #d77c261a; color: #ffe0ae; border-bottom-color: #ffac58; }
#main-container { grid-template-columns: 230px minmax(0, 1fr) 230px; background: #100b09c9; }
#content-main { background: transparent; }
.content-box { margin: 20px 18px; border: 1px solid #cb935530; border-radius: 10px; background: var(--bg-box); backdrop-filter: none; }
.content-box:hover { transform: none; box-shadow: none; }
.content-box-title, .side-box-title { background: linear-gradient(100deg, #2c1b12, #1b130f); color: #f1c58d; border-bottom-color: #cb935530; }
.content-box-title::before { display: none; }
.side-box { border-radius: 0; background: var(--bg-panel); }
.content-box-body.welcome-block { padding: 0; }
.hero-wrap { border: 0; border-radius: 0; margin: 0; }
.hero-wrap .welcome-hero-img { width: 100%; height: auto; max-height: none; aspect-ratio: 16 / 9; object-fit: contain; background: #130d0a; }
.hero-wrap::after { background: linear-gradient(180deg, transparent 74%, #17110f 100%); }
.hero-badges { position: relative; inset: auto; padding: 12px 22px 0; background: #17110f; gap: 8px; }
.hero-badge { background: #2b1b12; border-color: #cb93554d; color: #efc18d; backdrop-filter: none; letter-spacing: .4px; }
.hero-badge i { background: #ec9b4e; box-shadow: none; }
.welcome-banner { margin: 0; padding: 24px 26px 28px; background: #17110f; border: 0; border-radius: 0; }
.welcome-title { font-family: var(--font-gothic); font-size: clamp(1.8rem, 3vw, 2.5rem); color: #ffe0ae; letter-spacing: .3px; }
.welcome-subtitle { max-width: 48ch; color: var(--text-light); }
.btn-primary, .btn-hdr--gold, .btn-download { background: linear-gradient(180deg, #f1b46e, #c98340); border-color: #efa85e; color: #21120a !important; text-shadow: none; }
.btn-primary:hover, .btn-hdr--gold:hover, .btn-download:hover { background: #ffc981; color: #21120a !important; }
.btn-secondary, .btn-hdr:not(.btn-hdr--gold):not(.btn-hdr--danger) { background: #241810; border-color: #9b6840; color: #f1c58d; }
.features-grid { padding: 0 22px 24px; gap: 14px; }
.feature-item { background: #211710; border-color: #cb935526; }
.feature-icon-wrapper { background: #2b1b13; border-color: #cb935540; }
.feature-item:hover .feature-icon-wrapper { box-shadow: none; }
.news-title { color: #f1c58d; }
.news-date { background: #362215; color: #efc18d; }
.news-divider { border-color: #cb935526; }
.table-responsive { border-color: #cb935530; }
.rank-table thead tr, .panel-char-table thead tr, .dl-req-table thead tr { background: #2b1a11; }
.rank-table tbody tr:hover, .panel-char-table tbody tr:hover { background: #cb93550d; }
#site-footer { background: #130d0a; border-color: #593523; padding-top: 28px; }
.footer-ornament { color: #bf7541; }
.preview-notice { background: #2a1a11; color: #dcc2a7; }
@media (max-width: 1080px) {
    #main-container { grid-template-columns: 210px minmax(0, 1fr); }
    #sidebar-right { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}
@media (max-width: 800px) {
    #main-container { display: flex; flex-direction: column; }
    #site-logo { flex: none; width: min(290px, 80vw); }
    .hdr-login-form { justify-content: center; }
}
@media (max-width: 480px) {
    #site-header { padding: 14px 16px; }
    #site-logo { width: 250px; }
    .content-box { margin: 14px 8px; }
    .hero-badges { padding: 12px 14px 0; gap: 6px; }
    .hero-badge { font-size: .62rem; padding: 5px 8px; }
    .welcome-banner { padding: 22px 16px; }
    .features-grid { padding: 0 14px 20px; }
    #sidebar-right { grid-template-columns: minmax(0, 1fr); }
}

/* Ranking con retratos auténticos por familia de clase. */
#site-header { padding: 12px 28px; }
#site-logo { flex-basis: 220px; }
#site-logo img.brand-logo { width: 220px; }
.top-list-item { gap: 7px; padding: 10px 0; }
.top-avatar, .rank-avatar { flex-shrink: 0; object-fit: cover; object-position: center 18%; background: #111; border: 1px solid #cb935550; border-radius: 9px; }
.top-avatar { width: 36px; height: 36px; }
.top-player-info { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 3px; }
.top-list-item .top-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-list-item .top-meta { font-size: .66rem; }
.top-list-item .class-badge { padding: 1px 5px; font-size: .6rem; }
.top-resets { font-size: .72rem; color: #f1c58d; }
.ranking-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; margin: 8px 0 12px; }
.ranking-filters label { display: flex; flex-direction: column; gap: 6px; color: #e3c49f; font-size: .82rem; }
.ranking-filters .form-input { width: 100%; min-width: 0; margin: 0; }
.ranking-filters button { min-height: 42px; font-size: .78rem; padding: 10px 14px; }
.ranking-caption, .ranking-results { color: var(--text-muted); font-size: .78rem; margin: 8px 0; }
.ranking-results { color: var(--text-gold); min-height: 1.3em; }
.ranking-podium { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 20px 0 24px; }
.podium-card { position: relative; text-align: center; padding: 16px 10px; border: 1px solid #cb93554d; border-radius: 12px; background: linear-gradient(180deg,#352314,#19120e); min-width: 0; }
.podium-1 { border-color: #e6b56c; background: linear-gradient(180deg,#4b3219,#1e160f); }
.podium-2 { border-color: #9faebc; }
.podium-3 { border-color: #b87c53; }
.podium-position { position: absolute; left: 12px; top: 10px; font-weight: 700; color: #ffe0ae; }
.podium-card img { display: block; width: 110px; height: 110px; margin: 10px auto 12px; border-radius: 50%; object-fit: cover; object-position: center 18%; border: 2px solid #cb935566; background: #111; }
.podium-card h2 { color: #ffe0ae; font-family: var(--font-body); font-size: 1rem; overflow-wrap: anywhere; }
.podium-card p { color: var(--text-muted); font-size: .73rem; margin: 4px 0 10px; }
.podium-card strong, .podium-card > span:last-child { display: block; }
.podium-card strong { font-size: .95rem; color: #f1c58d; }
.podium-card > span:last-child { font-size: .74rem; color: var(--text-muted); }
.rank-player { display: flex; align-items: center; gap: 12px; min-width: 140px; }
.rank-player > span { overflow-wrap: anywhere; }
.rank-avatar { width: 48px; height: 48px; }
.rank-table .rank-class .class-badge { min-width: 0; font-size: .68rem; letter-spacing: 0; }
.rank-table td { vertical-align: middle; }
.rank-entry[hidden], .podium-card[hidden], .rank-empty-filter[hidden], .ranking-filters[hidden] { display: none; }
.rank-empty-filter td { padding: 24px; text-align: center; color: var(--text-muted); }
@media (max-width: 800px) {
    #site-logo { flex-basis: auto; width: 220px; }
}
@media (max-width: 600px) {
    .ranking-filters { grid-template-columns: minmax(0,1fr); gap: 10px; }
    .ranking-podium { grid-template-columns: minmax(0,1fr); gap: 10px; }
    .podium-card { display: grid; grid-template-columns: 72px minmax(0,1fr); column-gap: 14px; text-align: left; padding: 16px; }
    .podium-position { position: static; grid-column: 2; }
    .podium-card img { grid-column: 1; grid-row: 1 / 6; width: 72px; height: 72px; margin: auto; }
    .podium-card h2, .podium-card p, .podium-card strong, .podium-card > span:last-child { grid-column: 2; }
    .podium-card p { margin: 3px 0; }
    .rank-player { min-width: 125px; gap: 8px; }
    .rank-avatar { width: 38px; height: 38px; }
}

/* Movimiento ligero: solo transform/opacity, sin vídeo ni partículas. */
@media (prefers-reduced-motion: no-preference) {
    .rank-avatar, .top-avatar, .gallery-item img, #site-logo img.brand-logo {
        transition: transform 240ms ease-out;
    }
    .podium-card { transition: transform 240ms ease-out; }
    .btn-primary, .btn-secondary, .btn-download { transition: transform 180ms ease-out; }
    .btn-primary:active, .btn-secondary:active, .btn-download:active { transform: scale(.98); }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .rank-entry:hover .rank-avatar, .top-list-item:hover .top-avatar { transform: translateY(-2px) scale(1.06); }
    .podium-card:hover { transform: translateY(-4px); }
    .gallery-item:hover img { transform: scale(1.035); }
    #site-logo:hover img.brand-logo { transform: translateY(-2px); }
    .btn-primary:hover, .btn-secondary:hover, .btn-download:hover { transform: translateY(-2px); }
}
@media (min-width: 801px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .hero-wrap::before {
        content: ''; position: absolute; inset: 0 0 48px; z-index: 1;
        pointer-events: none;
        background: radial-gradient(ellipse at 75% 68%, #ff7e272e, transparent 48%);
        opacity: 0;
        animation: apocalypse-embers 8s ease-in-out infinite;
        animation-play-state: paused;
    }
    .podium-card img {
        animation: apocalypse-float 6s ease-in-out infinite;
        animation-play-state: paused;
    }
    .podium-2 img { animation-delay: -2s; }
    .podium-3 img { animation-delay: -4s; }
    .hero-wrap.motion-visible::before, .podium-card.motion-visible img { animation-play-state: running; }
}
@keyframes apocalypse-embers {
    0%, 100% { opacity: .15; transform: translateY(0); }
    50% { opacity: .8; transform: translateY(-8px); }
}
@keyframes apocalypse-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
/* Halo y brasas en dos capas CSS, sin bloquear clics ni cargar imágenes. */
@media (min-width: 801px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    body::before {
        content: ''; position: fixed; inset: 0; z-index: 60; pointer-events: none;
        background:
            radial-gradient(ellipse 38vw 58vh at 0% 70%, #f078243d, transparent 100%),
            radial-gradient(ellipse 34vw 54vh at 100% 76%, #dc541535, transparent 100%),
            radial-gradient(ellipse 55vw 30vh at 50% 0%, #ffad4b20, transparent 100%),
            linear-gradient(115deg, transparent 35%, #ffb65a08 50%, transparent 65%);
        opacity: .42;
        animation: apocalypse-background 18s ease-in-out infinite;
        animation-play-state: paused;
    }
    body::after {
        content: ''; position: fixed; inset: 0; z-index: 61; pointer-events: none;
        background:
            radial-gradient(circle at 2% 88%, #ffc374 0 1.5px, transparent 3px),
            radial-gradient(circle at 5% 66%, #ff9c43 0 1px, transparent 2.5px),
            radial-gradient(circle at 8% 95%, #ffd59b 0 1.5px, transparent 3px),
            radial-gradient(circle at 3% 38%, #ffa552 0 1px, transparent 2.5px),
            radial-gradient(circle at 7% 20%, #ffc374 0 1px, transparent 2.5px),
            radial-gradient(circle at 11% 78%, #ff9c43 0 1px, transparent 2.5px),
            radial-gradient(circle at 14% 54%, #ffd59b 0 1px, transparent 2.5px),
            radial-gradient(circle at 98% 90%, #ffc374 0 1.5px, transparent 3px),
            radial-gradient(circle at 95% 72%, #ff9c43 0 1px, transparent 2.5px),
            radial-gradient(circle at 92% 98%, #ffd59b 0 1.5px, transparent 3px),
            radial-gradient(circle at 97% 45%, #ffa552 0 1px, transparent 2.5px),
            radial-gradient(circle at 93% 28%, #ffc374 0 1px, transparent 2.5px),
            radial-gradient(circle at 89% 62%, #ff9c43 0 1px, transparent 2.5px),
            radial-gradient(circle at 86% 36%, #ffd59b 0 1px, transparent 2.5px);
        animation: apocalypse-background-embers 12s linear infinite;
        animation-play-state: paused;
    }
    body.background-motion::before, body.background-motion::after { animation-play-state: running; }
}
@keyframes apocalypse-background {
    0%, 100% { opacity: .28; }
    50% { opacity: .78; }
}
@keyframes apocalypse-background-embers {
    0% { opacity: 0; transform: translateY(12px); }
    20% { opacity: .75; }
    75% { opacity: .55; }
    100% { opacity: 0; transform: translateY(-65px); }
}
@media (prefers-reduced-motion: reduce) {
    .hero-wrap::before { display: none; }
    .rank-avatar, .top-avatar, .podium-card, .podium-card img,
    .gallery-item img, #site-logo img.brand-logo { transform: none !important; }
}
.panel-char-table .panel-class {
    gap: 10px;
    min-width: 164px;
    padding: 5px 12px 5px 5px;
    border-radius: 9px;
    border-left-width: 3px;
    font-size: .78rem;
    letter-spacing: .15px;
    line-height: 1.35;
    text-transform: none;
    vertical-align: middle;
}
.panel-char-table .panel-class::before { content: none; }
.panel-class img {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    object-fit: cover;
    background: #17120e;
    border: 1px solid #ffffff24;
}

/* Acabado premium para botones y paneles. */
.content-box {
    position: relative;
    border: 1px solid rgba(202, 145, 83, .34);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(35, 23, 16, .97), rgba(16, 12, 10, .98) 68%);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .44), inset 0 1px rgba(255, 224, 174, .075);
    transition: border-color .24s ease, box-shadow .24s ease, transform .24s ease;
}
.content-box-title {
    background: linear-gradient(100deg, #352014 0%, #26170f 54%, #1c120e 100%);
    border-bottom: 1px solid rgba(208, 153, 95, .32);
    box-shadow: inset 0 1px rgba(255, 231, 194, .07);
    text-shadow: 0 1px 8px rgba(229, 151, 76, .22);
}
.content-box-title::after {
    height: 1px;
    background: linear-gradient(90deg, transparent, #d99a5c, #f2c487 48%, #d99a5c, transparent);
    opacity: .48;
}
#sidebar-left .side-box, #sidebar-right .side-box {
    margin: 9px 8px;
    overflow: hidden;
    border: 1px solid rgba(202, 145, 83, .25);
    border-radius: 9px;
    background: linear-gradient(150deg, rgba(34, 23, 17, .96), rgba(16, 12, 10, .98));
    box-shadow: 0 7px 18px rgba(0, 0, 0, .26), inset 0 1px rgba(255, 224, 174, .045);
    transition: border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.side-box-title {
    background: linear-gradient(100deg, #342014, #24160f 62%, #1a120e);
    border-bottom-color: rgba(208, 153, 95, .28);
    box-shadow: inset 0 1px rgba(255, 231, 194, .055);
}
.side-box-body { background: linear-gradient(180deg, rgba(255, 207, 143, .018), transparent 72%); }

.btn-primary, .btn-download:not(.btn-download--alt), .btn-hdr--gold {
    position: relative;
    border: 1px solid #f0b773;
    border-radius: 6px;
    background: linear-gradient(180deg, #f4c17e 0%, #d9944e 52%, #b96d31 100%);
    box-shadow: 0 5px 16px rgba(128, 69, 29, .34), inset 0 1px rgba(255, 244, 219, .62), inset 0 -1px rgba(97, 48, 17, .35);
    color: #26150c !important;
    font-weight: 800;
    text-shadow: 0 1px rgba(255, 232, 196, .28);
}
.btn-secondary, .btn-hdr:not(.btn-hdr--gold):not(.btn-hdr--danger) {
    border: 1px solid rgba(192, 135, 82, .68);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(61, 39, 25, .96), rgba(31, 21, 16, .98));
    box-shadow: inset 0 1px rgba(255, 228, 188, .07), 0 4px 12px rgba(0, 0, 0, .22);
    color: #f1c58d;
}
.btn-hdr--danger, .btn-danger {
    border-radius: 6px;
    box-shadow: inset 0 1px rgba(255, 220, 220, .05), 0 4px 12px rgba(0, 0, 0, .22);
}
.btn-primary:hover, .btn-download:not(.btn-download--alt):hover, .btn-hdr--gold:hover {
    border-color: #ffe0ae;
    background: linear-gradient(180deg, #ffdaa0, #e8a45f 58%, #c87b3c);
    box-shadow: 0 7px 22px rgba(217, 130, 55, .4), inset 0 1px rgba(255, 250, 235, .8);
    color: #241309 !important;
}
.btn-secondary:hover, .btn-hdr:not(.btn-hdr--gold):not(.btn-hdr--danger):hover {
    border-color: #e3ad73;
    background: linear-gradient(180deg, #51331f, #322116);
    box-shadow: 0 6px 18px rgba(186, 108, 49, .22), inset 0 1px rgba(255, 231, 194, .12);
    color: #ffe0ae;
}
.btn-primary:focus-visible, .btn-secondary:focus-visible, .btn-download:focus-visible,
.btn-hdr:focus-visible, .btn-danger:focus-visible {
    outline: 2px solid #ffe0ae;
    outline-offset: 3px;
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .content-box:hover {
        border-color: rgba(230, 173, 111, .55);
        box-shadow: 0 15px 34px rgba(0, 0, 0, .5), 0 0 20px rgba(197, 117, 51, .09), inset 0 1px rgba(255, 224, 174, .09);
        transform: translateY(-2px);
    }
    #sidebar-left .side-box:hover, #sidebar-right .side-box:hover {
        border-color: rgba(226, 166, 103, .48);
        box-shadow: 0 9px 22px rgba(0, 0, 0, .32), 0 0 15px rgba(197, 117, 51, .08), inset 0 1px rgba(255, 224, 174, .07);
    }
    .btn-primary:hover, .btn-secondary:hover, .btn-download:hover, .btn-hdr:hover, .btn-danger:hover {
        transform: translateY(-2px);
    }
}
@media (max-width: 800px) {
    #sidebar-left .side-box, #sidebar-right .side-box { margin: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .content-box, .side-box, .btn-primary, .btn-secondary, .btn-download, .btn-hdr, .btn-danger { transition: none !important; }
}

/* El ambiente y los acentos también se ven en pantallas táctiles. */
@media (prefers-reduced-motion: no-preference) {
    body::before {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 60;
        pointer-events: none;
        background:
            radial-gradient(ellipse 42vw 62vh at 0% 68%, rgba(255, 105, 35, .42), transparent 100%),
            radial-gradient(ellipse 40vw 60vh at 100% 74%, rgba(225, 66, 28, .36), transparent 100%),
            radial-gradient(ellipse 72vw 36vh at 50% 0%, rgba(255, 170, 70, .28), transparent 100%),
            linear-gradient(112deg, rgba(255, 130, 48, .14), transparent 22%, transparent 78%, rgba(240, 83, 42, .14));
        opacity: .58;
        transform: scale(1);
        transform-origin: 50% 45%;
        animation: mu-apocalypse-aura 6.5s ease-in-out infinite alternate;
        will-change: opacity, transform;
    }
    body::after {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 61;
        pointer-events: none;
        background:
            radial-gradient(circle at 3% 88%, #ffd28a 0 2.2px, transparent 4.5px),
            radial-gradient(circle at 7% 65%, #ff9a50 0 1.8px, transparent 4px),
            radial-gradient(circle at 12% 92%, #ffe2ab 0 2px, transparent 4.2px),
            radial-gradient(circle at 16% 49%, #ffb15c 0 1.7px, transparent 3.8px),
            radial-gradient(circle at 5% 25%, #ffd28a 0 1.8px, transparent 4px),
            radial-gradient(circle at 20% 79%, #ff8b40 0 1.8px, transparent 4px),
            radial-gradient(circle at 97% 90%, #ffd28a 0 2.2px, transparent 4.5px),
            radial-gradient(circle at 93% 70%, #ff9a50 0 1.8px, transparent 4px),
            radial-gradient(circle at 88% 95%, #ffe2ab 0 2px, transparent 4.2px),
            radial-gradient(circle at 84% 52%, #ffb15c 0 1.7px, transparent 3.8px),
            radial-gradient(circle at 96% 29%, #ffd28a 0 1.8px, transparent 4px),
            radial-gradient(circle at 80% 82%, #ff8b40 0 1.8px, transparent 4px);
        opacity: .82;
        animation: mu-apocalypse-embers 6s linear infinite;
        will-change: opacity, transform;
    }
    .content-box-title { overflow: hidden; }
    .content-box-title::before {
        display: block;
        content: '';
        position: absolute;
        z-index: 1;
        top: 0;
        bottom: 0;
        left: -42%;
        width: 30%;
        background: linear-gradient(105deg, transparent, rgba(255, 220, 164, .14), transparent);
        transform: skewX(-18deg);
        animation: mu-panel-glint 7s ease-in-out infinite;
        animation-delay: -1.6s;
        pointer-events: none;
    }
    .btn-primary::after, .btn-download::after, .btn-hdr--gold::before {
        display: block !important;
        animation: mu-button-glint 8s ease-in-out infinite;
        animation-delay: -2.4s;
        opacity: .24;
    }
    .btn-hdr--gold { overflow: hidden; }
    .btn-hdr--gold::before {
        content: '';
        position: absolute;
        z-index: 0;
        top: -50%;
        left: -60%;
        width: 40%;
        height: 200%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
        transform: rotate(25deg);
        pointer-events: none;
    }
}
.content-box {
    border-color: rgba(223, 163, 101, .48);
    outline: 1px solid rgba(255, 202, 133, .10);
    outline-offset: -4px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .52), 0 0 0 1px rgba(220, 149, 83, .10), inset 0 1px rgba(255, 224, 174, .11);
}
#sidebar-left .side-box, #sidebar-right .side-box {
    border-color: rgba(218, 156, 94, .37);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .38), 0 0 0 1px rgba(220, 149, 83, .075), inset 0 1px rgba(255, 224, 174, .08);
}
.btn-primary, .btn-download:not(.btn-download--alt), .btn-hdr--gold {
    overflow: hidden;
    border: 1px solid #ffd08f;
    box-shadow: 0 0 0 1px rgba(255, 192, 113, .20), 0 6px 20px rgba(139, 69, 24, .48), inset 0 1px rgba(255, 249, 233, .78), inset 0 -2px rgba(111, 56, 22, .30);
}
.btn-secondary, .btn-hdr:not(.btn-hdr--gold):not(.btn-hdr--danger) {
    box-shadow: 0 0 0 1px rgba(209, 146, 87, .12), 0 5px 15px rgba(0, 0, 0, .34), inset 0 1px rgba(255, 228, 188, .13), inset 0 -1px rgba(0, 0, 0, .32);
}
@keyframes mu-apocalypse-aura {
    0% { opacity: .42; transform: translate3d(-3vw, 0, 0) scale(.99); }
    100% { opacity: 1; transform: translate3d(3vw, 0, 0) scale(1.06); }
}
@keyframes mu-apocalypse-embers {
    0% { opacity: .3; transform: translate3d(0, 24px, 0); }
    28% { opacity: 1; }
    72% { opacity: .76; }
    100% { opacity: .32; transform: translate3d(0, -72px, 0); }
}
@keyframes mu-panel-glint {
    0% { left: -42%; }
    26%, 100% { left: 125%; }
}
@keyframes mu-button-glint {
    0% { left: -60%; }
    32%, 100% { left: 130%; }
}
@media (prefers-reduced-motion: reduce) {
    body::before { animation: none !important; opacity: .76; will-change: auto; }
    body::after { animation: none !important; opacity: .46; will-change: auto; }
    .content-box-title::before, .btn-primary::after, .btn-download::after, .btn-hdr--gold::before { animation: none !important; }
}
body { isolation: isolate; }
body::before, body::after { z-index: 0; }
#wrapper {
    position: relative;
    z-index: 1;
    background: transparent;
}
#main-container { background: rgba(16, 11, 9, .58); }
.content-box {
    background: linear-gradient(145deg, rgba(35, 23, 16, .985), rgba(16, 12, 10, .99) 68%);
}
#sidebar-left .side-box, #sidebar-right .side-box {
    background: linear-gradient(150deg, rgba(34, 23, 17, .985), rgba(16, 12, 10, .99));
}
.event-frequency, .event-count-label, .event-state, .event-zone, .local-clock-title,
.ranking-caption, .podium-card p, .podium-card > span:last-child {
    color: #c5b09a;
}
@media (prefers-reduced-motion: no-preference) {
    #main-container {
        position: relative;
        isolation: isolate;
    }
    #main-container::before {
        content: '';
        position: absolute;
        z-index: 0;
        inset: -8% -4%;
        pointer-events: none;
        background:
            radial-gradient(ellipse 42% 38% at 3% 26%, rgba(255, 112, 46, .34), transparent 100%),
            radial-gradient(ellipse 38% 42% at 98% 64%, rgba(203, 55, 32, .29), transparent 100%),
            radial-gradient(ellipse 54% 26% at 50% 6%, rgba(255, 181, 91, .20), transparent 100%);
        opacity: .58;
        animation: mu-main-atmosphere 7.5s ease-in-out infinite alternate;
        will-change: opacity, transform;
    }
    #main-container > * { position: relative; z-index: 1; }
    .btn-primary, .btn-download:not(.btn-download--alt), .btn-hdr--gold {
        background-image: linear-gradient(112deg, #b66a32 0%, #d9944e 27%, #ffd08c 48%, #e6a15e 64%, #a95c2d 100%);
        background-size: 240% 100%;
        animation: mu-button-surface 3.8s ease-in-out infinite alternate;
    }
    .btn-primary:hover, .btn-download:not(.btn-download--alt):hover, .btn-hdr--gold:hover {
        background-image: linear-gradient(112deg, #c5793c 0%, #e7a45e 27%, #ffe2ae 48%, #f0b477 64%, #b96831 100%);
    }
}
@media (prefers-reduced-motion: reduce) {
    #main-container { position: relative; isolation: isolate; }
    #main-container::before {
        content: '';
        position: absolute;
        z-index: 0;
        inset: -8% -4%;
        pointer-events: none;
        background:
            radial-gradient(ellipse 42% 38% at 3% 26%, rgba(255, 112, 46, .22), transparent 100%),
            radial-gradient(ellipse 38% 42% at 98% 64%, rgba(203, 55, 32, .18), transparent 100%);
    }
    #main-container > * { position: relative; z-index: 1; }
}
@keyframes mu-main-atmosphere {
    0% { opacity: .62; transform: translate3d(-1.2%, 0, 0) scale(1); }
    100% { opacity: .86; transform: translate3d(1.2%, 0, 0) scale(1.025); }
}
@keyframes mu-button-surface {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}
html, body { overflow-x: hidden; overflow-x: clip; }
#main-container { overflow-x: hidden; overflow-x: clip; }

/* Cabecera con luz de forja y botones de acceso con mayor presencia. */
#site-header {
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(ellipse 34% 105% at 31% 48%, rgba(239, 129, 45, .25), transparent 100%),
        radial-gradient(ellipse 24% 90% at 76% 52%, rgba(194, 75, 35, .13), transparent 100%),
        repeating-linear-gradient(118deg, transparent 0 92px, rgba(255, 205, 139, .018) 93px 94px, transparent 95px 172px),
        linear-gradient(112deg, #120b08 0%, #28170f 37%, #1d100b 69%, #100a08 100%);
    border-bottom: 1px solid rgba(223, 151, 79, .48);
    box-shadow: inset 0 -1px rgba(255, 207, 139, .12), 0 10px 26px rgba(0, 0, 0, .36);
}
#site-header::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 8% 25%, rgba(255, 192, 117, .72) 0 1px, rgba(255, 156, 70, .18) 1.5px, transparent 3px),
        radial-gradient(circle at 19% 72%, rgba(255, 213, 151, .62) 0 .9px, rgba(255, 145, 61, .16) 1.5px, transparent 3px),
        radial-gradient(circle at 37% 18%, rgba(255, 178, 92, .68) 0 1px, rgba(255, 145, 61, .15) 1.6px, transparent 3px),
        radial-gradient(circle at 53% 79%, rgba(255, 217, 158, .62) 0 .9px, rgba(255, 145, 61, .15) 1.5px, transparent 3px),
        radial-gradient(circle at 68% 31%, rgba(255, 185, 104, .66) 0 1px, rgba(255, 145, 61, .16) 1.6px, transparent 3px),
        radial-gradient(circle at 83% 68%, rgba(255, 214, 157, .7) 0 .9px, rgba(255, 145, 61, .17) 1.5px, transparent 3px),
        radial-gradient(circle at 94% 20%, rgba(255, 177, 89, .65) 0 1px, rgba(255, 145, 61, .16) 1.6px, transparent 3px);
    opacity: .48;
    transform: translateY(0);
}
#site-header::after {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 34% 95% at 31% 46%, rgba(236, 115, 39, .14), transparent 100%);
}
#header-inner { position: relative; z-index: 1; }
#site-logo img.brand-logo { filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .62)) drop-shadow(0 0 14px rgba(223, 111, 39, .22)); }
.hdr-input {
    border-radius: 5px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, .42), 0 1px rgba(255, 220, 173, .04);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.hdr-input:focus {
    border-color: #d99556;
    box-shadow: 0 0 0 3px rgba(219, 145, 78, .15), inset 0 2px 8px rgba(0, 0, 0, .38);
    outline: none;
}
.btn-hdr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 17px;
    border-radius: 6px;
    font-weight: 750;
    letter-spacing: .025em;
    line-height: 1.2;
    text-align: center;
    vertical-align: middle;
    text-decoration: none;
    transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease, filter .2s ease;
}
.btn-hdr:not(.btn-hdr--gold):not(.btn-hdr--danger) {
    border-color: rgba(221, 157, 96, .78);
    background: linear-gradient(180deg, #392519 0%, #24160f 54%, #1b110d 100%);
    box-shadow: 0 0 0 1px rgba(255, 198, 125, .09), 0 5px 14px rgba(0, 0, 0, .34), inset 0 1px rgba(255, 231, 194, .17), inset 0 -2px rgba(0, 0, 0, .28);
    color: #ffe0b3;
}
.btn-hdr--gold {
    border-color: #ffe0a5;
    background: linear-gradient(180deg, #f5c17a 0%, #da9149 52%, #ad5e2e 100%);
    box-shadow: 0 0 0 1px rgba(255, 218, 159, .2), 0 0 10px rgba(232, 153, 78, .16), 0 5px 13px rgba(0, 0, 0, .34), inset 0 1px rgba(255, 251, 233, .58), inset 0 -2px rgba(104, 51, 19, .3);
    color: #27150a !important;
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    #site-header::before { animation: mu-header-embers 4.8s ease-in-out infinite alternate; }
    .btn-hdr:hover { transform: translateY(-2px); filter: brightness(1.1); }
    .btn-hdr:not(.btn-hdr--gold):not(.btn-hdr--danger):hover {
        border-color: #f0bd81;
        background: linear-gradient(180deg, #573820, #322014);
        box-shadow: 0 0 0 1px rgba(255, 201, 134, .2), 0 8px 20px rgba(0, 0, 0, .4), 0 0 16px rgba(224, 143, 70, .17), inset 0 1px rgba(255, 235, 202, .22);
    }
    .btn-hdr--gold:hover {
        background: linear-gradient(180deg, #ffdda0 0%, #e9a65e 52%, #bf7035 100%);
        box-shadow: 0 0 0 1px rgba(255, 225, 174, .34), 0 0 16px rgba(240, 163, 82, .24), 0 7px 18px rgba(0, 0, 0, .38), inset 0 1px rgba(255, 255, 242, .72);
    }
}
.btn-hdr:active, .btn-primary:active, .btn-secondary:active, .btn-download:active {
    transform: translateY(0) scale(.985);
    filter: brightness(.96);
}
@keyframes mu-header-embers {
    from { transform: translateY(1px); opacity: .32; }
    to { transform: translateY(-2px); opacity: .7; }
}
@media (prefers-reduced-motion: reduce) {
    #site-header::before { animation: none !important; transform: none; opacity: .45; }
    .btn-hdr, .hdr-input { transition: none !important; }
}

/* Selector de idioma en la esquina superior, con banderas reconocibles. */
.language-switch {
    position: absolute;
    z-index: 3;
    top: 9px;
    right: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px;
    border: 1px solid rgba(222, 164, 104, .25);
    border-radius: 7px;
    background: rgba(13, 9, 7, .68);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .32), inset 0 1px rgba(255, 225, 184, .08);
    transform: none;
}
.language-switch-label { display: none; }
.language-switch a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 58px;
    min-height: 30px;
    padding: 4px 7px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: #e5d2be;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .035em;
    line-height: 1;
    text-decoration: none;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.language-flag { font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif; font-size: 1rem; line-height: 1; }
.language-flag {
    position: relative;
    display: inline-block;
    flex: 0 0 20px;
    width: 20px;
    height: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 238, 211, .48);
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .45);
    font-size: 0;
    line-height: 0;
}
.flag-es { background: linear-gradient(to bottom, #aa151b 0 25%, #f1bf00 25% 75%, #aa151b 75% 100%); }
.flag-en { background: repeating-linear-gradient(to bottom, #b22234 0 1.05px, #fff 1.05px 2.1px); }
.flag-en::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 7px;
    background: #3c3b6e;
}
.flag-ptbr { background: #159447; }
.flag-ptbr::before {
    content: '';
    position: absolute;
    inset: 1px 3px;
    background: #ffdf00;
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.flag-ptbr::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    left: 6px;
    top: 3.5px;
    border-radius: 50%;
    background: #183a8f;
}
.language-switch a:hover, .language-switch a[aria-current="true"] {
    border-color: rgba(240, 185, 119, .6);
    background: linear-gradient(180deg, rgba(132, 79, 39, .6), rgba(68, 39, 23, .72));
    box-shadow: inset 0 1px rgba(255, 232, 196, .14), 0 2px 8px rgba(0, 0, 0, .24);
    color: #ffe0ae;
}
@media (hover: hover) and (pointer: fine) {
    .language-switch a:hover { transform: translateY(-1px); }
}
@media (max-width: 540px) {
    .language-switch { top: 7px; right: 8px; gap: 2px; padding: 3px; }
    .language-switch a { min-width: 43px; min-height: 29px; gap: 3px; padding: 3px 5px; font-size: .58rem; }
    .language-flag { font-size: .94rem; }
    #site-logo { margin-top: 30px; }
}
@media (max-width: 360px) {
    .language-switch a { min-width: 36px; padding-inline: 3px; }
    .language-code { font-size: .52rem; }
}
@media (prefers-reduced-motion: reduce) {
    .language-switch a { transition: none !important; }
}
@media (prefers-reduced-motion: no-preference) {
    #site-header::before { animation: mu-header-embers 4.8s ease-in-out infinite alternate; }
}

/* Brillo vivo en el emblema y acabado cinematográfico en los renders. */
#site-logo img.brand-logo {
    animation: mu-logo-glow 4.6s ease-in-out infinite alternate;
    transform-origin: center;
}
.hero-wrap { overflow: hidden; }
.hero-wrap .welcome-hero-img, .event-hero-img, .gallery-item img, .podium-card img {
    transition: transform .42s cubic-bezier(.2, .75, .25, 1), filter .42s ease, box-shadow .42s ease;
    filter: saturate(1.035) contrast(1.02);
}
@keyframes mu-logo-glow {
    from { filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .62)) drop-shadow(0 0 10px rgba(223, 111, 39, .18)); }
    to { filter: drop-shadow(0 4px 9px rgba(0, 0, 0, .65)) drop-shadow(0 0 20px rgba(255, 145, 58, .46)); }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    #site-logo:hover img.brand-logo { animation-play-state: paused; filter: drop-shadow(0 5px 10px rgba(0, 0, 0, .68)) drop-shadow(0 0 24px rgba(255, 157, 70, .56)); }
    .hero-wrap:hover .welcome-hero-img, .event-hero-img:hover { transform: scale(1.01); filter: saturate(1.09) contrast(1.035) brightness(1.025); }
    .gallery-item:hover img, .podium-card:hover img { filter: saturate(1.1) contrast(1.035) brightness(1.035); }
    .rank-entry:hover .rank-avatar, .top-list-item:hover .top-avatar { filter: saturate(1.08) brightness(1.04); }
}

/* Mantiene un único destello lento, sin gradientes que barran los controles. */
#main-container .btn-primary, #main-container .btn-download:not(.btn-download--alt), #header-user .btn-hdr--gold {
    animation: none;
    background-size: auto;
    background-image: linear-gradient(180deg, #f0bc74 0%, #d88c45 54%, #aa5b2c 100%);
}
#main-container .btn-primary:hover, #main-container .btn-download:not(.btn-download--alt):hover, #header-user .btn-hdr--gold:hover {
    background-image: linear-gradient(180deg, #ffdda0 0%, #e9a65e 54%, #bf7035 100%);
}
.btn-primary::after, .btn-download::after, .btn-hdr--gold::before {
    animation-duration: 8s;
    animation-delay: -2.4s;
    opacity: .24;
}
@media (prefers-reduced-motion: reduce) {
    #site-logo img.brand-logo { animation: none !important; }
    .hero-wrap .welcome-hero-img, .event-hero-img, .gallery-item img, .podium-card img { transition: none !important; }
}

/* Selector desplegable: solo bandera actual hasta que el visitante lo abre. */
.language-switch {
    display: block;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    box-shadow: none;
}
.language-switch > summary {
    display: flex;
    width: 42px;
    height: 38px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid rgba(222, 164, 104, .55);
    border-radius: 7px;
    background: linear-gradient(155deg, rgba(69, 42, 25, .96), rgba(21, 13, 10, .98));
    box-shadow: 0 4px 13px rgba(0, 0, 0, .35), inset 0 1px rgba(255, 230, 191, .16);
    cursor: pointer;
    list-style: none;
}
.language-switch > summary::-webkit-details-marker { display: none; }
.language-switch > summary::after {
    content: '';
    width: 5px;
    height: 5px;
    margin-top: -3px;
    border-right: 1px solid #e7c293;
    border-bottom: 1px solid #e7c293;
    transform: rotate(45deg);
    transition: transform .18s ease, margin .18s ease;
}
.language-switch[open] > summary::after { margin-top: 3px; transform: rotate(225deg); }
.language-switch > summary:hover, .language-switch[open] > summary {
    border-color: #f0bd81;
    background: linear-gradient(155deg, rgba(100, 59, 31, .98), rgba(38, 23, 15, .99));
}
.language-options {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    display: grid;
    grid-template-columns: repeat(2, 40px);
    gap: 4px;
    padding: 5px;
    border: 1px solid rgba(222, 164, 104, .58);
    border-radius: 7px;
    background: linear-gradient(155deg, #2a1a11, #120c09 82%);
    box-shadow: 0 9px 22px rgba(0, 0, 0, .58), inset 0 1px rgba(255, 230, 191, .1);
}
.language-options a {
    display: grid;
    width: 40px;
    min-width: 40px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 5px;
}
.language-options .language-flag { width: 22px; height: 15px; }
.language-options a:hover { border-color: rgba(240, 185, 119, .6); background: rgba(132, 79, 39, .52); }
@media (max-width: 540px) {
    .language-switch > summary { width: 40px; height: 36px; }
    .language-options { grid-template-columns: repeat(2, 38px); }
    .language-options a { width: 38px; min-width: 38px; }
}
@media (prefers-reduced-motion: reduce) {
    .language-switch > summary::after { transition: none; }
}
