/*
 * Legacy Theme — recreates the visual identity of the old M2Legend site
 * (D:/M2DEV_2026/WebSite_MercadoPago/repositorio) on top of the current
 * Bootstrap 4 / Neumorphism base. Loaded AFTER neumorphism.css + style.css
 * so it wins the cascade. Scoped to body.legacy-theme to avoid leaking
 * into the (untouched) admin panel skin.
 */

:root {
    --legacy-bg: #0a0806;
    --legacy-panel-bg: rgba(18, 14, 10, 0.92);
    --legacy-panel-bg-soft: rgba(28, 22, 16, 0.9);
    --legacy-border: #4a3720;
    --legacy-border-soft: #33281a;
    --legacy-parchment: #f5deb3;
    --legacy-gold: #ceb798;
    --legacy-red: #ff2b2b;
    --legacy-red-dark: #b40000;
    --legacy-green: #4caf50;
    --legacy-slate: #8fa6b8;
    --legacy-online: #2ecc40;
    --legacy-offline: #ff2b2b;
    --legacy-footer-text: #d8d8d8;
    --legacy-empire-shinsoo: #c15656;
    --legacy-empire-chunjo: #c1b656;
    --legacy-empire-jinno: #5678c1;
    --legacy-row-a: rgba(255, 255, 255, 0.035);
    --legacy-row-b: rgba(0, 0, 0, 0.25);
}

html {
    background: var(--legacy-bg);
    min-height: 100%;
}

body.legacy-theme {
    /* Sitewide background art (avelon's background01.png — a plain moody portrait,
       not a raster sprite with content baked into it like the old M2Legend bg.jpg
       was, so it's safe to stretch full-bleed behind every page without covering
       or clashing with foreground panels). Solid --legacy-bg is the fallback/
       letterbox color above/below the image on very tall or very wide pages. */
    background: var(--legacy-bg) url('/images/avelon/background01.png') no-repeat top center;
    background-size: cover;
    background-attachment: fixed;
    min-height: 100vh;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    color: var(--legacy-parchment);
}

body.legacy-theme a {
    color: var(--legacy-gold);
}

body.legacy-theme a:hover {
    color: var(--legacy-parchment);
}

/* ---------- Headings / title-bar convention ---------- *
 * Old site formula: <h2 class="legacy-title"><span>WORD1</span><b>WORD2</b></h2>
 * first word = parchment/gold, second word = red.
 */
body.legacy-theme .legacy-title {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 1.05rem;
    letter-spacing: .5px;
    color: var(--legacy-gold);
    text-shadow: 0 1px 2px #000;
    margin: 0;
}

body.legacy-theme .legacy-title b,
body.legacy-theme .legacy-title strong {
    color: var(--legacy-red);
    font-weight: bold;
}

/* ---------- Navbar ---------- */
body.legacy-theme .header-global {
    background: linear-gradient(#1a120b, #0a0806);
    border-bottom: 2px solid var(--legacy-border);
}

/* Center the nav links + login/account badge together as one group on desktop
   (Bootstrap's default flex justify-content:space-between just pins the nav to
   the left edge and the badge to the right, leaving a big empty gap). Mobile
   keeps the default collapse/toggler behavior untouched. */
@media (min-width: 992px) {
    body.legacy-theme #navbar-main .container {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* neumorphism's base .navbar-collapse has flex-grow:1, which fills the
       whole row regardless of the parent's justify-content — nothing left to
       actually center against otherwise. */
    body.legacy-theme #navbar-main .container > .navbar-collapse {
        flex-grow: 0;
    }

    body.legacy-theme #navbar-main .container > .d-none.d-lg-block {
        margin-left: 2rem !important;
    }
}

/* Big centered logo row, separate from the header/nav (2-row layout, like the
   reference project's main theme) instead of a small logo pinned to the
   navbar's left edge. */
body.legacy-theme .legacy-logo-bar {
    padding: calc(1.25rem + 30px) 1rem calc(.75rem + 30px);
}

body.legacy-theme .legacy-logo-big {
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, .6));
}

@media (max-width: 767.98px) {
    body.legacy-theme .legacy-logo-big {
        height: 60px;
    }
}

body.legacy-theme .navbar-main {
    background: transparent !important;
    /* neumorphism's .navbar-main is position:absolute/top:0 for a transparent
       hero-overlay nav pattern — this theme instead has a real logo row above
       the nav that needs to push it down in normal flow, not sit under it. */
    position: relative;
    top: auto;
}

body.legacy-theme .navbar-brand img {
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, .6));
}

body.legacy-theme .navbar-nav .nav-link {
    color: #fff !important;
    text-transform: uppercase;
    font-size: .8rem;
    font-weight: 700;
    text-shadow: 0 1px 0 #2e0200, 0 0 4px #2e0200;
    transition: opacity .2s ease;
}

body.legacy-theme .navbar-nav .nav-link:hover {
    opacity: .65;
    color: var(--legacy-gold) !important;
}

/* Removing the `headroom` class (see .navbar-main below) newly activates
   neumorphism's ":not(.headroom)" mobile-collapsed nav-item rule, which paints
   each item as a light neumorphism "soft-UI" card (#e6e7ee + white-glow inset
   shadow) — the same pattern fixed elsewhere in this file, just gated behind a
   selector that used to never match. */
