/*
 * Base layout and components.
 * Colors and fonts come from the variables of the theme (wwwroot/themes/<name>/theme.css).
 * The theme also assigns the images in its own rules, because relative url() values
 * in variables would be resolved relative to this file instead of the theme folder.
 */

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

html { color-scheme: dark; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg-color);
    background-position: center top;
    background-size: cover;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

a { color: var(--link); text-decoration: none; transition: color .15s; }
a:hover { color: var(--link-hover); }

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--heading);
    line-height: 1.25;
}

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

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

::selection { color: var(--bg-color); background: var(--accent); }

.skip-link {
    position: absolute;
    left: 16px;
    top: -48px;
    z-index: 20;
    padding: 8px 14px;
    color: var(--bg-color);
    background: var(--accent);
    font-weight: 700;
}

.skip-link:focus { top: 8px; color: var(--bg-color); }

/* ---------- Top bar ---------- */

/* The status bar and the top bar stay on top of the page while scrolling. */
:root { --header-height: 100px; }
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar {
    position: relative;
    z-index: 10;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--line-strong);
    box-shadow: 0 2px 16px rgb(0 0 0 / .6);
    backdrop-filter: blur(6px);
}

.topbar-inner {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 0 16px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent);
    text-shadow: var(--glow);
    white-space: nowrap;
}

.brand img { display: block; height: 44px; width: auto; }

.nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav > a, .nav-form button {
    font-family: var(--font-display);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text);
    padding: 8px 12px;
    border-bottom: 2px solid transparent;
}

.nav > a:hover, .nav > a.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.nav > a.btn { border-bottom: 0; color: var(--btn-text); margin-left: 8px; padding: .9em 2.8em; }

.nav-form { margin: 0; }
.nav-form button { background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; }
.nav-form button:hover { color: var(--accent); }

.nav-toggle, .nav-toggle-button { display: none; }

@media (max-width: 860px) {
    .nav-toggle-button {
        display: block;
        margin-left: auto;
        width: 40px;
        height: 40px;
        cursor: pointer;
        position: relative;
    }

    .nav-toggle-button span,
    .nav-toggle-button span::before,
    .nav-toggle-button span::after {
        position: absolute;
        left: 8px;
        right: 8px;
        height: 2px;
        background: var(--accent);
        content: "";
    }

    .nav-toggle-button span { top: 19px; }
    .nav-toggle-button span::before { top: -8px; left: 0; right: 0; }
    .nav-toggle-button span::after { top: 8px; left: 0; right: 0; }

    .nav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        padding: 8px 16px 16px;
        background: var(--topbar-bg);
        border-bottom: 1px solid var(--line-strong);
    }

    .nav-toggle:checked ~ .nav { display: flex; }
    .nav > a.btn { margin: 8px 0 0; text-align: center; }
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 16px;
    background-color: var(--bg-color);
    background-position: var(--hero-position, center);
    background-size: cover;
    background-repeat: no-repeat;
    border-bottom: 1px solid var(--line-strong);
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--hero-overlay);
    pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; }

.hero-title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.1;
    font-size: clamp(2.2rem, 6vw, 4rem);
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--accent);
    text-shadow: var(--glow), 0 4px 12px rgb(0 0 0 / .9);
}

@supports (background-clip: text) {
    .hero-title {
        background: var(--title-gradient, linear-gradient(var(--accent), var(--accent))) center / 100% 100%;
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        text-shadow: none;
        filter: drop-shadow(0 0 10px rgb(224 180 76 / .35)) drop-shadow(0 4px 6px rgb(0 0 0 / .9));
    }
}

.hero-tagline {
    margin: 8px 0 24px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text);
    text-shadow: 0 2px 6px rgb(0 0 0 / .9);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.hero-logo img { display: block; width: min(var(--hero-logo-width, 520px), 86vw); height: auto; margin: 0 auto; filter: drop-shadow(0 8px 24px rgb(0 0 0 / .75)); }
.hero-compact .hero-logo img { width: min(var(--hero-logo-compact-width, 300px), 70vw); }

.hero-facts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    margin: 28px auto 0;
    padding: 0;
    list-style: none;
    background: rgb(7 6 10 / .55);
    border: 1px solid var(--line-strong);
    backdrop-filter: blur(4px);
    width: fit-content;
}

.hero-facts li {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 110px;
    padding: 10px 18px;
}

.hero-facts li + li { border-left: 1px solid var(--line); }

.hero-facts strong {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--heading);
    line-height: 1.2;
}

