/* =====================================================================
   VEYLMU website: shared styles: layout shell, panels, forms, tables,
   rankings, armory. Page-only styles live in /css/<page>.css.
   Theme: deep near-black, one cold-violet "veil" accent, clean type.
   ===================================================================== */

/* === TOKENS === */
:root {
    --accent: #8f7bff;
    --accent-hi: #c9c0ff;
    --accent-lo: #5f4fe0;
    --accent-soft: rgba(143, 123, 255, 0.12);
    --accent-line: rgba(143, 123, 255, 0.38);
    --accent-glow: rgba(143, 123, 255, 0.35);
    --primary: var(--accent);        /* alias used by the older page CSS */

    --text: #e7e7ee;
    --muted: #9a9aab;
    --faint: #66667a;
    --bg: #07070b;
    --panel: rgba(15, 15, 22, 0.78);
    --panel-solid: #111118;
    --line: rgba(255, 255, 255, 0.07);
    --line-strong: rgba(255, 255, 255, 0.13);

    --ok: #34d399;
    --bad: #f87171;
    --warn: #fbbf24;
    --info: #60a5fa;
    --ml: #f472b6;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);

    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Liberation Sans", Arial, sans-serif;
    --font-head: "Sora", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-mono: "JetBrains Mono", "Cascadia Mono", "Liberation Mono", Consolas, monospace;
    --header-h: 64px;
}

/* === BASE === */
*, *::before, *::after { box-sizing: border-box; }

html {
    overflow-x: hidden;
    scroll-padding-top: calc(var(--header-h) + 12px);
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background-color: var(--bg);
    /* the "veil": slow layers of violet mist over near-black, all CSS */
    background-image:
        radial-gradient(1100px 520px at 78% -8%, rgba(143, 123, 255, 0.16), transparent 62%),
        radial-gradient(900px 480px at -10% 18%, rgba(110, 96, 220, 0.09), transparent 60%),
        radial-gradient(1000px 600px at 50% 110%, rgba(143, 123, 255, 0.07), transparent 60%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

/* a very faint grain so large dark areas don't band */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    opacity: 0.35;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--accent-hi); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

[hidden] { display: none !important; }

::selection { background: rgba(143, 123, 255, 0.45); color: #fff; }

.skip-link {
    position: absolute;
    left: -999px;
    top: 8px;
    z-index: 200;
    background: var(--accent);
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
}
.skip-link:focus { left: 8px; }

:focus-visible {
    outline: 2px solid var(--accent-hi);
    outline-offset: 2px;
}

/* === HEADER === */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8, 8, 12, 0.78);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--line);
}
.site-header::after {
    /* thin glowing veil line under the header */
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: var(--header-h);
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}
.brand:hover { text-decoration: none; }

.brand-emblem {
    display: block;
    border-radius: 9px;
    box-shadow: 0 0 18px rgba(143, 123, 255, 0.25);
}