@media (max-width: 991.98px) {
    body.legacy-theme .navbar-nav .nav-link,
    body.legacy-theme .navbar-nav .nav-link:focus,
    body.legacy-theme .navbar-nav .nav-link.active,
    body.legacy-theme .navbar-nav .nav-link:hover,
    body.legacy-theme .navbar-nav .show > .nav-link,
    body.legacy-theme .navbar-nav .dropdown-item,
    body.legacy-theme .navbar-nav .list-group-item {
        background: transparent !important;
        box-shadow: none !important;
    }
}

body.legacy-theme .dropdown-menu {
    background: var(--legacy-panel-bg);
    border: 1px solid var(--legacy-border);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .5) !important;
}

body.legacy-theme .dropdown-item {
    color: var(--legacy-parchment);
}

body.legacy-theme .dropdown-item:hover {
    background: var(--legacy-border-soft);
    color: #fff;
}

body.legacy-theme .navbar-collapse-header,
body.legacy-theme #navbar_global.collapse.show,
body.legacy-theme #navbar_global.collapsing {
    background: var(--legacy-panel-bg);
}

/* Neumorphism's .shadow-soft/.border-light are light-theme decorations (a bright
   white glow + light-gray border, both !important) left over on buttons/badges
   throughout the templates. Override them site-wide instead of stripping the
   classes from every template. */
body.legacy-theme .shadow-soft {
    box-shadow: 0 2px 8px rgba(0, 0, 0, .5) !important;
}

body.legacy-theme .border-light {
    border-color: var(--legacy-border) !important;
}

/* Same story for the neumorphism ":focus"/":active" states — they carry a hard-coded
   white inset glow (inset ... #FFFFFF) meant for the light soft-UI look. */
body.legacy-theme .btn:focus,
body.legacy-theme .btn.focus,
body.legacy-theme .btn:active,
body.legacy-theme .btn:active:focus,
body.legacy-theme .btn:not(:disabled):not(.disabled):active:focus,
body.legacy-theme .btn:not(:disabled):not(.disabled).active:focus {
    outline: none !important;
    box-shadow: 0 0 0 .15rem rgba(206, 183, 152, .35) !important;
}

/* ---------- Buttons ---------- */
/* Neumorphism's base ".btn" rule (no !important) applies a two-tone white/gray
   "soft-UI" box-shadow to literally every button regardless of variant — override
   it once here so no button anywhere needs its own box-shadow reset. */
body.legacy-theme .btn {
    box-shadow: 0 2px 4px rgba(0, 0, 0, .45) !important;
}