.hero-facts span {
    font-size: .7rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Glowing sparks rising over the banner of the start page. */
.embers { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }

.embers span {
    position: absolute;
    bottom: -10px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--ember-color, #ffc865);
    box-shadow: 0 0 6px 2px var(--ember-glow, rgb(255 160 60 / .7));
    opacity: 0;
    animation: ember 9s linear infinite;
}

.embers span:nth-child(4n) { width: 3px; height: 3px; }
.embers span:nth-child(5n) { width: 5px; height: 5px; }
.embers span:nth-child(1) { left: 6%; animation-delay: 0s; }
.embers span:nth-child(2) { left: 14%; animation-delay: 3.2s; animation-duration: 11s; }
.embers span:nth-child(3) { left: 21%; animation-delay: 6.1s; }
.embers span:nth-child(4) { left: 28%; animation-delay: 1.4s; animation-duration: 12s; }
.embers span:nth-child(5) { left: 35%; animation-delay: 4.8s; }
.embers span:nth-child(6) { left: 42%; animation-delay: 7.5s; animation-duration: 10s; }
.embers span:nth-child(7) { left: 49%; animation-delay: 2.3s; }
.embers span:nth-child(8) { left: 56%; animation-delay: 5.6s; animation-duration: 13s; }
.embers span:nth-child(9) { left: 63%; animation-delay: .8s; }
.embers span:nth-child(10) { left: 70%; animation-delay: 3.9s; animation-duration: 11s; }
.embers span:nth-child(11) { left: 77%; animation-delay: 6.7s; }
.embers span:nth-child(12) { left: 84%; animation-delay: 2.9s; animation-duration: 12s; }
.embers span:nth-child(13) { left: 91%; animation-delay: 5.1s; }
.embers span:nth-child(14) { left: 96%; animation-delay: 8.2s; animation-duration: 10s; }
.embers span:nth-child(15) { left: 10%; animation-delay: 7.9s; animation-duration: 14s; }
.embers span:nth-child(16) { left: 67%; animation-delay: 9.4s; animation-duration: 12s; }

@keyframes ember {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: .9; }
    50% { transform: translate(18px, -45vh); opacity: .7; }
    100% { transform: translate(-12px, -90vh); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .embers { display: none; }
    *, *::before, *::after { transition-duration: 0s !important; }
}

.hero:not(.hero-compact) { min-height: 460px; }
.hero-compact { min-height: 0; padding: 32px 16px; }
.hero-compact .hero-title { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.hero-compact .hero-tagline { margin-bottom: 0; }

@media (max-width: 600px) {
    /* On phones the banner is shown in full width at its own aspect ratio (--hero-ratio)
       with the title on it, and the buttons go below the image instead of stretching it. */
    .hero {
        display: block;
        min-height: 0;
        padding: 0 16px calc(24px + var(--band-height, 0px) / 2);
        background-size: 100% auto;
        background-position: center top;
    }

    .hero:not(.hero-compact) { min-height: 0; }

    .hero::after {
        bottom: auto;
        height: calc(100vw / var(--hero-ratio, 2.5));
        background: linear-gradient(180deg, rgb(7 6 10 / .35) 0%, rgb(7 6 10 / .2) 55%, var(--bg-color) 100%);
    }

    .hero-inner { display: flex; flex-direction: column; align-items: center; }

    .hero-title, .hero-tagline {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hero-title { min-height: calc(100vw / var(--hero-ratio, 2.5) * .62); padding-top: 12px; font-size: clamp(1.8rem, 9vw, 2.6rem); }
    .hero-logo img { width: 72vw; }
    .hero-tagline { margin: 0 0 20px; font-size: .8rem; letter-spacing: .12em; }
    .hero-actions { width: 100%; max-width: 360px; flex-wrap: nowrap; gap: 10px; }
    .hero-actions .btn { flex: 1; padding-inline: 2.3em; font-size: .72rem; letter-spacing: .06em; }
    .hero-facts { width: 100%; max-width: 360px; margin-top: 18px; }
    .hero-facts li { flex: 1 1 50%; min-width: 0; padding: 8px; }
    .hero-facts li + li { border-left: 0; }
    .hero-facts li:nth-child(even) { border-left: 1px solid var(--line); }
    .hero-facts li:nth-child(n + 3) { border-top: 1px solid var(--line); }
    .hero-facts strong { font-size: 1.05rem; }
    .embers { height: calc(100vw / var(--hero-ratio, 2.5)); }
    .hero-compact { padding-bottom: calc(14px + var(--band-height, 0px) / 2); }
    .hero-compact .hero-tagline { min-height: 0; margin-bottom: 0; }
    .page { padding: 20px 12px; gap: 16px; }
    .content, .sidebar { gap: 16px; }
    .panel { padding: 16px; }
}

/* ---------- Decorative band ---------- */

/* A horizontally repeated strip between banner and content and above the footer.
   A theme without a band image leaves --band-height at 0. */
.band {
    position: relative;
    z-index: 1;
    height: var(--band-height, 0);
    margin-block: calc(var(--band-height, 0px) / -2);
    background-repeat: repeat-x;
    background-position: center;
    background-size: var(--band-tile-size, auto 100%);
    filter: drop-shadow(0 4px 8px rgb(0 0 0 / .7));
    pointer-events: none;
}

/* ---------- Page layout ---------- */

.page {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 32px 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
}

.content { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.sidebar { display: flex; flex-direction: column; gap: 24px; }

@media (max-width: 960px) {
    .page { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Panels ---------- */

.panel {
    position: relative;
    padding: 20px 22px;
    background: var(--panel-bg);
    border-style: solid;
    border-width: var(--panel-frame-width);
    border-color: var(--line-strong);
    border-image-slice: var(--panel-frame-slice);
    border-image-width: var(--panel-frame-image-width, var(--panel-frame-width));
    border-image-repeat: stretch;
    box-shadow: 0 8px 24px rgb(0 0 0 / .5);
}

.panel-title {
    margin: -4px 0 16px;
    padding-bottom: var(--divider-space, 14px);
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: .14em;
    text-align: center;
    background-position: center bottom;
    background-size: var(--divider-size);
    background-repeat: no-repeat;
}

.content .panel-title { font-size: 1.3rem; }

.panel-footer { margin: 12px 0 0; text-align: center; font-size: .9rem; }
.panel > :last-child { margin-bottom: 0; }

/* ---------- Buttons ---------- */

.btn, button[type="submit"]:not(.nav-form button) {
    /* The height is always 3em (line-height + vertical padding), so that the button image
       keeps its proportions; the sizes below only change the font size. */
    display: inline-block;
    padding: .9em 2.6em;
    font-family: var(--font-display);
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
    color: var(--btn-text);
    background: var(--btn-bg);
    /* No border shorthand here: it would reset the border image of the theme. */
    border-style: solid;
    border-width: 0;
    border-image-slice: var(--btn-frame-slice) fill;
    border-image-width: var(--btn-frame-width);
    border-image-repeat: stretch;
    cursor: pointer;
    transition: filter .15s, transform .05s;
    text-shadow: var(--btn-text-shadow);
}

.btn:hover, button[type="submit"]:not(.nav-form button):hover { color: var(--btn-text); filter: brightness(1.15); }
.btn:active, button[type="submit"]:not(.nav-form button):active { transform: translateY(1px); }

.btn-secondary, button.btn-secondary[type="submit"]:not(.nav-form button) {
    color: var(--btn-secondary-text);
    background: var(--btn-secondary-bg);
}

.btn-secondary:hover, button.btn-secondary[type="submit"]:not(.nav-form button):hover { color: var(--btn-secondary-text); }
.btn-large { font-size: 1rem; }
.btn-small { font-size: .75rem; }
.btn-block { display: block; width: 100%; }
.sidebar .btn-block { font-size: .8rem; letter-spacing: .06em; padding-inline: 2.3em; }

/* ---------- Forms ---------- */

.form { display: flex; flex-direction: column; gap: 6px; max-width: 380px; }
.content .form { margin: 0 auto; }
.form-compact { max-width: none; }

.form label {
    margin-top: 8px;
    font-family: var(--font-display);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.form input {
    padding: 10px 12px;
    font: inherit;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--line);
    box-shadow: inset 0 2px 6px rgb(0 0 0 / .6);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.form input:focus { border-color: var(--accent); box-shadow: inset 0 2px 6px rgb(0 0 0 / .6), 0 0 0 1px var(--accent), var(--glow); }
.form button[type="submit"] { margin-top: 16px; }
.form small { font-size: .8rem; }
.form input::placeholder { color: var(--text-muted); opacity: .7; }
.form input[aria-invalid="true"], .input-validation-error { border-color: var(--danger); }

.password-field { position: relative; display: block; }
.password-field input { width: 100%; padding-right: 44px; }

.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    width: 32px;
    height: 32px;
    transform: translateY(-50%);
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--text-muted);
}

.password-toggle:hover, .password-toggle[aria-pressed="true"] { color: var(--accent); }

/* An eye, drawn with the text color. */
.password-toggle::before {
    content: "";
    position: absolute;
    inset: 9px 6px;
    border: 2px solid currentColor;
    border-radius: 75% 15%;
    transform: rotate(45deg);
}

.password-toggle::after {
    content: "";
    position: absolute;
    left: 13px;
    top: 13px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

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

.error, .field-validation-error { color: var(--danger); font-size: .9rem; }
.error ul { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none; }
.success { color: var(--success); }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; }

.table th {
    padding: 10px 12px;
    font-family: var(--font-display);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-align: left;
    color: var(--accent);
    border-bottom: 1px solid var(--line-strong);
    white-space: nowrap;
}

.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody tr:nth-child(even) { background: var(--row-alt); }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--row-hover); box-shadow: inset 2px 0 0 var(--accent); }
.table tbody tr:nth-child(-n + 3) .name { color: var(--accent); }
.table .name small { display: none; font-weight: 400; font-size: .78rem; color: var(--text-muted); }

@media (max-width: 600px) {
    .table th, .table td { padding: 8px 6px; }
    .table .hide-sm { display: none; }
    .table .name small.show-sm { display: block; }
}

/* ---------- Ranking toolbar ---------- */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.tabs { display: flex; border: 1px solid var(--line-strong); }

.tabs a {
    padding: 8px 18px;
    font-family: var(--font-display);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text);
}

.tabs a + a { border-left: 1px solid var(--line-strong); }
.tabs a:hover { color: var(--accent); }
.tabs a.is-active { color: var(--bg-color); background: var(--rank-1); }

.search {
    flex: 0 1 240px;
    min-width: 0;
    padding: 8px 12px;
    font: inherit;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--line);
    outline: none;
}

.search:focus { border-color: var(--accent); box-shadow: var(--glow); }
.filter-empty { text-align: center; margin: 16px 0 0; }

@media (max-width: 600px) {
    .tabs, .search { flex: 1 1 100%; }
    .tabs a { flex: 1; text-align: center; }
}
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .name { font-weight: 600; color: var(--heading); }
.table .party { white-space: normal; }

/* ---------- Chamber of Kundun ---------- */

.kundun-intro { text-align: center; margin: 0 0 16px; }
.kundun-heading { margin: 20px 0 8px; font-size: 1rem; text-transform: uppercase; letter-spacing: .1em; }

/* ---------- Ranks ---------- */

.rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .85rem;
    color: var(--text-muted);
    border: 1px solid var(--line);
}