/* Typographic wordmark: VEYL in light, MU fading into the accent. */
.wordmark {
    font-family: var(--font-head);
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: #f2f0ff;
    line-height: 1;
    white-space: nowrap;
    text-shadow: 0 0 18px rgba(143, 123, 255, 0.35);
}
.wordmark .wm-accent {
    background: linear-gradient(180deg, var(--accent-hi), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-panel {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.site-nav a {
    color: #b9b9c8;
    font-size: 0.86rem;
    font-weight: 500;
    padding: 8px 11px;
    border-radius: 8px;
    white-space: nowrap;
    position: relative;
    transition: color 0.2s, background 0.2s;
}
.site-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.05); text-decoration: none; }
.site-nav a.active { color: #fff; }
.site-nav a.active::after {
    content: "";
    position: absolute;
    left: 11px; right: 11px; bottom: 1px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    color: var(--muted);
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    white-space: nowrap;
}
.status-pill b { color: var(--text); font-weight: 600; }
/* Room for the login / account buttons: on medium screens the status pill gives way first. */
@media (min-width: 1181px) and (max-width: 1480px) {
    .status-pill { display: none; }
    .site-nav a { padding-left: 8px; padding-right: 8px; }
    .hdr-account .hdr-label { display: none; }
}
/* Wider screens: the header gets more room than the 1200px page column, because brand,
   8 nav links, status pill, language and account need ~1350px and the links don't shrink. */
@media (min-width: 1481px) {
    .header-inner { max-width: 1380px; }
}

.nav-toggle {
    display: none;
    margin: 0 0 0 auto;
    width: 42px;
    height: 42px;
    padding: 12px 10px;
    background: transparent;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    flex-direction: column;
    justify-content: space-between;
    gap: 0;
    box-shadow: none;
}
.nav-toggle span {
    display: block;
    flex-shrink: 0;
    height: 2px;
    width: 100%;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle:hover { transform: none; box-shadow: none; filter: none; border-color: var(--accent-line); }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* === LANGUAGE SWITCHER === */
.lang-switch {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--faint);
    white-space: nowrap;
    letter-spacing: 0.05em;
}

.lang-switch span {
    cursor: pointer;
    color: var(--faint);
    transition: color 0.2s;
    padding: 0 4px;
}
.lang-switch span:hover { color: var(--text); }
.lang-switch span.active { color: var(--accent-hi); }

/* === MAIN / PAGE === */
.site-main {
    flex: 1;
    width: 100%;
    padding: 32px 16px 56px;
}

.page {
    max-width: 1200px;
    margin: 0 auto;
}

.page-narrow { max-width: 460px; }
.page-mid { max-width: 920px; }

/* Panels: the glass card used by every page (".container" kept as an alias). */
.panel,
.container {
    position: relative;
    background: var(--panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    padding: 2rem;
    width: 100%;
}
.panel::before,
.container::before {
    /* soft accent highlight along the top edge */
    content: "";
    position: absolute;
    left: 24px; right: 24px; top: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
}

.panel + .panel { margin-top: 20px; }

.panel-title {
    font-family: var(--font-head);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.panel-title::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    flex-shrink: 0;
}
.panel-title > span:first-child { flex: 1; }

.panel-title .more {
    font-family: var(--font);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--muted);
}
.panel-title .more:hover { color: var(--accent-hi); text-decoration: none; }

.eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent-hi);
}

.page-head {
    text-align: center;
    margin: 0 0 1.8rem;
}

.page-head h1,
h2 {
    font-family: var(--font-head);
    text-align: center;
    color: #f4f3ff;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0 0 1.6rem;
    font-size: 1.7rem;
    line-height: 1.2;
}

.page-head h1 { margin: 0.35rem 0 0.5rem; font-size: 2.1rem; }

.page-head p {
    margin: 0 auto;
    max-width: 640px;
    color: var(--muted);
    font-size: 0.98rem;
}

/* Page banners: generated art behind the page title (tools/generate-art.mjs, page-*).
   Inside a panel the banner bleeds to the card's edges; on its own it is a rounded band. */
.page-head.art {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 2.6rem 1.5rem 2rem;
    border-radius: var(--radius);
}
.page-head.art::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--art) center / cover no-repeat;
    opacity: 0.75;
    -webkit-mask-image: linear-gradient(180deg, #000 50%, transparent);
    mask-image: linear-gradient(180deg, #000 50%, transparent);
}
.page-head.art h1 { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7); }
.page-head.art p { color: #b4b4c4; }
.panel > .page-head.art:first-child {
    margin: -2rem -2rem 1.8rem;
    padding: 3rem 2rem 2rem;
    border-radius: var(--radius) var(--radius) 0 0;
}
.art-rankings { --art: url("/img/brand/page-rankings.jpg"); }
.art-events { --art: url("/img/brand/page-events.jpg"); }
.art-shop { --art: url("/img/brand/page-shop.jpg"); }
.art-downloads { --art: url("/img/brand/page-downloads.jpg"); }
.art-info { --art: url("/img/brand/page-info.jpg"); }

.muted { color: var(--muted); }
.center { text-align: center; }

/* === BUTTONS === */
.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { text-decoration: none; }

/* Form buttons stay full width, as on the original site. */
button {
    width: 100%;
    margin-top: 1rem;
    padding: 14px;
    color: #fff;
    background: linear-gradient(135deg, #9f8dff 0%, #7a66f5 50%, #5f4fe0 100%);
    box-shadow: 0 8px 24px rgba(95, 79, 224, 0.28);
}

button:hover,
.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(143, 123, 255, 0.38);
}

button:disabled { opacity: 0.7; cursor: progress; transform: none; }

/* A <button> styled as .btn sizes to its content like a link button. */
button.btn { width: auto; margin-top: 0; }
button.btn-ghost { box-shadow: none; }

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #9f8dff 0%, #7a66f5 50%, #5f4fe0 100%);
    box-shadow: 0 8px 24px rgba(95, 79, 224, 0.28);
}