body.legacy-theme .btn-primary,
body.legacy-theme .hero-btn-secondary {
    background: linear-gradient(#3a2c1a, #1c140b);
    border: 1px solid var(--legacy-border);
    color: var(--legacy-parchment);
    text-shadow: 0 1px 0 #000;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

/* Same neumorphism white-glow pattern on Bootstrap badges (e.g. the "Recomendado"
   tag on downloads.html) — base rule has no !important either. */
body.legacy-theme .badge {
    box-shadow: none !important;
}

body.legacy-theme .badge-success {
    background-color: rgba(76, 175, 80, .2) !important;
    color: var(--legacy-green) !important;
    border: 1px solid var(--legacy-green);
}

body.legacy-theme .btn-primary:hover,
body.legacy-theme .btn-primary:focus {
    background: linear-gradient(#4a3722, #241a0e);
    color: #fff;
    border-color: var(--legacy-gold);
}

body.legacy-theme .btn-secondary {
    background: var(--legacy-red-dark);
    border: 1px solid #7a0000;
    color: #fff;
}

body.legacy-theme .btn-secondary:hover {
    background: var(--legacy-red);
}

body.legacy-theme .btn-success {
    background: #1f6b2b;
    border-color: #123c18;
}

/* Big carved "submit" button, faithful to the original sprite */
body.legacy-theme .btn-legacy-big {
    background: url('/images/legacy/btn-big.gif') no-repeat center;
    background-color: transparent;
    border: 0;
    width: 145px;
    height: 32px;
    color: #fff8e6;
    text-shadow: 0 1px 1px #000;
    font-weight: bold;
}

body.legacy-theme .btn-legacy-big:hover {
    filter: brightness(1.15);
    color: #fff;
}

/* ---------- Panels / "con-ui" boxes ----------
 * Reskins the Bootstrap .card used throughout the current templates so most
 * pages get the old dark/gold "content box" look without needing new markup.
 */
body.legacy-theme .card,
body.legacy-theme .card.bg-primary {
    background: var(--legacy-panel-bg) !important;
    border: 1px solid var(--legacy-border) !important;
    border-top: 3px solid var(--legacy-red-dark) !important;
    color: var(--legacy-parchment);
    border-radius: 4px;
}

body.legacy-theme .card .font-weight-bold {
    color: var(--legacy-gold);
}

body.legacy-theme .card hr {
    border-color: var(--legacy-border-soft);
}

body.legacy-theme .list-group-item {
    background: transparent;
    border-color: var(--legacy-border-soft);
    color: var(--legacy-parchment);
}

/* Reusable explicit panel class for new/relocated blocks (e.g. homepage banner) */
body.legacy-theme .legacy-panel {
    background: var(--legacy-panel-bg);
    border: 1px solid var(--legacy-border);
    border-top: 3px solid var(--legacy-red-dark);
    border-radius: 4px;
    padding: 1.25rem 1.5rem;
}

body.legacy-theme .legacy-panel + .legacy-panel {
    margin-top: 1rem;
}

/* ---------- Quote / disclaimer banner ---------- */
body.legacy-theme .legacy-quote {
    background: url('/images/legacy/quote-banner.png') no-repeat center;
    background-size: cover;
    background-color: rgba(0, 0, 0, .3);
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem 2.5rem;
    color: var(--legacy-red);
    font-weight: bold;
    font-size: 1.15rem;
    border-radius: 4px;
}

/* ---------- Forms ---------- */
body.legacy-theme label {
    color: var(--legacy-gold);
    font-weight: 600;
    font-size: .85rem;
}

body.legacy-theme .form-control {
    background: #14100a;
    border: 1px solid var(--legacy-border);
    color: var(--legacy-parchment);
    /* base neumorphism .form-control has its own white inset glow with no
       !important — it wins the cascade unless box-shadow is reset here too */
    box-shadow: none !important;
}

body.legacy-theme .form-control:focus {
    background: #1c160d;
    border-color: var(--legacy-gold);
    color: #fff;
    box-shadow: 0 0 0 .15rem rgba(206, 183, 152, .25);
}

body.legacy-theme .form-control::placeholder {
    color: #7a6a52;
}

/* Same neumorphism white-glow pattern on Bootstrap nav-pills (tab switchers,
   e.g. forgot.html) — base rule has no !important either. */
body.legacy-theme .nav-pills .nav-link,
body.legacy-theme .nav-pills .nav-link.active,
body.legacy-theme .nav-pills .show > .nav-link {
    box-shadow: none !important;
}

/* ...and again on the .input-group wrapper itself (icon + input combo), not
   just the .form-control inside it. */
body.legacy-theme .input-group {
    box-shadow: none !important;
}

body.legacy-theme .input-group-text {
    background: #1c1712;
    border-color: var(--legacy-border);
    color: var(--legacy-parchment);
    box-shadow: none !important;
}

/* ---------- Alerts ---------- */
body.legacy-theme .alert-primary {
    background: var(--legacy-panel-bg-soft);
    border: 1px solid var(--legacy-border);
    color: var(--legacy-parchment);
}

/* ---------- Status (online/offline) ---------- */
body.legacy-theme .legacy-online {
    color: var(--legacy-online);
    font-weight: bold;
}

body.legacy-theme .legacy-offline {
    color: var(--legacy-offline);
    font-weight: bold;
}

/* ---------- Ranking tables ---------- */
body.legacy-theme .legacy-ranking-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(10, 8, 6, .6);
}

body.legacy-theme .legacy-ranking-table thead th {
    background: #000;
    color: var(--legacy-red);
    text-transform: uppercase;
    font-size: .75rem;
    text-align: center;
    padding: .6rem .4rem;
    border-bottom: 2px solid var(--legacy-border);
}

body.legacy-theme .legacy-ranking-table tbody td {
    text-align: center;
    color: #fff;
    font-size: .85rem;
    padding: .5rem .4rem;
    border-bottom: 1px solid var(--legacy-border-soft);
}

body.legacy-theme .legacy-ranking-table tbody tr:nth-child(odd) {
    background: var(--legacy-row-a);
}

body.legacy-theme .legacy-ranking-table tbody tr:nth-child(even) {
    background: var(--legacy-row-b);
}

body.legacy-theme .legacy-ranking-table tbody tr:hover {
    background: rgba(255, 43, 43, .12);
}

body.legacy-theme .legacy-rank-icon,
body.legacy-theme .legacy-class-icon,
body.legacy-theme .legacy-empire-icon {
    height: 24px;
    vertical-align: middle;
}

/* Post content (article.html) comes straight from the CMS rich-text editor and
   can contain bare <table> markup with no classes at all — style plain tables
   inside articles the same way .legacy-ranking-table looks, so they don't just
   render as unstyled floating text. */
body.legacy-theme article table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(10, 8, 6, .6);
    margin-bottom: 1rem;
}

body.legacy-theme article table td,
body.legacy-theme article table th {
    padding: .5rem .75rem;
    border: 1px solid var(--legacy-border-soft);
    color: var(--legacy-parchment);
    vertical-align: middle;
}

body.legacy-theme article table th {
    background: #000;
    color: var(--legacy-red);
    text-transform: uppercase;
    font-size: .8rem;
}

body.legacy-theme article table tr:nth-child(odd) {
    background: var(--legacy-row-a);
}

body.legacy-theme article table tr:nth-child(even) {
    background: var(--legacy-row-b);
}

body.legacy-theme article table p {
    margin-bottom: 0;
}

/* Ranking-type switcher (old site: a <select> acting as a tab bar) */
body.legacy-theme .legacy-ranking-switcher {
    max-width: 260px;
    margin: 0 auto 1rem;
}

/* ---------- Stat rows (character / guild profile) ---------- */
body.legacy-theme .legacy-stat-row {
    display: flex;
    justify-content: space-between;
    padding: .5rem 0;
    border-bottom: 1px solid var(--legacy-border-soft);
    font-size: .95rem;
}

body.legacy-theme .legacy-stat-row .label {
    color: var(--legacy-gold);
    font-weight: 600;
}

body.legacy-theme .legacy-stat-row .value {
    font-weight: bold;
}

body.legacy-theme .legacy-value-green { color: #4caf50; }
body.legacy-theme .legacy-value-gold { color: var(--legacy-gold); }
body.legacy-theme .legacy-value-gray { color: #c7c7c7; }
body.legacy-theme .legacy-value-red { color: var(--legacy-red); }

/* Empire faction accent colors */
body.legacy-theme .legacy-empire-1 { color: var(--legacy-empire-shinsoo); }
body.legacy-theme .legacy-empire-2 { color: var(--legacy-empire-chunjo); }
body.legacy-theme .legacy-empire-3 { color: var(--legacy-empire-jinno); }

/* ---------- Pricing cards (cash shop) ---------- */
body.legacy-theme .legacy-pricing-card {
    background: linear-gradient(135deg, #2a2114, #14100a);
    border: 1px solid var(--legacy-border);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 0 1px rgba(255, 255, 255, .05) inset;
    text-align: center;
    padding: 1rem;
}

/* ---------- Footer ---------- */
body.legacy-theme .footer {
    background: #0a0806 url('/images/legacy/footer-bg.png') repeat-x top center;
    border-top: 2px solid var(--legacy-border);
    color: var(--legacy-footer-text);
}

body.legacy-theme .footer a {
    color: var(--legacy-gold);
}

body.legacy-theme .footer .card {
    background: transparent !important;
    border: 0 !important;
}

/* ---------- Homepage hero / banner (moved out of the global chrome) ---------- */
body.legacy-theme .legacy-hero {
    background: var(--legacy-panel-bg);
    border: 1px solid var(--legacy-border);
    border-top: 3px solid var(--legacy-red-dark);
    border-radius: 4px;
    padding: 2rem;
}

body.legacy-theme .legacy-hero h1 {
    color: var(--legacy-gold);
    text-shadow: 0 1px 2px #000;
    font-size: 1.75rem;
}

/* ---------- Downloads: main download button (2-frame sprite) ----------
 * btn-download-main.gif is a 300x140 canvas with two 300x70 states stacked
 * vertically (normal on top, hover on bottom) — show only one at a time via
 * background-size:100% 200% + background-position swap, not "contain"
 * (which would squeeze both frames into view at once).
 */
body.legacy-theme .legacy-download-btn-main {
    display: block;
    width: 100%;
    max-width: 300px;
    aspect-ratio: 300 / 70;
    background-image: url('/images/legacy/downloads/btn-download-main.gif');
    background-repeat: no-repeat;
    background-size: 100% 200%;
    background-position: top;
}

body.legacy-theme .legacy-download-btn-main:hover {
    background-position: bottom;
}

/* ---------- Homepage: event slider (tiny-slider) ---------- */
body.legacy-theme .legacy-slider-frame {
    border: 1px solid var(--legacy-border);
    border-top: 3px solid var(--legacy-red-dark);
    border-radius: 4px;
    overflow: hidden;
    background: var(--legacy-panel-bg);
    padding: .5rem;
}

body.legacy-theme .legacy-event-slider img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 2px;
}

body.legacy-theme .legacy-slider-frame .tns-outer {
    position: relative;
}

body.legacy-theme .legacy-slider-frame .tns-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 .5rem;
    pointer-events: none;
    z-index: 2;
}

body.legacy-theme .legacy-slider-frame .tns-controls button {
    pointer-events: auto;
    background: rgba(10, 8, 6, .75);
    border: 1px solid var(--legacy-border);
    color: var(--legacy-gold);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: .85rem;
}

body.legacy-theme .legacy-slider-frame .tns-controls button:hover {
    background: var(--legacy-red-dark);
    color: #fff;
}

body.legacy-theme .legacy-slider-frame .tns-nav {
    display: flex;
    justify-content: center;
    gap: .4rem;
    padding: .6rem 0 .2rem;
}

body.legacy-theme .legacy-slider-frame .tns-nav button {
    background: var(--legacy-border-soft);
    border: 1px solid var(--legacy-border);
    width: 9px;
    height: 9px;
    border-radius: 50%;
    padding: 0;
}

body.legacy-theme .legacy-slider-frame .tns-nav button.tns-nav-active {
    background: var(--legacy-red);
    border-color: var(--legacy-red-dark);
}

/* ---------- Homepage: screenshot gallery ---------- */
body.legacy-theme .legacy-gallery-thumb {
    width: 140px;
    height: 90px;
    object-fit: cover;
    border: 1px solid var(--legacy-border);
    border-radius: 3px;
    transition: transform .15s ease, border-color .15s ease;
}

body.legacy-theme .legacy-gallery-thumb:hover {
    transform: scale(1.04);
    border-color: var(--legacy-gold);
}

/* ================= Homepage v2 (avelon-inspired layout) ================= */

/* -- shared side/panel box -- */
body.legacy-theme .hp-side-box,
body.legacy-theme .hp-news,
body.legacy-theme .hp-classes {
    background: var(--legacy-panel-bg);
    border: 1px solid var(--legacy-border);
    border-top: 3px solid var(--legacy-red-dark);
    border-radius: 4px;
    padding: 1.1rem;
}

body.legacy-theme .hp-side-header,
body.legacy-theme .hp-classes-header {
    text-transform: uppercase;
    font-weight: bold;
    font-size: .95rem;
    color: var(--legacy-gold);
    text-shadow: 0 1px 2px #000;
    margin-bottom: .85rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--legacy-border-soft);
}

/* -- news tabs -- */
body.legacy-theme .hp-news-header {
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--legacy-border-soft);
}

