/* Stellar Mu compatibility layer for the native Template UI.
   Global visuals come from template-css/modern.css; this file only maps the
   existing PHP module markup into that component system. */

:root { --we-container: 1320px; }

body.we-body {
    background-color: #090b11;
    background-image:
        linear-gradient(rgba(9,11,17,.76), rgba(9,11,17,.9)),
        url('../images/template/background-2600.jpg');
    background-position: center top;
    background-size: cover;
    background-attachment: fixed;
}

body.we-body::before {
    background:
        radial-gradient(circle at 18% 8%, rgba(138,43,226,.15), transparent 30%),
        radial-gradient(circle at 80% 22%, rgba(192,132,252,.09), transparent 24%);
}

body.template-theme {
    --we-accent: #c084fc;
    --we-border: rgba(168,85,247,.16);
    --we-border-glow: rgba(168,85,247,.48);
    --we-bg-glass: rgba(17,15,27,.78);
    --we-text-muted: #c2b8d1;
    --we-text-dim: #978ba9;
}

.template-theme h1,
.template-theme h2,
.template-theme h3,
.template-theme p { margin-top: 0; }

.template-theme .we-navbar { z-index: 50; }
.template-theme .we-navbar-inner { gap: 22px; }
.template-theme .we-brand { flex: 0 0 auto; }
.template-theme .we-brand-logo { width: 47px; height: 47px; object-fit: contain; }
.top-brand-copy { display: grid; line-height: 1.05; }
.top-brand-copy strong { color: var(--we-text); font: 700 16px/1.1 var(--we-font-display); }
.top-brand-copy small { margin-top: 5px; color: var(--we-text-dim); font-size: 8px; letter-spacing: .18em; text-transform: uppercase; }
.template-theme .nav-shell { min-width: 0; }
.template-theme .we-nav-menu { display: flex; align-items: center; justify-content: center; gap: 3px; white-space: nowrap; }
.template-theme .we-nav-menu > a {
    position: relative; display: inline-flex; padding: 9px 10px; align-items: center;
    border: 1px solid transparent; border-radius: 999px; background: rgba(255,255,255,.015);
    color: var(--we-text-muted); font-size: 10px; font-weight: 750; letter-spacing: .055em; text-transform: uppercase;
}
.template-theme .we-nav-menu > a:hover { border-color: rgba(168,85,247,.24); background: rgba(138,43,226,.16); color: var(--we-text); }
.template-theme .we-nav-menu > a::after { position: absolute; bottom: 4px; left: 50%; width: 55%; height: 2px; border-radius: 2px; background: linear-gradient(90deg,var(--we-primary),var(--we-accent)); content: ''; transform: translateX(-50%) scaleX(0); transition: transform var(--we-transition); }
.template-theme .we-nav-menu > a:hover::after,
.template-theme .we-nav-menu > a.active::after { transform: translateX(-50%) scaleX(1); }
.template-theme .nav a.active { color: var(--we-text) !important; }
.top-online { display: inline-flex; align-items: center; gap: 7px; color: var(--we-text-muted); font-size: 11px; }
.top-online strong { color: var(--we-text); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--we-success); box-shadow: 0 0 9px rgba(34,197,94,.8); }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle-button { display: none; }

.template-theme .we-hero-bg {
    background-image: url('../images/template/hero-banner.jpg');
    background-position: center 28%;
    background-size: cover;
}
.template-theme .we-hero-magic { min-height: 570px; }
.template-theme .we-hero-layout { min-height: 570px; }
.template-theme.we-body-home .we-hero-magic { min-height: 0; }
.template-theme.we-body-home .we-hero-layout { min-height: 0; padding-bottom: 58px; }
.template-theme .we-hero-main { max-width: 680px; }
.template-theme .we-hero-title-line { font-size: clamp(52px, 7vw, 92px); }
.template-masthead-overlay { background: linear-gradient(90deg, rgba(8,9,14,.94) 0%, rgba(8,9,14,.48) 48%, rgba(8,9,14,.2) 72%, rgba(8,9,14,.65) 100%); }
.template-launch-card {
    display: grid;
    width: min(100%, 390px);
    margin-top: 24px;
    padding: 13px 16px;
    gap: 4px;
    border: 1px solid rgba(192,132,252,.34);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(28,15,47,.82), rgba(8,7,15,.72));
    box-shadow: 0 12px 28px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.06);
    backdrop-filter: blur(10px);
}
.template-launch-card span { color: #d8b4fe; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.template-launch-card strong { color: #fff7ff; font: 700 17px/1.25 var(--we-font-display); }
.template-launch-card small { color: #c2b8d1; font-size: 12px; font-weight: 700; }
.template-hud { position: absolute; right: 20px; bottom: 48px; display: flex; gap: 10px; }
.template-hud-card { min-width: 150px; padding: 14px 17px; border: 1px solid var(--we-border); border-radius: 12px; background: rgba(9,11,17,.7); backdrop-filter: blur(12px); }
.template-hud-card span,
.template-hud-card small { display: block; color: var(--we-text-dim); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.template-hud-card strong { display: block; margin: 3px 0; color: var(--we-text); font-size: 22px; }
.template-hud-card i { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--we-success); }

.template-pagebar-current { display: grid; margin-right: auto; }
.template-pagebar-current span { color: var(--we-text-dim); font-size: 9px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.template-pagebar-current strong { color: var(--we-text); font-size: 17px; }
.template-pagebar-status { display: flex; gap: 10px; }
.template-pagebar-status > div { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--we-border); border-radius: 999px; background: rgba(255,255,255,.025); }
.template-pagebar-status span { color: var(--we-text-dim); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.template-pagebar-status strong { color: var(--we-text); font-size: 11px; }
.template-pagebar-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--we-success); box-shadow: 0 0 8px rgba(34,197,94,.7); }

.template-theme .we-main { min-height: 400px; padding: 46px 0 72px; }
.template-theme .we-content { overflow: visible; }
.template-theme .page-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 24px; }
.template-theme .page-main { min-width: 0; }
.template-theme .we-sidebar { display: grid; align-content: start; gap: 16px; }

/* Existing modules become the Template's glass content modules. */
.template-theme .section {
    padding: 28px;
    border: 1px solid var(--we-border);
    border-radius: var(--we-radius-lg);
    background: var(--we-bg-glass);
    box-shadow: var(--we-shadow);
    backdrop-filter: blur(14px);
}
.template-theme .section-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.template-theme .section-header h1,
.template-theme .section-header h2 { margin: 0; color: var(--we-text); font: 700 clamp(22px,3vw,31px)/1.2 var(--we-font-display); }
.template-theme .section-header p,
.template-theme .section-subtitle { margin: 6px 0 0; color: var(--we-text-muted); }
.template-theme .eyebrow { color: var(--we-primary-light); font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }

.template-theme .panel,
.template-theme .detail-panel,
.template-theme .ranking-block,
.template-theme .warehouse-panel,
.template-theme .news-card,
.template-theme .guide-card,
.template-theme .download-client,
.template-theme .info-card {
    border: 1px solid var(--we-border);
    border-radius: var(--we-radius);
    background: rgba(18,22,31,.72);
}
.template-theme .detail-panel,
.template-theme .ranking-block,
.template-theme .warehouse-panel,
.template-theme .news-card,
.template-theme .guide-card,
.template-theme .download-client,
.template-theme .info-card { padding: 20px; }
.template-theme .detail-panel > h2,
.template-theme .panel > h2 { color: var(--we-text); font: 700 18px/1.3 var(--we-font-display); }

.template-theme .button,
.template-theme button:not(.nav-toggle-button),
.template-theme input[type=submit] {
    display: inline-flex;
    min-height: 42px;
    padding: 0 18px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    background: linear-gradient(135deg,var(--we-primary),var(--we-primary-dark));
    color: #fff;
    font: 700 12px/1 var(--we-font);
    cursor: pointer;
}
.template-theme .button.secondary,
.template-theme .button.ghost { border-color: var(--we-border); background: rgba(255,255,255,.035); color: var(--we-text); }
.template-theme .full { width: 100%; }

.template-theme label { color: var(--we-text-muted); font-size: 11px; font-weight: 600; }
.template-theme input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
.template-theme select,
.template-theme textarea {
    width: 100%; min-height: 44px; padding: 10px 13px;
    border: 1px solid var(--we-border); border-radius: 8px;
    outline: 0; background: rgba(7,9,14,.72); color: var(--we-text);
}
.template-theme input:focus,
.template-theme select:focus,
.template-theme textarea:focus { border-color: var(--we-border-glow); box-shadow: 0 0 0 3px rgba(138,43,226,.1); }
.template-theme textarea { min-height: 125px; }
.template-theme .field,
.template-theme .side-login-form,
.template-theme .side-actions,
.template-theme .form-grid,
.template-theme .info-list,
.template-theme .news-list,
.template-theme .download-client-list,
.template-theme .guide-accordion { display: grid; gap: 12px; }
.template-theme .field,
.template-theme .side-login-form label { display: grid; gap: 7px; }
.template-theme .form-grid.two-column,
.template-theme .detail-grid,
.template-theme .info-section-grid,
.template-theme .summary-grid,
.template-theme .feature-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.template-theme .download-actions,
.template-theme .ranking-tabs,
.template-theme .class-filter { display: flex; flex-wrap: wrap; gap: 9px; }