.btn-ghost {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--line-strong);
}
.btn-ghost:hover {
    color: #fff;
    border-color: var(--accent-line);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.btn-sm { padding: 8px 14px; font-size: 0.8rem; }
.btn-lg { padding: 15px 28px; font-size: 0.98rem; }

/* === FORMS === */
.form-group { margin-bottom: 1.2rem; }

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

input,
select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--line-strong);
    color: #fff;
    border-radius: var(--radius-sm);
    font: inherit;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 3px rgba(143, 123, 255, 0.18);
}

select option { background: var(--panel-solid); }

.form-hint {
    font-size: 0.76rem;
    color: var(--faint);
    margin: 6px 0 0;
}

/* === MESSAGES === */
#message {
    margin-top: 1.5rem;
    padding: 12px;
    border-radius: var(--radius-sm);
    text-align: center;
    display: none;
    font-size: 0.9rem;
}

.success {
    background: rgba(52, 211, 153, 0.12);
    color: var(--ok);
    border: 1px solid rgba(52, 211, 153, 0.6);
}

.error {
    background: rgba(248, 113, 113, 0.12);
    color: var(--bad);
    border: 1px solid rgba(248, 113, 113, 0.6);
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 1.6rem 1rem;
    font-size: 0.9rem;
}
.empty-state.error-text { color: var(--bad); }

/* === WARNING / NOTE BOX === */
.warning-box,
.note-box {
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
    padding: 10px 12px;
    font-size: 0.8rem;
    margin-top: 10px;
    color: #d6d0ff;
    border-radius: 0 8px 8px 0;
}