body.legacy-theme .hp-news-tab {
    cursor: pointer;
    text-transform: uppercase;
    font-size: .75rem;
    font-weight: 600;
    color: var(--legacy-slate);
    letter-spacing: .5px;
}

body.legacy-theme .hp-news-tab:hover {
    color: var(--legacy-gold);
}

body.legacy-theme .hp-news-tab.active {
    color: var(--legacy-red);
}

body.legacy-theme .hp-news-sep {
    color: var(--legacy-border);
    margin: 0 .5rem;
}

body.legacy-theme .hp-news-tag-img {
    height: 16px;
    width: auto;
    margin-right: .5rem;
    flex-shrink: 0;
}

body.legacy-theme .hp-news-item + .hp-news-item {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--legacy-border-soft);
}

/* -- classes showcase -- */
body.legacy-theme .hp-classes-menu {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}

body.legacy-theme .hp-class-tab {
    cursor: pointer;
    padding: .35rem 1rem;
    border: 1px solid var(--legacy-border);
    border-radius: 3px;
    font-size: .8rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--legacy-parchment);
    background: var(--legacy-panel-bg-soft);
}

body.legacy-theme .hp-class-tab:hover {
    border-color: var(--legacy-gold);
}

body.legacy-theme .hp-class-tab.active {
    background: var(--legacy-red-dark);
    border-color: var(--legacy-red-dark);
    color: #fff;
}