.rank-1 { color: #1a1206; background: var(--rank-1); border-color: var(--rank-1); }
.rank-2 { color: #15161a; background: var(--rank-2); border-color: var(--rank-2); }
.rank-3 { color: #160d06; background: var(--rank-3); border-color: var(--rank-3); }

.top-list { list-style: none; margin: 0; padding: 0; }

.top-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.top-list li:last-child { border-bottom: 0; }
.top-name { flex: 1; min-width: 0; font-weight: 600; color: var(--heading); overflow: hidden; text-overflow: ellipsis; }
.top-name small { display: block; font-weight: 400; font-size: .78rem; color: var(--text-muted); }
.top-value { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; }

/* ---------- Server status ---------- */

.status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: var(--input-bg);
    border: 1px solid var(--line);
}

.status-light { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.is-online .status-light { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-text { font-family: var(--font-display); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.is-online .status-text { color: var(--success); }
.is-offline .status-text { color: var(--danger); }
.status-count { margin-left: auto; color: var(--text-muted); }
.status-count strong { color: var(--heading); }

.facts { margin: 0 0 16px; }
.facts div { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; font-weight: 600; color: var(--heading); }

/* ---------- News ---------- */

.news-item + .news-item { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.news-meta { display: flex; gap: 10px; align-items: center; font-size: .8rem; color: var(--text-muted); }
.news-tag {
    padding: 2px 8px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.news-item h3 { margin: 6px 0 8px; font-size: 1.15rem; }
.news-item p { margin: 0 0 8px; }

/* ---------- Steps ---------- */

.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.steps li {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 14px 18px;
    margin-top: 18px;
    background: var(--input-bg);
    border: 1px solid var(--line);
    transition: border-color .2s, transform .2s;
}

.steps li:hover { border-color: var(--line-strong); transform: translateY(-2px); }

.step-number {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    color: #1a1206;
}

/* A gold diamond behind the number. */
.step-number::before {
    content: "";
    position: absolute;
    inset: 3px;
    z-index: -1;
    transform: rotate(45deg);
    background: var(--rank-1);
    box-shadow: 0 0 0 3px var(--bg-color), 0 0 0 4px var(--line-strong), var(--glow);
}

.steps h3 { margin: 4px 0 6px; font-size: 1rem; }
.steps p { flex: 1; margin: 0 0 14px; font-size: .9rem; color: var(--text-muted); }

@media (max-width: 700px) {
    /* One row per step: number, text, button. */
    .steps { grid-template-columns: minmax(0, 1fr); gap: 10px; }

    .steps li {
        display: grid;
        grid-template-columns: 36px minmax(0, 1fr);
        column-gap: 14px;
        align-items: center;
        text-align: left;
        margin-top: 0;
        padding: 12px;
    }

    .step-number { position: relative; top: auto; left: auto; transform: none; grid-row: span 3; }
    .steps h3 { margin: 0; }
    .steps p { margin: 2px 0 8px; font-size: .85rem; }
    .steps .btn { justify-self: start; }
}

/* ---------- Downloads ---------- */

.downloads { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.downloads li { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.download-help { margin: 28px 0 10px; font-size: 1.05rem; }
.download-steps { margin: 0 0 12px; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }

/* ---------- Auction and wallet ---------- */

.center { text-align: center; }
.sub-title { margin: 24px 0 12px; font-size: 1rem; letter-spacing: .12em; text-transform: uppercase; text-align: center; color: var(--heading); }

.notice { padding: 10px 14px; border: 1px solid; text-align: center; }
.notice-success { color: var(--success); border-color: color-mix(in srgb, var(--success) 45%, transparent); background: color-mix(in srgb, var(--success) 8%, transparent); }
.notice-error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 8%, transparent); }

.filter-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; margin: 12px 0 20px; }
.filter-bar input[type="search"], .filter-bar select, .form select, .form-inline input {
    padding: 8px 10px;
    font: inherit;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--line);
}
.filter-bar input[type="search"] { flex: 1 1 200px; min-width: 0; }
.filter-bar label { display: flex; align-items: center; gap: 6px; font-size: .9rem; }

.lot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.lot-card {
    display: flex;
    gap: 12px;
    height: 100%;
    padding: 12px;
    color: var(--text);
    background: var(--row-alt);
    border: 1px solid var(--line);
    transition: border-color .15s, background .15s;
}
a.lot-card:hover { color: var(--text); border-color: var(--line-strong); background: var(--row-hover); }
.lot-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.lot-price strong { color: var(--accent); font-size: 1.05rem; }
.lot-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .82rem; color: var(--text-muted); }
.lot-meta .link { color: var(--link); }
.lot-card-wrap { position: relative; }
.lot-flag { position: absolute; top: -8px; right: 8px; padding: 1px 8px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; background: var(--bg-color); border: 1px solid; }
.is-leading .lot-flag { color: var(--success); }
.is-outbid .lot-flag { color: var(--danger); }

.item-picture {
    flex: 0 0 72px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 45%, rgb(255 255 255 / .06), transparent 70%);
}
.item-picture img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lot-detail { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 16px; }
.lot-detail .item-picture { flex-basis: 140px; height: 190px; }
.lot-detail h2 { margin: 0 0 8px; font-size: 1.3rem; }

.item-name { font-family: var(--font-display); font-weight: 700; color: var(--heading); overflow-wrap: anywhere; }
.item-name.is-excellent { color: var(--item-excellent, #7ee07e); }
.item-name.is-ancient { color: var(--item-ancient, #5bc8f5); }
.item-options { margin: 0; padding: 0; list-style: none; font-size: .82rem; color: var(--item-option, #8fb6ff); }
.lot-detail .item-options { font-size: .95rem; margin-bottom: 12px; }

.lot-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 16px 32px; margin: 16px 0; }
.form-inline { max-width: 320px; margin: 0; }
.content .form-inline { margin: 0; }
.form select { padding: 10px 12px; }

.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 18px; }
.pager a { padding: 4px 10px; border: 1px solid var(--line); }
.pager a.is-active { color: var(--heading); border-color: var(--accent); }

.wallet-summary { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-bottom: 12px; }
.wallet-box { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 200px; padding: 12px 18px; border: 1px solid var(--line); background: var(--row-alt); }
.wallet-label { font-family: var(--font-display); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.wallet-value { font-size: 1.5rem; color: var(--accent); }
.table .positive { color: var(--success); }
.table .negative { color: var(--danger); }

@media (max-width: 600px) {
    .lot-detail { flex-direction: column; align-items: center; text-align: center; }
    .lot-grid { grid-template-columns: 1fr; }
}

/* ---------- Classes ---------- */

.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.class-card {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-small, 0);
    background: var(--bg-color);
}
.class-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.class-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgb(0 0 0 / .55) 62%, rgb(0 0 0 / .92) 100%); }
.class-card:hover img { transform: scale(1.05); }
.class-card-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 10px 12px; }
.class-card h3 { margin: 0; font-size: 1rem; color: var(--heading); }
.class-evolutions { margin: 2px 0 0; font-size: .72rem; color: var(--accent); }
.class-description { margin: 6px 0 0; font-size: .78rem; line-height: 1.4; color: var(--text); max-height: 0; overflow: hidden; opacity: 0; transition: max-height .3s ease, opacity .3s ease; }
.class-card:hover .class-description, .class-card:focus-within .class-description { max-height: 6em; opacity: 1; }

.class-avatar {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 18%;
    border: 1px solid var(--line-strong);
    background: var(--bg-color);
}
.char-cell { display: inline-flex; align-items: center; gap: 10px; }
.top-list .class-avatar { margin-right: 2px; }

@media (hover: none) {
    .class-description { max-height: none; opacity: 1; }
}

/* ---------- Footer ---------- */

.footer {
    padding: 24px 16px 32px;
    text-align: center;
    font-size: .85rem;
    border-top: 1px solid var(--line);
    background: var(--topbar-bg);
}

.footer p { margin: 4px 0; }

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 22px;
    margin-bottom: 14px;
    font-family: var(--font-display);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.footer-nav a { color: var(--text); }
.footer-nav a:hover { color: var(--accent); }

/* Storage: the vault in the game and the storage on the website as grids of 8 columns, like in the game. */
.small { font-size: .8rem; }

.balance-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 18px; }
.balance-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-small, 0);
    background: var(--row-alt);
    color: var(--text);
}
.balance-chip img { width: 26px; height: 26px; object-fit: contain; }
.balance-chip:hover { color: var(--text); border-color: var(--line-strong); background: var(--row-hover); }
.balance-chip.is-empty { opacity: .45; }
.balance-chip.is-selected { border-color: var(--accent); box-shadow: var(--glow); opacity: 1; }
.balance-zen .balance-label { color: var(--text-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }

.action-panel {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-small, 0);
    background: var(--row-alt);
}
.action-panel .item-picture { flex: 0 0 120px; height: 150px; }
.action-body { flex: 1; min-width: 0; }
.action-body h2 { margin: 0 0 2px; font-size: 1.15rem; }
.action-body > .muted { margin: 0 0 8px; }
.action-form { display: flex; flex-direction: column; gap: 6px; max-width: 420px; }
.action-form input { max-width: 160px; }
.action-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.action-buttons form { margin: 0; }

.storage-columns { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; }
.storage-column { display: flex; flex-direction: column; align-items: center; }
.storage-column .sub-title { margin-bottom: 2px; }
.storage-column > .muted { margin: 0 0 8px; }

.vault-grid {
    --cell: 36px;
    position: relative;
    display: grid;
    grid-template-columns: repeat(8, var(--cell));
    grid-template-rows: repeat(var(--rows, 15), var(--cell));
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-small, 0);
    background-color: rgb(0 0 0 / .35);
    background-image:
        linear-gradient(to right, var(--line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--line) 1px, transparent 1px);
    background-size: var(--cell) var(--cell);
}
.vault-grid.is-website { background-color: rgb(230 191 110 / .04); }