/* === LOADERS === */
.spinner-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    border-top: 3px solid #fff;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.loading {
    text-align: center;
    padding: 1.4rem;
    color: var(--faint);
}
.loading::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(143, 123, 255, 0.25);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === CONTEXT LINKS UNDER A PAGE (register / change password) === */
.footer-nav {
    margin-top: 1.4rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.nav-link {
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    color: var(--text);
    background: rgba(15, 15, 22, 0.75);
    border: 1px solid var(--line-strong);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.nav-link:hover {
    background: var(--accent-soft);
    border-color: var(--accent-line);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

/* === FOOTER === */
.site-footer {
    background: rgba(5, 5, 8, 0.92);
    border-top: 1px solid var(--line);
    font-size: 0.87rem;
    color: var(--muted);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 16px 26px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 28px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-col a:not(.brand):not(.social-btn) { color: var(--muted); }
.footer-col a:not(.brand):not(.social-btn):hover { color: #fff; text-decoration: none; }

.footer-about p { margin: 8px 0 0; max-width: 360px; line-height: 1.6; }
.footer-tagline { color: var(--accent-hi); font-weight: 500; }

.footer-title {
    color: var(--text);
    font-weight: 600;
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.footer-social { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.footer-bottom {
    border-top: 1px solid var(--line);
    padding: 14px 16px 18px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--faint);
}
.footer-bottom a { color: var(--faint); }
.footer-bottom a:hover { color: var(--accent-hi); text-decoration: none; }
.footer-bottom .sep { margin: 0 8px; }

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    background: rgba(88, 101, 242, 0.16);
    border: 1px solid rgba(88, 101, 242, 0.5);
}
.social-btn:hover { background: rgba(88, 101, 242, 0.3); text-decoration: none; }
.social-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* === TABLES (rankings, top 10) === */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
}

th {
    text-align: left;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    padding: 12px;
    border-bottom: 1px solid var(--line-strong);
    white-space: nowrap;
}

td {
    padding: 11px 12px;
    font-size: 0.92rem;
    border-bottom: 1px solid var(--line);
}

th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { white-space: nowrap; }

.master-level { text-align: center; }

td.master-level {
    color: var(--ml);
    font-weight: 600;
}

tbody tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(143, 123, 255, 0.05); }

.char-name {
    font-weight: 600;
    color: #fff;
}

.rank-number {
    color: var(--muted);
    font-weight: 700;
    width: 30px;
    font-variant-numeric: tabular-nums;
}

/* podium colours */
.rank-1 .rank-number, .rank-medal.m1 { color: #fcd34d; }
.rank-2 .rank-number, .rank-medal.m2 { color: #e5e7eb; }
.rank-3 .rank-number, .rank-medal.m3 { color: #f0a46b; }

.reset-badge {
    background: var(--accent-soft);
    color: var(--accent-hi);
    border: 1px solid var(--accent-line);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: 10px;
    display: inline-block;
    vertical-align: middle;
    letter-spacing: 0.04em;
}

#rankingBody tr:nth-child(1) .char-name {
    color: #fcd34d;
    text-shadow: 0 0 10px rgba(252, 211, 77, 0.4);
}

/* characters who reached the server reset cap (muConfig.maxResets) get a glowing
   reset badge; rank #1 is marked separately by its highlighted character name */
.reset-badge.max-reset {
    background: rgba(143, 123, 255, 0.3);
    border-color: var(--accent-hi);
    color: #fff;
    box-shadow: 0 0 10px var(--accent-glow);
}

.table-loader {
    text-align: center;
    padding: 20px;
    color: var(--accent-hi);
}

/* === SHARED BITS: class badge, guild mark, online dot, links, tags === */
.cls {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 20px;
    padding: 0 6px;
    border-radius: 5px;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fff;
    background: #444;
    vertical-align: middle;
    text-transform: uppercase;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.cls-dk  { background: #7f1d1d; color: #fecaca; }
.cls-dw  { background: #1e3a8a; color: #bfdbfe; }
.cls-elf { background: #14532d; color: #bbf7d0; }
.cls-mg  { background: #581c87; color: #e9d5ff; }
.cls-dl  { background: #7c2d12; color: #fed7aa; }
.cls-sum { background: #831843; color: #fbcfe8; }
.cls-rf  { background: #713f12; color: #fef08a; }

.class-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #b5b5c4;
    font-size: 0.86rem;
}

.guild-mark {
    display: inline-block;
    vertical-align: middle;
    image-rendering: pixelated;
    border: 1px solid var(--line-strong);
    background: rgba(0, 0, 0, 0.6);
    border-radius: 3px;
    flex-shrink: 0;
}

.guild-cell {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.char-link, .guild-link {
    color: #fff;
    font-weight: 600;
}
.char-link:hover, .guild-link:hover { color: var(--accent-hi); }

.online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 6px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.8);
    vertical-align: middle;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.07);
    color: #ccc;
}
.tag-accent { background: var(--accent-soft); color: var(--accent-hi); }
.tag-red { background: rgba(248, 113, 113, 0.14); color: #fca5a5; }
.tag-green { background: rgba(52, 211, 153, 0.12); color: var(--ok); }
.tag-blue { background: rgba(96, 165, 250, 0.14); color: #93c5fd; }
.tag-gold { background: rgba(252, 211, 77, 0.14); color: #fcd34d; }

/* === TABS / CHIPS === */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.tabs button,
.chips button {
    width: auto;
    margin: 0;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
    transform: none;
    filter: none;
}

.tabs button {
    flex: 1 1 auto;
    padding: 9px 14px;
    border-radius: 9px;
    font-size: 0.84rem;
}
.tabs button:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); transform: none; box-shadow: none; filter: none; }
.tabs button.active {
    color: #fff;
    background: var(--accent-soft);
    border-color: var(--accent-line);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chips button {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.76rem;
    border-color: var(--line-strong);
}
.chips button:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.3); transform: none; box-shadow: none; filter: none; }
.chips button.active { color: #fff; background: var(--accent-lo); border-color: var(--accent); }

/* === SERVER STATUS DOT === */
.server-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: -10px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--muted);
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #555;
    display: inline-block;
    flex-shrink: 0;
    transition: background 0.3s;
}

#statusText { line-height: 1; }

.status-dot.online {
    background: var(--ok);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
    animation: pulse 2.4s infinite;
}

.status-dot.offline {
    background: var(--bad);
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.6);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* === ARMORY / CHARACTER PROFILE === */
.armory-search {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 1.8rem;
}

.armory-search input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: 320px;
    font-size: 1rem;
}

.armory-search button {
    flex: 0 0 auto;
    width: auto;
    margin-top: 0;
    padding: 12px 22px;
    white-space: nowrap;
}

.armory-content {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.armory-char {
    flex: 0 0 290px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.2rem;
    text-align: center;
}

.armory-char-image {
    width: 100%;
    max-width: 150px;
    height: auto;
    opacity: 0.9;
}

.armory-char-name {
    color: #fff;
    font-family: var(--font-head);
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 0.5rem;
    word-break: break-word;
}

.armory-char-class {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0.3rem 0 0.9rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.armory-char-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9rem;
    color: var(--text);
}

.armory-char-stats b { color: #fff; }

.armory-equip {
    flex: 1;
    min-width: 0;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.armory-doll {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 460px;
}

.armory-slot {
    position: relative;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.armory-slot.filled {
    border-color: var(--accent-line);
    background: radial-gradient(circle at 50% 45%, rgba(143, 123, 255, 0.16), rgba(0, 0, 0, 0.35) 70%);
    cursor: help;
}

.armory-slot img {
    max-width: 86%;
    max-height: 86%;
    object-fit: contain;
    image-rendering: pixelated;
}

.armory-slot img.img-missing { visibility: hidden; }

.armory-slot .slot-label {
    color: #4d4d5c;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.armory-slot .badge {
    position: absolute;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 4px;
    line-height: 1.2;
}

.armory-slot .badge.exc { top: 3px; left: 3px; background: rgba(52, 211, 153, 0.9); color: #052e1c; }
.armory-slot .badge.anc { top: 3px; right: 3px; background: rgba(252, 211, 77, 0.92); color: #2a2100; }
.armory-slot .badge.sock { bottom: 3px; right: 3px; background: rgba(167, 139, 250, 0.92); color: #1e1240; }

.armory-message {
    text-align: center;
    color: var(--muted);
    padding: 1rem;
}

.armory-message.error { color: var(--bad); }

/* Themed item tooltip */
.item-tooltip {
    display: none;
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    max-width: 320px;
    padding: 10px 13px;
    background: rgba(12, 12, 18, 0.97);
    border: 1px solid var(--accent-line);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.75), 0 0 24px rgba(143, 123, 255, 0.15);
    font-size: 0.8rem;
    line-height: 1.55;
    color: #cfcfda;
}

.item-tooltip .tip-head {
    color: #fff;
    font-weight: 700;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--line-strong);
}

.item-tooltip .tip-line.opt { color: #7cb8ff; }
.item-tooltip .tip-line.exc { color: #4ade80; }
.item-tooltip .tip-line.skill { color: #ffffff; }
.item-tooltip .tip-line.sock { color: #c4b5fd; }

/* === RESPONSIVE === */
@media (max-width: 1180px) {
    .nav-toggle { display: flex; }

    .nav-panel {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 16px 16px;
        background: rgba(8, 8, 12, 0.98);
        border-bottom: 1px solid var(--accent-line);
        box-shadow: 0 18px 30px rgba(0, 0, 0, 0.6);
        max-height: calc(100vh - var(--header-h));
        overflow-y: auto;
    }
    .nav-open .nav-panel { display: flex; }

    .site-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .site-nav a {
        padding: 13px 6px;
        border-bottom: 1px solid var(--line);
        border-radius: 0;
        font-size: 0.95rem;
    }
    .site-nav a.active::after { display: none; }
    .site-nav a.active { box-shadow: inset 3px 0 0 var(--accent); padding-left: 12px; }

    .header-actions {
        padding-top: 14px;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .footer-inner { grid-template-columns: 1fr 1fr 1fr; }
    .footer-about { grid-column: 1 / -1; }
}

/* armory paper-doll stacks earlier (720px) than the phone breakpoint */
@media (max-width: 720px) {
    .armory-content { flex-direction: column; }
    .armory-char {
        flex: none;
        width: 100%;
    }
}

@media (max-width: 600px) {
    body { font-size: 14px; }

    .site-main { padding: 20px 12px 40px; }

    .panel,
    .container { padding: 1.25rem; }
    .panel > .page-head.art:first-child { margin: -1.25rem -1.25rem 1.4rem; padding: 2.2rem 1.25rem 1.5rem; }
    .page-head.art { padding: 2rem 1rem 1.5rem; }

    h2,
    .page-head h1 {
        font-size: 1.4rem;
        margin-bottom: 1.2rem;
        word-break: break-word;
    }

    .wordmark { font-size: 1.02rem; letter-spacing: 0.26em; }

    .nav-link { padding: 8px 14px; font-size: 0.78rem; }

    th, td { padding: 8px 6px; font-size: 0.82rem; }

    .reset-badge { margin-left: 6px; padding: 1px 5px; font-size: 0.65rem; }

    .footer-inner { grid-template-columns: 1fr 1fr; gap: 20px; }

    .hide-sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