body.legacy-theme .hp-classes-body {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    flex-wrap: wrap;
}

body.legacy-theme .hp-class-render {
    flex: 0 0 auto;
    width: 220px;
    text-align: center;
}

body.legacy-theme .hp-class-render img {
    max-width: 100%;
    max-height: 260px;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .6));
}

body.legacy-theme .hp-class-desc {
    flex: 1;
    min-width: 220px;
    font-size: .9rem;
    line-height: 1.6;
}

body.legacy-theme .hp-class-desc b {
    color: var(--legacy-gold);
    text-transform: uppercase;
    font-size: 1rem;
}

/* -- login box -- */
body.legacy-theme .hp-input-icon {
    position: relative;
    margin-bottom: .75rem;
}

body.legacy-theme .hp-input-icon img {
    position: absolute;
    left: .6rem;
    top: 50%;
    transform: translateY(-50%);
    height: 16px;
    opacity: .8;
}

body.legacy-theme .hp-input-icon input {
    width: 100%;
    padding: .5rem .75rem .5rem 2.3rem;
    background: #14100a;
    border: 1px solid var(--legacy-border);
    color: var(--legacy-parchment);
    border-radius: 3px;
}

body.legacy-theme .hp-input-icon input:focus {
    outline: none;
    border-color: var(--legacy-gold);
}

body.legacy-theme .hp-quick-social {
    display: flex;
    justify-content: center;
    gap: .6rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--legacy-border-soft);
}

body.legacy-theme .hp-quick-social a {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--legacy-panel-bg-soft);
    border: 1px solid var(--legacy-border);
    color: var(--legacy-gold);
}

body.legacy-theme .hp-quick-social a:hover {
    background: var(--legacy-red-dark);
    color: #fff;
}

/* -- banner button (download / cash) -- */
body.legacy-theme .hp-banner-btn {
    display: block;
    width: 100%;
    height: 90px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    border-radius: 4px;
    border: 1px solid var(--legacy-border);
    transition: filter .15s ease;
}

body.legacy-theme .hp-banner-btn:hover {
    filter: brightness(1.1);
}

/* -- ranking list -- */
body.legacy-theme .hp-rank-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

body.legacy-theme .hp-rank-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem 0;
    border-bottom: 1px solid var(--legacy-border-soft);
    font-size: .9rem;
}

body.legacy-theme .hp-rank-list .label {
    color: var(--legacy-gold);
    font-weight: 600;
}

body.legacy-theme .hp-rank-list .value a {
    color: var(--legacy-parchment);
    font-weight: 600;
}

@media (max-width: 767.98px) {
    body.legacy-theme .hp-classes-body {
        flex-direction: column;
        text-align: center;
    }
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 767.98px) {
    body.legacy-theme .legacy-ranking-table thead th,
    body.legacy-theme .legacy-ranking-table tbody td {
        font-size: .7rem;
        padding: .4rem .25rem;
    }

    body.legacy-theme .legacy-stat-row {
        flex-direction: column;
    }
}