.vault-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1px;
    border: 1px solid rgb(255 255 255 / .12);
    border-radius: 4px;
    background: rgb(255 255 255 / .04);
    color: var(--text);
}
.vault-item img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }
.vault-item.is-excellent { border-color: color-mix(in srgb, var(--item-excellent, #7ee07e) 55%, transparent); background: color-mix(in srgb, var(--item-excellent, #7ee07e) 8%, transparent); }
.vault-item.is-ancient { border-color: color-mix(in srgb, var(--item-ancient, #5bc8f5) 55%, transparent); background: color-mix(in srgb, var(--item-ancient, #5bc8f5) 8%, transparent); }
.vault-item:hover, .vault-item:focus-visible { z-index: 2; border-color: var(--accent); background: var(--row-hover); color: var(--text); }
.vault-item.is-selected { z-index: 1; border-color: var(--accent); box-shadow: var(--glow); }
.vault-count {
    position: absolute;
    right: 2px;
    bottom: 0;
    font-size: .7rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 3px #000, 0 0 3px #000;
}

.vault-tip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    z-index: 10;
    display: none;
    flex-direction: column;
    gap: 1px;
    width: max-content;
    max-width: 260px;
    padding: 8px 10px;
    transform: translateX(-50%);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-small, 0);
    background: rgb(10 9 14 / .96);
    font-size: .8rem;
    text-align: center;
    pointer-events: none;
}
.vault-tip-option { color: var(--item-option, #9dbcff); }
.vault-item:hover .vault-tip, .vault-item:focus-visible .vault-tip { display: flex; }

.jewel-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.jewel-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-small, 0);
    background: var(--row-alt);
    color: var(--text);
    text-align: center;
}
.jewel-tile img { width: 40px; height: 40px; object-fit: contain; }
.jewel-tile-name { font-size: .85rem; }
.jewel-tile:hover { color: var(--text); border-color: var(--line-strong); background: var(--row-hover); }
.jewel-tile.is-selected { border-color: var(--accent); box-shadow: var(--glow); }

.exchange-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-bottom: 10px; }
.exchange-box { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-small, 0); background: var(--row-alt); }
.exchange-box .sub-title { margin-top: 0; }

@media (max-width: 600px) {
    .vault-grid { --cell: 34px; }
    .action-panel { flex-direction: column; align-items: center; text-align: center; }
    .action-form { margin: 0 auto; align-items: center; }
    .action-buttons { justify-content: center; }
}

/* Status bar above the top bar: server state and rates on the left, the user panel on the right. */
.statusbar {
    position: relative;
    z-index: 11;
    background: rgb(0 0 0 / .55);
    border-bottom: 1px solid var(--line);
    font-size: .8rem;
}
.statusbar-inner {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 0 16px;
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.server-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; min-width: 0; }
.server-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.server-state.is-online { color: var(--success); }
.server-state.is-offline { color: var(--danger); }
.server-state .status-light { width: 8px; height: 8px; }
.server-players { margin-left: 4px; color: var(--text-muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.server-players strong { color: var(--heading); }
.server-fact { white-space: nowrap; }
.server-fact strong { color: var(--heading); }
.server-info-link {
    padding: 2px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--accent);
}
.server-info-link:hover, .server-info-link.is-active { background: var(--accent-soft); color: var(--accent); }

.user-panel { margin-left: auto; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.user-panel .btn-small { padding: 4px 14px; font-size: .75rem; }
.user-login { color: var(--text); font-weight: 600; }
.user-login:hover { color: var(--accent); }

.user-coins {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--heading);
    font-weight: 600;
}
.user-coins:hover { border-color: var(--accent); color: var(--accent); }
.user-coins .coin-icon { width: 16px; height: 16px; margin: 0; }

/* the confirm window of the site instead of the browser's confirm() (26.11.2026, site.js) */
.confirm-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .6); }
.confirm-modal[hidden] { display: none; }
.confirm-box { width: 100%; max-width: 420px; padding: 22px 24px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel-bg); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.confirm-text { margin: 0 0 18px; color: var(--heading); line-height: 1.5; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.user-menu { position: relative; }
.user-menu > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--heading);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary::after { content: ""; width: 6px; height: 6px; margin-left: 2px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: translateY(-2px) rotate(45deg); }
.user-menu[open] > summary { background: var(--accent-soft); }
.user-icon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, var(--accent) 0 28%, transparent 30%), radial-gradient(circle at 50% 110%, var(--accent) 0 48%, transparent 50%);
}
.user-menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 30;
    display: flex;
    flex-direction: column;
    min-width: 190px;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-small, 0);
    background: rgb(14 13 19 / .98);
    box-shadow: 0 14px 30px rgb(0 0 0 / .5);
}
.user-menu-list a, .user-menu-list .nav-form button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--text);
    font: inherit;
    font-size: .85rem;
    text-align: left;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}
.user-menu-list a:hover, .user-menu-list .nav-form button:hover { background: var(--row-hover); color: var(--accent); }
.user-menu-list .nav-form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--line); }

@media (max-width: 700px) {
    .statusbar-inner { gap: 10px; }
    .server-fact { display: none; }
}

/* Amount pickers: "- step +" groups and MAX under an amount input. */
.amount-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.amount-step { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.amount-steps button {
    min-width: 28px;
    padding: 3px 8px;
    border: 0;
    background: var(--row-alt);
    color: var(--text);
    font: inherit;
    font-size: .78rem;
    line-height: 1.4;
    cursor: pointer;
}
.amount-steps button:hover { background: var(--accent-soft); color: var(--accent); }
.amount-step .amount-step-value { min-width: 44px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); color: var(--heading); font-weight: 700; }
.amount-steps .amount-max { border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); font-weight: 700; letter-spacing: .05em; }

/* Prices in several currencies. */
.jewel-icon { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; }
.lot-prices { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; }
.price-tag { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.price-tag strong { color: var(--heading); }
.buy-options { display: flex; flex-direction: column; gap: 8px; max-width: 520px; margin: 0 auto 14px; }
.buy-option { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-small, 0); background: var(--row-alt); }
.buy-option .price-tag { flex: 1; }
.buy-option form { margin: 0; }
.buy-option button[disabled] { opacity: .45; cursor: not-allowed; }
.price-set { margin: 8px 0; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: var(--radius-small, 0); }
.price-set legend { padding: 0 6px; color: var(--text-muted); font-size: .85rem; }
.price-jewels { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; margin-top: 10px; }
.price-jewel { display: flex; align-items: center; gap: 6px; margin: 0; }
.price-jewel input { width: 100%; min-width: 0; }

/* Auction search: the main filters in one row, the others under "More filters". */
.auction-filter { margin-bottom: 12px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-row .filter-search { flex: 1 1 160px; min-width: 140px; }
.filter-row select, .filter-row input { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-small, 0); background: var(--input-bg, rgb(0 0 0 / .3)); color: var(--text); font: inherit; font-size: .85rem; }
.filter-row label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: .85rem; color: var(--text-muted); }
.filter-row .filter-check { color: var(--text); }
.filter-row .filter-price { width: 140px; }
.filter-more { margin-top: 8px; }
.filter-more > summary { cursor: pointer; color: var(--accent); font-size: .85rem; margin-bottom: 8px; }
.filter-reset { font-size: .85rem; margin-left: auto; }

/* Market filter: compact chips instead of drop-downs. */
.market-filter { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.mf-top, .mf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mf-row { gap: 6px 14px; }
.mf-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.mf-search { flex: 1 1 200px; min-width: 160px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--input-bg, rgb(0 0 0 / .3)); color: var(--text); font: inherit; font-size: .85rem; }
.mf-seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; }
.mf-chip { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.mf-chip input { position: absolute; opacity: 0; pointer-events: none; }
.mf-chip > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 28px;
    padding: 3px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--row-alt);
    color: var(--text);
    font-size: .8rem;
    white-space: nowrap;
    transition: background .12s, border-color .12s, color .12s;
}
.mf-seg .mf-chip > span { border-color: transparent; background: none; }
.mf-chip:hover > span { border-color: var(--line-strong); color: var(--heading); }
.mf-chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.mf-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.mf-icon > span { min-width: 32px; padding: 2px 6px; }
.mf-icon img { width: 22px; height: 22px; object-fit: contain; border-radius: 50%; }
.mf-zen { font-size: .7rem; font-weight: 800; letter-spacing: .04em; color: #f1c95b; }
.mf-chip-exc > span { font-size: .75rem; }
.mf-label { color: var(--text-muted); font-size: .8rem; }
.mf-select select, .mf-price { padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--input-bg, rgb(0 0 0 / .3)); color: var(--text); font: inherit; font-size: .8rem; }
.mf-price { width: 120px; }
.mf-clear { font-size: .8rem; color: var(--danger); }
.mf-sell { margin-left: auto; }
.mf-found { margin: 0 0 10px; font-size: .85rem; color: var(--text-muted); }
.mf-found strong { color: var(--accent); }

.amount-steps .amount-reset { border: 1px solid var(--line); border-radius: 999px; color: var(--text-muted); }
.amount-preview { align-self: center; color: var(--accent); font-size: .8rem; font-weight: 700; }