.template-theme .info-row,
.template-theme .character-login-box div { display: flex; min-height: 42px; padding: 9px 11px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--we-border); }
.template-theme .info-row:last-child { border-bottom: 0; }
.template-theme .info-row span { color: var(--we-text-muted); }
.template-theme .info-row strong { color: var(--we-text); }
.template-theme .character-guild-box { display: grid; gap: 8px; padding: 14px; }

.template-theme table { width: 100%; border-collapse: collapse; color: var(--we-text-muted); }
.template-theme th { padding: 12px 14px; border-bottom: 1px solid var(--we-border); color: var(--we-text-dim); font-size: 10px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.template-theme td { padding: 13px 14px; border-bottom: 1px solid rgba(255,255,255,.055); }
.template-theme tbody tr:hover { background: rgba(138,43,226,.06); }
.template-theme .ranking-tabs a,
.template-theme .class-filter a { padding: 8px 12px; border: 1px solid var(--we-border); border-radius: 8px; background: rgba(255,255,255,.025); }
.template-theme .ranking-tabs a.active { border-color: var(--we-border-glow); background: rgba(138,43,226,.14); color: var(--we-text); }

.template-theme .alerts { display: grid; gap: 10px; margin-bottom: 18px; }
.template-theme .alert { padding: 13px 15px; border: 1px solid rgba(239,68,68,.3); border-radius: 9px; background: rgba(239,68,68,.09); color: #fda4af; }
.template-theme .alert.success { border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.08); color: #86efac; }

/* Homepage follows Template/inc/home.php: news + login, then three widgets. */
.native-home-dashboard { display: grid; gap: 24px; }
.native-home-top { display: grid; grid-template-columns: minmax(0,2fr) minmax(280px,1fr); gap: 24px; align-items: start; }
.native-news-panel { margin: 0; padding: 25px; }
.native-panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.native-panel-heading h2 { margin: 2px 0 0; color: var(--we-text); font: 700 25px/1.2 var(--we-font-display); }
.native-kicker { color: var(--we-primary-light); font-size: 9px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.native-news-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.native-news-card { min-height: 205px; }
.native-news-card:first-child { grid-column: 1/-1; display: grid; grid-template-columns: minmax(220px,.9fr) 1fr; }
.native-news-card .we-news-card-thumb { min-height: 130px; }
.native-news-card:first-child .we-news-card-thumb { min-height: 235px; }
.native-news-card p { margin: 7px 0 0; color: var(--we-text-muted); font-size: 12px; }
.native-home-sidebar { display: grid; gap: 16px; }
.native-login-panel { margin: 0 !important; }
.native-login-panel .panel-title { display: flex; justify-content: space-between; }
.native-login-panel .panel-title a { font-size: 10px; }
.native-login-form { display: grid; gap: 12px; }
.native-login-form label { display: grid; gap: 6px; }
.native-login-form .we-btn { width: 100%; margin-top: 3px; }
.native-banner { display: block; overflow: hidden; border: 1px solid var(--we-border); border-radius: 12px; background: #0b0e14; box-shadow: var(--we-shadow); }
.native-banner img { display: block; width: 100%; aspect-ratio: 2.56/1; object-fit: cover; transition: transform var(--we-transition),filter var(--we-transition); }
.native-banner:hover img { transform: scale(1.025); filter: brightness(1.08); }
.native-home-widgets { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; margin: 0; }
.native-widget { min-width: 0; margin: 0 !important; }
.native-quick-list { display: grid; gap: 8px; }
.native-quick-list a { display: grid; grid-template-columns: 34px 1fr; gap: 0 10px; padding: 10px; border: 1px solid var(--we-border); border-radius: 8px; }
.native-quick-list a > span { grid-row: 1/3; align-self: center; color: var(--we-primary-light); font-weight: 800; }
.native-quick-list strong { color: var(--we-text); font-size: 12px; }
.native-quick-list small { color: var(--we-text-dim); font-size: 10px; }
.native-action-card { position: relative; min-height: 205px; display: flex; flex-direction: column; align-items: start; }
.native-action-number { color: var(--we-primary-light); font: 700 30px/1 var(--we-font-display); opacity: .65; }
.native-action-card h3 { margin: 12px 0 5px; color: var(--we-text); }
.native-action-card p { color: var(--we-text-muted); }
.native-action-card > div { display: flex; flex-wrap: wrap; gap: 9px; margin-top: auto; }

.side-panel { margin: 0 !important; }
.side-heading span { color: var(--we-primary-light); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.side-heading h2 { margin: 2px 0 14px; }
.template-sidebar-banner { display: block; overflow: hidden; border: 1px solid var(--we-border); border-radius: 12px; }
.template-sidebar-banner img { display: block; width: 100%; }

.site-footer { display: flex; min-height: 90px; padding: 25px 20px; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 28px; border-top: 1px solid var(--we-border); background: rgba(8,10,15,.86); color: var(--we-text-dim); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.site-footer a { color: var(--we-text-muted); }
.site-loading-indicator { position: fixed; right: 18px; bottom: 18px; display: none; padding: 9px 13px; border: 1px solid var(--we-border); border-radius: 999px; background: #11151e; color: var(--we-text); z-index: 100; }
.is-navigating .site-loading-indicator { display: flex; }

@media (max-width: 1080px) {
    .template-theme .we-navbar-actions .top-online { display: none; }
    .template-theme .we-nav-menu { gap: 1px; }
    .template-theme .we-nav-menu a { padding-inline: 8px; font-size: 11px; }
}

@media (max-width: 900px) {
    .template-hud { display: none; }
    .native-home-top,
    .template-theme .page-layout { grid-template-columns: 1fr; }
    .native-home-sidebar { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .native-home-sidebar .native-login-panel { grid-row: span 2; }
    .native-home-widgets { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .template-theme .we-navbar-inner { min-height: 66px; }
    .nav-toggle-button { display: grid; width: 40px; height: 36px; padding: 9px; gap: 4px; margin-left: auto; border: 1px solid var(--we-border); border-radius: 8px; }
    .nav-toggle-button span { display: block; height: 2px; background: var(--we-text); }
    .template-theme .nav-shell { display: none; position: absolute; top: 66px; left: 0; right: 0; padding: 12px 20px; background: rgba(9,11,17,.98); border-bottom: 1px solid var(--we-border); }
    .nav-toggle:checked ~ .nav-shell { display: block; }
    .template-theme .we-nav-menu { display: grid; grid-template-columns: repeat(2,1fr); }
    .template-theme .we-navbar-actions { display: none; }
    .template-theme .we-hero-magic,
    .template-theme .we-hero-layout { min-height: 500px; }
    .template-theme .we-hero-title-line { font-size: 48px; }
    .template-pagebar-status > div:first-child { display: none; }
    .native-home-sidebar,
    .native-news-grid,
    .template-theme .form-grid.two-column,
    .template-theme .detail-grid,
    .template-theme .info-section-grid,
    .template-theme .summary-grid,
    .template-theme .feature-grid { grid-template-columns: 1fr; }
    .native-news-card:first-child { grid-column: auto; grid-template-columns: 1fr; }
    .native-news-card:first-child .we-news-card-thumb { min-height: 170px; }
    .template-theme .section { padding: 20px; }
}

/* Account sidebar: separate the balance from navigation actions. */
.template-theme .account-panel .wcoin-card {
    display: grid;
    grid-template-columns: auto minmax(0,1fr);
    align-items: center;
    gap: 2px 12px;
    margin: 18px 0 22px;
    padding: 14px 16px;
    border: 1px solid rgba(183,116,255,.34);
    border-radius: 13px;
    background:
        radial-gradient(circle at 12% 18%, rgba(211,153,56,.18), transparent 34%),
        linear-gradient(135deg, rgba(118,48,184,.22), rgba(16,13,28,.82));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 10px 24px rgba(0,0,0,.16);
}
.template-theme .account-panel .wcoin-card::before {
    content: 'W';
    grid-row: 1 / span 2;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(246,215,107,.62);
    border-radius: 50%;
    background: linear-gradient(145deg, #f6d76b, #b97820);
    color: #38200b;
    font: 800 16px/1 var(--we-font-display);
    box-shadow: 0 0 18px rgba(246,215,107,.2);
}
.template-theme .account-panel .wcoin-label {
    color: var(--we-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.template-theme .account-panel .wcoin-value {
    color: #f6d76b;
    font: 800 24px/1.15 var(--we-font-display);
    letter-spacing: .01em;
}
.template-theme .account-panel .account-panel-actions {
    gap: 10px;
    margin-top: 2px;
}
.template-theme .account-panel .account-panel-actions .button {
    min-height: 43px;
}
.template-theme .account-panel .account-panel-actions > .button:first-child {
    min-height: 45px;
    box-shadow: 0 8px 18px rgba(126,47,219,.2);
}
.template-theme .account-panel .account-panel-actions form { display: grid; }

@media (max-width: 480px) {
    .template-theme .we-container { padding-inline: 14px; }
    .template-theme .we-hero-title-line { font-size: 39px; }
    .template-theme .we-hero-subtitle { font-size: 14px; }
    .template-pagebar-status { display: none; }
    .native-news-panel { padding: 17px; }
}

/* Complete module integration
   The native application modules keep their proven layout rules from
   assets/style.css. These overrides bring every route into the Template
   palette without changing the application markup or data logic. */
.template-theme .section-header {
    display: grid;
    justify-items: start;
    align-items: start;
    gap: 5px;
}
.template-theme .section-header > h1,
.template-theme .section-header > h2 { order: 2; }
.template-theme .section-header > .eyebrow { order: 1; }
.template-theme .section-header > p,
.template-theme .section-header > .section-subtitle { order: 3; }
.template-theme .section-header.compact { margin-bottom: 16px; }

.template-theme .ranking-block + .ranking-block { margin-top: 20px; }
.template-theme .ranking-table-wrap,
.template-theme .guide-table-wrap {
    overflow: auto;
    border: 1px solid var(--we-border);
    border-radius: 10px;
    background: rgba(6, 8, 13, .48);
}
.template-theme .ranking-table { min-width: 720px; }
.template-theme .ranking-table th {
    background: rgba(11, 14, 21, .96);
    color: var(--we-text-dim);
}
.template-theme .ranking-link { color: var(--we-text); font-weight: 750; }
.template-theme .rank-number { color: var(--we-primary-light); font-weight: 800; }
.template-theme .status-badge {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}
.template-theme .status-badge.online { background: rgba(34,197,94,.12); color: #86efac; }
.template-theme .status-badge.offline { background: rgba(148,163,184,.09); color: var(--we-text-muted); }

.theme-page-rankings .class-filter {
    display: grid;
    grid-template-columns: repeat(4, minmax(125px, 1fr));
    gap: 10px;
    margin: 0 0 20px;
}
.theme-page-rankings .class-filter a {
    min-height: 118px;
    padding: 12px 10px;
    border-color: var(--we-border);
    border-radius: 11px;
    background: rgba(255,255,255,.022);
}
.theme-page-rankings .class-filter a:hover,
.theme-page-rankings .class-filter a.active {
    border-color: var(--we-border-glow);
    background: linear-gradient(180deg, rgba(138,43,226,.16), rgba(18,22,31,.76));
    box-shadow: inset 0 -2px 0 var(--we-primary), var(--we-glow-sm);
}
.theme-page-rankings .class-filter img,
.theme-page-rankings .class-filter-all > span {
    width: 64px;
    height: 64px;
    border-color: rgba(168,85,247,.35);
    object-fit: cover;
}
.theme-page-rankings .ranking-search { margin: 0 0 18px; }
.theme-page-rankings .ranking-search > div { display: flex; gap: 8px; }
.theme-page-rankings .ranking-search input { min-width: 0; flex: 1; }
.template-theme .ranking-class-cell img,
.template-theme .ranking-search-list img { border-color: rgba(168,85,247,.35); }

.theme-page-info .info-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.theme-page-info .stat-card {
    border-color: var(--we-border);
    background: linear-gradient(145deg, rgba(168,85,247,.07), rgba(18,22,31,.76));
}
.theme-page-info .stat-icon {
    border-color: rgba(168,85,247,.28);
    background: rgba(138,43,226,.12);
    color: var(--we-primary-light);
}
.theme-page-info .info-section-grid { align-items: start; }
.theme-page-info .info-table-card {
    overflow: hidden;
    border: 1px solid var(--we-border);
    border-radius: var(--we-radius);
    background: rgba(18,22,31,.72);
}

.theme-page-guides .guide-wiki-toolbar,
.theme-page-guides .guide-wiki-intro,
.theme-page-guides .guide-wiki-sidebar,
.theme-page-guides .guide-summary,
.theme-page-guides .guide-info-panel {
    border-color: var(--we-border);
    background: rgba(18,22,31,.72);
}
.theme-page-guides .guide-wiki-layout {
    grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
    gap: 20px;
}
.theme-page-guides .guide-wiki-nav { display: grid; gap: 6px; }
.theme-page-guides .guide-wiki-nav a {
    display: grid;
    padding: 9px 10px;
    border-radius: 7px;
}
.theme-page-guides .guide-wiki-nav a:hover {
    background: rgba(138,43,226,.12);
    color: var(--we-text);
}
.theme-page-guides .guide-drop { overflow: hidden; border-radius: var(--we-radius); }
.theme-page-guides .guide-summary { cursor: pointer; }
.theme-page-guides .guide-open-label { color: var(--we-primary-light); }
.theme-page-guides .combo-class-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
}

.theme-page-rankings .character-equipment-panel {
    width: 100%;
    overflow: visible;
}
.theme-page-rankings .character-paperdoll {
    border-color: rgba(168,85,247,.22);
    background:
        radial-gradient(circle at 50% 34%, rgba(138,43,226,.14), transparent 47%),
        linear-gradient(180deg, rgba(18,22,31,.8), rgba(6,8,13,.92));
}
.theme-page-rankings .equipment-slot {
    border-color: rgba(168,85,247,.28);
    background:
        radial-gradient(circle at 50% 0%, rgba(138,43,226,.24), transparent 58%),
        linear-gradient(180deg, rgba(28,20,46,.82), rgba(8,9,15,.96));
}
.theme-page-rankings .equipment-item-card {
    background:
        radial-gradient(circle at 50% 0%, rgba(168,85,247,.3), transparent 60%),
        linear-gradient(180deg, rgba(30,20,50,.9), rgba(8,9,15,.96));
}
.theme-page-rankings .equipment-item-card img {
    width: auto;
    height: auto;
    max-width: calc(100% - 4px);
    max-height: calc(100% - 4px);
    object-fit: contain;
    image-rendering: auto;
}
.theme-page-rankings .equipment-item-card .item-tooltip {
    z-index: 80;
    pointer-events: none;
}
.theme-page-rankings .character-class-panel {
    min-height: 370px;
    display: flex;
    flex-direction: column;
}
.theme-page-rankings .character-class-panel .class-image {
    width: 100%;
    min-height: 280px;
    flex: 1;
    border-radius: 9px;
    object-fit: cover;
    object-position: top center;
}

@media (max-width: 900px) {
    .theme-page-info .info-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .theme-page-guides .guide-wiki-layout { grid-template-columns: 1fr; }
    .theme-page-guides .guide-wiki-sidebar { position: static; }
}

@media (max-width: 760px) {
    .theme-page-rankings .class-filter {
        display: flex;
        margin-inline: -4px;
        padding: 4px 4px 10px;
        overflow-x: auto;
    }
    .theme-page-rankings .class-filter a { min-width: 116px; }
    .theme-page-rankings .ranking-search > div { display: grid; grid-template-columns: 1fr 1fr; }
    .theme-page-rankings .ranking-search input { grid-column: 1 / -1; }
    .theme-page-rankings .ranking-table { min-width: 0; }
}

@media (max-width: 560px) {
    .theme-page-info .info-stats-grid { grid-template-columns: 1fr; }
    .template-theme .section-header { gap: 4px; }
}

/* Castle Siege: preserve the useful information hierarchy from the original
   page while matching the modern purple Template system. */
.template-theme .castle-section {
    display: grid;
    gap: 20px;
}
.template-theme .castle-section > .ranking-tabs { margin-bottom: 2px; }
.template-theme .castle-hero {
    position: relative;
    isolation: isolate;
    max-width: none;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    padding: 24px;
    overflow: hidden;
    border-color: rgba(168,85,247,.25);
    background:
        linear-gradient(115deg, rgba(138,43,226,.14), transparent 52%),
        rgba(14,17,25,.88);
    box-shadow: var(--we-shadow), inset 0 1px 0 rgba(255,255,255,.04);
}
.template-theme .castle-hero::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 10% 50%, rgba(168,85,247,.14), transparent 28%),
        linear-gradient(90deg, transparent, rgba(192,132,252,.035));
    content: '';
    pointer-events: none;
}
.template-theme .castle-owner-mark {
    width: 112px;
    height: 112px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(168,85,247,.3);
    border-radius: 16px;
    background: rgba(7,9,14,.72);
    box-shadow: inset 0 0 28px rgba(138,43,226,.12), var(--we-glow-sm);
}
.template-theme .castle-mark {
    max-width: 80px;
    max-height: 80px;
    image-rendering: pixelated;
}
.template-theme .castle-owner-info {
    min-width: 0;
    display: grid;
    gap: 13px;
}
.template-theme .castle-owner-info h2 {
    margin: 0;
    color: var(--we-text);
    font: 700 clamp(30px,4vw,44px)/1 var(--we-font-display);
    text-shadow: 0 0 22px rgba(138,43,226,.28);
}
.template-theme .castle-owner-info h2 a { color: inherit; }
.template-theme .castle-owner-info h2 a:hover { color: var(--we-primary-light); }
.template-theme .castle-owner-info .detail-grid {
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 12px;
}
.template-theme .castle-owner-info .summary-card {
    min-height: 94px;
    display: grid;
    align-content: center;
    gap: 7px;
    padding: 16px;
    border: 1px solid var(--we-border);
    border-radius: 10px;
    background: rgba(7,9,14,.66);
}
.template-theme .castle-owner-info .summary-card span {
    color: var(--we-text-dim);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.template-theme .castle-owner-info .summary-card strong {
    color: var(--we-text);
    font-size: 17px;
    line-height: 1.25;
}
.template-theme .castle-owner-info .summary-card.highlight {
    border-color: rgba(34,197,94,.24);
    background: rgba(34,197,94,.055);
}
.template-theme .castle-owner-info .summary-card.highlight strong { color: #86efac; }

.template-theme .castle-section > .ranking-block {
    padding: 22px;
    border: 1px solid var(--we-border);
    border-radius: var(--we-radius);
    background: rgba(18,22,31,.7);
}
.template-theme .castle-section .ranking-block .empty {
    min-height: 72px;
    display: flex;
    padding: 18px;
    align-items: center;
    border-radius: 9px;
    background: rgba(7,9,14,.5);
    color: var(--we-text-muted);
}
.template-theme .castle-table,
.template-theme .castle-history-table { min-width: 720px; }
.template-theme .castle-table th:nth-child(1),
.template-theme .castle-table td:nth-child(1),
.template-theme .castle-table th:nth-child(2),
.template-theme .castle-table td:nth-child(2),
.template-theme .castle-history-table th:nth-child(1),
.template-theme .castle-history-table td:nth-child(1),
.template-theme .castle-history-table th:nth-child(2),
.template-theme .castle-history-table td:nth-child(2) {
    width: 72px;
    text-align: center;
}

.template-theme .siege-state-grid {
    display: grid;
    gap: 9px;
}
.template-theme .siege-state-item {
    display: grid;
    grid-template-columns: minmax(0,1.45fr) minmax(165px,.85fr) minmax(145px,.72fr);
    align-items: center;
    gap: 16px;
    padding: 15px 17px;
    border: 1px solid var(--we-border);
    border-radius: 10px;
    background:
        linear-gradient(90deg, rgba(138,43,226,.035), transparent 42%),
        rgba(7,9,14,.62);
    transition: border-color var(--we-transition), background var(--we-transition), transform var(--we-transition);
}
.template-theme .siege-state-item:hover {
    transform: translateY(-1px);
    border-color: rgba(168,85,247,.24);
    background: rgba(18,22,31,.9);
}
.template-theme .siege-state-item span {
    display: block;
    margin-bottom: 4px;
    color: var(--we-text-dim);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.template-theme .siege-state-item strong {
    display: block;
    color: var(--we-text);
    font-size: 13px;
    line-height: 1.3;
}
.template-theme .siege-state-item.is-current {
    border-color: rgba(34,197,94,.55);
    background:
        linear-gradient(90deg, rgba(34,197,94,.12), transparent 48%),
        rgba(7,12,12,.82);
    box-shadow: 0 0 24px rgba(34,197,94,.09), inset 3px 0 0 #22c55e;
}
.template-theme .siege-state-item.is-current strong,
.template-theme .siege-state-item.is-current [data-siege-state-row-countdown] {
    color: #86efac;
    text-shadow: 0 0 12px rgba(34,197,94,.24);
}

@media (max-width: 780px) {
    .template-theme .castle-hero { grid-template-columns: 1fr; }
    .template-theme .castle-owner-mark { width: 88px; height: 88px; }
    .template-theme .castle-owner-info .detail-grid { grid-template-columns: 1fr; }
    .template-theme .siege-state-item { grid-template-columns: 1fr; gap: 11px; }
}

@media (max-width: 560px) {
    .template-theme .castle-hero,
    .template-theme .castle-section > .ranking-block { padding: 17px; }
    .template-theme .castle-owner-info h2 { font-size: 29px; }
}

/* Purple-native module foundations.
   These rules intentionally replace the former legacy stylesheet so no blue
   theme, old header, or old page background can leak into the Template. */
.template-theme .section { display: grid; gap: 20px; }
.template-theme .section > .panel:not(.castle-hero),
.template-theme .register-panel,
.template-theme .download-panel { padding: 22px; }
.template-theme .empty {
    padding: 22px;
    color: var(--we-text-muted);
    text-align: center;
}
.template-theme .muted-value { color: var(--we-text-dim); }

.template-theme .ranking-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}
.template-theme .ranking-tabs a,
.template-theme .class-filter a {
    color: var(--we-text-muted);
    text-decoration: none;
}
.template-theme .ranking-tabs a {
    padding: 9px 13px;
    border: 1px solid var(--we-border);
    border-radius: 8px;
    background: rgba(255,255,255,.025);
    font-weight: 700;
}
.template-theme .ranking-tabs a:hover,
.template-theme .ranking-tabs a.active {
    border-color: var(--we-border-glow);
    background: rgba(138,43,226,.16);
    color: #f3e8ff;
}
.template-theme .ranking-table-wrap { width: 100%; }
.template-theme .ranking-table { width: 100%; border-collapse: collapse; }
.template-theme .ranking-table th,
.template-theme .ranking-table td { vertical-align: middle; }
.template-theme .ranking-search,
.template-theme .ranking-search-results {
    display: grid;
    gap: 9px;
    padding: 15px;
    border: 1px solid var(--we-border);
    border-radius: 10px;
    background: rgba(11,9,18,.55);
}
.template-theme .ranking-search label,
.template-theme .ranking-search-results > strong {
    color: var(--we-text-muted);
    font-size: 11px;
    font-weight: 700;
}
.template-theme .ranking-search-list { display: grid; gap: 7px; }
.template-theme .ranking-search-list a {
    display: grid;
    grid-template-columns: 58px 42px minmax(120px,1fr) minmax(120px,.8fr);
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border-radius: 8px;
    background: rgba(255,255,255,.025);
}
.template-theme .ranking-search-list em { color: var(--we-text-muted); font-style: normal; }
.template-theme .ranking-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}

.template-theme .detail-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 12px;
}
.template-theme .detail-grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.template-theme .summary-card {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 17px;
    border: 1px solid var(--we-border);
    border-radius: 10px;
    background: rgba(16,13,25,.72);
}
.template-theme .summary-card span {
    color: var(--we-text-dim);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.template-theme .summary-card strong {
    min-width: 0;
    color: var(--we-text);
    font: 700 21px/1.2 var(--we-font-display);
    overflow-wrap: anywhere;
}
.template-theme .summary-card.highlight {
    border-color: rgba(168,85,247,.32);
    background: linear-gradient(145deg,rgba(138,43,226,.15),rgba(16,13,25,.72));
}
.template-theme .summary-card.highlight strong { color: #d8b4fe; }

.template-theme .info-stats-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 12px;
}
.template-theme .stat-card {
    min-width: 0;
    display: grid;
    grid-template-columns: 48px minmax(0,1fr);
    gap: 12px;
    padding: 16px;
    align-items: center;
    border: 1px solid var(--we-border);
    border-radius: 10px;
}
.template-theme .stat-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(168,85,247,.3);
    border-radius: 10px;
    color: #d8b4fe;
    font-size: 12px;
    font-weight: 800;
}
.template-theme .stat-card span {
    display: block;
    color: var(--we-text-muted);
    font-size: 11px;
}
.template-theme .stat-card strong {
    display: block;
    color: var(--we-text);
    font-size: 20px;
}
.template-theme .info-table-card > h2 { padding: 18px 18px 0; }

.template-theme .form-link-box { text-align: center; }
.template-theme .form-grid { display: grid; gap: 14px; }
.template-theme .field { display: grid; gap: 7px; }
.template-theme .register-panel,
.template-theme .page-login .panel { max-width: 680px; width: 100%; }

.template-theme .download-client-list { display: grid; gap: 13px; }
.template-theme .download-client-card {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 8px 18px;
    padding: 19px;
    align-items: center;
    border: 1px solid var(--we-border);
    border-radius: 10px;
    background: rgba(16,13,25,.7);
}
.template-theme .download-client-card h2,
.template-theme .download-client-card p { margin: 0; }
.template-theme .download-client-card p { color: var(--we-text-muted); }
.template-theme .download-client-card .button { grid-column: 2; grid-row: 1 / 3; }
.template-theme .download-help-grid,
.template-theme .news-info-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 12px;
}
.template-theme .download-help-grid article,
.template-theme .news-info-card,
.template-theme .news-highlight > div,
.template-theme .news-schedule {
    padding: 17px;
    border: 1px solid var(--we-border);
    border-radius: 10px;
    background: rgba(16,13,25,.68);
}
.template-theme .download-actions-row,
.template-theme .download-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.template-theme .news-list { display: grid; gap: 14px; }
.template-theme .news-item {
    position: relative;
    isolation: isolate;
    padding: 22px;
    overflow: hidden;
    border: 1px solid var(--we-border);
    border-radius: 12px;
    background:
        linear-gradient(115deg, rgba(10,7,19,.94), rgba(18,12,30,.78) 52%, rgba(10,8,18,.92)),
        url('../images/news/news-opening-bg.jpg') center/cover;
    box-shadow: 0 18px 55px rgba(0,0,0,.42), 0 0 34px rgba(138,43,226,.1);
}
.template-theme .news-feature::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 90% 8%, rgba(192,132,252,.22), transparent 28%),
        linear-gradient(90deg, transparent, rgba(138,43,226,.08));
    content: '';
    pointer-events: none;
}
.template-theme .news-feature > time {
    display: inline-block;
    margin-bottom: 5px;
    color: #d8b4fe;
    font-size: 12px;
    font-weight: 800;
}
.template-theme .news-feature > h2 {
    margin: 0 0 18px;
    color: #f8f5ff;
    font: 700 clamp(24px,3vw,32px)/1.15 var(--we-font-display);
}
.template-theme .news-highlight > div {
    min-height: 67px;
    display: grid;
    align-content: center;
    gap: 5px;
    background: rgba(11,8,20,.58);
}
.template-theme .news-highlight span,
.template-theme .news-info-card h3,
.template-theme .news-schedule h3 {
    color: #d8b4fe;
}
.template-theme .news-highlight strong { color: #fff; font-size: 16px; }
.template-theme .news-schedule {
    background: rgba(9,7,17,.68);
}
.template-theme .news-schedule h3 {
    margin: 0 0 8px;
    font-size: 16px;
}
.template-theme .news-schedule .schedule-row {
    min-height: 40px;
    align-items: center;
}
.template-theme .news-schedule .schedule-row strong { color: #e9d5ff; }
.template-theme .news-schedule .schedule-row span { color: #c9c1d7; }
.template-theme .news-info-card {
    background:
        linear-gradient(145deg, rgba(138,43,226,.09), rgba(10,8,18,.72) 58%),
        rgba(16,13,25,.78);
}
.template-theme .news-info-card h3 { margin: 0 0 12px; font-size: 17px; }
.template-theme .news-info-card p {
    margin: 0;
    padding: 7px 0;
    border-bottom: 1px solid rgba(168,85,247,.12);
    color: #c9c1d7;
}
.template-theme .news-info-card p:last-child { border-bottom: 0; }
.template-theme .news-info-card p strong { color: #f4f0fb; }
.theme-page-rankings .ranking-table-wrap {
    position: relative;
    isolation: isolate;
    border-color: rgba(168,85,247,.24);
    background:
        linear-gradient(115deg, rgba(8,6,15,.94), rgba(21,13,34,.78) 48%, rgba(8,6,15,.95)),
        url('../images/template/background-2600.jpg') center/cover;
    box-shadow: 0 22px 60px rgba(0,0,0,.38), 0 0 32px rgba(138,43,226,.1);
}
.theme-page-rankings .ranking-table tbody tr {
    background-color: rgba(7,6,13,.72);
}
.theme-page-rankings .ranking-table tbody tr:nth-child(n+4):hover {
    background-color: rgba(138,43,226,.1);
    box-shadow: inset 3px 0 0 rgba(192,132,252,.7);
}
.template-theme .news-highlight {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 12px;
}
.template-theme .news-schedule { margin-top: 12px; }
.template-theme .schedule-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px solid var(--we-border);
}

.template-theme .guide-wiki-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--we-border);
    border-radius: 10px;
}
.template-theme .guide-wiki-search {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 6px;
}
.template-theme .guide-wiki-count { color: var(--we-text-muted); white-space: nowrap; }
.template-theme .guide-wiki-layout {
    display: grid;
    grid-template-columns: 230px minmax(0,1fr);
    gap: 20px;
    align-items: start;
}
.template-theme .guide-wiki-sidebar {
    position: sticky;
    top: 92px;
    padding: 15px;
    border: 1px solid var(--we-border);
    border-radius: 10px;
}
.template-theme .guide-wiki-sidebar-title {
    margin-bottom: 9px;
    color: var(--we-text);
    font-weight: 800;
}
.template-theme .guide-wiki-top-link { display: inline-block; margin-top: 10px; font-size: 11px; }
.template-theme .guide-wiki-content,
.template-theme .guide-accordion { min-width: 0; display: grid; gap: 12px; }
.template-theme .guide-wiki-intro { padding: 19px; }
.template-theme .guide-drop { border: 1px solid var(--we-border); }
.template-theme .guide-drop > summary { list-style: none; }
.template-theme .guide-drop > summary::-webkit-details-marker { display: none; }
.template-theme .guide-summary {
    position: relative;
    display: grid;
    gap: 6px;
    padding: 18px 52px 18px 18px;
}
.template-theme .guide-summary::after {
    position: absolute;
    top: 50%;
    right: 20px;
    color: #c084fc;
    content: '+';
    font-size: 23px;
    transform: translateY(-50%);
}
.template-theme .guide-drop[open] .guide-summary::after { content: '−'; }
.template-theme .guide-summary h2,
.template-theme .guide-summary p { margin: 0; }
.template-theme .guide-summary p { color: var(--we-text-muted); }
.template-theme .guide-info-panel {
    padding: 20px;
    border-top: 1px solid var(--we-border);
}
.template-theme .guide-info-heading { margin-bottom: 15px; }
.template-theme .guide-table { min-width: 680px; }
.template-theme .formula-class-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 12px;
}
.template-theme .formula-class-card {
    display: grid;
    grid-template-columns: 86px minmax(0,1fr);
    overflow: hidden;
    border: 1px solid var(--we-border);
    border-radius: 10px;
    background: rgba(16,13,25,.68);
}
.template-theme .formula-class-card > img {
    width: 86px;
    height: 100%;
    object-fit: cover;
}
.template-theme .formula-class-body { padding: 14px; }
.template-theme .formula-list { display: grid; gap: 7px; }
.template-theme .formula-list > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid var(--we-border);
}

.template-theme .guild-profile {
    display: grid;
    grid-template-columns: 130px minmax(0,1fr);
    gap: 20px;
    align-items: center;
}
.template-theme .guild-logo-wrap {
    min-height: 130px;
    display: grid;
    place-items: center;
    border: 1px solid var(--we-border);
    border-radius: 12px;
    background: rgba(11,9,18,.6);
}
.template-theme .guild-profile-info { min-width: 0; }
.template-theme .guild-profile-info > h2 { margin-top: 0; }
.template-theme .guild-profile .detail-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }

.template-theme .character-paperdoll {
    position: relative;
    width: 760px;
    max-width: 100%;
    height: 500px;
    margin: 0 auto;
}
.template-theme .equipment-slot {
    position: absolute;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 7px;
}
.template-theme .equipment-slot-pet { left: 58px; top: 30px; width: 112px; height: 76px; }
.template-theme .equipment-slot-helm { left: 324px; top: 24px; width: 112px; height: 92px; }
.template-theme .equipment-slot-wings { right: 58px; top: 24px; width: 156px; height: 96px; }
.template-theme .equipment-slot-left-hand { left: 58px; top: 158px; width: 112px; height: 148px; }
.template-theme .equipment-slot-armor { left: 310px; top: 150px; width: 140px; height: 136px; }
.template-theme .equipment-slot-pendant { left: 214px; top: 126px; width: 60px; height: 60px; }
.template-theme .equipment-slot-gloves { right: 58px; top: 158px; width: 112px; height: 136px; }
.template-theme .equipment-slot-ring-left { left: 214px; top: 324px; width: 60px; height: 60px; }
.template-theme .equipment-slot-pants { left: 320px; top: 328px; width: 120px; height: 104px; }
.template-theme .equipment-slot-ring-right { right: 214px; top: 324px; width: 60px; height: 60px; }
.template-theme .equipment-slot-right-hand { left: 58px; bottom: 28px; width: 112px; height: 148px; }
.template-theme .equipment-slot-boots { right: 58px; bottom: 28px; width: 112px; height: 118px; }
.template-theme .equipment-slot-name { display: none; }
.template-theme .equipment-item-card,
.template-theme .equipment-slot-empty {
    position: relative;
    width: calc(100% - 2px);
    height: calc(100% - 2px);
    display: grid;
    place-items: center;
    border-radius: 6px;
}
.template-theme .equipment-item-card { padding: 5px; overflow: visible; }
.template-theme .equipment-item-card > span {
    position: absolute;
    right: 4px;
    bottom: 3px;
    padding: 1px 4px;
    border-radius: 999px;
    background: rgba(7,5,12,.82);
    color: #d8b4fe;
    font-size: 10px;
    font-weight: 800;
}
.template-theme .equipment-slot-empty { color: transparent; }
.template-theme .item-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    z-index: 80;
    min-width: 260px;
    max-width: 360px;
    display: none;
    padding: 10px 12px;
    border: 1px solid rgba(168,85,247,.38);
    border-radius: 6px;
    background: rgba(5,4,9,.96);
    box-shadow: 0 18px 44px rgba(0,0,0,.65), 0 0 20px rgba(138,43,226,.18);
    text-align: center;
    transform: translateX(-50%);
}
.template-theme .item-tooltip:not(.item-tooltip-with-set) {
    min-width: 205px;
    max-width: 260px;
}
.template-theme .equipment-item-card:hover .item-tooltip { display: block; }
.template-theme .item-tooltip-line {
    color: #f6f7fb;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}
.template-theme .item-tooltip-line + .item-tooltip-line { margin-top: 3px; }
.template-theme .item-tooltip-line.name { color: #ffffff; font-weight: 700; }
.template-theme .item-tooltip-line.high-level { color: #ffd900; font-weight: 700; }
.template-theme .item-tooltip-line.base,
.template-theme .item-tooltip-line.requirement { color: #ffffff; }
.template-theme .item-tooltip-line.damage,
.template-theme .item-tooltip-line.option,
.template-theme .item-tooltip-line.normal-option,
.template-theme .item-tooltip-line.wing { color: #8db8ff; }
.template-theme .item-tooltip-line.excellent { color: #00ff66; font-weight: 700; }
.template-theme .item-tooltip-line.luck { color: #ff4d4d; }
.template-theme .item-tooltip-line.socket-title { color: #c084fc; font-weight: 700; }
.template-theme .item-tooltip-line.ancient-title {
    color: #00ff66;
    background: #3d2aaf;
    margin: -4px -7px 8px;
    padding: 2px 8px;
    font-weight: 700;
}
.template-theme .item-tooltip-line.ancient,
.template-theme .item-tooltip-line.ancient-option { color: #8db8ff; }
.template-theme .item-tooltip-line.harmony { color: #ffd900; }
.template-theme .item-tooltip-line.socket-header { color: #d946ef; margin-top: 12px; }
.template-theme .item-tooltip-line.socket { color: #a8a8b6; }
.template-theme .item-tooltip-line.description { color: #d8d8e4; font-weight: 500; }
.template-theme .item-tooltip-line.class-requirement {
    display: block;
    margin: 8px 4px 0;
    padding: 2px 8px;
    border-radius: 0;
    background: #b80000;
    color: #ffffff;
    font-weight: 700;
    white-space: nowrap;
}

.template-theme .item-tooltip:not(.item-tooltip-with-set) {
    min-width: 290px;
    max-width: 360px;
}

@media (max-width: 900px) {
    .template-theme .detail-grid,
    .template-theme .guild-profile .detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .template-theme .guide-wiki-layout { grid-template-columns: 1fr; }
    .template-theme .guide-wiki-sidebar { position: static; }
    .template-theme .download-help-grid,
    .template-theme .news-info-grid { grid-template-columns: 1fr; }
    .template-theme .character-paperdoll {
        transform: scale(.72);
        transform-origin: top left;
        margin-bottom: -140px;
    }
}

/* Use the purple hero artwork as the shared page atmosphere so inner pages
   show the castle and character composition instead of a cropped hand. */
body.we-body {
    background-image:
        linear-gradient(rgba(8,6,15,.84), rgba(8,6,15,.93)),
        url('../images/template/hero-banner.jpg');
    background-position: center top;
    background-size: cover;
}
@media (max-width: 760px) {
    body.template-theme {
        background-position: 28% top;
        background-size: auto 100%;
    }
}

/* Downloads and registration use stronger hierarchy and breathing room. */
.theme-page-download .download-panel {
    padding: 24px;
    background:
        linear-gradient(140deg, rgba(138,43,226,.08), transparent 42%),
        rgba(15,11,24,.82);
}
.theme-page-download .download-client-list { gap: 15px; }
.theme-page-download .download-client-card {
    position: relative;
    min-height: 96px;
    padding: 22px 24px;
    border-color: rgba(168,85,247,.22);
    background:
        linear-gradient(100deg, rgba(138,43,226,.09), rgba(10,8,18,.7) 55%),
        rgba(16,13,25,.76);
    box-shadow: 0 12px 28px rgba(0,0,0,.22);
}
.theme-page-download .download-client-card::before {
    width: 4px;
    height: 38px;
    position: absolute;
    left: 0;
    top: 50%;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg,#c084fc,#7c3aed);
    content: '';
    transform: translateY(-50%);
}
.theme-page-download .download-client-card h2 {
    color: #f4effb;
    font-size: 21px;
}
.theme-page-download .download-client-card .button {
    min-width: 142px;
}
.theme-page-download .download-help-grid {
    gap: 14px;
    margin-top: 2px;
}
.theme-page-download .download-help-grid article {
    min-height: 176px;
    padding: 20px;
    background:
        linear-gradient(145deg, rgba(168,85,247,.1), rgba(10,8,18,.72) 60%),
        rgba(16,13,25,.76);
}
.theme-page-download .download-help-grid article::before {
    display: block;
    margin-bottom: 10px;
    color: #d8b4fe;
    font: 700 22px/1 var(--we-font-display);
    counter-increment: download-step;
    content: counter(download-step, decimal-leading-zero);
}
.theme-page-download .download-help-grid { counter-reset: download-step; }
.theme-page-download .download-help-grid h3 { color: #f4effb; font-size: 16px; }
.theme-page-download .download-help-grid p { color: #c2b8d1; line-height: 1.55; }
.theme-page-download .download-actions-row {
    gap: 13px;
    margin-top: 16px;
}

.theme-page-register .section {
    max-width: 840px;
    margin: 0 auto;
}
.theme-page-register .section-header { margin-bottom: 5px; }
.theme-page-register .register-panel {
    max-width: 760px;
    margin: 0 auto;
    padding: 30px 32px;
    border-color: rgba(168,85,247,.25);
    background:
        linear-gradient(145deg, rgba(138,43,226,.09), rgba(10,8,18,.74) 56%),
        rgba(16,13,25,.82);
    box-shadow: 0 20px 55px rgba(0,0,0,.32), 0 0 28px rgba(138,43,226,.08);
}
.theme-page-register .register-panel .form-grid {
    gap: 18px;
}
.theme-page-register .register-panel .field {
    gap: 8px;
}
.theme-page-register .register-panel .field label {
    color: #cfc5da;
    font-size: 13px;
    font-weight: 700;
}
.theme-page-register .register-panel input {
    min-height: 48px;
    border-color: rgba(168,85,247,.2);
    background: rgba(5,4,10,.78);
    color: #f4effb;
}
.theme-page-register .register-panel input:focus {
    border-color: #c084fc;
    box-shadow: 0 0 0 3px rgba(192,132,252,.14), 0 0 18px rgba(138,43,226,.16);
}
.theme-page-register .register-panel button[type=submit] {
    margin-top: 5px;
    min-height: 48px;
    font-size: 14px;
}
.theme-page-register .form-link-box {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(168,85,247,.18);
    color: #c2b8d1;
    font-size: 14px;
}
.theme-page-register .form-link-box a {
    color: #d8b4fe;
    font-weight: 700;
}

@media (max-width: 680px) {
    .theme-page-download .download-panel { padding: 17px; }
    .theme-page-download .download-client-card { padding: 18px; }
    .theme-page-register .register-panel { padding: 23px 19px; }
}

/* Warehouse grid: restore the 8x15 item board without the legacy blue skin. */
.theme-page-warehouse .warehouse-panel {
    width: max-content;
    max-width: 100%;
    justify-self: center;
    display: grid;
    gap: 10px;
    padding: 17px;
    border: 1px solid rgba(168,85,247,.28);
    border-radius: 16px;
    background:
        radial-gradient(circle at 20% 0%, rgba(138,43,226,.16), transparent 34%),
        rgba(13,10,22,.86);
    box-shadow: 0 20px 55px rgba(0,0,0,.34), 0 0 26px rgba(138,43,226,.1);
}
.theme-page-warehouse .warehouse-frame-title {
    color: #f4effb;
    font-size: 17px;
    font-weight: 800;
    text-align: center;
}
.theme-page-warehouse .warehouse-grid-wrap {
    position: relative;
    width: max-content;
    max-width: 100%;
    overflow: visible;
    padding: 8px;
    border: 1px solid rgba(168,85,247,.24);
    border-radius: 12px;
    background: rgba(5,4,10,.7);
}
.theme-page-warehouse .warehouse-grid {
    --warehouse-cell: 56px;
    --warehouse-gap: 3px;
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--warehouse-cols), var(--warehouse-cell));
    grid-template-rows: repeat(var(--warehouse-rows), var(--warehouse-cell));
    grid-auto-columns: 0;
    grid-auto-rows: 0;
    width: max-content;
    height: calc((var(--warehouse-cell) * var(--warehouse-rows)) + (var(--warehouse-gap) * (var(--warehouse-rows) - 1)));
    gap: var(--warehouse-gap);
}
.theme-page-warehouse .warehouse-cell {
    width: var(--warehouse-cell);
    height: var(--warehouse-cell);
    border: 1px solid rgba(168,85,247,.18);
    border-radius: 6px;
    background:
        linear-gradient(180deg, rgba(34,20,57,.72), rgba(8,6,14,.86));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.theme-page-warehouse .warehouse-item-position {
    position: relative;
    z-index: 2;
    min-width: 0;
    min-height: 0;
    overflow: visible;
}
.theme-page-warehouse .warehouse-item-position:hover { z-index: 10000; }
.theme-page-warehouse .warehouse-item {
    position: relative;
    z-index: 2;
    display: grid;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 4px;
    align-content: center;
    justify-items: center;
    gap: 2px;
    overflow: visible;
    border: 1px solid rgba(192,132,252,.38);
    border-radius: 7px;
    background:
        radial-gradient(circle at 50% 0%, rgba(168,85,247,.24), transparent 55%),
        linear-gradient(180deg, rgba(39,22,66,.88), rgba(8,6,14,.95));
    box-shadow: 0 8px 20px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.08);
    text-align: center;
}
.theme-page-warehouse .warehouse-item img {
    max-width: calc(100% - 4px);
    max-height: calc(100% - 4px);
    object-fit: contain;
    filter: drop-shadow(0 6px 9px rgba(0,0,0,.48));
}
.theme-page-warehouse .warehouse-item strong {
    max-width: 100%;
    color: #f4effb;
    font-size: 10px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}
.theme-page-warehouse .warehouse-item > span {
    position: absolute;
    right: 3px;
    bottom: 2px;
    padding: 1px 4px;
    border: 1px solid rgba(192,132,252,.3);
    border-radius: 999px;
    background: rgba(7,4,13,.84);
    color: #d8b4fe;
    font-size: 10px;
    font-weight: 800;
}
.theme-page-warehouse .warehouse-arrow {
    position: absolute;
    top: 50%;
    z-index: 20;
    width: 0;
    height: 0;
    filter: drop-shadow(0 0 6px rgba(192,132,252,.6));
    transform: translateY(-50%);
}
.theme-page-warehouse .warehouse-arrow-left {
    left: -28px;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-right: 22px solid #c084fc;
}
.theme-page-warehouse .warehouse-arrow-right {
    right: -28px;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-left: 22px solid #c084fc;
}
.theme-page-warehouse .warehouse-arrow:hover { filter: drop-shadow(0 0 10px rgba(240,171,252,.9)); }
.theme-page-warehouse .warehouse-item:hover .item-tooltip { display: block; }

@media (max-width: 700px) {
    .theme-page-warehouse .warehouse-panel { justify-self: stretch; padding: 12px; }
    .theme-page-warehouse .warehouse-grid-wrap { max-width: 100%; overflow-x: auto; }
    .theme-page-warehouse .warehouse-grid { --warehouse-cell: 48px; }
}

/* Mobile navigation and background crop fixes. */
@media (max-width: 760px) {
    .template-theme .nav-toggle-button {
        position: relative;
        z-index: 90;
        display: grid;
        cursor: pointer;
        pointer-events: auto;
    }
    .template-theme .nav-shell {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        z-index: 80;
        display: none;
        visibility: hidden;
        padding: 15px 16px 18px;
        border-top: 1px solid rgba(168,85,247,.18);
        border-bottom: 1px solid rgba(168,85,247,.28);
        background:
            linear-gradient(145deg, rgba(20,10,34,.99), rgba(7,6,13,.99)),
            rgba(7,6,13,.99);
        box-shadow: 0 20px 40px rgba(0,0,0,.48), 0 0 28px rgba(138,43,226,.16);
    }
    .template-theme #nav-toggle:checked + .nav-toggle-button + .nav-shell,
    .template-theme .nav-toggle:checked ~ .nav-shell {
        display: block !important;
        visibility: visible;
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
    .template-theme .nav-shell .we-nav-menu {
        display: grid;
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 8px;
    }
    .template-theme .nav-shell .we-nav-menu > a {
        min-height: 44px;
        justify-content: center;
        padding: 10px 8px;
        border-color: rgba(168,85,247,.18);
        border-radius: 10px;
        background: rgba(255,255,255,.045);
        font-size: 12px;
    }
    .template-theme .nav-shell .we-nav-menu > a.active {
        border-color: rgba(192,132,252,.5);
        background: rgba(138,43,226,.28);
    }
    .template-theme .nav-shell .we-nav-menu > a::after {
        bottom: 4px;
        width: 54%;
        height: 3px;
    }
    body.template-theme {
        background-position: 72% top;
        background-size: auto 100vh;
        background-attachment: fixed;
    }
    body.template-theme::before {
        background:
            linear-gradient(180deg, rgba(8,6,15,.78), rgba(8,6,15,.66) 42%, rgba(8,6,15,.9)),
            radial-gradient(circle at 18% 8%, rgba(138,43,226,.18), transparent 42%);
    }
}

/* Every nav item is a visible surface; the active route gets the strongest
   purple contrast and underline. */
.template-theme .we-nav-menu > a {
    border: 1px solid rgba(168,85,247,.11);
    background: rgba(255,255,255,.035);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.template-theme .we-nav-menu > a:hover {
    border-color: rgba(192,132,252,.35);
    background: rgba(138,43,226,.18);
}
.template-theme .we-nav-menu > a.active {
    border-color: rgba(192,132,252,.5);
    background:
        linear-gradient(180deg, rgba(168,85,247,.3), rgba(91,33,182,.2)),
        rgba(138,43,226,.18);
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        0 0 20px rgba(138,43,226,.2);
}
.template-theme .we-nav-menu > a.active::after {
    width: 78%;
    height: 4px;
    bottom: 2px;
    background: linear-gradient(90deg,#c084fc,#f0abfc);
    box-shadow: 0 0 11px rgba(216,180,254,.85);
}

/* Navigation visibility and shared focus polish. */
.template-theme .we-nav-menu > a {
    min-height: 42px;
    padding-bottom: 12px;
}
.template-theme .we-nav-menu > a::after {
    bottom: 3px;
    width: 72%;
    height: 3px;
    background: linear-gradient(90deg, #a855f7, #f0abfc);
    box-shadow: 0 0 9px rgba(192,132,252,.72);
}
.template-theme .we-nav-menu > a.active {
    border-color: rgba(192,132,252,.18);
    box-shadow: inset 0 -1px 0 rgba(192,132,252,.18), 0 0 18px rgba(138,43,226,.1);
}
.template-theme .we-nav-menu > a.active::after {
    width: 78%;
    height: 4px;
    bottom: 2px;
}
.template-theme a:focus-visible,
.template-theme button:focus-visible,
.template-theme input:focus-visible,
.template-theme select:focus-visible,
.template-theme textarea:focus-visible {
    outline: 2px solid #d8b4fe;
    outline-offset: 3px;
}
.template-theme .we-btn-primary:hover {
    box-shadow: 0 0 20px rgba(168,85,247,.38);
}
.template-theme .we-link-more,
.template-theme .download-actions-row a,
.template-theme .download-actions a {
    color: #d8b4fe;
}

/* Shared readability and header polish across every route. */
.template-theme .we-navbar {
    background:
        linear-gradient(180deg, rgba(8,7,14,.98), rgba(8,7,14,.9)),
        radial-gradient(circle at 50% 0%, rgba(138,43,226,.12), transparent 48%);
    border-bottom: 1px solid rgba(168,85,247,.2);
    box-shadow: 0 12px 34px rgba(0,0,0,.34), 0 0 24px rgba(138,43,226,.08);
}
.template-theme .we-nav-menu > a {
    color: #b9b1c9;
    font-weight: 800;
}
.template-theme .we-nav-menu > a:hover,
.template-theme .we-nav-menu > a.active {
    background: rgba(138,43,226,.16);
    color: #fff;
}
.template-theme .we-nav-menu > a.active::after {
    height: 3px;
    background: linear-gradient(90deg,#c084fc,#e9d5ff);
    box-shadow: 0 0 10px rgba(192,132,252,.7);
    transform: translateX(-50%) scaleX(1);
}
.template-theme .we-brand-name { color: #f4effb; }
.template-theme .we-navbar-actions .we-btn {
    font-size: 12px;
    font-weight: 800;
}
.template-theme .we-main { font-size: 15px; }
.template-theme .we-main p,
.template-theme .we-main li,
.template-theme .we-main label { font-size: 14px; }
.template-theme .section-header > .eyebrow,
.template-theme .eyebrow {
    font-size: 11px;
    letter-spacing: .16em;
}
.template-theme .panel-title,
.template-theme .detail-panel > h2,
.template-theme .panel > h2 {
    font-size: 20px;
}
.template-theme .button,
.template-theme button,
.template-theme input[type=submit] {
    min-height: 44px;
    font-size: 13px;
}
.template-theme input,
.template-theme select,
.template-theme textarea {
    font-size: 14px;
}
.template-theme table td { font-size: 14px; }
.template-theme .site-footer { font-size: 11px; }

@media (max-width: 760px) {
    .template-theme .we-navbar-actions { gap: 8px; }
    .template-theme .we-main { padding-top: 28px; }
    .template-theme .we-main p,
    .template-theme .we-main li,
    .template-theme .we-main label { font-size: 13px; }
    .template-theme .nav-toggle-button {
        width: 42px;
        height: 38px;
        border-color: rgba(168,85,247,.3);
        background: rgba(138,43,226,.1);
    }
}

@media (max-width: 680px) {
    .template-theme .detail-grid,
    .template-theme .detail-grid.two,
    .template-theme .info-stats-grid,
    .template-theme .formula-class-grid { grid-template-columns: 1fr; }
    .template-theme .download-client-card { grid-template-columns: 1fr; }
    .template-theme .download-client-card .button { grid-column: auto; grid-row: auto; }
    .template-theme .news-highlight { grid-template-columns: 1fr; }
    .template-theme .guild-profile { grid-template-columns: 1fr; }
    .template-theme .guild-logo-wrap { width: 130px; }
}

@media (max-width: 560px) {
    .template-theme .character-paperdoll {
        transform: scale(.5);
        margin-bottom: -250px;
    }
    .template-theme .formula-class-card { grid-template-columns: 70px minmax(0,1fr); }
    .template-theme .formula-class-card > img { width: 70px; }
}

/* Visual refinement pass: clearer typography, compact portraits and podium
   emphasis without reintroducing any legacy-theme styling. */
.template-theme .template-pagebar { display: none; }
.template-theme .we-main { padding-top: 38px; }
.template-theme .we-navbar-inner {
    min-height: 78px;
    gap: 28px;
}
.template-theme .we-brand-logo { width: 50px; height: 50px; }
.template-theme .top-brand-copy strong { font-size: 18px; }
.template-theme .top-brand-copy small { font-size: 9px; }
.template-theme .we-nav-menu { gap: 5px; }
.template-theme .we-nav-menu > a {
    padding: 10px 12px;
    font-size: 12px;
    letter-spacing: .045em;
}
.template-theme .we-navbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.template-theme .top-online {
    min-height: 38px;
    gap: 8px;
    padding: 0 15px;
    border: 1px solid var(--we-border);
    border-radius: 999px;
    background: rgba(255,255,255,.025);
    font-size: 12px;
    white-space: nowrap;
}
.template-theme .top-online strong { margin-left: 2px; font-size: 13px; }
.template-theme .top-account-link {
    min-width: 88px;
    min-height: 40px;
    padding-inline: 17px;
    font-size: 12px;
}

.template-theme .section-header h1 { font-size: clamp(28px,3vw,36px); }
.template-theme .section-header h2 { font-size: clamp(21px,2.3vw,28px); }
.template-theme .section-header p { font-size: 14px; }
.template-theme .section,
.template-theme .panel,
.template-theme .ranking-block { font-size: 14px; }

.theme-page-info .ranking-table-wrap {
    max-width: 100%;
    overflow: hidden;
}
.theme-page-info .ranking-table.info-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}
.theme-page-info .info-table th,
.theme-page-info .info-table td {
    width: 50%;
    padding: 15px 16px;
    font-size: 14px;
    overflow-wrap: anywhere;
}
.theme-page-info .info-table th {
    font-size: 11px;
    letter-spacing: .075em;
}

.theme-page-rankings .class-filter {
    grid-template-columns: repeat(4,minmax(150px,1fr));
    gap: 10px;
}
.theme-page-rankings .class-filter a {
    min-height: 84px;
    display: grid;
    grid-template-columns: 52px minmax(0,1fr);
    place-items: center start;
    align-content: center;
    gap: 11px;
    padding: 12px 14px;
}
.theme-page-rankings .class-filter img,
.theme-page-rankings .class-filter-all > span {
    width: 48px;
    height: 48px;
    border: 2px solid rgba(192,132,252,.4);
    border-radius: 50%;
    object-fit: cover;
    object-position: center 18%;
    box-shadow: 0 7px 18px rgba(0,0,0,.34), 0 0 14px rgba(138,43,226,.12);
}
.theme-page-rankings .class-filter-all > span {
    display: grid;
    place-items: center;
    background: rgba(138,43,226,.13);
    color: #e9d5ff;
    font-size: 11px;
    font-weight: 800;
}
.theme-page-rankings .class-filter strong {
    color: var(--we-text);
    font-size: 13px;
    line-height: 1.25;
}
.theme-page-rankings .ranking-table th {
    padding: 15px 14px;
    font-size: 11px;
    letter-spacing: .08em;
}
.theme-page-rankings .ranking-table td {
    padding: 16px 14px;
    color: #b7bed0;
    font-size: 14px;
}
.theme-page-rankings .ranking-link {
    color: #f4f0fb;
    font-size: 15px;
}
.theme-page-rankings .rank-number {
    font-size: 15px;
    font-weight: 850;
}
.theme-page-rankings .ranking-class-cell {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.theme-page-rankings .ranking-class-cell img,
.theme-page-rankings .ranking-search-list img {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border: 2px solid rgba(192,132,252,.32);
    border-radius: 50%;
    object-fit: cover;
    object-position: center 18%;
    box-shadow: 0 5px 14px rgba(0,0,0,.32);
}
.theme-page-rankings .ranking-class-cell > span { font-size: 14px; }
.theme-page-rankings .guild-mini {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
.theme-page-rankings .status-badge { font-size: 11px; }

.theme-page-rankings .character-ranking-table tbody tr:nth-child(1) {
    background:
        linear-gradient(90deg, rgba(212,175,55,.24), rgba(212,175,55,.08) 48%, transparent 86%);
    box-shadow: inset 4px 0 0 #d4af37;
}
.theme-page-rankings .character-ranking-table tbody tr:nth-child(2) {
    background:
        linear-gradient(90deg, rgba(192,192,192,.2), rgba(192,192,192,.065) 48%, transparent 86%);
    box-shadow: inset 4px 0 0 #c0c0c0;
}
.theme-page-rankings .character-ranking-table tbody tr:nth-child(3) {
    background:
        linear-gradient(90deg, rgba(184,115,51,.24), rgba(184,115,51,.075) 48%, transparent 86%);
    box-shadow: inset 4px 0 0 #b87333;
}
.theme-page-rankings .character-ranking-table tbody tr:nth-child(1) .rank-number { color: #f6d76b; }
.theme-page-rankings .character-ranking-table tbody tr:nth-child(2) .rank-number { color: #e2e8f0; }
.theme-page-rankings .character-ranking-table tbody tr:nth-child(3) .rank-number { color: #e8a66a; }
.theme-page-rankings .character-ranking-table tbody tr:nth-child(-n+3):hover {
    filter: brightness(1.08);
}

/* Shared polish pass: consistent surfaces, clearer hierarchy, and touch-friendly controls. */
.template-theme .section > .section-header { margin-bottom: 28px; }
.template-theme .section-header h1,
.template-theme .section-header h2 { letter-spacing: -.015em; }
.template-theme .section-header p { max-width: 720px; color: #c2b8d1; line-height: 1.6; }
.template-theme .info-table-card,
.template-theme .guide-card,
.template-theme .download-panel,
.template-theme .register-panel,
.template-theme .ranking-block {
    border: 1px solid rgba(168,85,247,.2);
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(20,15,31,.78), rgba(9,8,16,.74));
    box-shadow: 0 16px 42px rgba(0,0,0,.16);
}
.template-theme .ranking-table-wrap { scrollbar-color: #8b3fd1 rgba(255,255,255,.06); }
.template-theme .ranking-table thead th { position: sticky; top: 0; z-index: 2; }
.template-theme .ranking-table tbody tr { min-height: 60px; }

/* Warehouse: make the board feel like a real storage UI instead of a blank panel. */
.theme-page-warehouse .warehouse-panel { width: min(100%, 610px); }
.theme-page-warehouse .warehouse-grid-wrap { margin-inline: 20px; }
.theme-page-warehouse .warehouse-frame-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 4px 8px;
    text-align: left;
}
.theme-page-warehouse .warehouse-frame-title::after {
    content: 'Read-only preview';
    color: #bfa9d8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.theme-page-warehouse .warehouse-cell { background: linear-gradient(145deg, rgba(42,25,65,.68), rgba(11,8,18,.9)); }
.theme-page-warehouse .warehouse-item-position { padding: 2px; }
.theme-page-warehouse .warehouse-item { border-radius: 9px; }
.theme-page-warehouse .warehouse-item img { width: 82%; height: 82%; }
.theme-page-warehouse .warehouse-arrow {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(192,132,252,.45);
    border-radius: 50%;
    background: rgba(28,15,45,.94);
    box-shadow: 0 6px 18px rgba(0,0,0,.35);
    transform: translateY(-50%);
}
.theme-page-warehouse .warehouse-arrow::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-top: 2px solid #ead7ff;
    border-right: 2px solid #ead7ff;
    content: '';
    transform: translate(-65%,-50%) rotate(45deg);
}
.theme-page-warehouse .warehouse-arrow-left { left: -46px; border-top: 0; border-right: 0; border-bottom: 0; }
.theme-page-warehouse .warehouse-arrow-left::after { transform: translate(-35%,-50%) rotate(-135deg); }
.theme-page-warehouse .warehouse-arrow-right { right: -46px; border-top: 0; border-left: 0; border-bottom: 0; }
.theme-page-warehouse .warehouse-arrow:hover { background: rgba(126,47,219,.62); }

/* Rankings: keep identity details legible while preserving compact rows. */
.theme-page-rankings .character-ranking-table td { min-height: 68px; }
.theme-page-rankings .character-ranking-table .ranking-class-cell img { width: 48px; height: 48px; }
.theme-page-rankings .character-ranking-table tbody tr:nth-child(-n+3) td:first-child { position: relative; }
.theme-page-rankings .character-ranking-table tbody tr:nth-child(-n+3) td:first-child::after {
    content: 'TOP';
    display: inline-flex;
    margin-left: 7px;
    padding: 3px 5px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 8px;
    letter-spacing: .08em;
    vertical-align: middle;
    opacity: .72;
}
.theme-page-rankings .character-ranking-table tbody tr:nth-child(n+4) td:first-child { color: #c8bfd3; }

@media (max-width: 760px) {
    .template-theme .section { padding-inline: 14px; }
    .template-theme .section > .section-header { margin-bottom: 20px; }
    .template-theme .button,
    .template-theme button:not(.nav-toggle-button),
    .template-theme input[type=submit] { min-height: 46px; }
    .template-theme .download-actions,
    .template-theme .download-actions-row { display: grid; grid-template-columns: 1fr; }
    .template-theme .download-actions .button { width: 100%; }
    .template-theme .ranking-table th { position: sticky; top: 0; }
    .theme-page-warehouse .warehouse-panel { width: 100%; }
    .theme-page-warehouse .warehouse-grid-wrap { margin-inline: 22px; }
    .theme-page-warehouse .warehouse-arrow-left { left: -43px; }
    .theme-page-warehouse .warehouse-arrow-right { right: -43px; }
    .theme-page-warehouse .warehouse-frame-title::after { font-size: 9px; }
}

@media (max-width: 1160px) {
    .template-theme .we-navbar-inner { gap: 16px; }
    .template-theme .we-nav-menu > a { padding-inline: 9px; font-size: 11px; }
    .template-theme .we-navbar-actions { gap: 10px; }
    .template-theme .top-online { padding-inline: 11px; }
}

@media (max-width: 900px) {
    .theme-page-rankings .class-filter { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
    .template-theme .we-navbar-inner { min-height: 70px; }
    .theme-page-rankings .class-filter {
        display: flex;
        grid-template-columns: none;
    }
    .theme-page-rankings .class-filter a {
        min-width: 150px;
        min-height: 76px;
        grid-template-columns: 46px minmax(0,1fr);
    }
    .theme-page-rankings .class-filter img,
    .theme-page-rankings .class-filter-all > span {
        width: 42px;
        height: 42px;
    }
}