/* ---------- SweetAlert2 (v11, CDN) modals ---------- *
 * Same neumorphism-style white-glow bug as everywhere else in this file, just
 * coming from SweetAlert2's own runtime-injected <style> tag instead of
 * Bootstrap/neumorphism — the default popup is a bright white card with a soft
 * box-shadow, which reads as an ugly glowing box floating over this dark theme.
 * Everything below needs !important to win against that injected stylesheet.
 */
body.legacy-theme .swal2-popup {
    background: var(--legacy-panel-bg) !important;
    border: 1px solid var(--legacy-border) !important;
    border-top: 3px solid var(--legacy-red-dark) !important;
    border-radius: 4px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .6) !important;
}

body.legacy-theme .swal2-title {
    color: var(--legacy-parchment) !important;
}

body.legacy-theme .swal2-html-container {
    color: var(--legacy-gold) !important;
}

/* Some Swal HTML content embeds Bootstrap-styled <input class="form-control">
   instead of Swal's own input (e.g. the password/email prompts), so both need
   the same dark reskin as the rest of the site's .form-control. */
body.legacy-theme .swal2-input,
body.legacy-theme .swal2-popup .form-control {
    background: #14100a !important;
    border: 1px solid var(--legacy-border) !important;
    color: var(--legacy-parchment) !important;
    box-shadow: none !important;
}

body.legacy-theme .swal2-input:focus,
body.legacy-theme .swal2-popup .form-control:focus {
    border-color: var(--legacy-gold) !important;
    box-shadow: none !important;
}

body.legacy-theme .swal2-validation-message {
    background: rgba(255, 43, 43, .12) !important;
    color: var(--legacy-red) !important;
}

body.legacy-theme .swal2-styled,
body.legacy-theme .swal2-actions {
    box-shadow: none !important;
}

body.legacy-theme .swal2-styled.swal2-cancel {
    background: var(--legacy-border-soft) !important;
    color: var(--legacy-parchment) !important;
}

/* custom-js.html passes confirmButtonColor: 'darkred' via JS, but SweetAlert2 v11
   only sets that as a --swal2-confirm-button-background-color custom property,
   which its own stylesheet doesn't reliably consume — the button renders its
   default blue regardless. Force it here so every confirm button matches the
   site's red accent instead of a stray blue one. */
body.legacy-theme .swal2-styled.swal2-confirm {
    background: var(--legacy-red-dark) !important;
    color: var(--legacy-parchment) !important;
}

body.legacy-theme .swal2-close {
    color: var(--legacy-gold) !important;
}

/* Success icon: swap SweetAlert2's default green for the site's, and the
   circular masks (used to hide the ring overflow at the 0/90deg marks) for the
   panel bg instead of their hard-coded white — otherwise they show up as white
   patches against the now-dark popup. */
body.legacy-theme .swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(76, 175, 80, .3) !important;
}

body.legacy-theme .swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: var(--legacy-green) !important;
}

body.legacy-theme .swal2-icon.swal2-success [class^='swal2-success-circular-line'] {
    background-color: var(--legacy-panel-bg) !important;
}

/* Error icon X-mark */
body.legacy-theme .swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
    background-color: var(--legacy-red) !important;
}

/* Same white-glow neumorphism shadow, this time on the player-profile avatar
   (style.css .player-icon-neu: box-shadow: 6px 6px 11px #d9d9d9, -6px -6px 11px #fff). */
body.legacy-theme .player-icon-neu {
    box-shadow: 0 0 0 3px var(--legacy-border), 0 4px 14px rgba(0, 0, 0, .6) !important;
}

/* ================= Invite Friends (referral program) ================= */
body.legacy-theme .referral-tier-card {
    background: var(--legacy-panel-bg-soft);
    border: 1px solid var(--legacy-border);
    border-top: 3px solid var(--legacy-red-dark);
    border-radius: 4px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

body.legacy-theme .referral-tier-card__header {
    padding: .6rem .9rem;
    border-bottom: 1px solid var(--legacy-border-soft);
    font-weight: 600;
    color: var(--legacy-gold);
    font-size: .85rem;
    text-transform: uppercase;
}

body.legacy-theme .referral-tier-card__body {
    padding: .9rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

body.legacy-theme .referral-tier-card__reward {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--legacy-gold);
    margin: .4rem 0 .8rem;
}

body.legacy-theme .referral-tier-card__progress {
    margin-top: auto;
    margin-bottom: .8rem;
}

body.legacy-theme .referral-tier-card .progress {
    background: var(--legacy-bg);
    border: 1px solid var(--legacy-border-soft);
    border-radius: 3px;
    /* Neumorphism's base ".progress" (no !important) paints a light "soft-UI"
       inset glow that otherwise cascades straight through and floods this
       6px-tall bar white — same fix pattern as .btn/.badge/.form-control above. */
    box-shadow: none !important;
}

body.legacy-theme .referral-tier-card .progress-bar {
    background-color: var(--legacy-red-dark);
    box-shadow: none !important;
}

body.legacy-theme .referral-tier-card__btn {
    border: none;
    border-radius: 3px;
    padding: .5rem;
    font-weight: 600;
    font-size: .8rem;
    transition: all .2s ease;
}

body.legacy-theme .referral-tier-card__btn:focus {
    outline: none;
    box-shadow: 0 0 0 .15rem rgba(206, 183, 152, .35);
}

body.legacy-theme .referral-tier-card__btn--claimable {
    background: var(--legacy-red-dark);
    color: #fff;
}

body.legacy-theme .referral-tier-card__btn--claimable:hover {
    background: var(--legacy-red);
    color: #fff;
}

body.legacy-theme .referral-tier-card__btn--claimed {
    background: rgba(76, 175, 80, .15);
    color: var(--legacy-green);
    border: 1px solid var(--legacy-green);
}

body.legacy-theme .referral-tier-card__btn--locked {
    background: var(--legacy-border-soft);
    color: var(--legacy-slate);
}

/* ================= Wiki ================= */
body.legacy-theme .wiki-banner {
    width: 100%;
    border: 1px solid var(--legacy-border);
    border-radius: 4px;
    display: block;
    margin-bottom: 1rem;
}

body.legacy-theme .wiki-content-sticky {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--legacy-bg);
    padding-top: 1rem;
    padding-bottom: 1rem;
    margin-top: -1rem;
}