/* Item tooltip like in the game. */
.item-tooltip { display: flex; flex-direction: column; gap: 1px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-small, 0); background: rgb(0 0 0 / .55); text-align: center; font-size: .85rem; line-height: 1.35; }
.tt-name { margin-bottom: 4px; font-weight: 700; font-size: 1rem; color: var(--heading); }
.tt-name.is-excellent { color: var(--item-excellent, #7ee07e); }
.tt-name.is-ancient { color: var(--item-ancient, #5bc8f5); }
.tt-line { color: #e9e6df; }
.tt-option { color: #6f9cff; }
.tt-gap { height: 8px; }
.lot-detail .item-tooltip { flex: 1; }
.action-body .item-tooltip { margin: 4px 0 10px; }
.vault-tip { padding: 0; border: 0; background: none; max-width: 300px; }
.vault-tip .item-tooltip { background: rgb(8 7 12 / .97); border-color: var(--line-strong); white-space: normal; }

/* Wallet jewels, per piece lots, sell mode. */
.wallet-jewels { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.wallet-jewel { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-small, 0); background: var(--row-alt); color: var(--text); }
.wallet-jewel:hover { color: var(--text); border-color: var(--line-strong); background: var(--row-hover); }
.wallet-jewel .wallet-jewel-name { flex: 1; font-size: .8rem; }
.wallet-jewel strong { color: var(--heading); }
.wallet-jewel.is-empty { opacity: .45; }
.lot-per-piece { color: var(--accent); }
.buy-quantity { max-width: 520px; margin: 0 auto 10px; }
.buy-quantity input { max-width: 160px; }
.sell-mode { margin: 8px 0 2px; flex-wrap: wrap; border-radius: var(--radius-small, 0); }
.mf-classes .mf-chip > span { font-weight: 600; }

.mf-exc-more { width: 100%; }
.mf-exc-more > summary { display: inline-block; cursor: pointer; padding: 3px 11px; border: 1px dashed var(--line-strong); border-radius: 999px; color: var(--accent); font-size: .8rem; list-style: none; }
.mf-exc-more > summary::-webkit-details-marker { display: none; }
.mf-exc-more[open] > summary { margin-bottom: 6px; background: var(--accent-soft); }
input[data-amount-field] { font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* Pages other than the start page have no banner; the content starts right below the top bar. */
.page-no-hero { padding-top: 24px; }

/* The own lots on the auction. */
.lot-card { position: relative; }
.lot-card.is-mine { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-soft); }
.lot-mine-badge { position: absolute; top: 6px; left: 6px; z-index: 1; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--btn-text, #1b1407); font-size: .7rem; font-weight: 800; letter-spacing: .03em; }
.wallet-jewels + .sub-title { margin-top: 18px; }

/* ---------- Wiki ---------- */

.mode-switch {
    display: inline-flex;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    overflow: hidden;
    margin-right: 6px;
}
.mode-switch a {
    padding: 2px 12px;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.mode-switch a + a { border-left: 1px solid var(--line-strong); }
.mode-switch a:hover { color: var(--accent); }
.mode-switch a.is-active { background: var(--accent-soft); color: var(--accent); }

.page-wide { max-width: calc(var(--page-width) + 220px); grid-template-columns: minmax(0, 1fr); }

.wiki { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.wiki-nav { position: sticky; top: calc(var(--header-height) + 16px); max-height: calc(100vh - var(--header-height) - 32px); overflow-y: auto; }
.wiki-list, .wiki-toc { list-style: none; margin: 0; padding: 0; }
.wiki-list > li > a {
    display: block;
    padding: 6px 10px;
    border-left: 2px solid transparent;
    color: var(--text);
}
.wiki-list > li > a:hover { color: var(--accent); background: var(--row-hover); }
.wiki-list > li.is-active > a { border-left-color: var(--accent); color: var(--accent); font-weight: 700; background: var(--accent-soft); }
.wiki-toc { margin: 4px 0 8px 14px; font-size: .85rem; }
.wiki-toc a { display: block; padding: 2px 8px; color: var(--text-muted); }
.wiki-toc a:hover { color: var(--accent); }

.wiki-article { min-width: 0; }

/* wiki containers: spoilers, tabs and the search box (WikiContainersExtension) */
.wiki-spoiler { margin: 6px 0 14px; border: 1px solid var(--line-strong); border-radius: 6px; background: rgb(255 255 255 / .02); }
.wiki-spoiler > summary { cursor: pointer; padding: 6px 12px; color: var(--accent); font-weight: 600; list-style: none; }
.wiki-spoiler > summary::-webkit-details-marker { display: none; }
.wiki-spoiler > summary::before { content: "▸"; display: inline-block; width: 1em; transition: transform .15s ease; }
.wiki-spoiler[open] > summary::before { transform: rotate(90deg); }
.wiki-spoiler > :not(summary) { margin-left: 12px; margin-right: 12px; }
.wiki-tabbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); }
.wiki-tabbar button { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer; font: inherit; }
.wiki-tabbar button:hover { color: var(--text); }
.wiki-tabbar button.is-active { border-color: var(--accent); color: var(--accent); background: rgb(255 196 58 / .08); }
.wiki-search { width: 100%; max-width: 360px; margin-top: 8px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: rgb(0 0 0 / .3); color: var(--text); font: inherit; }
.wiki-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.wiki-item > p { margin: 4px 0; }
.wiki-item img { height: 28px; vertical-align: middle; }
.wiki-facts { max-width: 420px; }
.wiki-nav .wiki-group { margin: 16px 0 4px; color: var(--text-muted); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.wiki-nav .wiki-group:first-of-type { margin-top: 4px; }
/* ::: brief - the short version at the top of an article */
.wiki-body .brief { margin: 4px 0 18px; padding: 10px 14px 10px 16px; border: 1px solid rgb(255 196 58 / .35); border-left: 3px solid var(--accent); border-radius: 6px; background: rgb(255 196 58 / .06); }
.wiki-body .brief::before { content: "In short"; display: block; margin-bottom: 4px; color: var(--accent); font-weight: 700; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }
.wiki-body .brief > ul { margin: 0; padding-left: 18px; }
.wiki-body .brief > ul > li { margin: 3px 0; }
.wiki-body .brief > p { margin: 4px 0; }
.wiki-body { overflow-wrap: anywhere; }
.wiki-body h2 { margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 1.25rem; }
.wiki-body h3 { margin: 22px 0 8px; font-size: 1.05rem; }
.wiki-body h2, .wiki-body h3 { scroll-margin-top: calc(var(--header-height) + 16px); }
.wiki-body blockquote { margin: 12px 0; padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--text); }
.wiki-body blockquote p { margin: 4px 0; }
.wiki-body hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.wiki-body code { padding: 1px 5px; border-radius: 4px; background: rgb(255 255 255 / .07); font-size: .9em; }
.wiki-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 12px 0; font-size: .9rem; }
.wiki-body th, .wiki-body td { padding: 6px 10px; border: 1px solid var(--line); text-align: left; white-space: nowrap; }
.wiki-body th { background: rgb(255 255 255 / .05); color: var(--heading); }
.wiki-body tr:hover td { background: var(--row-hover); }
.wiki-body ul, .wiki-body ol { padding-left: 22px; }
.wiki-body li { margin: 3px 0; }

.wiki-fold-summary { display: none; }
@media (max-width: 960px) {
    .wiki { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .panel.wiki-nav { position: static; max-height: none; padding: 0; }
    /* the list of articles folds into one line above the article (Pages/Wiki/Index.cshtml) */
    .wiki-fold-summary { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; }
    .wiki-fold-summary::-webkit-details-marker { display: none; }
    .wiki-fold-summary::after { content: "▾"; margin-left: auto; color: var(--accent); transition: transform .15s ease; }
    .wiki-fold[open] > .wiki-fold-summary::after { transform: rotate(180deg); }
    .wiki-fold-summary span { color: var(--text-muted); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
    .wiki-fold-summary strong { color: var(--accent); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .wiki-fold > :not(summary) { margin-left: 16px; margin-right: 16px; }
    .wiki-fold[open] { padding-bottom: 12px; }
    .wiki-fold .panel-title { display: none; }
}

/* ---------- Events ---------- */

.events-table td { vertical-align: middle; }
.event-status { white-space: nowrap; }
.event-status .status-light { display: inline-block; width: 8px; height: 8px; margin-right: 6px; background: var(--text-muted); box-shadow: none; }
.events-table tr.is-online .status-light { background: var(--success); box-shadow: 0 0 8px var(--success); }
.events-table tr.is-online .status-text { color: var(--success); font-weight: 700; }

/* ---------- Maps ---------- */

.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .9rem; color: var(--text-muted); }
.map-legend .map-dot { position: static; transform: none; margin-right: -8px; }
.map-view { position: relative; width: 100%; max-width: 768px; margin: 12px auto; aspect-ratio: 1; border: 1px solid var(--line-strong); }
.map-view img { display: block; width: 100%; height: 100%; image-rendering: auto; }
.map-spots { position: absolute; inset: 0; }
.map-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    padding: 0;
    border: 2px solid rgb(0 0 0 / .8);
    border-radius: 50%;
    background: #4fc3ff;
    box-shadow: 0 0 6px rgb(79 195 255 / .8);
    transform: translate(-50%, -50%);
    cursor: help;
}
.map-dot.is-occupied { background: #ff4a3d; box-shadow: 0 0 10px rgb(255 74 61 / .9); }
.map-dot:hover, .map-dot:focus-visible { width: 16px; height: 16px; z-index: 2; }
.map-tip {
    position: absolute;
    z-index: 3;
    transform: translate(12px, -50%);
    padding: 6px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: rgb(14 13 19 / .95);
    color: var(--text);
    font-size: .85rem;
    white-space: pre;
    pointer-events: none;
}

/* spot markers (SVG sprite on the maps page): normal gem, gold star for big spots (more than 5 monsters), boss */
.spot-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.map-spot {
    position: absolute;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    background: none;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 1px 2px rgb(0 0 0 / .9));
    cursor: help;
    transition: transform .12s ease;
}
.map-spot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.map-spot:hover, .map-spot:focus-visible { transform: translate(-50%, -50%) scale(1.35); z-index: 2; }
.map-spot.role-top { width: 22px; height: 22px; filter: drop-shadow(0 0 5px rgb(255 196 58 / .95)) drop-shadow(0 1px 2px rgb(0 0 0 / .9)); animation: spot-shine 2.4s ease-in-out infinite; }
.map-spot.role-warband { width: 22px; height: 22px; filter: drop-shadow(0 0 5px rgb(123 92 255 / .95)) drop-shadow(0 1px 2px rgb(0 0 0 / .9)); }
.map-spot.role-boss { width: 22px; height: 22px; filter: drop-shadow(0 0 5px rgb(239 59 44 / .9)) drop-shadow(0 1px 2px rgb(0 0 0 / .9)); }
.map-spot.is-occupied svg { opacity: .55; }
.map-spot.is-occupied::after {
    content: "";
    position: absolute;
    inset: -5px;
    border: 2px solid #ff4a3d;
    border-radius: 50%;
    box-shadow: 0 0 8px rgb(255 74 61 / .9);
}
.map-spot.is-legend { position: relative; display: inline-block; transform: none; vertical-align: middle; margin-right: -8px; cursor: default; animation: none; }
@keyframes spot-shine { 50% { filter: drop-shadow(0 0 9px rgb(255 214 90 / 1)) drop-shadow(0 1px 2px rgb(0 0 0 / .9)); } }
@media (prefers-reduced-motion: reduce) { .map-spot.role-top { animation: none; } .map-spot { transition: none; } }

.map-server { margin-bottom: 6px; }
.map-server > summary { cursor: pointer; padding: 6px 0; font-weight: 600; }
.map-server .wiki-list { margin-top: 4px; }
.map-server-state { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--text-muted); vertical-align: middle; }
.map-server-state.is-online { background: var(--success); }

.map-reqs { font-size: 0.85em; }

/* Account panel: the title with the button "Check spots" (spot map, premium accounts only) on the right. */
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-title-row h2 { margin: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.panel-title-row .spots-button { position: relative; padding: 4px 12px; letter-spacing: .03em; text-transform: none; white-space: nowrap; }
.spots-button.is-locked { opacity: .5; }
.spots-button.is-locked:hover, .spots-button.is-locked:focus-visible { opacity: 1; }
.spots-button[data-tooltip]:hover::after, .spots-button[data-tooltip]:focus-visible::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 5;
    width: max-content;
    max-width: 220px;
    padding: 8px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--bg-color);
    color: var(--text);
    font-size: .8rem;
    font-weight: 400;
    white-space: normal;
    text-align: left;
    box-shadow: 0 6px 18px rgb(0 0 0 / .5);
}

/* Events: a button next to the logo in the top bar; a click opens the list over the page (closed at first). */
.events-dropdown { position: relative; }
.events-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--input-bg, rgb(0 0 0 / .3));
    color: var(--heading, var(--text));
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .04em;
    white-space: nowrap;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: border-color .15s, background .15s;
}
.events-button::-webkit-details-marker { display: none; }
.events-button:hover, .events-dropdown[open] .events-button { border-color: var(--accent); background: var(--accent-soft, rgb(230 191 110 / .14)); }
.events-light { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.events-button.has-active .events-light { background: var(--success); box-shadow: 0 0 8px var(--success); animation: events-pulse 1.6s ease-in-out infinite; }
@keyframes events-pulse { 50% { opacity: .35; } }
.events-badge { padding: 1px 8px; border-radius: 999px; background: var(--success); color: #0b1a0f; font-size: .7rem; font-weight: 800; }
.events-next { color: var(--text-muted); font-weight: 600; }
.events-chevron { width: 7px; height: 7px; margin-left: 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.events-dropdown[open] .events-chevron { transform: translateY(2px) rotate(225deg); }

.events-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 30;
    width: min(440px, calc(100vw - 32px));
    max-height: min(70vh, 520px);
    overflow-y: auto;
    padding: 16px 18px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-small, 8px);
    background: var(--bg-color);
    box-shadow: 0 16px 40px rgb(0 0 0 / .6);
    animation: events-open .15s ease-out;
}
@keyframes events-open { from { opacity: 0; transform: translateY(-6px); } }
.events-title { margin: 0 0 10px; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; color: var(--heading, var(--text)); }
.events-list { margin: 0; padding: 0; list-style: none; }
.events-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: .85rem; }
.events-list li:first-child { border-top: 0; }
.events-list .status-light { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.events-list li.is-online .status-light { background: var(--success); box-shadow: 0 0 8px var(--success); }
.events-list li.is-online .status-text { color: var(--success); font-weight: 700; }
.events-name small { display: block; color: var(--text-muted); font-size: .75rem; }
.events-when { text-align: right; font-size: .8rem; }
.events-footer { margin: 10px 0 0; font-size: .8rem; text-align: center; }

@media (max-width: 760px) {
    .events-next { display: none; }
    .events-panel { left: -8px; }
}

/* Kundun ranking: the party leader with a "Party · N" chip; hover or focus shows the members (class, resets at the kill). */
.kundun-party { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kundun-leader { font-weight: 700; color: var(--heading, var(--text)); }
.kundun-leader small, .party-card-name small { display: block; font-weight: 400; font-size: .75rem; color: var(--text-muted); }
.party-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--accent-soft, rgb(230 191 110 / .14));
    color: var(--accent);
    font-size: .75rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: help;
    outline: none;
}
.party-chip:hover, .party-chip:focus-visible, .party-chip:focus { border-color: var(--accent); }
.party-chip-icon { width: 12px; height: 10px; background: currentColor; -webkit-mask: radial-gradient(circle at 30% 28%, #000 2px, transparent 2.5px), radial-gradient(circle at 72% 28%, #000 2px, transparent 2.5px), radial-gradient(ellipse at 30% 100%, #000 3.5px, transparent 4px), radial-gradient(ellipse at 72% 100%, #000 3.5px, transparent 4px); mask: radial-gradient(circle at 30% 28%, #000 2px, transparent 2.5px), radial-gradient(circle at 72% 28%, #000 2px, transparent 2.5px), radial-gradient(ellipse at 30% 100%, #000 3.5px, transparent 4px), radial-gradient(ellipse at 72% 100%, #000 3.5px, transparent 4px); }
.party-card {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    z-index: 15;
    width: max-content;
    min-width: 230px;
    max-width: min(320px, calc(100vw - 32px));
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-small, 8px);
    background: var(--bg-color);
    box-shadow: 0 14px 34px rgb(0 0 0 / .6);
    color: var(--text);
    font-weight: 400;
    white-space: normal;
    transform: translateX(-50%);
    cursor: default;
}
.party-chip:hover .party-card, .party-chip:focus .party-card, .party-chip:focus-within .party-card { display: block; animation: events-open .12s ease-out; }
.party-card-title { display: block; margin-bottom: 6px; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.party-card-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: .85rem; }
.party-card-row:first-of-type { border-top: 0; }
.party-card-row .class-avatar { width: 28px; height: 28px; margin: 0; }
.party-card-name { font-weight: 700; color: var(--heading, var(--text)); }
.party-card-leader { margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--btn-text, #1b1407); font-size: .65rem; font-weight: 800; vertical-align: 1px; }
.party-card-resets { color: var(--accent); font-weight: 700; white-space: nowrap; }
.party-card-hint { display: block; margin-top: 6px; font-size: .7rem; color: var(--text-muted); }
/* The party card must not be cut by the scrolling table wrapper (the Kundun tables are narrow). */
@media (min-width: 761px) { .table-wrap:has(.party-chip) { overflow: visible; } }
.price-per-piece { margin-left: 6px; font-size: .75rem; }

/* Wiki pictures: items and classes in tables (Items, Potions, Jewels, Classes) - small and in line with the text. */
.wiki-body img { max-width: 100%; }
.wiki-body td img { height: 28px; width: auto; max-width: 48px; object-fit: contain; vertical-align: middle; margin-right: 4px; }
.wiki-body td img[src*="/img/classes/"] { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; border: 1px solid var(--line-strong); }
.wiki-body td { vertical-align: middle; }

/* links of the wiki to the database (WikiLinker): an item, monster or NPC with a small picture */
.wiki-body a.wiki-ref { color: var(--heading); text-decoration: underline dotted rgb(255 255 255 / .35); text-underline-offset: 3px; white-space: nowrap; }
.wiki-body a.wiki-ref:hover { color: var(--accent); text-decoration-color: currentColor; }
.wiki-body a.wiki-ref-npc { color: var(--accent); }
.wiki-body img.wiki-ref-icon, .wiki-body td img.wiki-ref-icon { width: 20px; height: 20px; max-width: none; object-fit: contain; vertical-align: -4px; margin: 0 4px 0 0; }
.wiki-body a.wiki-ref-item > img:not(.wiki-ref-icon) { cursor: pointer; }
.wiki-card { position: absolute; z-index: 50; display: flex; gap: 10px; align-items: flex-start; max-width: 340px; padding: 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel-bg); box-shadow: 0 8px 24px rgb(0 0 0 / .45); pointer-events: none; font-size: .85rem; }
.wiki-card img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.wiki-card div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wiki-card strong { color: var(--heading); }
.wiki-card small { color: var(--accent); }
.wiki-card span { color: var(--text-muted); }
.wiki-body img.wiki-skill-icon, .wiki-body td img.wiki-skill-icon { width: 18px; height: 25px; border-radius: 3px; vertical-align: -7px; }

/* database: monsters and items (Pages/Database) */
.db-groups { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.db-groups a { padding: 5px 11px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--text-muted); font-size: .9rem; }
.db-groups a:hover { color: var(--text); }
.db-groups a.is-active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.db-table td { vertical-align: middle; }
.db-table td.muted { white-space: normal; }
.db-link { display: inline-flex; align-items: center; gap: 10px; color: var(--heading); font-weight: 600; }
.db-link:hover .db-name { color: var(--accent); }
.db-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; border: 1px solid var(--line); border-radius: 4px; background: rgb(0 0 0 / .35); }
.db-icon img { max-width: 28px; max-height: 28px; }
.db-icon-large { width: 48px; height: 48px; }
.db-icon-large img { max-width: 44px; max-height: 44px; }
.db-role { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; vertical-align: middle; border: 1px solid currentColor; }
.db-role-Elite { color: #78c3ff; }
.db-role-Warband { color: #cd91ff; }
.db-role-boss { color: #ffcd46; }
/* the attack traits of the monster (28.11.2026); Elite, Warband and boss have the colors of their names in the game */
.db-trait { display: inline-block; margin-left: 4px; padding: 1px 5px; border-radius: 4px; font-size: .68rem; font-weight: 600; vertical-align: middle; background: rgba(255,255,255,.07); }
.db-trait-pierce { color: #ff9b5e; }
.db-trait-crit { color: #ffe27a; }
.db-trait-double { color: #ff6b6b; }
.db-role-quest { color: #9be37a; margin-left: 4px; }
.db-crumbs { margin: 0 0 6px; font-size: .85rem; color: var(--text-muted); }
.db-card { display: grid; grid-template-columns: 160px repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 10px 0 20px; }
.db-portrait { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 180px; border: 1px solid var(--line-strong); border-radius: 8px; background: radial-gradient(circle at 50% 40%, rgb(255 196 58 / .10), rgb(0 0 0 / .4) 70%); color: var(--text-muted); font-size: .85rem; }
.db-portrait svg { width: 84px; height: 84px; fill: rgb(255 255 255 / .18); }
.db-portrait-item img { max-width: 120px; max-height: 140px; image-rendering: auto; }
.db-portrait-map { padding: 8px; }
.db-portrait-map img { width: 100%; max-width: 256px; aspect-ratio: 1; border-radius: 6px; }

/* the cards of the maps in the wiki (::: mapcards) */
.wiki-mapcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.wiki-mapcard { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: rgb(0 0 0 / .25); color: var(--heading); text-decoration: none; }
.wiki-mapcard:hover { border-color: var(--accent); color: var(--accent); }
.wiki-mapcard img, .wiki-body .wiki-mapcard img { width: 100%; max-width: none; aspect-ratio: 1; border-radius: 5px; object-fit: cover; background: rgb(0 0 0 / .4); }
.wiki-mapcard span { font-weight: 600; font-size: .9rem; }
.wiki-mapcard small { color: var(--text-muted); font-size: .78rem; }
.db-stats { border: 1px solid var(--line-strong); border-radius: 8px; padding: 12px 14px; min-width: 0; }
.db-stats-wide { grid-column: 2 / -1; }
.db-stats h2, .db-heading { margin: 0 0 10px; font-size: 1rem; color: var(--accent); }
.db-heading { margin-top: 6px; }
.db-stats dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.db-stats dt { color: var(--text-muted); }
.db-stats dd { margin: 0; text-align: right; white-space: nowrap; color: var(--heading); font-variant-numeric: tabular-nums; }
.db-note { font-size: .85rem; margin-top: 8px; }
.db-drops { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.db-drop { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: rgb(255 255 255 / .02); color: var(--heading); transition: border-color .15s, background .15s; }
.db-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.db-drop-name { font-weight: 600; line-height: 1.2; }
/* the drops of a monster: one table, the most likely first; a group "one of N" opens to the list of its items */
.db-droptable td { vertical-align: top; }
.db-droptable td.num { white-space: nowrap; padding-top: 14px; }
.db-droptable .db-droptable-icon { width: 44px; padding-right: 0; }
.db-droptable .db-name { font-weight: 600; color: var(--heading); }
.db-droptable td:nth-child(2) { padding-top: 12px; }
.db-sub { display: block; margin-top: 2px; color: var(--text-muted); font-size: .8rem; }
.db-sub .db-tag { display: inline-block; margin-left: 6px; padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--text); font-size: .74rem; line-height: 1.6; }
.db-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.db-chip { padding: 2px 8px; border: 1px solid rgb(155 227 122 / .45); border-radius: 999px; color: #9be37a; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.db-row { cursor: pointer; }
.db-row:hover td { background: var(--row-hover); }
.db-row .db-group-items { cursor: default; }
.db-chip-pop { position: relative; display: inline-block; }
.db-effect { display: inline; color: var(--accent); text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; list-style: none; }
.db-effect::-webkit-details-marker { display: none; }
.db-pop-text { display: block; margin-bottom: 8px; max-width: 260px; color: var(--text-muted); white-space: normal; }
.db-chip-pop > summary { list-style: none; cursor: pointer; }
.db-chip-pop > summary::-webkit-details-marker { display: none; }
.db-chip-button:hover, .db-chip-pop[open] > .db-chip-button { background: rgb(155 227 122 / .15); }
.db-pop { position: fixed; z-index: 1000; min-width: 190px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #16171d; box-shadow: 0 8px 24px rgb(0 0 0 / .6); font-size: .82rem; }
.db-pop strong { display: block; margin-bottom: 6px; color: var(--heading); }
.db-pop-rows { display: grid; grid-template-columns: auto auto; gap: 2px 18px; line-height: 1.35; }
.db-pop-rows span { color: var(--text); }
.db-pop-rows .num { text-align: right; color: var(--accent); font-weight: 600; }
.db-pop .muted { display: block; margin-top: 6px; font-size: .75rem; }
.db-share { margin-left: auto; color: var(--accent); font-size: .78rem; font-weight: 600; }
.db-group-items .db-link { display: flex; width: 100%; }
.db-group { margin-top: 6px; }
.db-group > summary { display: inline-block; color: var(--accent); font-size: .8rem; cursor: pointer; list-style: none; }
.db-group > summary::-webkit-details-marker { display: none; }
.db-group > summary::before { content: "▸ "; }
.db-group[open] > summary::before { content: "▾ "; }
.db-quality { display: block; margin-top: 3px; color: #9be37a; font-size: .78rem; font-weight: 600; letter-spacing: .01em; }
.db-drop-group > summary .db-drop-name .db-quality::after { content: none; }
.db-group-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 14px; padding: 8px 0 4px; }
.db-group-items .db-name { font-weight: 500; }
.db-chance { color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 760px) {
    .db-card { grid-template-columns: 1fr; }
    .db-stats-wide { grid-column: auto; }
    .db-portrait { min-height: 140px; }
}
.db-stats-wide dl { grid-template-columns: max-content 1fr; }
.db-stats-wide dd { text-align: left; white-space: normal; }
.db-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.db-filters select, .db-reset { padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: rgb(0 0 0 / .35); color: var(--text); font: inherit; font-size: .9rem; }
.db-filters select:focus { outline: none; border-color: var(--accent); }
.db-filters select option { background: #15121c; }
.db-reset { cursor: pointer; color: var(--accent); background: transparent; }
.db-reset[hidden], .db-filters select[hidden] { display: none; }

/* 3D view of a character (/Account/Character) */
.charview-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.charview { position: relative; height: 560px; border-radius: 8px; overflow: hidden; background: radial-gradient(ellipse at 50% 35%, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.35)); cursor: grab; }
.charview canvas { display: block; width: 100%; height: 100%; }
.charview.charview-error { display: flex; align-items: center; justify-content: center; }
.charview-items h2 { margin-top: 0; font-size: 1.1rem; }
.charview-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.charview-list li { display: flex; gap: 10px; align-items: center; }
.charview-list img { width: 40px; height: 40px; object-fit: contain; flex: none; }
@media (max-width: 760px) {
    .charview-layout { grid-template-columns: 1fr; }
    .charview { height: 420px; }
}

/* 3D characters in the wiki (::: charview) */
.wiki-body .charviews { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin: 12px 0; }
.wiki-charview { margin: 0; }
.wiki-charview .charview { height: 420px; }
.wiki-charview figcaption { margin-top: 6px; font-size: .85rem; color: var(--text-muted); text-align: center; }
/* ::: wiki-gallery with ::: wiki-shot inside (a picture and its caption), e.g. the models of the Illusion of Noria */
.wiki-body .wiki-gallery, .wiki-body .wiki-gallery-big { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 12px 0 18px; max-width: 900px; }
.wiki-body .wiki-gallery-big { grid-template-columns: minmax(0, 220px); }
.wiki-body .wiki-shot { background: radial-gradient(circle at 50% 40%, rgb(140 90 220 / .18), rgb(0 0 0 / .25) 70%); border: 1px solid var(--line); border-radius: 8px; padding: 10px; text-align: center; }
.wiki-body .wiki-shot p { margin: 0; font-size: .85rem; color: var(--text-muted); }
.wiki-body .wiki-shot img { display: block; height: 120px; width: 100%; object-fit: contain; margin: 0 auto 6px; }
.wiki-body .wiki-gallery-big .wiki-shot img { height: 190px; }
.wiki-body .wiki-shot img.wiki-ref-icon { display: none; }

/* rankings: sub tabs and the top 3 in 3D */
.tabs-sub { margin: -4px 0 12px; font-size: .9rem; }
.podium { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 12px; align-items: end; margin: 8px 0 16px; }
.podium-place { margin: 0; text-align: center; }
.podium-place .charview { height: 300px; }
.podium-place.podium-1 .charview { height: 380px; }
.podium-place figcaption { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 6px; }
@media (max-width: 760px) {
    .podium { grid-template-columns: 1fr; }
    .podium-place .charview, .podium-place.podium-1 .charview { height: 320px; }
    .podium-place.podium-1 { order: -1; }
}

.db-model { position: relative; min-height: 300px; padding: 0; overflow: hidden; cursor: grab; }
.db-model canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* the language of the site (05.11.2026): the flags at the top, the chosen one lit */
.lang-switch { display: inline-flex; align-items: center; gap: 4px; }
.lang-switch a { display: inline-flex; padding: 3px; border-radius: 4px; border: 1px solid transparent; opacity: .55; transition: opacity .15s, border-color .15s; }
.lang-switch a:hover, .lang-switch a:focus-visible { opacity: 1; }
.lang-switch a.is-active { opacity: 1; border-color: var(--accent); }
.lang-switch img { display: block; width: 22px; height: 14px; object-fit: cover; border-radius: 2px; }
.wiki-untranslated { margin: 0 0 14px; padding: 8px 12px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--text-muted); font-size: .9rem; }

/* ::: mastertrees - the master trees like the window of the game (20.11.2026, Services/MasterTreesBlock.cs) */
.master-class { margin: 0 0 8px; color: var(--text-muted); font-size: .85rem; }
.master-window { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px; border: 1px solid #5a4a2e; border-radius: 6px; background: radial-gradient(ellipse at top, #2a2118 0%, #120e0a 70%); box-shadow: inset 0 0 24px rgb(0 0 0 / .8); }
.master-branch { padding: 8px 6px 10px; border: 1px solid #3d3122; border-radius: 4px; background: rgb(0 0 0 / .35); }
.master-branch h4 { margin: 0 0 8px; text-align: center; color: #e8c06a; font-size: .95rem; letter-spacing: .04em; text-shadow: 0 1px 2px #000; }
.master-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 4px; }
.master-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.master-cell.is-empty { cursor: default; }
.master-cell img, .wiki-body .master-cell img { width: 40px; height: 56px; max-width: none; margin: 0; border: 2px solid #6b5631; border-radius: 3px; background: #000; box-shadow: 0 0 0 1px #000, 0 2px 4px rgb(0 0 0 / .7); }
.master-cell:hover img { border-color: #e8c06a; }
.master-cell.is-keystone img { border-color: #e8c06a; box-shadow: 0 0 0 1px #000, 0 0 10px rgb(232 192 106 / .7); }
.master-cell b { position: absolute; top: 40px; right: calc(50% - 22px); padding: 0 3px; border-radius: 3px; background: rgb(0 0 0 / .85); color: #fff; font-size: .7rem; line-height: 1.3; }
.master-cell small { width: 100%; overflow: hidden; color: #cfc3a8; font-size: .66rem; line-height: 1.15; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.master-cell.has-arrow::before { content: "▼"; position: absolute; top: -9px; left: 50%; transform: translateX(-50%); color: #e8c06a; font-size: .55rem; }
@media (max-width: 900px) { .master-window { grid-template-columns: 1fr; } }
.master-pop { position: absolute; z-index: 60; width: 300px; max-width: calc(100vw - 16px); padding: 12px 14px; border: 1px solid #8a6d38; border-radius: 6px; background: #17120c; color: #e6dcc6; box-shadow: 0 8px 28px rgb(0 0 0 / .75); font-size: .85rem; }
.master-pop h5 { margin: 0 22px 2px 0; color: #e8c06a; font-size: 1rem; }
.master-pop-meta { margin: 0 0 8px; color: #a8987a; font-size: .78rem; }
.master-pop-text { margin: 0 0 8px; }
.master-pop table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.master-pop th { color: #a8987a; font-weight: 600; text-align: left; border-bottom: 1px solid #3d3122; padding: 2px 4px; }
.master-pop td { padding: 1px 4px; border-bottom: 1px solid rgb(61 49 34 / .4); }
.master-pop td:nth-child(odd) { color: #a8987a; width: 18%; }
.master-pop-note { margin: 8px 0 0; color: #a8987a; font-size: .78rem; }
.master-pop-note.is-gold { color: #e8c06a; }
.master-pop-close { position: absolute; top: 6px; right: 8px; padding: 0 4px; border: 0; background: none; color: #a8987a; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.master-pop-close:hover { color: #fff; }
.master-branch { display: flex; flex-direction: column; }
.master-bonuses { margin: 10px 0 0; padding: 8px 4px 0; border-top: 1px solid #3d3122; list-style: none; font-size: .74rem; line-height: 1.35; color: #cfc3a8; }
.master-bonuses li { display: grid; grid-template-columns: auto 1fr; gap: 6px; align-items: start; margin: 0 0 5px; padding: 0; }
.master-bonuses li em { font-style: normal; }
.master-bonuses li span { display: inline-block; min-width: 64px; padding: 0 5px; border: 1px solid #6b5631; border-radius: 3px; color: #e8c06a; font-weight: 600; text-align: center; }
.master-bonuses li b { color: #e8c06a; font-weight: 600; }
.master-pop-at { margin: 0; color: #a8987a; font-size: .74rem; }
/* :::: skilltable - the skills of a class: the drop columns open by a click on the row (Pages/Wiki/Index.cshtml) */
.skilltable table th:nth-child(n+4), .skilltable table td:nth-child(n+4) { display: none; }
.skilltable tbody tr { cursor: pointer; }
.skilltable tbody tr:hover td { background: rgb(255 196 58 / .06); }
.master-pop table td a, .master-pop-note a { color: #e8c06a; }
.master-pop table.master-pop-facts td:first-child { width: 40%; white-space: nowrap; }

/* the ended lots of My auction (26.11.2026): two lines per lot, no table to scroll */
.ended-lots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ended-lots li { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--row-alt); min-width: 0; }
.ended-main { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; align-items: baseline; }
.ended-main a { font-weight: 600; overflow-wrap: anywhere; }
.ended-outcome { font-size: .85rem; }
.ended-lots .is-sold .ended-outcome { color: var(--accent); }
.ended-lots .is-unsold .ended-outcome { color: var(--text-muted); }
.ended-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 2px; }