/* -- Sidebar em árvore (reproduz o menu de categorias do Wiki in-game) -- */
body.legacy-theme .wiki-sidebar {
    background: var(--legacy-panel-bg);
    border: 1px solid var(--legacy-border);
    border-top: 3px solid var(--legacy-red-dark);
    border-radius: 4px;
    padding: 1.1rem;
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: 100vh;
    overflow-y: auto;
}

body.legacy-theme .wiki-search {
    position: relative;
    margin-bottom: 1rem;
}

body.legacy-theme .wiki-search input {
    width: 100%;
    background: rgba(0, 0, 0, .35);
    border: 1px solid var(--legacy-border);
    border-radius: 6px;
    padding: .5rem 1rem .5rem 2.2rem;
    color: var(--legacy-parchment);
    font-size: .85rem;
}

body.legacy-theme .wiki-search input::placeholder {
    color: var(--legacy-slate);
}

body.legacy-theme .wiki-search input:focus {
    outline: none;
    border-color: var(--legacy-gold);
}

body.legacy-theme .wiki-search .fa-search {
    position: absolute;
    left: .9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--legacy-slate);
    font-size: .8rem;
    pointer-events: none;
}

body.legacy-theme .wiki-tree-label {
    text-transform: uppercase;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .8px;
    color: var(--legacy-slate);
    margin: 0 0 .5rem .1rem;
}

body.legacy-theme .wiki-tree-group {
    margin-bottom: .25rem;
}

body.legacy-theme .wiki-tree-group summary {
    cursor: pointer;
    list-style: none;
    padding: .5rem .65rem;
    border-radius: 3px;
    background: rgba(0, 0, 0, .25);
    color: var(--legacy-gold);
    font-weight: 600;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body.legacy-theme .wiki-tree-group summary::-webkit-details-marker {
    display: none;
}

body.legacy-theme .wiki-tree-group summary::after {
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: .7rem;
    color: var(--legacy-slate);
    transition: transform .15s ease;
}

body.legacy-theme .wiki-tree-group[open] summary::after {
    transform: rotate(180deg);
}

body.legacy-theme .wiki-tree-group.has-active summary {
    background: rgba(255, 43, 43, .12);
    color: #fff;
}

body.legacy-theme .wiki-tree-children {
    display: flex;
    flex-direction: column;
    padding-left: .4rem;
    margin-top: .15rem;
}

body.legacy-theme .wiki-tree-link {
    display: block;
    padding: .4rem .65rem;
    margin-bottom: .1rem;
    border-radius: 3px;
    border-left: 2px solid transparent;
    color: var(--legacy-slate);
    font-size: .76rem;
    line-height: 1.3;
}

body.legacy-theme .wiki-tree-link:hover {
    color: var(--legacy-gold);
    background: rgba(255, 255, 255, .04);
}

body.legacy-theme .wiki-tree-link.active {
    color: #fff;
    background: rgba(255, 43, 43, .16);
    border-left-color: var(--legacy-red);
    font-weight: 600;
}

body.legacy-theme .wiki-tree-link--top {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}

body.legacy-theme .wiki-nav-arrows {
    display: flex;
    gap: .5rem;
    margin-top: 1.1rem;
    padding-top: .85rem;
    border-top: 1px solid var(--legacy-border-soft);
}

body.legacy-theme .wiki-nav-arrow {
    background: rgba(0, 0, 0, .3);
    border: 1px solid var(--legacy-border);
    color: var(--legacy-slate);
    border-radius: 4px;
    width: 42px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.legacy-theme .wiki-nav-arrow:hover {
    color: var(--legacy-gold);
    border-color: var(--legacy-gold);
}

body.legacy-theme .wiki-card-thumb {
    width: 200px;
    height: 46px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    background-color: rgba(0, 0, 0, .3);
    border: 1px solid var(--legacy-border);
    border-radius: 4px;
}

body.legacy-theme .wiki-data-table {
    color: var(--legacy-parchment);
    margin-bottom: 0;
}

body.legacy-theme .wiki-data-table th {
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .4px;
    color: var(--legacy-slate);
    border-color: var(--legacy-border-soft);
    white-space: nowrap;
}

body.legacy-theme .wiki-data-table td {
    border-color: var(--legacy-border-soft);
    vertical-align: middle;
}

body.legacy-theme .wiki-data-table td a {
    color: var(--legacy-gold);
}

body.legacy-theme .wiki-data-table td a:hover {
    color: var(--legacy-parchment);
}

body.legacy-theme .wiki-refine-chain th,
body.legacy-theme .wiki-refine-chain td {
    white-space: nowrap;
    padding: .3rem .35rem;
    font-size: .72rem;
    text-align: center;
}

body.legacy-theme .wiki-refine-chain th:nth-child(2),
body.legacy-theme .wiki-refine-chain td:nth-child(2) {
    text-align: left;
}

body.legacy-theme .wiki-refine-chain .wiki-item-icon {
    width: 22px;
    height: 22px;
}

body.legacy-theme .wiki-refine-icon-col {
    width: 64px;
    vertical-align: middle !important;
    text-align: center;
}

body.legacy-theme .wiki-evolution-tree {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .85rem;
    padding-top: .75rem;
    border-top: 1px solid var(--legacy-border-soft);
}

body.legacy-theme .wiki-evolution-node {
    display: inline-flex;
    padding: 2px;
    border: 1px solid var(--legacy-border);
    border-radius: 4px;
    background: rgba(0, 0, 0, .3);
}

body.legacy-theme .wiki-evolution-node img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

body.legacy-theme .wiki-evolution-node:hover {
    border-color: var(--legacy-gold);
}

body.legacy-theme .wiki-evolution-node.active {
    border-color: var(--legacy-red);
    box-shadow: 0 0 0 2px rgba(255, 43, 43, .3);
}

body.legacy-theme .wiki-evolution-arrow {
    color: var(--legacy-slate);
}

html:has(body.legacy-theme) {
    scroll-behavior: smooth;
}

body.legacy-theme .wiki-item-icon-lg {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border: 1px solid var(--legacy-border);
    border-radius: 4px;
    background: rgba(0, 0, 0, .3);
}

body.legacy-theme .wiki-item-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border: 1px solid var(--legacy-border);
    border-radius: 3px;
    background: rgba(0, 0, 0, .3);
}

body.legacy-theme .wiki-class-filter {
    display: flex;
    gap: .5rem;
    align-items: stretch;
}

body.legacy-theme .wiki-class-btn {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    padding: .5rem;
    border: 1px solid var(--legacy-border);
    border-radius: 4px;
    background: var(--legacy-panel-bg-soft);
    color: var(--legacy-slate);
    font-size: .78rem;
}

body.legacy-theme .wiki-class-btn img {
    width: 100%;
    height: 64px;
    object-fit: cover;
    border-radius: 3px;
}

body.legacy-theme .wiki-class-btn:hover {
    border-color: var(--legacy-gold);
    color: var(--legacy-gold);
}

body.legacy-theme .wiki-class-btn.active {
    border-color: var(--legacy-red);
    background: rgba(255, 43, 43, .16);
    color: #fff;
}

body.legacy-theme .wiki-tag {
    text-transform: uppercase;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .5px;
    color: var(--legacy-slate);
    background: var(--legacy-panel-bg-soft);
    border: 1px solid var(--legacy-border);
    border-radius: 20px;
    padding: .2rem .7rem;
}

body.legacy-theme .wiki-item-clickable {
    cursor: pointer;
}

body.legacy-theme .wiki-item-clickable:hover {
    border-color: var(--legacy-gold);
}

body.legacy-theme .wiki-source-card {
    position: relative;
    margin-top: .85rem;
    padding: .75rem 2rem .75rem 1rem;
    background: var(--legacy-panel-bg-soft);
    border: 1px solid var(--legacy-border);
    border-radius: 4px;
}

body.legacy-theme .wiki-source-close {
    position: absolute;
    top: .35rem;
    right: .6rem;
    background: none;
    border: none;
    color: var(--legacy-slate);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

body.legacy-theme .wiki-source-close:hover {
    color: var(--legacy-gold);
}

body.legacy-theme .wiki-source-item {
    display: block;
    padding: .3rem 0;
    color: var(--legacy-parchment);
    border-top: 1px solid var(--legacy-border-soft);
}

body.legacy-theme .wiki-source-item:first-of-type {
    border-top: none;
}

body.legacy-theme .wiki-source-item:hover {
    color: var(--legacy-gold);
}

body.legacy-theme .wiki-hotkey-list {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

body.legacy-theme .wiki-hotkey-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--legacy-border-soft);
}

body.legacy-theme .wiki-hotkey-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

body.legacy-theme .wiki-key {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    flex-shrink: 0;
}

body.legacy-theme .wiki-key img {
    height: 26px;
    width: auto;
}

body.legacy-theme .wiki-key-plus {
    color: var(--legacy-slate);
    font-weight: bold;
}

body.legacy-theme .wiki-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

body.legacy-theme .wiki-gallery img {
    height: 90px;
    width: auto;
    border: 1px solid var(--legacy-border);
    border-radius: 4px;
}
