/* Sword & Magic - site v3. Dark arcane theme: ink background, gold metal, teal magic. */

:root {
    --bg: #0b0d14;
    --bg-2: #10131d;
    --surface: #161a26;
    --surface-2: #1c2130;
    --line: #2a3042;
    --line-2: #3a4258;
    --text: #e8e4d8;
    --muted: #9aa0b4;
    --faint: #6b7189;
    --gold: #e2b55a;
    --gold-2: #f3d27a;
    --gold-3: #a8782a;
    --magic: #6fdccf;
    --magic-2: #3aa99b;
    --danger: #ef6b6b;
    --warn: #f0b04a;
    --ok: #5fd08d;
    --violet: #a78bfa;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Cinzel", Georgia, serif;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #0b0d14; }
/* In-page anchors (#download, #classes, #cases ...) stop below the sticky top bar: its real height comes from app.js
   (--topbar-h, follows resizes and a wrapping menu), plus a little air. Works for links, scrollIntoView and smooth scroll. */
html { scroll-padding-top: calc(var(--topbar-h, 67px) + 14px); }
/* Page to page navigation as one smooth cross-fade (Chrome/Edge/Safari): the background does not blink. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(111, 220, 207, .07), transparent 60%),
        radial-gradient(900px 500px at -10% 10%, rgba(226, 181, 90, .07), transparent 60%),
        var(--bg);
    color: var(--text);
    font: 400 15px/1.6 var(--font);
}
img, svg { max-width: 100%; }
a { color: var(--gold-2); text-decoration: none; }
a:hover { color: #fff; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
code { font: 13px/1.4 ui-monospace, "Cascadia Code", Consolas, monospace; color: var(--magic); }
:focus-visible { outline: 2px solid var(--magic); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
/* The one gap between the page and the footer (containers, sections and the footer add none of their own, so nesting
   never doubles it); the fixed phone tab bar is handled separately by body padding-bottom. */
.main { flex: 1; padding-bottom: 56px; }
@media (max-width: 760px) { .main { padding-bottom: 36px; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #000; padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; }
.inline-form { display: inline; margin: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Logo ---------- */
.logo { width: 34px; height: 34px; flex: none; }
.logo__frame { fill: none; stroke: var(--gold); stroke-width: 2.4; }
.logo__blade { fill: none; stroke: var(--gold-2); stroke-width: 2.6; stroke-linecap: round; }
.logo__gem { fill: var(--magic); filter: drop-shadow(0 0 4px var(--magic)); }

/* ---------- Top bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(11, 13, 20, .82);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; gap: 18px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand__text { font: 700 18px/1 var(--font-display); letter-spacing: .06em; white-space: nowrap; }
.brand__text em { font-style: normal; color: var(--gold); }

.nav { display: flex; align-items: center; gap: 6px; flex: 1; }
.nav__spacer { flex: 1; }
.nav__link { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.nav__link:hover { color: var(--text); background: var(--surface); }
.nav__link.is-active { color: var(--gold-2); background: rgba(226, 181, 90, .08); }
.nav__user { display: flex; align-items: center; gap: 8px; color: var(--muted); padding: 0 6px; }
.nav__username { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-right: 6px; }
.lang-switch__item { padding: 5px 9px; font-size: 12px; font-weight: 600; color: var(--faint); }
.lang-switch__item:hover { color: var(--text); background: var(--surface); }
.lang-switch__item.is-active { color: #0b0d14; background: var(--gold); }

.nav-toggle { display: none; margin-left: auto; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; padding: 11px 10px; flex-direction: column; justify-content: space-between; }
.nav-toggle span:not(.sr-only) { display: block; height: 2px; background: var(--text); border-radius: 2px; }

/* ---------- Buttons ---------- */
.btn {
    --b: var(--line-2);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border-radius: 10px; border: 1px solid var(--b);
    font: 600 14px/1 var(--font); color: var(--text); background: var(--surface-2);
    cursor: pointer; transition: transform .12s, background .2s, border-color .2s, box-shadow .2s;
    white-space: nowrap;
}
.btn:hover { color: #fff; border-color: var(--gold-3); }
.btn:active { transform: translateY(1px); }
.btn--primary {
    color: #1a1206; border-color: transparent;
    background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, var(--gold-3));
    box-shadow: 0 6px 18px rgba(226, 181, 90, .25), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn--primary:hover { color: #000; box-shadow: 0 8px 24px rgba(226, 181, 90, .4), inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn--ghost { background: transparent; }
.btn--sm { padding: 8px 14px; font-size: 13px; }
.btn--lg { padding: 15px 28px; font-size: 16px; }
.btn--block { width: 100%; }

/* ---------- Cards / forms ---------- */
.card {
    background: linear-gradient(180deg, var(--surface), var(--bg-2));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card__title { font: 700 26px/1.2 var(--font-display); color: var(--gold-2); text-align: center; }
.card__subtitle { color: var(--muted); text-align: center; margin: 8px 0 24px; }

.auth { display: grid; place-items: center; padding: 56px 20px 0; }
.auth__card { width: 100%; max-width: 430px; padding: 36px 32px; position: relative; }
.auth__card::before {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
    background: linear-gradient(140deg, rgba(226, 181, 90, .5), transparent 30%, transparent 70%, rgba(111, 220, 207, .4));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude; padding: 1px;
}
.auth__switch { text-align: center; color: var(--muted); margin: 22px 0 0; }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field__hint { font-size: 12px; color: var(--faint); }
.input {
    width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--line-2); background: #0e111a; color: var(--text);
    font: 400 15px/1.3 var(--font); transition: border-color .2s, box-shadow .2s;
}
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(226, 181, 90, .15); }
.input:user-invalid { border-color: var(--danger); }
.input--code { text-align: center; font-size: 26px; letter-spacing: .5em; padding-left: .5em; }
.input-wrap { position: relative; display: block; }
.input-wrap .input { padding-right: 46px; }
.input-wrap__btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 16px; padding: 6px 8px; border-radius: 6px; }
.input-wrap__btn:hover, .input-wrap__btn.is-on { color: var(--gold); }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--gold); width: 16px; height: 16px; }
.strength { display: block; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.strength span { display: block; height: 100%; width: 0; background: var(--danger); transition: width .25s, background .25s; }

/* ---------- Alerts ---------- */
.flashes { display: grid; gap: 10px; padding-top: 20px; }
.alert {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 13px 16px; border-radius: 10px; border: 1px solid; font-size: 14px;
}
.alert--success { background: rgba(95, 208, 141, .08); border-color: rgba(95, 208, 141, .35); color: #bff0d2; }
.alert--error { background: rgba(239, 107, 107, .08); border-color: rgba(239, 107, 107, .4); color: #ffd0d0; }
.alert--warn { background: rgba(240, 176, 74, .08); border-color: rgba(240, 176, 74, .4); color: #ffe2b0; }
.alert--info { background: rgba(111, 220, 207, .07); border-color: rgba(111, 220, 207, .35); color: #c7f5ef; }
.alert--wide { margin-top: 18px; flex-wrap: wrap; }
.alert__close { border: 0; background: none; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; opacity: .7; }
.alert__close:hover { opacity: 1; }

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

.section { padding-top: 40px; }
.section:last-child { padding-bottom: 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.section__head .section__title { margin: 0; }
.section__title { font: 700 22px/1.2 var(--font-display); color: var(--text); margin: 0 0 16px; letter-spacing: .03em; }
.section__hint { color: var(--faint); font-size: 13px; margin: 0; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { padding: 26px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, var(--surface), transparent); }
.feature__icon { width: 46px; height: 46px; display: grid; place-items: center; font-size: 22px; color: var(--gold-2); border-radius: 12px; border: 1px solid rgba(226, 181, 90, .35); background: rgba(226, 181, 90, .06); margin-bottom: 16px; }
.feature h2 { font-size: 17px; margin-bottom: 8px; }
.feature p { margin: 0; color: var(--muted); }

.steps { padding: 30px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); }
.steps__list { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps__list li { counter-increment: s; display: grid; gap: 6px; padding-left: 52px; position: relative; color: var(--muted); }
.steps__list li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; font: 700 16px/1 var(--font-display); color: #1a1206; background: linear-gradient(180deg, var(--gold-2), var(--gold-3)); }
.steps__list strong { color: var(--text); }

/* ---------- Cabinet ---------- */
.cabinet { padding-top: 28px; }
.avatar { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; font: 700 16px/1 var(--font-display); color: #1a1206; background: linear-gradient(135deg, var(--gold-2), var(--gold-3)); }
.avatar--sm { width: 28px; height: 28px; font-size: 13px; }
.avatar--lg { width: 84px; height: 84px; font-size: 34px; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px rgba(226, 181, 90, .5), 0 0 30px rgba(226, 181, 90, .25); }

.profile { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; padding: 26px; }
.profile__name { font: 700 28px/1.15 var(--font-display); color: var(--gold-2); word-break: break-word; }
.profile__meta { color: var(--faint); margin: 6px 0 12px; font-size: 14px; }
.profile__vip { min-width: 220px; display: grid; gap: 6px; padding: 16px 18px; border-radius: 12px; background: rgba(0, 0, 0, .2); border: 1px solid var(--line); }
.profile__vip-label { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); }
.profile__vip-total { font: 700 24px/1 var(--font); color: var(--text); }
.profile__vip-next { font-size: 12px; color: var(--muted); }
.profile__vip-link { font-size: 12px; font-weight: 600; color: var(--gold-2); }
.progress { appearance: none; width: 100%; height: 6px; border: 0; border-radius: 6px; background: var(--line); overflow: hidden; }
.progress::-webkit-progress-bar { background: var(--line); border-radius: 6px; }
.progress::-webkit-progress-value { background: linear-gradient(90deg, var(--magic-2), var(--magic)); border-radius: 6px; }
.progress::-moz-progress-bar { background: linear-gradient(90deg, var(--magic-2), var(--magic)); border-radius: 6px; }

.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid; }
.badge--vip { color: var(--gold-2); border-color: rgba(226, 181, 90, .45); background: rgba(226, 181, 90, .08); }
.badge--premium { color: #d9ccff; border-color: rgba(167, 139, 250, .45); background: rgba(167, 139, 250, .1); }
.badge--ok { color: #bff0d2; border-color: rgba(95, 208, 141, .4); background: rgba(95, 208, 141, .08); }
.badge--warn { color: #ffe2b0; border-color: rgba(240, 176, 74, .45); background: rgba(240, 176, 74, .08); }

.balance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.balance { position: relative; display: grid; gap: 4px; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.balance__label { font-size: 13px; color: var(--muted); font-weight: 500; }
.balance__value { font: 700 30px/1.1 var(--font); color: var(--text); font-variant-numeric: tabular-nums; }
.balance__note { font-size: 12px; color: var(--faint); }
.balance__warn { font-size: 12px; color: var(--warn); }
.balance--gold { border-color: rgba(226, 181, 90, .45); background: linear-gradient(135deg, rgba(226, 181, 90, .14), var(--surface) 60%); }
.balance--gold .balance__value { color: var(--gold-2); }
.balance--active { border-color: rgba(111, 220, 207, .4); }
.balance--active::after { content: ""; position: absolute; right: 14px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--magic); box-shadow: 0 0 10px var(--magic); }

.case-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.case { --c: var(--line-2); display: grid; justify-items: center; text-align: center; gap: 4px; padding: 20px 14px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); opacity: .72; transition: transform .2s, opacity .2s, border-color .2s; }
.case.is-ready { opacity: 1; border-color: color-mix(in srgb, var(--c) 55%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 15%, transparent), 0 10px 30px color-mix(in srgb, var(--c) 12%, transparent); }
.case.is-ready:hover { transform: translateY(-3px); }
.case--daily { --c: #8fb3ff; }
.case--weekly { --c: var(--magic); }
.case--premium { --c: var(--violet); }
.case--vip { --c: var(--gold); }
.case--mystery { --c: #ff8fb1; }
.case__chest { width: 96px; height: 88px; object-fit: contain; margin: -6px 0 6px; filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--c) 45%, transparent)); transition: transform .25s; }
.case.is-ready .case__chest { cursor: pointer; }
.case.is-ready:hover .case__chest { transform: scale(1.06) rotate(-2deg); }
.case:not(.is-ready) .case__chest { filter: grayscale(.7) brightness(.8); }
.case--vip .case__chest { filter: hue-rotate(45deg) saturate(1.3) drop-shadow(0 0 12px rgba(255, 215, 0, .55)); }
.case__name { font-size: 15px; font-weight: 700; }
.case__count { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.case__count strong { font-size: 20px; color: var(--text); }
.case__refill { margin: 0; font-size: 12px; color: var(--faint); }

.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 14px; }
.char { padding: 18px; box-shadow: none; }
.char__head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.char__name { font-size: 16px; word-break: break-word; }
.char__server { margin: 2px 0 0; font-size: 12px; color: var(--magic); }
.char__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.char__stats div { padding: 8px; border-radius: 8px; background: rgba(0, 0, 0, .2); }
.char__stats dt { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.char__stats dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; }
.char__where { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.empty { padding: 26px; text-align: center; color: var(--muted); box-shadow: none; }
.empty p { margin: 0; }

.table-card { overflow-x: auto; box-shadow: none; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.table th { color: var(--faint); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.table tr:last-child td { border-bottom: 0; }
.table__ua { color: var(--muted); max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Error page ---------- */
.error-page { text-align: center; padding: 100px 20px; }
.error-page__code { font: 700 96px/1 var(--font-display); color: var(--gold); margin: 0; opacity: .9; }
.error-page__title { font-size: 20px; color: var(--muted); font-weight: 500; margin: 16px 0 28px; }
.error-page__debug { text-align: left; margin-top: 32px; padding: 16px; background: #000; border-radius: 8px; overflow: auto; font-size: 12px; color: #ffb4b4; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 14px 0; margin-top: 0; line-height: 1.35; }
.footer__inner { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; align-items: center; }
.footer__links { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; }
.footer__links a { color: var(--muted); font-size: 13px; }
.footer__links a:hover { color: var(--gold-2); }
.footer__copy { grid-column: 1 / -1; margin: 0; color: var(--faint); font-size: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
    .case-grid { grid-template-columns: repeat(3, 1fr); }
    .profile { grid-template-columns: auto 1fr; }
    .profile__vip { grid-column: 1 / -1; }
}
@media (max-width: 1180px) {
    .nav-toggle { display: flex; }
    .nav {
        position: absolute; left: 0; right: 0; top: 100%;
        flex-direction: column; align-items: stretch; gap: 4px;
        padding: 12px 20px 18px; background: var(--bg-2); border-bottom: 1px solid var(--line);
        display: none;
    }
    .nav.is-open { display: flex; }
    .nav__spacer { display: none; }
    .lang-switch { align-self: flex-start; margin: 6px 0; }
    .nav .btn, .nav .inline-form, .nav .inline-form .btn { width: 100%; }
}
@media (max-width: 820px) {
    .feature-grid, .steps__list { grid-template-columns: 1fr; }
    .footer__inner { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    /* Side gutters only: a shorthand here used to wipe the pages' own top padding (e.g. the cabinet). */
    .container { padding-left: 14px; padding-right: 14px; }
    .hero { padding: 72px 0 60px; }
    .case-grid { grid-template-columns: repeat(2, 1fr); }
    .auth__card { padding: 28px 20px; }
    .balance__value { font-size: 26px; }
    .table__ua { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ---------- Case opening ---------- */
.server-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.server-pick__label { font-size: 13px; color: var(--muted); }
.input--select { width: auto; min-width: 180px; padding: 8px 34px 8px 12px; font-size: 14px; appearance: none; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
    background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.js .server-pick [data-autosubmit-fallback] { display: none; }
#cases > .alert { margin-bottom: 14px; }
.case form { margin-top: 10px; width: 100%; }
.case__btn { width: 100%; }
.case__btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.6); box-shadow: none; }
.case.is-opening .case__chest { animation: shake .5s ease-in-out infinite; }
@keyframes shake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-6deg) translateY(-2px); }
    75% { transform: rotate(6deg) translateY(-2px); }
}

.prize {
    --c: var(--gold);
    width: min(92vw, 380px); padding: 34px 26px 26px; border-radius: 18px; text-align: center; overflow: hidden;
    color: var(--text); background: linear-gradient(180deg, var(--surface-2), var(--bg-2));
    border: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
    box-shadow: 0 0 60px color-mix(in srgb, var(--c) 35%, transparent), var(--shadow);
}
.prize::backdrop { background: rgba(5, 6, 10, .75); backdrop-filter: blur(4px); }
.prize[open] { animation: pop .35s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes spin { to { transform: rotate(1turn); } }
.prize > * { position: relative; z-index: 1; }
.prize__eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .25em; font-size: 12px; color: var(--muted); }
.prize__icon { width: 96px; height: 96px; margin: 18px auto; border-radius: 20px; display: grid; place-items: center;
    background: radial-gradient(circle, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%); font-size: 46px; color: var(--c); }
.prize__icon img { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 0 12px color-mix(in srgb, var(--c) 60%, transparent)); }
.prize__title { font: 700 24px/1.2 var(--font-display); color: var(--c); margin: 0; word-break: break-word; }
.prize__subtitle { color: var(--muted); margin: 8px 0 22px; font-size: 14px; }
.prize--common { --c: #c7ccd9; }
.prize--uncommon { --c: var(--ok); }
.prize--rare { --c: #8fb3ff; }
.prize--epic { --c: var(--violet); }
.prize--legendary { --c: var(--gold); }
.prize--mythic, .prize--overlord { --c: #ff6f91; }

/* ---------- Shop & inventory ---------- */
.store { padding-top: 28px; }
.store__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title { font: 700 30px/1.15 var(--font-display); color: var(--gold-2); letter-spacing: .03em; }
.page-sub { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.muted { color: var(--muted); font-size: 14px; }
.narrow { max-width: 560px; padding-top: 32px; }
.sheet-page { padding: 26px; }
.sheet-page__back { margin: 18px 0 0; font-size: 14px; }

.wallet { display: flex; flex-wrap: wrap; gap: 8px; }
.wallet__item { display: grid; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); min-width: 110px; }
.wallet__item small { font-size: 11px; color: var(--faint); }
.wallet__item strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.wallet__item--gold { border-color: rgba(226, 181, 90, .45); }
.wallet__item--gold strong { color: var(--gold-2); }

.toolbar { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search { display: flex; gap: 8px; flex: 1 1 280px; max-width: 420px; }
.search .input { padding: 9px 12px; font-size: 14px; }
.sorts { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.is-active { color: #1a1206; background: var(--gold); border-color: var(--gold); font-weight: 600; }

.tabs { position: relative; display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tab { flex: none; padding: 9px 14px; color: var(--muted); font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--gold-2); border-bottom-color: var(--gold); }

.rarity--common { --r: #aab1c3; }
.rarity--uncommon { --r: var(--ok); }
.rarity--rare { --r: #6f9dff; }
.rarity--epic { --r: var(--violet); }
.rarity--legendary { --r: var(--gold); }
.rarity--mythic { --r: #ff3b3b; }
.rarity--overlord { --r: #ff5dc8; }

.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 10px; }
.item {
    --r: var(--line-2);
    position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; text-align: center;
    padding: 10px 8px 9px; border-radius: 12px; color: var(--text);
    border: 1px solid color-mix(in srgb, var(--r) 35%, var(--line));
    background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--r) 14%, transparent), transparent 70%), var(--surface);
    transition: transform .15s, border-color .15s, box-shadow .15s;
}
.item:hover { color: var(--text); transform: translateY(-3px); border-color: color-mix(in srgb, var(--r) 70%, transparent); box-shadow: 0 8px 24px color-mix(in srgb, var(--r) 18%, transparent); }
.item.is-sold-out { opacity: .5; filter: grayscale(.7); }
.item__icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 12px; background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--r) 40%, transparent); }
.item__icon img { width: 56px; height: 56px; object-fit: contain; }
.item__icon--lg { width: 88px; height: 88px; flex: none; }
.item__icon--lg img { width: 76px; height: 76px; }
.item__pack, .item__qty { position: absolute; top: 6px; right: 6px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: var(--gold-2); }
.item__name { font-size: 13px; font-weight: 600; line-height: 1.25; min-height: 2.5em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.item__price { font-weight: 700; color: var(--gold-2); font-variant-numeric: tabular-nums; }
/* One line: the actual price, coin and badge never shrink; the old price gets smaller first, then short (app.js fits it). */
.item { grid-template-columns: minmax(0, 1fr); } /* the column never grows past the card, so the price can be measured against it */
.item .item__price { min-width: 0; display: flex; justify-content: center; align-items: center; gap: 3px; max-width: 100%; white-space: nowrap; }
.item .item__price > * { flex: none; }
.item .item__old { margin-right: 1px; font-size: .78em; }
.item .item__old.is-small { font-size: .68em; }
/* the −N% badge sits on the icon corner, so the price line only holds the prices */
.item .item__price .item__sale { position: absolute; top: 58px; left: calc(50% + 14px); margin: 0; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.item__price s, .product s { color: var(--faint); font-weight: 400; font-size: .85em; margin-right: 4px; }
.item__limit { font-size: 11px; color: var(--warn); }
.item__sale { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #fff; background: #c0392b; vertical-align: 1px; }
.item__tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.tag { font-size: 10px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); }
.tag--magic { color: var(--magic); border-color: rgba(111, 220, 207, .4); }

.pager { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 26px; }
.pager__page { min-width: 38px; padding: 8px 10px; text-align: center; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); }
.pager__page.is-active { color: #1a1206; background: var(--gold); border-color: var(--gold); font-weight: 700; }

.sheet { width: min(94vw, 480px); max-height: 90vh; padding: 26px 22px 22px; border-radius: 18px; border: 1px solid var(--line-2); color: var(--text); background: linear-gradient(180deg, var(--surface-2), var(--bg-2)); box-shadow: var(--shadow); overflow-y: auto; }
.sheet::backdrop { background: rgba(5, 6, 10, .7); backdrop-filter: blur(3px); }
.sheet[open] { animation: pop .25s ease-out; }
.sheet__close { position: absolute; top: 10px; right: 12px; border: 0; background: none; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; z-index: 2; }
.sheet__close:hover { color: var(--text); }
.sheet__loading { text-align: center; color: var(--muted); padding: 40px 0; }

.product { display: grid; gap: 16px; }
.product__head { display: flex; gap: 16px; align-items: center; padding-right: 24px; }
.product__name { font: 700 21px/1.2 var(--font-display); color: var(--r, var(--text)); word-break: break-word; }
.product__meta { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.rarity-tag { color: var(--r); font-weight: 600; }
.product__desc { margin: 0; color: var(--muted); font-size: 14px; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.facts li { display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 9px; border-radius: 999px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); }
.facts span { font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: .03em; }
.facts strong { font-size: 13px; white-space: nowrap; }
.facts .coin { vertical-align: -3px; }
.currency-select { width: 100%; }

.stepper { display: flex; gap: 6px; }
.stepper .input { text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper .input::-webkit-outer-spin-button, .stepper .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper__btn { width: 44px; flex: none; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 20px; cursor: pointer; }
.stepper__btn:hover { border-color: var(--gold-3); }
.currency-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.currency-pick legend { margin-bottom: 6px; }
.currency-pick__opt { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); cursor: pointer; }
.currency-pick__opt:has(input:checked) { border-color: var(--gold); background: rgba(226, 181, 90, .08); }
.currency-pick__opt input { grid-row: span 2; accent-color: var(--gold); }
.currency-pick__opt span { font-size: 13px; font-weight: 600; }
.currency-pick__opt small { font-size: 12px; color: var(--muted); }
.buy-form__total { margin: 0; color: var(--muted); font-size: 14px; }
.buy-form__total strong { color: var(--text); font-size: 16px; }
.buy-form__warn { margin: 0; color: var(--danger); font-size: 13px; }
.input--full { width: 100%; }
.action-box { display: grid; gap: 10px; padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .15); }
.action-box__title { font-size: 15px; }
.btn--danger { color: #ffb4b4; border-color: rgba(239, 107, 107, .45); }
.btn--danger:hover { color: #fff; border-color: var(--danger); background: rgba(239, 107, 107, .12); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

@media (max-width: 560px) {
    .item-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
    .page-title { font-size: 25px; }
}

/* ---------- Top-up, settings ---------- */
.avatar--img { object-fit: cover; padding: 0; background: var(--surface); }
.nav__user { border-radius: 8px; padding: 4px 8px; }
.nav__user:hover, .nav__user.is-active { color: var(--text); background: var(--surface); }
.form__row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.form__link { font-size: 13px; }
.form--inline { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.form--inline .input { flex: 1 1 180px; width: auto; }
.input--mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.input--file { padding: 9px; font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.pay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 18px; }
.pay-card { padding: 24px; display: grid; gap: 14px; align-content: start; box-shadow: none; }
.pay-card__title { font: 700 22px/1.2 var(--font-display); color: var(--gold-2); }
.pay-card .muted { margin: 0; }
.pay-steps { margin: 0; padding: 0; list-style: none; counter-reset: st; display: grid; gap: 10px; }
.pay-steps li { counter-increment: st; position: relative; padding-left: 34px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.pay-steps li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #1a1206; background: var(--gold); }
.agree-box { padding: 14px; border-radius: 10px; border: 1px dashed var(--line-2); }
.agree-box__text { margin: 0; font-size: 13px; color: var(--muted); }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets .chip { background: none; cursor: pointer; font: inherit; font-size: 13px; }
.mock-pay { text-align: center; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings-card { padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; box-shadow: none; }
.settings-card--wide { grid-column: 1 / -1; }
.settings-card__title { font-size: 18px; }
.avatar-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.avatar-form { flex: 1 1 220px; gap: 8px; }
/* Your own avatar opens the avatar dialog: a pencil badge shows it is clickable */
.avatar-edit { position: relative; cursor: pointer; border-radius: 50%; }
.avatar-edit__hint {
    position: absolute; right: 2px; top: 2px; z-index: 3; width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center; font-size: 14px; line-height: 1; color: #1a1206;
    background: linear-gradient(180deg, var(--gold-2), var(--gold)); border: 2px solid var(--bg-2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .6); transition: transform .15s;
}
.avatar-edit:hover .avatar-edit__hint, .avatar-edit:focus-visible .avatar-edit__hint { transform: scale(1.12); }
.avatar-edit:hover .vip-photo { filter: brightness(1.08); }
.avatar-row__hint { margin: 0; flex: 1 1 160px; }
.avatar-dialog { width: min(94vw, 640px); }
.avatar-dialog .settings-card__title { margin: 0 34px 10px 0; }
.avatar-dialog .tabs { margin-bottom: 14px; }
.avatar-dialog a.sheet__close { text-decoration: none; }
.avatar-dialog__body[aria-busy="true"] { opacity: .55; pointer-events: none; }
.avatar-dialog__status { margin: 0 0 12px; color: var(--danger); font-size: 14px; }
@media (max-width: 560px) {
    .avatar-dialog { padding: 22px 14px 16px; }
    .avatar-dialog .avatar-pick { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
    .avatar-dialog .tab { padding: 8px 9px; font-size: 13px; }
}
.avatar-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; }
.avatar-pick__item { display: grid; justify-items: center; gap: 6px; margin: 0; }
.avatar-pick__btn { padding: 0; border: 2px solid var(--line); border-radius: 50%; overflow: hidden; background: rgba(0, 0, 0, .25); cursor: pointer; aspect-ratio: 1; width: 100%; max-width: 96px; transition: border-color .15s, transform .15s; }
.avatar-pick__btn:hover, .avatar-pick__btn:focus-visible { border-color: var(--gold); transform: translateY(-2px); }
.avatar-pick__btn img, .avatar-pick--admin img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-pick__item.is-current .avatar-pick__btn { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 185, 79, .35); cursor: default; transform: none; }
.avatar-pick--admin { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.avatar-pick--admin img { width: 96px; height: 96px; border-radius: 50%; }
.avatar-pick__item.is-hidden img { opacity: .35; filter: grayscale(1); }
.avatar-pick__meta { font-size: 12px; color: var(--muted); }
.twofa-state { margin: 0; display: flex; gap: 8px; align-items: center; color: var(--muted); }
.twofa-actions { display: grid; gap: 10px; max-width: 560px; }
.totp-setup { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.totp-setup__qr { padding: 10px; background: #fff; border-radius: 12px; line-height: 0; }
.totp-setup__qr svg { width: 196px; height: 196px; }
.totp-setup__body { flex: 1 1 260px; display: grid; gap: 14px; }
.secret { display: inline-block; padding: 4px 8px; border-radius: 6px; background: rgba(0, 0, 0, .3); font-size: 14px; letter-spacing: .06em; word-break: break-all; }

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

/* ---------- News, rating, giveaway, social ---------- */
.narrow--wide { max-width: 820px; }
.news-list { display: grid; gap: 14px; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 14px; }
.news-card { padding: 20px 22px; box-shadow: none; display: grid; gap: 8px; align-content: start; }
.news-card__date { font-size: 12px; color: var(--magic); letter-spacing: .05em; }
.news-card__title { font-size: 18px; line-height: 1.3; }
.news-card__title a { color: var(--text); }
.news-card__title a:hover { color: var(--gold-2); }
.news-card__excerpt { margin: 0; color: var(--muted); font-size: 14px; }
.news-card__more { font-size: 13px; font-weight: 600; }
.article { padding: 30px 32px; box-shadow: none; }
.article__meta { margin: 0 0 8px; font-size: 13px; color: var(--faint); }
.article__title { font: 700 30px/1.2 var(--font-display); color: var(--gold-2); margin-bottom: 18px; }
.prose { color: #d6d2c6; font-size: 16px; line-height: 1.75; word-break: break-word; }
.prose > * + * { margin-top: 1em; }
.prose p { margin: 0; }
.prose h2, .prose h3, .prose h4 { color: var(--text); margin-top: 1.4em; }
.prose a { text-decoration: underline; }
.prose img { border-radius: 10px; height: auto; }
.prose blockquote { margin: 0; padding: 10px 16px; border-left: 3px solid var(--gold); background: rgba(226, 181, 90, .06); border-radius: 0 8px 8px 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose table { border-collapse: collapse; width: 100%; }
.prose td, .prose th { border: 1px solid var(--line); padding: 6px 10px; }

.rating__server { margin: 0; }
.rating td { vertical-align: middle; }
.place { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 50%; font-weight: 700; color: var(--muted); }
.rating__top--1 .place { color: #1a1206; background: linear-gradient(180deg, var(--gold-2), var(--gold-3)); }
.rating__top--2 .place { color: #111; background: linear-gradient(180deg, #e9edf5, #9aa3b5); }
.rating__top--3 .place { color: #1a0f06; background: linear-gradient(180deg, #e7a46a, #9b5a2a); }
.rating__top td { background: rgba(226, 181, 90, .04); }
.gender { color: var(--faint); margin-right: 4px; }
.camp { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.camp--bloodoath { color: #ff9a9a; border-color: rgba(239, 107, 107, .45); }
.camp--holyguard { color: #9cc4ff; border-color: rgba(111, 157, 255, .45); }

.gw { padding: 22px; box-shadow: none; display: grid; gap: 18px; }
.gw__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.gw__stat { display: grid; gap: 2px; padding: 14px; border-radius: 12px; background: rgba(0, 0, 0, .22); }
.gw__stat small { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.gw__stat strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.gw__stat span { font-size: 12px; color: var(--muted); }
.gw__stat--pool strong { color: var(--gold-2); font-size: 28px; }
.gw__line { margin: 0; padding: 12px 14px; border-radius: 10px; background: rgba(255, 255, 255, .03); color: var(--muted); }
.gw__line--ok { color: #bff0d2; background: rgba(95, 208, 141, .08); }
.gw__line--warn { color: #ffe2b0; background: rgba(240, 176, 74, .08); }
.gw__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.gw__h { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.gw__list { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.gw__list li { color: var(--muted); }
.gw__list li span { color: var(--text); }
.gw__list li strong { float: right; color: var(--gold-2); font-variant-numeric: tabular-nums; }

.social { margin-top: 18px; display: grid; gap: 12px; }
.social__or { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.social__or::before, .social__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.social__buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.social__icon { font-weight: 800; }
.social__btn--google .social__icon { color: #8ab4f8; }
.social__btn--telegram .social__icon { color: #5fb7ea; }
.linked { display: grid; gap: 10px; max-width: 520px; }
.linked__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: rgba(0, 0, 0, .18); }
.linked__name { font-weight: 600; flex: 1; min-width: 0; }
.badge:not([class*="badge--"]) { color: var(--muted); border-color: var(--line-2); }

@media (max-width: 720px) {
    .gw__stats { grid-template-columns: repeat(2, 1fr); }
    .gw__cols { grid-template-columns: 1fr; }
    .hide-sm { display: none; }
    .article { padding: 22px 18px; }
}

/* ---------- Admin panel ---------- */
.nav__link--admin { color: var(--warn); }
.admin-tabs { margin-bottom: 22px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 16px 18px; box-shadow: none; display: grid; gap: 4px; }
.stat small { font-size: 12px; color: var(--faint); }
.stat strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.stat--warn { border-color: rgba(240, 176, 74, .55); }
.stat--warn strong { color: var(--warn); }
.search--wide { max-width: 640px; margin-bottom: 8px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); gap: 16px; }
.admin-box { padding: 18px; box-shadow: none; display: grid; gap: 10px; align-content: start; }
.admin-box__title { font-size: 16px; }
.admin-box .table td { padding: 6px 8px; }
.admin-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.admin-act .input { flex: 1 1 110px; width: auto; padding: 8px 10px; font-size: 13px; }
.admin-act .input[type="number"] { flex: 0 1 90px; }
.admin-act .input--select { min-width: 0; flex: 1 1 130px; padding-right: 30px; }
.admin-row { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-form { padding: 20px; box-shadow: none; }
/* Admin → Re-send: the send controls stay in view while scrolling the (long) list */
.resend-form { padding: 12px; box-shadow: none; }
.resend-bar {
    position: sticky; top: 72px; z-index: 5;
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
    padding: 12px 14px; margin-bottom: 8px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.admin-form.form--inline .input { flex: 1 1 140px; }
.admin-form__hint { flex-basis: 100%; margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.admin-checks { display: flex; gap: 10px 22px; flex-wrap: wrap; }
.table--compact { font-size: 13px; }
.table--compact th, .table--compact td { padding: 8px 10px; }
.table__details { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.table__details:hover { white-space: normal; word-break: break-all; }
.nowrap { white-space: nowrap; }
.row--muted td { opacity: .5; }
.input--area { min-height: 260px; resize: vertical; font: 13px/1.5 ui-monospace, Consolas, monospace; }
.editor-bar { display: flex; gap: 4px; flex-wrap: wrap; }
.editor-bar button { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); cursor: pointer; font: 600 12px/1.4 var(--font); }
.editor-bar button:hover { border-color: var(--gold-3); }
.preview { margin-top: 10px; }
.progress--inline { width: 80px; vertical-align: middle; margin-right: 6px; }
.cases-head__right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ==========================================================================
   Theme art: old-site images (hero background, logo, class art, chests)
   ========================================================================== */
/* --site-bg: Admin → Налаштування сайту → Фон overrides it from /uploads/backgrounds/site-bg.css (SiteBackground). */
:root { --site-bg: url("/assets/img/hero.webp?v=2"); }
body {
    background:
        linear-gradient(180deg, rgba(11, 13, 20, .55) 0, rgba(11, 13, 20, .86) 420px, var(--bg) 900px),
        var(--site-bg) center top / 1920px auto no-repeat,
        var(--bg);
}
.brand__logo { height: 50px; width: auto; display: block; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .6)); transition: filter .2s; }
.brand:hover .brand__logo { filter: drop-shadow(0 0 10px rgba(143, 196, 255, .45)); }

.topbar { background: linear-gradient(180deg, rgba(8, 10, 16, .92), rgba(11, 13, 20, .78)); border-bottom: 1px solid rgba(226, 181, 90, .22); box-shadow: 0 1px 0 rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .25); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent); opacity: .55; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 64px 0 80px; text-align: center; isolation: isolate; }
.hero::before {
    content: ""; position: absolute; inset: 0; z-index: -2;
    background: var(--site-bg) center 20% / cover no-repeat;
    -webkit-mask: linear-gradient(180deg, #000 55%, transparent); mask: linear-gradient(180deg, #000 55%, transparent);
}
/* Optional hero video (SiteBackground): over the image, under the dark overlay (::after); shown once it plays,
   so a slow, blocked or failed video simply leaves the image. app.js skips it on phones and reduced motion. */
.hero__video {
    position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center 20%;
    opacity: 0; transition: opacity .8s ease; pointer-events: none;
    -webkit-mask: linear-gradient(180deg, #000 55%, transparent); mask: linear-gradient(180deg, #000 55%, transparent);
}
.hero__video.is-playing { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .hero__video { display: none; } }
/* Admin → Налаштування сайту → Фон */
.bg-admin__sub { margin: 18px 0 8px; font-size: 16px; }
.bg-admin__current { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.bg-admin__current img, .bg-admin__current video { width: 320px; max-width: 100%; height: 180px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line, rgba(255, 255, 255, .12)); background: #000; }
.bg-admin form.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.bg-admin form.inline-form .input { flex: 1 1 260px; width: auto; max-width: 560px; }
.bg-admin__list { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.bg-admin__item { margin: 0; width: 200px; }
.bg-admin__item img { width: 200px; height: 112px; object-fit: cover; border-radius: 6px; border: 2px solid transparent; display: block; }
.bg-admin__item.is-current img { border-color: var(--gold); }
.bg-admin__item figcaption { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.bg-admin__item figcaption form { margin: 0; }
.hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: radial-gradient(70% 60% at 50% 45%, rgba(11, 13, 20, .2), rgba(11, 13, 20, .78)), linear-gradient(180deg, rgba(11, 13, 20, .2), var(--bg));
}
.hero__inner { position: relative; z-index: 1; }
.hero__logo { margin: 0 auto; max-width: 520px; line-height: 0; }
.hero__logo img { width: 100%; height: auto; filter: drop-shadow(0 10px 40px rgba(0, 0, 0, .7)) drop-shadow(0 0 30px rgba(143, 196, 255, .25)); animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.eyebrow { text-transform: uppercase; letter-spacing: .3em; font-size: 12px; font-weight: 600; color: var(--magic); margin: 4px 0 0; text-shadow: 0 2px 8px #000; }
.hero__lead { max-width: 620px; margin: 16px auto 0; color: #d9d6cc; font-size: 18px; text-shadow: 0 2px 10px #000; }
.hero__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.hero__actions .btn--ghost { background: rgba(11, 13, 20, .55); backdrop-filter: blur(4px); }
.hero__download { display: inline-block; margin-top: 22px; color: #cfd3e0; font-size: 14px; text-shadow: 0 1px 6px #000; }
.hero__download:hover { color: var(--gold-2); }
/* Players online (cron/online.php): one wrapping row of small pills under the hero buttons */
.online { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 8px; max-width: 640px; margin: 22px auto 0; font-size: 13px; color: #cfd3e0; text-shadow: 0 1px 6px #000; }
.online__now { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.online__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: online-pulse 2s ease-in-out infinite; }
@keyframes online-pulse { 50% { opacity: .45; } }
.online__srv, .online__today { padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(226, 181, 90, .25); background: rgba(11, 13, 20, .6); white-space: nowrap; }
.online__srv b { color: var(--gold-2); }
.online__today { color: var(--muted); white-space: normal; }
@media (prefers-reduced-motion: reduce) { .online__dot { animation: none; } }
.hero__art { position: absolute; bottom: 0; z-index: 0; pointer-events: none; width: min(34vw, 470px); opacity: .95; }
.hero__art img { width: 100%; height: auto; display: block; -webkit-mask: linear-gradient(180deg, #000 70%, transparent); mask: linear-gradient(180deg, #000 70%, transparent); }
.hero__art--left { left: max(-60px, calc(50% - 900px)); }
.hero__art--right { right: max(-40px, calc(50% - 880px)); width: min(36vw, 520px); }

/* Hero layout from Admin → Головна сторінка → Головний блок (HeroSettings: classes on .hero) */
.hero--logo-s .hero__logo { max-width: 340px; }
.hero--logo-l .hero__logo { max-width: 720px; }

.hero__logo { width: 100%; }
/* Hidden logo: the h1 stays for screen readers and search engines (visually hidden) */
.hero--no-logo .hero__logo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* Logo and text placement (HeroSettings pos_h / pos_v → .hero--h-* / .hero--v-*, any pair). .hero__main holds the logo
   (.hero__logo) and the text (.hero__text: eyebrow, lead, buttons, online, launch strip); the «download» link under it
   is always centred. */
.hero__main { display: flex; flex-direction: column; align-items: center; }
.hero__text { display: flex; flex-direction: column; align-items: center; width: 100%; }
.hero__text > .hero__lead, .hero__text > .online, .hero__text > .launch-strip { margin-left: 0; margin-right: 0; }
.hero__download { display: table; margin: 22px auto 0; }
/* Horizontal: left / right (the character on that side steps aside), spread (logo left, text right, no characters) */
.hero--h-left .hero__main, .hero--h-left .hero__text { align-items: flex-start; text-align: left; }
.hero--h-left .hero__actions, .hero--h-left .online { justify-content: flex-start; }
.hero--h-left .hero__art--left { display: none; }
.hero--h-right .hero__main, .hero--h-right .hero__text { align-items: flex-end; text-align: right; }
.hero--h-right .hero__actions, .hero--h-right .online { justify-content: flex-end; }
.hero--h-right .hero__art--right { display: none; }
.hero--h-left .hero__logo, .hero--h-right .hero__logo { margin-left: 0; margin-right: 0; }
@media (min-width: 1241px) {
    .hero--h-left .hero__main { padding-right: 38%; }
    .hero--h-right .hero__main { padding-left: 38%; }
}
@media (min-width: 761px) {
    .hero--h-spread .hero__art { display: none; }
    .hero--h-spread .hero__main { flex-direction: row; align-items: center; justify-content: space-between; gap: 40px; }
    .hero.hero--h-spread .hero__logo { margin: 0; flex: 0 1 42%; }
    .hero.hero--h-spread .hero__text { flex: 0 1 52%; width: auto; min-width: 0; align-items: flex-end; text-align: right; }
    .hero--h-spread .hero__actions, .hero--h-spread .online { justify-content: flex-end; }
}
/* Vertical outside full screen: «split» only adds air between the logo and the text */
.hero--v-split .hero__logo { margin-bottom: 28px; }

/* Full screen: the hero fills the window under the sticky top bar (--topbar-h, measured by app.js); .hero__main takes
   the free height and places the logo and the text in it (top / center / bottom / split), the «download» hint sits at
   the bottom, the characters stand on the bottom edge and follow the height. */
.hero--full { min-height: calc(100vh - var(--topbar-h, 67px)); min-height: calc(100svh - var(--topbar-h, 67px)); display: flex; flex-direction: column; padding: 28px 0 22px; }
.hero--full .hero__inner { flex: 1; display: flex; flex-direction: column; width: 100%; }
.hero--full .hero__main { flex: 1 0 auto; justify-content: center; }
.hero--full .hero__logo { flex: none; }
.hero--full.hero--v-top .hero__main { justify-content: flex-start; }
.hero--full.hero--v-bottom .hero__main { justify-content: flex-end; }
.hero--full.hero--v-split .hero__main { justify-content: space-between; }
.hero--full.hero--v-split .hero__logo { margin-bottom: 18px; }
.hero--full .hero__text { flex: none; }
@media (min-width: 761px) {
    /* spread: one row, the vertical setting moves both (split: logo up, text down) */
    .hero--full.hero--h-spread .hero__main { justify-content: space-between; }
    .hero--full.hero--h-spread.hero--v-top .hero__main { align-items: flex-start; }
    .hero--full.hero--h-spread.hero--v-bottom .hero__main { align-items: flex-end; }
    .hero--full.hero--h-spread.hero--v-split .hero__main { align-items: stretch; }
    .hero--full.hero--h-spread.hero--v-split .hero__logo { align-self: flex-start; margin-bottom: 0; }
    .hero--full.hero--h-spread.hero--v-split .hero__text { align-self: flex-end; }
}
.hero--full .hero__download { margin-top: 18px; }
.hero--full .hero__download::after { content: ""; display: block; width: 1px; height: 22px; margin: 6px auto 0; background: linear-gradient(var(--gold-2), transparent); animation: hero-hint 1.8s ease-in-out infinite; }
@keyframes hero-hint { 50% { transform: translateY(6px); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .hero--full .hero__download::after { animation: none; } }
.hero--full .hero__art--left { width: min(34vw, 60vh, 640px); width: min(34vw, 60svh, 640px); }
.hero--full .hero__art--right { width: min(36vw, 80vh, 720px); width: min(36vw, 80svh, 720px); }
/* Logo sizes follow the screen (the file is 560 px wide: medium stays close to it), capped by the height */
.hero--full .hero__logo { max-width: min(clamp(380px, 27vw, 640px), 46vh); max-width: min(clamp(380px, 27vw, 640px), 46svh); }
.hero--full.hero--logo-s .hero__logo { max-width: min(clamp(260px, 18vw, 440px), 30svh); }
.hero--full.hero--logo-l .hero__logo { max-width: min(clamp(480px, 36vw, 860px), 60svh); }
/* Phones and narrow screens: everything centred in one column again (the vertical setting still applies) */
@media (max-width: 760px) {
    .hero .hero__main, .hero .hero__text { align-items: center; text-align: center; padding-left: 0; padding-right: 0; }
    .hero .hero__actions, .hero .online { justify-content: center; }
    .hero--h-left .hero__logo, .hero--h-right .hero__logo { margin-left: auto; margin-right: auto; }
    .hero--v-split .hero__logo { margin-bottom: 0; }
    .hero .hero__logo, .hero--full .hero__logo, .hero--logo-s .hero__logo, .hero--logo-l .hero__logo,
    .hero--full.hero--logo-s .hero__logo, .hero--full.hero--logo-l .hero__logo { max-width: min(320px, 80vw); }
}

/* Ornate section titles */
.section__title--ornate { display: flex; align-items: center; justify-content: center; gap: 18px; text-align: center; font-size: 26px; color: var(--gold-2); margin-bottom: 22px; }
.section__title--ornate::before, .section__title--ornate::after {
    content: ""; flex: 1; max-width: 220px; height: 10px;
    background: linear-gradient(90deg, transparent, var(--gold-3)) center / 100% 1px no-repeat,
                radial-gradient(circle, var(--gold-2) 0 2.5px, transparent 3px) right center / 10px 10px no-repeat;
}
.section__title--ornate::after { transform: scaleX(-1); }

/* Framed cards: thin gold corner accents */
.card, .feature, .steps { position: relative; }
.card::after, .feature::after, .steps::after {
    content: ""; position: absolute; inset: 6px; pointer-events: none; border-radius: calc(var(--radius) - 4px);
    background:
        linear-gradient(var(--gold-3), var(--gold-3)) left top / 14px 1px no-repeat,
        linear-gradient(var(--gold-3), var(--gold-3)) left top / 1px 14px no-repeat,
        linear-gradient(var(--gold-3), var(--gold-3)) right top / 14px 1px no-repeat,
        linear-gradient(var(--gold-3), var(--gold-3)) right top / 1px 14px no-repeat,
        linear-gradient(var(--gold-3), var(--gold-3)) left bottom / 14px 1px no-repeat,
        linear-gradient(var(--gold-3), var(--gold-3)) left bottom / 1px 14px no-repeat,
        linear-gradient(var(--gold-3), var(--gold-3)) right bottom / 14px 1px no-repeat,
        linear-gradient(var(--gold-3), var(--gold-3)) right bottom / 1px 14px no-repeat;
    opacity: .55;
}
.card { background: linear-gradient(180deg, rgba(28, 33, 48, .92), rgba(16, 19, 29, .94)); }

/* Features */
.feature { text-align: center; padding: 22px 22px 26px; background: linear-gradient(180deg, rgba(28, 33, 48, .85), rgba(16, 19, 29, .7)); }
.feature__img { width: 110px; height: 96px; object-fit: contain; margin: 0 auto 10px; display: block; filter: drop-shadow(0 8px 18px rgba(226, 181, 90, .25)); transition: transform .3s; }
.feature:hover .feature__img { transform: translateY(-4px) scale(1.04); }

/* Classes (CSS-only tabs: the radio inputs come before the tabs and panels) */
.classes__radio { position: absolute; opacity: 0; pointer-events: none; }
.classes__tabs { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.classes__tab { display: grid; justify-items: center; gap: 6px; width: 104px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: rgba(16, 19, 29, .7); color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; transition: border-color .2s, color .2s, transform .2s; }
.classes__tab img { width: 46px; height: 46px; filter: grayscale(.6) brightness(.8); transition: filter .2s; }
.classes__tab:hover { color: var(--text); transform: translateY(-2px); }
.classes__tab:hover img { filter: none; }
.classes__panels { position: relative; }
.class-panel { display: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 26px; align-items: center; padding: 10px 26px 0; border-radius: var(--radius); border: 1px solid var(--line);
    background: radial-gradient(60% 90% at 25% 60%, rgba(111, 157, 255, .16), transparent 70%), linear-gradient(180deg, rgba(28, 33, 48, .9), rgba(16, 19, 29, .9)); overflow: hidden; min-height: 380px; }
.class-panel__art { align-self: end; text-align: center; line-height: 0; }
.class-panel__art img { max-height: 420px; width: auto; max-width: 100%; -webkit-mask: linear-gradient(180deg, #000 80%, transparent); mask: linear-gradient(180deg, #000 80%, transparent); }
.class-panel__body { padding: 24px 0 30px; }
.class-panel__name { font: 700 36px/1.1 var(--font-display); color: var(--gold-2); letter-spacing: .05em; text-transform: uppercase; }
.class-panel__tagline { color: var(--magic); margin: 10px 0 12px; font-weight: 600; }
.class-panel__text { color: #cfccc2; margin: 0 0 16px; font-size: 16px; line-height: 1.7; }
.class-panel__diff { margin: 0; color: var(--muted); font-size: 14px; }
.stars { color: var(--gold-2); letter-spacing: .15em; font-size: 16px; }
.stars__off { color: var(--line-2); }
#cls-1:checked ~ .classes__panels .class-panel--1, #cls-2:checked ~ .classes__panels .class-panel--2, #cls-3:checked ~ .classes__panels .class-panel--3,
#cls-4:checked ~ .classes__panels .class-panel--4, #cls-5:checked ~ .classes__panels .class-panel--5, #cls-6:checked ~ .classes__panels .class-panel--6 { display: grid; animation: fadeIn .35s ease-out; }
#cls-1:checked ~ .classes__tabs .classes__tab--1, #cls-2:checked ~ .classes__tabs .classes__tab--2, #cls-3:checked ~ .classes__tabs .classes__tab--3,
#cls-4:checked ~ .classes__tabs .classes__tab--4, #cls-5:checked ~ .classes__tabs .classes__tab--5, #cls-6:checked ~ .classes__tabs .classes__tab--6 { color: var(--gold-2); border-color: var(--gold); background: rgba(226, 181, 90, .1); box-shadow: 0 0 18px rgba(226, 181, 90, .2); }
#cls-1:checked ~ .classes__tabs .classes__tab--1 img, #cls-2:checked ~ .classes__tabs .classes__tab--2 img, #cls-3:checked ~ .classes__tabs .classes__tab--3 img,
#cls-4:checked ~ .classes__tabs .classes__tab--4 img, #cls-5:checked ~ .classes__tabs .classes__tab--5 img, #cls-6:checked ~ .classes__tabs .classes__tab--6 img { filter: none; }
.classes__radio:focus-visible ~ .classes__tabs { outline: 2px solid var(--magic); outline-offset: 4px; border-radius: 12px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Showcase banners */
.showcase { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: center; margin-bottom: 26px; }
.showcase--reverse .showcase__img { order: 2; }
.showcase__img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0, 0, 0, .5), 0 0 0 1px rgba(226, 181, 90, .25); }
.showcase__body .section__title { font-size: 24px; color: var(--gold-2); }
.showcase__body .muted { font-size: 16px; line-height: 1.7; margin: 0; }

/* Screenshot gallery */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gallery__item { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); line-height: 0; aspect-ratio: 16 / 9; background: var(--surface); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s, filter .35s; filter: saturate(.9); }
.gallery__item:hover { border-color: var(--gold-3); }
.gallery__item:hover img { transform: scale(1.06); filter: saturate(1.1); }

.page-title { text-shadow: 0 2px 12px rgba(0, 0, 0, .8); }
.case { background: linear-gradient(180deg, rgba(28, 33, 48, .9), rgba(16, 19, 29, .9)); }

@media (max-width: 1000px) {

    .class-panel { grid-template-columns: 1fr; padding-top: 0; }
    .class-panel__art img { max-height: 300px; }
    .gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
    .showcase { grid-template-columns: 1fr; gap: 14px; }
    .showcase--reverse .showcase__img { order: 0; }
}
@media (max-width: 560px) {
    .hero { padding: 36px 0 56px; }
    .hero__logo { max-width: 320px; }
    .classes__tab { width: calc(33.33% - 7px); }
    .class-panel { padding: 0 16px; }
    .class-panel__name { font-size: 28px; }
    .brand__logo { height: 42px; }
}
@media (max-width: 1240px) {
    .hero__art { display: none; }
}

/* ==========================================================================
   Rarity frames (shop, inventory, item sheets, case prizes)
   ========================================================================== */
.rarity--common { --r: #b4bccb; --r2: #6d7588; }
.rarity--uncommon { --r: #5fe08d; --r2: #1f8a4a; }
.rarity--rare { --r: #5aa2ff; --r2: #1f4fa8; }
.rarity--epic { --r: #b77bff; --r2: #6327b8; }
.rarity--legendary { --r: #ffb03a; --r2: #b86a00; }
.rarity--mythic { --r: #ff3b3b; --r2: #8a0000; }
.rarity--overlord { --r: #ff5dc8; --r2: #9b0f78; }

.item {
    border: 1px solid color-mix(in srgb, var(--r) 55%, transparent);
    background:
        radial-gradient(110% 60% at 50% 0%, color-mix(in srgb, var(--r) 22%, transparent), transparent 70%),
        linear-gradient(180deg, rgba(28, 33, 48, .95), rgba(14, 17, 26, .95));
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .4), 0 0 14px color-mix(in srgb, var(--r) 14%, transparent);
    overflow: hidden;
}
.item::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--r), transparent); }
.item:hover { border-color: var(--r); box-shadow: 0 0 0 1px color-mix(in srgb, var(--r) 40%, transparent), 0 10px 28px color-mix(in srgb, var(--r) 30%, transparent); }
.item__icon {
    width: 70px; height: 70px; border-radius: 12px;
    border: 2px solid var(--r);
    background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--r) 45%, #000), color-mix(in srgb, var(--r2) 55%, #05060a) 75%);
    box-shadow: 0 0 12px color-mix(in srgb, var(--r) 45%, transparent), inset 0 0 14px rgba(0, 0, 0, .55);
}
.item__icon img { width: 58px; height: 58px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.item__icon--lg { width: 92px; height: 92px; }
.item__icon--lg img { width: 78px; height: 78px; }
.item__name { color: color-mix(in srgb, var(--r) 70%, #fff); }
.item__rarity { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--r); }
.item__new {
    position: absolute; top: 6px; left: 6px; z-index: 1; padding: 2px 8px; border-radius: 999px;
    font: 800 10px/1.4 var(--font); letter-spacing: .08em; text-transform: uppercase; color: #06231f;
    background: linear-gradient(135deg, #8ff5e6, var(--magic)); box-shadow: 0 0 10px rgba(111, 220, 207, .55);
}

/* Top rarities: animated light sweep and pulsing glow */
/* Cheap to draw: the pulse only fades a pre-drawn glow layer (opacity) and the sweep only moves (transform),
   so the browser composites them instead of repainting every card each frame. */
.rarity--legendary .item__icon, .rarity--mythic .item__icon, .rarity--overlord .item__icon { position: relative; overflow: hidden; box-shadow: 0 0 22px color-mix(in srgb, var(--r) 75%, transparent), inset 0 0 14px rgba(0, 0, 0, .55); }
.rarity--legendary .item__icon::before, .rarity--mythic .item__icon::before, .rarity--overlord .item__icon::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
    background: radial-gradient(circle at 50% 50%, transparent 45%, color-mix(in srgb, var(--r) 35%, transparent));
    animation: rarityGlow 2.6s ease-in-out infinite; will-change: opacity;
}
@keyframes rarityGlow { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
.rarity--legendary .item__icon::after, .rarity--mythic .item__icon::after, .rarity--overlord .item__icon::after {
    content: ""; position: absolute; inset: -40%; pointer-events: none;
    background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .35) 50%, transparent 60%);
    animation: raritySweep 3.2s ease-in-out infinite; will-change: transform;
}
.rarity--overlord .item__icon { border-image: linear-gradient(135deg, #ff5dc8, #ffd23b, #ff5dc8) 1; border-radius: 0; }
@keyframes rarityPulse { 0%, 100% { box-shadow: 0 0 10px color-mix(in srgb, var(--r) 40%, transparent), inset 0 0 14px rgba(0, 0, 0, .55); } 50% { box-shadow: 0 0 22px color-mix(in srgb, var(--r) 75%, transparent), inset 0 0 14px rgba(0, 0, 0, .55); } }
@keyframes raritySweep { 0% { transform: translateX(-60%); } 60%, 100% { transform: translateX(60%); } }

.product__name { color: var(--r, var(--text)); text-shadow: 0 0 18px color-mix(in srgb, var(--r, transparent) 45%, transparent); }
.rarity-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--r) 60%, transparent); background: color-mix(in srgb, var(--r) 12%, transparent); font-size: 12px; }

/* Case prize uses the same palette */
.prize--common { --c: #b4bccb; }
.prize--uncommon { --c: #5fe08d; }
.prize--rare { --c: #5aa2ff; }
.prize--epic { --c: #b77bff; }
.prize--legendary { --c: #ffb03a; }
.prize--mythic { --c: #ff3b3b; }
.prize--overlord { --c: #ff5dc8; }
.prize__icon { border: 2px solid var(--c); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--c) 45%, #000), #05060a 80%); box-shadow: 0 0 30px color-mix(in srgb, var(--c) 55%, transparent); }
.vip-frame { position: relative; display: inline-block; flex: none; line-height: 0; }
.vip-photo { display: block; width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid var(--line-2); background: var(--surface); box-sizing: border-box; }
.vip-badge { position: absolute; bottom: -11px; left: 50%; transform: translateX(-50%); z-index: 2; padding: 3px 12px; border-radius: 12px; border: 1px solid transparent; color: #fff; font: 700 13px/1.4 var(--font); letter-spacing: .04em; white-space: nowrap; box-shadow: 0 3px 8px rgba(0, 0, 0, .8); cursor: help; }
.vip-frame--sm .vip-photo { width: 30px; height: 30px; border-width: 2px; animation: none; }
.vip-frame--md .vip-photo { width: 84px; height: 84px; }
.vip-title { display: inline-flex; align-items: center; gap: 6px; font: 700 13px/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--gold-2); }
.profile__vip-title { margin: 0 0 10px; }

/* ==========================================================================
   VIP levels 1-20: the same frames as the old site (avatar glow + badge)
   ========================================================================== */
/* Рівень 1: Basic (Світло-сірий) */
.vip-level-1 .vip-photo { border-color: #b0c4de; animation: pulseLvl1 3s infinite ease-in-out; }
.vip-level-1 .vip-badge { background: linear-gradient(135deg, #4b5d67, #b0c4de); border-color: #b0c4de; }
@keyframes pulseLvl1 { 0%, 100% { box-shadow: 0 0 3px rgba(176, 196, 222, 0.2); } 50% { box-shadow: 0 0 10px rgba(176, 196, 222, 0.6); } }

/* Рівень 2: Novice (Бронзовий) */
.vip-level-2 .vip-photo { border-color: #cd7f32; animation: pulseLvl2 2.8s infinite ease-in-out; }
.vip-level-2 .vip-badge { background: linear-gradient(135deg, #5c3a21, #cd7f32); border-color: #cd7f32; }
@keyframes pulseLvl2 { 0%, 100% { box-shadow: 0 0 4px rgba(205, 127, 50, 0.2); } 50% { box-shadow: 0 0 12px rgba(205, 127, 50, 0.7); } }

/* Рівень 3: Apprentice (Срібний) */
.vip-level-3 .vip-photo { border-color: #c0c0c0; animation: pulseLvl3 2.7s infinite ease-in-out; }
.vip-level-3 .vip-badge { background: linear-gradient(135deg, #696969, #c0c0c0); border-color: #c0c0c0; }
@keyframes pulseLvl3 { 0%, 100% { box-shadow: 0 0 4px rgba(192, 192, 192, 0.3); } 50% { box-shadow: 0 0 14px rgba(192, 192, 192, 0.8); } }

/* Рівень 4: Scout (Темно-зелений) */
.vip-level-4 .vip-photo { border-color: #228b22; animation: pulseLvl4 2.6s infinite ease-in-out; }
.vip-level-4 .vip-badge { background: linear-gradient(135deg, #004d00, #228b22); border-color: #228b22; }
@keyframes pulseLvl4 { 0%, 100% { box-shadow: 0 0 5px rgba(34, 139, 34, 0.3); } 50% { box-shadow: 0 0 15px rgba(34, 139, 34, 0.8); } }

/* Рівень 5: Ranger (Салатовий) */
.vip-level-5 .vip-photo { border-color: #1eff00; animation: pulseLvl5 2.5s infinite ease-in-out; }
.vip-level-5 .vip-badge { background: linear-gradient(135deg, #0a4d00, #179e00); border-color: #1eff00; }
@keyframes pulseLvl5 { 0%, 100% { box-shadow: 0 0 5px rgba(30, 255, 0, 0.3); } 50% { box-shadow: 0 0 16px rgba(30, 255, 0, 0.9); } }

/* Рівень 6: Adept (Бірюзовий) */
.vip-level-6 .vip-photo { border-color: #00fa9a; animation: pulseLvl6 2.4s infinite ease-in-out; }
.vip-level-6 .vip-badge { background: linear-gradient(135deg, #006633, #00fa9a); border-color: #00fa9a; }
@keyframes pulseLvl6 { 0%, 100% { box-shadow: 0 0 5px rgba(0, 250, 154, 0.3); } 50% { box-shadow: 0 0 18px rgba(0, 250, 154, 0.9); } }

/* Рівень 7: Mystic (Блакитний) */
.vip-level-7 .vip-photo { border-color: #00ffff; animation: pulseLvl7 2.3s infinite ease-in-out; }
.vip-level-7 .vip-badge { background: linear-gradient(135deg, #005555, #00b3b3); border-color: #00ffff; }
@keyframes pulseLvl7 { 0%, 100% { box-shadow: 0 0 6px rgba(0, 255, 255, 0.4); } 50% { box-shadow: 0 0 20px rgba(0, 255, 255, 1); } }

/* Рівень 8: Mage (Синій) */
.vip-level-8 .vip-photo { border-color: #0070dd; animation: pulseLvl8 2.2s infinite ease-in-out; }
.vip-level-8 .vip-badge { background: linear-gradient(135deg, #002244, #0050a0); border-color: #0070dd; }
@keyframes pulseLvl8 { 0%, 100% { box-shadow: 0 0 6px rgba(0, 112, 221, 0.4); } 50% { box-shadow: 0 0 22px rgba(0, 112, 221, 1); } }

/* Рівень 9: Wizard (Індиго) */
.vip-level-9 .vip-photo { border-color: #4b0082; animation: pulseLvl9 2.1s infinite ease-in-out; }
.vip-level-9 .vip-badge { background: linear-gradient(135deg, #1a0033, #4b0082); border-color: #4b0082; }
@keyframes pulseLvl9 { 0%, 100% { box-shadow: 0 0 6px rgba(75, 0, 130, 0.5); } 50% { box-shadow: 0 0 24px rgba(75, 0, 130, 1); } }

/* Рівень 10: Sorcerer (Фіолетовий) */
.vip-level-10 .vip-photo { border-color: #a335ee; animation: pulseLvl10 2s infinite ease-in-out; }
.vip-level-10 .vip-badge { background: linear-gradient(135deg, #38006b, #7d12ff); border-color: #a335ee; }
@keyframes pulseLvl10 { 0%, 100% { box-shadow: 0 0 7px rgba(163, 53, 238, 0.5); } 50% { box-shadow: 0 0 25px rgba(163, 53, 238, 1); } }

/* Рівень 11: Warlock (Маджента) */
.vip-level-11 .vip-photo { border-color: #ff00ff; animation: pulseLvl11 1.9s infinite ease-in-out; }
.vip-level-11 .vip-badge { background: linear-gradient(135deg, #660066, #cc00cc); border-color: #ff00ff; }
@keyframes pulseLvl11 { 0%, 100% { box-shadow: 0 0 7px rgba(255, 0, 255, 0.5); } 50% { box-shadow: 0 0 26px rgba(255, 0, 255, 1); } }

/* Рівень 12: Hero (Рожевий) */
.vip-level-12 .vip-photo { border-color: #ff1493; animation: pulseLvl12 1.8s infinite ease-in-out; }
.vip-level-12 .vip-badge { background: linear-gradient(135deg, #800040, #c71585); border-color: #ff1493; }
@keyframes pulseLvl12 { 0%, 100% { box-shadow: 0 0 8px rgba(255, 20, 147, 0.5); } 50% { box-shadow: 0 0 28px rgba(255, 20, 147, 1); } }

/* Рівень 13: Champion (Кораловий) */
.vip-level-13 .vip-photo { border-color: #ff7f50; animation: pulseLvl13 1.7s infinite ease-in-out; }
.vip-level-13 .vip-badge { background: linear-gradient(135deg, #8b3e2f, #ff7f50); border-color: #ff7f50; }
@keyframes pulseLvl13 { 0%, 100% { box-shadow: 0 0 8px rgba(255, 127, 80, 0.5); } 50% { box-shadow: 0 0 28px rgba(255, 127, 80, 1); } }

/* Рівень 14: Warlord (Помаранчевий) */
.vip-level-14 .vip-photo { border-color: #ff8000; animation: pulseLvl14 1.6s infinite ease-in-out; }
.vip-level-14 .vip-badge { background: linear-gradient(135deg, #663300, #cc6600); border-color: #ff8000; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
@keyframes pulseLvl14 { 0%, 100% { box-shadow: 0 0 8px rgba(255, 128, 0, 0.6); } 50% { box-shadow: 0 0 30px rgba(255, 128, 0, 1); } }

/* Рівень 15: Legend (Червоно-помаранчевий) */
.vip-level-15 .vip-photo { border-color: #ff4500; animation: pulseLvl15 1.5s infinite ease-in-out; }
.vip-level-15 .vip-badge { background: linear-gradient(135deg, #802200, #cc3700); border-color: #ff4500; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
@keyframes pulseLvl15 { 0%, 100% { box-shadow: 0 0 9px rgba(255, 69, 0, 0.6); } 50% { box-shadow: 0 0 32px rgba(255, 69, 0, 1); } }

/* Рівень 16: Mythic (Криваво-червоний) */
.vip-level-16 .vip-photo { border-color: #ff0000; animation: pulseLvl16 1.4s infinite ease-in-out; }
.vip-level-16 .vip-badge { background: linear-gradient(135deg, #660000, #cc0000); border-color: #ff0000; text-shadow: 0 0 3px #000; box-shadow: 0 0 8px rgba(255,0,0,0.8); }
@keyframes pulseLvl16 { 0%, 100% { box-shadow: 0 0 10px rgba(255, 0, 0, 0.6), inset 0 0 5px rgba(255, 0, 0, 0.3); } 50% { box-shadow: 0 0 35px rgba(255, 0, 0, 1), inset 0 0 15px rgba(255, 0, 0, 0.6); } }

/* Рівень 17: Demigod (Малиновий/Crimson) */
.vip-level-17 .vip-photo { border-color: #dc143c; animation: pulseLvl17 1.3s infinite ease-in-out; }
.vip-level-17 .vip-badge { background: linear-gradient(135deg, #7a0016, #b00020); border-color: #dc143c; text-shadow: 0 0 4px #000; }
@keyframes pulseLvl17 { 0%, 100% { box-shadow: 0 0 12px rgba(220, 20, 60, 0.7); } 50% { box-shadow: 0 0 40px rgba(220, 20, 60, 1), inset 0 0 20px rgba(220, 20, 60, 0.8); } }

/* Рівень 18: Immortal (Сяюче Золото) */
.vip-level-18 .vip-photo { border-color: #ffd700; animation: pulseLvl18 1.2s infinite ease-in-out; }
.vip-level-18 .vip-badge { background: linear-gradient(135deg, #b8860b, #ffd700); border-color: #ffd700; color: #000; text-shadow: 0 0 5px #fff; box-shadow: 0 0 15px rgba(255,215,0,0.9); }
@keyframes pulseLvl18 { 0%, 100% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.8), inset 0 0 10px rgba(255, 215, 0, 0.5); } 50% { box-shadow: 0 0 45px rgba(255, 215, 0, 1), inset 0 0 25px rgba(255, 215, 0, 0.9); } }

/* Рівень 19: Divine (Платиновий/Електрик) */
.vip-level-19 .vip-photo { border-color: #e5e4e2; animation: pulseLvl19 1s infinite alternate; }
.vip-level-19 .vip-badge { background: linear-gradient(135deg, #ffffff, #87cefa); border-color: #e5e4e2; color: #000; text-shadow: 0 0 8px #00bfff; }
@keyframes pulseLvl19 {
    0% { box-shadow: 0 0 15px #ffffff, 0 0 20px #00bfff; border-color: #ffffff; }
    100% { box-shadow: 0 0 50px #ffffff, 0 0 30px #00bfff, inset 0 0 20px #00bfff; border-color: #00bfff; }
}

/* Рівень 20: Creator (Призматичний / Максимальний) */
.vip-level-20 .vip-photo { border-color: #fff; animation: pulseLvl20 1.5s infinite linear; }
.vip-level-20 .vip-badge { background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000); background-size: 400%; border-color: #fff; text-shadow: 0 0 5px #000; animation: gradientShift 3s infinite linear; }
@keyframes pulseLvl20 {
    0%   { box-shadow: 0 0 20px #ff0000, inset 0 0 15px #ff0000; }
    25%  { box-shadow: 0 0 30px #fffb00, inset 0 0 15px #fffb00; }
    50%  { box-shadow: 0 0 40px #00ffd5, inset 0 0 20px #00ffd5; }
    75%  { box-shadow: 0 0 30px #7a00ff, inset 0 0 15px #7a00ff; }
    100% { box-shadow: 0 0 20px #ff0000, inset 0 0 15px #ff0000; }
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.profile__links { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 0; }
.nav__gear { color: var(--faint); font-size: 14px; }
.nav__user:hover .nav__gear { color: var(--gold-2); }
.profile .vip-frame { margin: 4px 6px 12px 4px; }
@media (min-width: 1181px) { .nav__link--settings { display: none; } }

/* ---------- Admin item editor: texts per language, icon picker ---------- */
.texts { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; margin: 0; display: grid; gap: 12px; background: rgba(0, 0, 0, .15); }
.texts__radio { position: absolute; opacity: 0; pointer-events: none; }
.texts__tabs { display: flex; gap: 6px; }
.texts__tab { cursor: pointer; }
.texts__panel { display: none; gap: 12px; }
.texts__desc { min-height: 96px; resize: vertical; }
#texts-uk:checked ~ .texts__panel--uk, #texts-en:checked ~ .texts__panel--en, #texts-ru:checked ~ .texts__panel--ru { display: grid; }
#texts-uk:checked ~ .texts__tabs .texts__tab--uk, #texts-en:checked ~ .texts__tabs .texts__tab--en, #texts-ru:checked ~ .texts__tabs .texts__tab--ru { color: #1a1206; background: var(--gold); border-color: var(--gold); font-weight: 600; }
.icon-field { display: flex; gap: 8px; }
.icon-field .input { flex: 1; min-width: 0; }
.icon-picker { width: min(96vw, 900px); display: none; }
.icon-picker[open] { display: grid; gap: 12px; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; max-height: 60vh; overflow-y: auto; padding: 2px; }
.icon-grid__btn { aspect-ratio: 1; display: grid; place-items: center; padding: 4px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); cursor: pointer; }
.icon-grid__btn img { width: 44px; height: 44px; object-fit: contain; }
.icon-grid__btn:hover { border-color: var(--gold-3); background: rgba(226, 181, 90, .08); }
.icon-grid__btn.is-active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(226, 181, 90, .35); }
.icon-grid__btn[hidden] { display: none; }
.product__desc { white-space: pre-line; }

/* ---------- Admin: send to a character ---------- */
.send-form { gap: 18px; }
.send-block { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; margin: 0; display: grid; gap: 12px; background: rgba(0, 0, 0, .15); }
.send-pick { position: relative; display: grid; gap: 8px; }
.send-pick .form--inline .input--select { flex: 0 0 auto; }
.pick-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; margin: 4px 0 0; padding: 4px; list-style: none; max-height: 340px; overflow-y: auto; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); box-shadow: var(--shadow); }
.pick-list__btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.pick-list__btn:hover, .pick-list__btn:focus-visible { background: rgba(226, 181, 90, .1); }
.pick-list__item .item__name { flex: 1; min-height: 0; -webkit-line-clamp: 1; }
.pick-list__empty { padding: 8px 10px; }
.item__icon--sm { width: 44px; height: 44px; flex: none; border-width: 1px; border-radius: 9px; }
.item__icon--sm img { width: 36px; height: 36px; }
.send-target { margin: 0; padding: 10px 14px; border-radius: 10px; background: rgba(95, 208, 141, .08); border: 1px solid rgba(95, 208, 141, .35); color: #bff0d2; }
.send-items { display: grid; gap: 8px; }
.send-item { display: grid; grid-template-columns: auto 1fr 130px 110px auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); }
.send-item__name { font-weight: 600; color: color-mix(in srgb, var(--r, var(--text)) 70%, #fff); word-break: break-word; }
.send-item__field { display: grid; gap: 2px; }
.send-item__field .input { padding: 8px 10px; }
@media (max-width: 720px) {
    .send-item { grid-template-columns: auto 1fr auto; }
    .send-item__field { grid-column: span 1; }
}

/* Item id fields with search (data-item-pick) */
.item-pick { position: relative; display: grid; gap: 6px; flex: 1 1 200px; min-width: 0; }
.item-pick > .input { width: 100%; }
.item-pick__preview { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.item-pick__name { font-weight: 600; color: color-mix(in srgb, var(--r, var(--text)) 75%, #fff); }
.item-pick .pick-list { top: 46px; }

/* ---------- Chat ---------- */
.chat { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.chat__side { padding: 12px; display: grid; gap: 10px; align-content: start; box-shadow: none; height: calc(100vh - 210px); min-height: 460px; overflow-y: auto; overscroll-behavior: contain; }
.chat-nav { display: grid; gap: 2px; }
.chat-nav__title { margin: 10px 8px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.chat-nav__item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--muted); font-size: 14px; }
.chat-nav__item:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.chat-nav__item.is-active { background: rgba(226, 181, 90, .12); color: var(--gold-2); }
.chat-nav__icon { width: 24px; text-align: center; }
.chat-nav__avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex: none; }
.chat-nav__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-nav__badge, .nav__badge { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.nav__badge { margin-left: 4px; }
.nav__badge--ok { background: var(--magic); color: #06231f; }
.nav__link { white-space: nowrap; } /* the label and its counter / dot stay on one line */
.nav__dot { display: inline-block; width: 8px; height: 8px; margin-left: 5px; border-radius: 50%; background: var(--magic); box-shadow: 0 0 8px rgba(111, 220, 207, .9); vertical-align: 2px; }
.chat-tools summary { cursor: pointer; padding: 6px 10px; font-size: 13px; color: var(--gold-2); }
.chat-tools__form { padding: 6px 4px 4px; gap: 8px; }
.chat__main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: calc(100vh - 210px); min-height: 460px; padding: 0; box-shadow: none; overflow: hidden; }
.chat__head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.chat__title { font: 700 19px/1.2 var(--font-display); color: var(--gold-2); }
.chat__hint { margin: 0; font-size: 13px; }
.chat__log { overflow-y: auto; padding: 14px 18px; display: grid; align-content: start; gap: 6px; }
.chat__older { justify-self: center; margin-bottom: 8px; }
.chat__empty { text-align: center; padding: 30px 0; }
.chat__composer { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: end; padding: 12px 14px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, .15); }
.chat__input { resize: none; min-height: 46px; max-height: 160px; }
.chat__attach { cursor: pointer; height: 46px; }
.chat__status { grid-column: 1 / -1; margin: 0; min-height: 0; color: var(--warn); }
.chat__status:empty { display: none; }
.chat__locked { margin: 12px 14px; }
.chat-members summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.chat-members__list { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.chat-members .form--inline { margin: 6px 0; }

.msg { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 6px 8px; border-radius: 10px; }
.msg:hover { background: rgba(255, 255, 255, .025); }
.msg__avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--surface); }
.msg__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.msg__name { font-weight: 700; font-size: 14px; color: var(--text); }
a.msg__name:hover { color: var(--gold-2); }
.msg--mine .msg__name { color: var(--magic); }
.msg--admin .msg__name { color: var(--danger); }
.msg--mod .msg__name { color: var(--warn); }
.msg__role { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; padding: 1px 6px; border-radius: 6px; border: 1px solid currentColor; color: var(--warn); }
.msg__time { font-size: 11px; color: var(--faint); }
.msg__del { margin-left: auto; opacity: 0; transition: opacity .15s; }
.msg:hover .msg__del, .msg__del:focus-within { opacity: 1; }
.msg__del-btn { border: 0; background: none; color: var(--faint); font-size: 18px; line-height: 1; cursor: pointer; }
.msg__del-btn:hover { color: var(--danger); }
.msg__text { margin: 2px 0 0; color: #d8d4c8; font-size: 14px; line-height: 1.55; word-break: break-word; }
.msg__text a { text-decoration: underline; }
.msg__image { display: inline-block; margin-top: 6px; line-height: 0; }
.msg__image img { max-width: min(100%, 360px); max-height: 280px; border-radius: 10px; border: 1px solid var(--line); }
.msg__file { display: inline-block; margin-top: 6px; font-size: 13px; }

@media (max-width: 820px) {
    .chat { grid-template-columns: 1fr; }
    .chat__side { height: auto; min-height: 0; max-height: 45vh; }
    .chat__main { height: 70vh; }
    .msg__del { opacity: 1; }
}

/* Nav dropdown (community) */
.nav__drop { position: relative; }
.nav__drop > summary { list-style: none; cursor: pointer; }
.nav__drop > summary::-webkit-details-marker { display: none; }
.nav__drop.is-active > summary { color: var(--gold-2); }
.nav__menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 180px; display: grid; gap: 2px; padding: 6px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); box-shadow: var(--shadow); }
@media (max-width: 1180px) {
    .nav__menu { position: static; box-shadow: none; border: 0; padding: 0 0 0 14px; background: none; }
}

/* ---------- Guides ---------- */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.guide-card { display: grid; grid-template-rows: 160px auto; overflow: hidden; color: var(--text); box-shadow: none; transition: transform .2s, border-color .2s; }
.guide-card:hover { color: var(--text); transform: translateY(-3px); border-color: var(--gold-3); }
.guide-card__cover { display: grid; place-items: center; background: linear-gradient(135deg, rgba(226, 181, 90, .12), rgba(111, 157, 255, .1)); font-size: 46px; overflow: hidden; }
.guide-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.guide-card__body { display: grid; gap: 6px; padding: 14px 16px 16px; align-content: start; }
.guide-card__title { font: 700 18px/1.25 var(--font-display); color: var(--gold-2); }
.guide-card__text { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.guide-card__meta { font-size: 12px; color: var(--faint); }
.prose img { max-width: 100%; }

/* ---------- Likes & comments ---------- */
.like { margin-top: 18px; }
.like__btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: none; color: var(--muted); font: 600 14px/1 var(--font); cursor: pointer; }
.like__btn:hover { border-color: #ff6f91; color: #ffb3c4; }
.like__btn.is-on { border-color: #ff6f91; background: rgba(255, 111, 145, .12); color: #ff9fb5; }
.comments { margin-top: 16px; padding: 20px 22px; box-shadow: none; display: grid; gap: 10px; }
.comments__title { font-size: 18px; }
.comment { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.comment--d1 { margin-left: 28px; }
.comment--d2, .comment--d3 { margin-left: 56px; }
.comment__actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.comment__react { border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 999px; padding: 2px 9px; font: 12px/1.5 var(--font); cursor: pointer; }
.comment__react:hover { color: var(--text); border-color: var(--line-2); }
.comment__react.is-on { color: var(--gold-2); border-color: var(--gold-3); }
.comment__del:hover { color: var(--danger); border-color: var(--danger); }
.comment__reply summary { cursor: pointer; font-size: 12px; color: var(--gold-2); list-style: none; padding: 2px 6px; }
.comment__reply[open] { flex-basis: 100%; }
.comment-form { gap: 8px; margin-top: 6px; }
.comment-form--main { padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- Gallery ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.media-card { display: grid; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); color: var(--text); transition: transform .2s, border-color .2s; }
.media-card:hover { color: var(--text); transform: translateY(-3px); border-color: var(--gold-3); }
.media-card__thumb { position: relative; aspect-ratio: 16 / 10; background: #05060a; display: grid; place-items: center; overflow: hidden; }
.media-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.media-card:hover .media-card__thumb img { transform: scale(1.05); }
.media-card__icon { font-size: 40px; color: var(--muted); }
.media-card__play { position: absolute; inset: auto auto 10px 10px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .65); color: #fff; font-size: 14px; }
.media-card__body { display: grid; gap: 2px; padding: 10px 12px 12px; }
.media-card__title { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card__meta { font-size: 12px; color: var(--faint); }
.media-view__frame { line-height: 0; border-radius: 12px; overflow: hidden; background: #000; }
.media-view__frame img, .media-view__frame video { width: 100%; height: auto; max-height: 75vh; object-fit: contain; }
.media-view__frame iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; }
.media-view__desc { margin: 14px 0 0; color: #d6d2c6; }
.media-view__manage { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.media-view__manage summary { cursor: pointer; color: var(--gold-2); font-size: 14px; margin-bottom: 10px; }
.media-view__manage .form { margin-bottom: 10px; }
.admin-thumb { object-fit: cover; border-radius: 6px; }

/* ---------- Prize reveal (case opening) ---------- */
.prize { position: relative; overflow: hidden; padding-top: 30px; }
.prize .sheet__close { position: absolute; z-index: 3; }
.prize__stage { position: relative; width: 220px; height: 170px; margin: 6px auto 4px; display: grid; place-items: center; }
.prize__stage .prize__icon { position: relative; z-index: 2; margin: 0; }
/* soft glow and light rays centred on the item, faded at the edges so they never look cut off */
.prize__burst { position: absolute; inset: 0; border-radius: 50%; z-index: 0;
    background: radial-gradient(circle, color-mix(in srgb, var(--c) 55%, transparent) 0, color-mix(in srgb, var(--c) 18%, transparent) 40%, transparent 70%); }
.prize__rays { position: absolute; left: 50%; top: 50%; width: 260px; height: 260px; margin: -130px 0 0 -130px; z-index: 1; border-radius: 50%;
    background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--c) 45%, transparent) 0 6deg, transparent 6deg 22deg);
    -webkit-mask: radial-gradient(circle, transparent 0 22%, #000 32%, transparent 68%); mask: radial-gradient(circle, transparent 0 22%, #000 32%, transparent 68%);
    animation: spin 12s linear infinite; }
.prize__sparks { position: absolute; inset: 0; z-index: 1; }
.prize__sparks i { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); opacity: 0; }
.prize.is-revealed .prize__burst { animation: burstIn .7s ease-out both, glowPulse 2.4s ease-in-out .7s infinite; }
.prize.is-revealed .prize__rays { animation: raysIn .8s ease-out both, spin 12s linear infinite; }
.prize.is-revealed .prize__icon { animation: iconPop .6s cubic-bezier(.2, 1.6, .4, 1) .1s both; }
.prize.is-revealed .prize__title { animation: riseIn .4s ease-out .35s both; }
.prize.is-revealed .prize__subtitle { animation: riseIn .4s ease-out .45s both; }
.prize__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.prize__actions [hidden] { display: none; }
.prize.is-revealed .prize__sparks i { animation: spark .9s ease-out .15s both; }
.prize__sparks i:nth-child(1) { --dx: 0px; --dy: -95px; }
.prize__sparks i:nth-child(2) { --dx: 70px; --dy: -65px; }
.prize__sparks i:nth-child(3) { --dx: 98px; --dy: 0px; }
.prize__sparks i:nth-child(4) { --dx: 70px; --dy: 65px; }
.prize__sparks i:nth-child(5) { --dx: 0px; --dy: 92px; }
.prize__sparks i:nth-child(6) { --dx: -70px; --dy: 65px; }
.prize__sparks i:nth-child(7) { --dx: -98px; --dy: 0px; }
.prize__sparks i:nth-child(8) { --dx: -70px; --dy: -65px; }
@keyframes burstIn { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes glowPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.08); opacity: .8; } }
@keyframes raysIn { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes iconPop { from { transform: scale(0) rotate(-20deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes riseIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spark { 0% { opacity: 0; transform: translate(0, 0) scale(.5); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .prize__rays, .prize__burst { animation: none !important; } }

.stepper__btn--edge { width: auto; padding: 0 10px; font-size: 12px; font-weight: 700; }
.coin { width: 16px; height: 16px; object-fit: contain; vertical-align: -3px; margin-left: 3px; }
.currency-pick__opt .coin { margin: 0 4px 0 0; }

/* Language dropdown */
.lang-drop { position: relative; margin-right: 6px; }
.lang-drop > summary { list-style: none; cursor: pointer; }
.lang-drop > summary::-webkit-details-marker { display: none; }
.lang-drop__current { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.lang-drop__current:hover, .lang-drop[open] .lang-drop__current { color: var(--text); border-color: var(--line-2); }
.lang-drop__menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 160px; display: grid; padding: 6px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); box-shadow: var(--shadow); }
.lang-drop__item { padding: 8px 10px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.lang-drop__item b { display: inline-block; width: 26px; color: var(--faint); }
.lang-drop__item:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.lang-drop__item.is-active { color: var(--gold-2); }
@media (max-width: 1180px) {
    .lang-drop { align-self: flex-start; margin: 6px 0; }
    .lang-drop__menu { left: 0; right: auto; }
}

/* Cookie notice */
.cookie-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90; max-width: 760px; margin: 0 auto; display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(16, 19, 29, .97); box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
.cookie-bar__text { margin: 0; font-size: 13px; color: var(--muted); }
@media (max-width: 560px) { .cookie-bar { flex-direction: column; align-items: stretch; } }

/* Top-up rules */
.rules-card { padding: 20px 22px; box-shadow: none; margin-bottom: 18px; border-color: rgba(240, 176, 74, .45); }
.rules-card.is-agreed { border-color: var(--line); }
.rules-card__list { margin: 10px 0 14px; padding-left: 20px; display: grid; gap: 6px; color: #d6d2c6; font-size: 14px; }
.rules-card__ok { margin: 0; color: var(--ok); font-weight: 600; }
.rules-card__summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; cursor: pointer; list-style: none; }
.rules-card__summary::-webkit-details-marker { display: none; }
.rules-card__summary::after { content: "\25BE"; margin-left: auto; color: var(--faint); transition: transform .2s; }
details[open] > .rules-card__summary::after { transform: rotate(180deg); }
.rules-card__summary .rules-card__ok { font-size: 13px; }
details.rules-card[open] .rules-card__list { margin-bottom: 0; }
.rules-card__form { align-items: center; gap: 14px; }
.pay-grid.is-locked .pay-card { opacity: .75; }

/* ---------- Home: trailer + downloads, screenshot viewer ---------- */
.downloads { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.trailer { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: #000; border: 1px solid rgba(226, 181, 90, .3); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.trailer__poster { display: block; width: 100%; height: 100%; position: relative; color: #fff; }
.trailer__poster img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.8); transition: filter .25s, transform .4s; }
.trailer__poster:hover img { filter: brightness(1); transform: scale(1.03); }
.trailer__play { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; padding-left: 6px; background: linear-gradient(180deg, var(--gold-2), var(--gold-3)); color: #1a1206; box-shadow: 0 0 0 8px rgba(226, 181, 90, .25), 0 10px 30px rgba(0, 0, 0, .6); transition: transform .2s; }
.trailer__poster:hover .trailer__play { transform: scale(1.08); }
.trailer__label { position: absolute; left: 16px; bottom: 14px; font: 700 18px/1 var(--font-display); text-shadow: 0 2px 8px #000; }
.trailer__frame { width: 100%; height: 100%; border: 0; display: block; }
.dl-cards { display: grid; gap: 14px; align-content: center; }
.dl-card { display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, rgba(28, 33, 48, .92), rgba(16, 19, 29, .94)); }
.dl-card__icon { width: 56px; height: 56px; flex: none; display: grid; place-items: center; font-size: 30px; border-radius: 14px; background: rgba(226, 181, 90, .08); border: 1px solid rgba(226, 181, 90, .3); }
.dl-card__title { font: 700 20px/1.1 var(--font-display); color: var(--gold-2); }
.dl-card__ver { margin: 4px 0 10px; font-size: 13px; color: var(--muted); }
.dl-card__btns { display: flex; gap: 8px; flex-wrap: wrap; }
/* Side by side the trailer fills its column (cropped by object-fit) instead of keeping 16:9: stretched to the taller
   card column, a 16:9 box grew wider than its column and slid under the cards. Stacked it keeps 16:9 again. */
@media (min-width: 821px) { .downloads .trailer { aspect-ratio: auto; min-width: 0; min-height: 260px; } }
@media (max-width: 820px) { .downloads { grid-template-columns: 1fr; } }

.lightbox { width: min(96vw, 1400px); max-width: none; max-height: 94vh; padding: 0; border: 0; background: transparent; overflow: visible; }
.lightbox::backdrop { background: rgba(3, 4, 8, .92); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox__img { max-width: 100%; max-height: 86vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .7); user-select: none; }
.lightbox__nav, .lightbox__close { position: fixed; z-index: 2; border: 1px solid rgba(255, 255, 255, .2); background: rgba(10, 12, 18, .7); color: #fff; cursor: pointer; border-radius: 50%; display: grid; place-items: center; }
.lightbox__nav { top: 50%; width: 52px; height: 52px; margin-top: -26px; font-size: 22px; }
.lightbox__nav--prev { left: 18px; }
.lightbox__nav--next { right: 18px; }
.lightbox__close { top: 16px; right: 18px; width: 44px; height: 44px; font-size: 26px; }
.lightbox__nav:hover, .lightbox__close:hover { border-color: var(--gold); color: var(--gold-2); }
.lightbox__count { position: fixed; bottom: 14px; left: 0; right: 0; margin: 0; text-align: center; color: var(--muted); font-size: 13px; }
@media (max-width: 560px) { .lightbox__nav { width: 42px; height: 42px; } .lightbox__nav--prev { left: 6px; } .lightbox__nav--next { right: 6px; } }

.msg__tr { border: 0; background: none; padding: 0; margin-top: 2px; color: var(--faint); font: 12px/1.4 var(--font); cursor: pointer; }
.msg__tr:hover { color: var(--gold-2); }
.msg__translated { margin: 4px 0 0; padding: 4px 10px; border-left: 2px solid var(--magic); color: #cdeee9; font-size: 13px; }

/* Cabinet: available promo codes */
.promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.promo-card { display: grid; gap: 6px; align-content: start; padding: 14px 16px; border-radius: var(--radius); border: 1px dashed rgba(226, 181, 90, .45); background: linear-gradient(180deg, rgba(226, 181, 90, .06), rgba(16, 19, 29, .9)); }
.promo-card__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.promo-card__code { font-size: 16px; font-weight: 700; color: var(--gold-2); letter-spacing: .06em; }
.promo-card__title { margin: 0; font-weight: 600; }
.promo-card__item { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: color-mix(in srgb, var(--r) 70%, #fff); }
.promo-card__rewards, .promo-card__meta { margin: 0; font-size: 12px; color: var(--muted); }
.promo-card .btn { justify-self: start; margin-top: 4px; }

/* Cabinet characters */
.char__head { position: relative; }
.char__remove { margin-left: auto; align-self: flex-start; }
.chars__status { margin: 0 0 10px; }
.chars__add { margin-top: 12px; }
.chars__add summary { cursor: pointer; color: var(--gold-2); font-size: 14px; margin-bottom: 8px; }
.btn.is-busy { opacity: .6; }
.char__class { width: 38px; height: 38px; flex: none; }

/* ==========================================================================
   Shop: "New" dot on category tabs
   ========================================================================== */
.tab__new { display: inline-block; width: 8px; height: 8px; margin-left: 6px; vertical-align: 2px; border-radius: 50%; background: var(--magic); box-shadow: 0 0 8px rgba(111, 220, 207, .8); }

/* ==========================================================================
   Rules / Privacy / About: modal + own page; footer links
   ========================================================================== */
.footer__info a { color: var(--faint); font-size: 13px; }
.info-dialog { width: min(94vw, 760px); }
.info-page { max-width: 860px; }
.info-page__card { padding: 28px; }
.info-page__title { font: 700 22px/1.25 var(--font-display); color: var(--gold-2); margin: 0 30px 16px 0; }
.info-page__text { font-size: 15px; }
.info-page__links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 16px 4px 0; font-size: 14px; }
.info-edit { display: grid; gap: 12px; }
.info-edit summary { cursor: pointer; }
.info-edit__lang { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 0; display: grid; gap: 10px; }
.info-edit__html { font: 13px/1.5 ui-monospace, Consolas, monospace; min-height: 160px; }
@media (max-width: 560px) { .info-page__card { padding: 20px 16px; } }

/* ==========================================================================
   Project finances
   ========================================================================== */
.finance__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.finance__card { padding: 22px; display: grid; gap: 12px; align-content: start; box-shadow: none; }
.finance__chart-card { grid-column: 1 / -1; }
.finance__h { font: 700 18px/1.25 var(--font-display); color: var(--gold-2); margin: 0; }
.finance__big { font: 700 26px/1.2 var(--font); margin: 0; }
.finance__big .coin, .finance__reserve-value .coin, .finance__plus .coin { width: 18px; height: 18px; vertical-align: -3px; }
.finance__progress { height: 10px; }
.finance__note { margin: 0; font-size: 13px; }
.finance__label { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.finance__reserve { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 12px; border: 1px solid rgba(111, 220, 207, .3); background: rgba(111, 220, 207, .06); }
.finance__reserve.is-low { border-color: rgba(240, 120, 90, .45); background: rgba(240, 120, 90, .06); }
.finance__reserve-icon { font-size: 30px; line-height: 1; }
.finance__reserve-value { margin: 2px 0; font-weight: 700; font-size: 20px; color: var(--magic); }
.finance__card .btn { justify-self: start; }
.finance__list { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: #d6d2c6; }
.finance__chart { width: 100%; height: auto; max-height: 280px; display: block; }
.finance__bar rect { fill: rgba(111, 220, 207, .45); transition: fill .15s; }
.finance__bar:hover rect, .finance__bar.is-now rect { fill: var(--magic); }
.finance__bar-value { fill: var(--muted); font: 600 11px var(--font); }
.finance__bar-label { fill: var(--faint); font: 500 12px var(--font); }
.finance__tops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.finance__rank { list-style: none; counter-reset: rank; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.finance__rank li { counter-increment: rank; display: flex; gap: 8px; justify-content: space-between; align-items: baseline; padding: 6px 10px; border-radius: 8px; background: rgba(0, 0, 0, .2); font-size: 14px; }
.finance__rank li::before { content: counter(rank); min-width: 18px; color: var(--faint); font-weight: 700; }
.finance__rank li.is-top1 { border-left: 3px solid #ffd257; }
.finance__rank li.is-top2 { border-left: 3px solid #c9d1dc; }
.finance__rank li.is-top3 { border-left: 3px solid #d08a4a; }
.finance__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance__sum { font-weight: 700; color: var(--gold-2); }
.finance__recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.finance__recent li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 8px; background: rgba(0, 0, 0, .2); }
.finance__recent li > span { display: grid; min-width: 0; }
.finance__plus { color: var(--ok); white-space: nowrap; }
.finance__updated { font-size: 12px; text-align: center; margin: 16px 0 0; }
.finance-mini { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px 22px; align-items: center; padding: 16px 20px; margin: 24px 0; color: var(--text); box-shadow: none; }
.finance-mini:hover { color: var(--text); border-color: var(--gold); }
.finance-mini__main, .finance-mini__side { display: grid; gap: 4px; }
.finance-mini__more { color: var(--gold-2); font-weight: 600; font-size: 14px; white-space: nowrap; }
@media (max-width: 820px) {
    .finance__grid { grid-template-columns: minmax(0, 1fr); }
    .finance-mini { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) { .finance__tops { grid-template-columns: minmax(0, 1fr); } }
/* Already activated codes in the cabinet: greyed, no actions */
.promo-card.is-used { border-style: solid; border-color: var(--line); background: rgba(16, 19, 29, .6); filter: grayscale(1); opacity: .55; }
.promo-card.is-used .promo-card__code { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.promo-card__used { border-color: var(--line-2); color: var(--muted); white-space: nowrap; }

/* ==========================================================================
   Phone: cabinet header (kept last so it wins over the general rules above)
   Avatar + name/login/role on top; badges and buttons in a full-width row below; support meter last.
   ========================================================================== */
@media (max-width: 560px) {
    .cabinet { padding-top: 16px; }
    .profile { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 14px; padding: 16px 14px; }
    .profile__main { display: contents; }
    .profile__id { min-width: 0; }
    .profile .vip-photo { width: 76px; height: 76px; }
    .profile .vip-frame { margin: 2px 2px 10px; }
    .profile .vip-badge { font-size: 11px; padding: 2px 8px; bottom: -9px; }
    .profile .avatar-edit__hint { width: 24px; height: 24px; font-size: 12px; right: -2px; top: -2px; }
    .profile__name { font-size: 20px; }
    .profile__meta { margin: 3px 0 4px; font-size: 12.5px; }
    .profile__vip-title { margin: 0; }
    .profile .badges, .profile__links { grid-column: 1 / -1; margin: 0; gap: 6px; }
    .profile .badge { font-size: 12px; padding: 3px 9px; }
    .profile__links { display: flex; flex-wrap: wrap; }
    .profile__links .btn { padding: 7px 11px; font-size: 13px; }
    .profile__vip { grid-column: 1 / -1; width: 100%; min-width: 0; padding: 12px 14px; }
}
@media (max-width: 380px) {
    .container { padding-left: 12px; padding-right: 12px; }
    .profile { padding: 14px 12px; }
}

/* ==========================================================================
   Chat: one pane at a time on phones/tablets (desktop keeps both columns)
   ========================================================================== */
.chat__head-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chat__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat__back { display: none; flex: none; width: 36px; height: 36px; place-items: center; border-radius: 10px; border: 1px solid var(--line-2); color: var(--text); font-size: 20px; line-height: 1; }
.chat__back:hover { color: var(--gold-2); border-color: var(--gold); }
@media (max-width: 820px) {
    .chat-page.store { padding-top: 12px; padding-bottom: 12px; }
    .chat-page .store__head { display: none; }
    .chat { gap: 0; }
    /* List view */
    .chat--list .chat__main { display: none; }
    .chat--list .chat__side { height: auto; min-height: 0; max-height: none; overflow: visible; }
    .chat--list .chat-nav__item { padding: 12px; font-size: 15px; }
    /* Conversation view: fills the screen under the top bar (67px), the log scrolls, the input stays at the bottom */
    .chat--open .chat__side { display: none; }
    .chat--open .chat__main { height: calc(100dvh - 67px - 24px); min-height: 300px; }
    .chat__back { display: inline-grid; }
    .chat__head { padding: 10px 12px; }
    .chat__title { font-size: 17px; }
    .chat--open .chat__hint { display: none; }
    .chat__log { padding: 10px 10px; overscroll-behavior: contain; }
    .chat__composer { padding: 8px 10px; gap: 6px; }
    body:has(.chat--open) .footer { display: none; }
}

/* ==========================================================================
   Bottom tab bar for signed-in players on phones/tablets
   ========================================================================== */
.tabbar { display: none; }
@media (max-width: 820px) {
    .tabbar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; display: grid; grid-template-columns: repeat(5, 1fr);
        padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); background: rgba(10, 12, 19, .96);
        border-top: 1px solid rgba(226, 181, 90, .25); box-shadow: 0 -8px 24px rgba(0, 0, 0, .45); backdrop-filter: blur(8px);
    }
    .tabbar__item { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 2px 4px; border-radius: 10px; color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.2; text-align: center; }
    .tabbar__item:hover { color: var(--text); }
    .tabbar__item.is-active { color: var(--gold-2); background: rgba(226, 181, 90, .08); }
    .tabbar__icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .tabbar__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tabbar__badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; line-height: 16px; }
    .tabbar__badge--ok { background: var(--magic); color: #06231f; }
    /* Room for the bar under the page, the cookie notice and the open chat */
    body:has(.tabbar) { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
    body:has(.tabbar) .cookie-bar { bottom: calc(76px + env(safe-area-inset-bottom)); }
    body:has(.tabbar) .chat--open .chat__main { height: calc(100dvh - 67px - 24px - 64px - env(safe-area-inset-bottom)); }
    /* Typing in the chat: the keyboard needs the space */
    body:has(.chat__input:focus) .tabbar { display: none; }
    body:has(.tabbar):has(.chat__input:focus) .chat--open .chat__main { height: calc(100dvh - 67px - 24px); }
}

/* Rating: account VIP level next to the character name (same colours as the avatar ribbon) */
.vip-badge--inline { position: static; transform: none; display: inline-block; margin-left: 6px; padding: 0 7px; font-size: 10px; line-height: 16px; vertical-align: 1px; box-shadow: none; animation: none; }
@media (max-width: 560px) {
    /* Rating on phones: tighter cells, numbers on one line */
    .rating th, .rating td { padding: 10px 6px; }
    .rating th:first-child, .rating td:first-child { padding-left: 10px; }
    .rating td.num { white-space: nowrap; font-size: 13px; }
    .rating .place { width: 26px; height: 26px; font-size: 12px; }
    /* Tab bar labels must fit 5 across at 320px */
    .tabbar__item { padding-left: 0; padding-right: 0; }
    .tabbar__label { font-size: 10.5px; letter-spacing: -.01em; }
}
@media (max-width: 560px) { .gallery__item--wide { display: none; } }
.comment__text > * { margin: 0; }
.comment__text > * + * { margin-top: .5em; }
.comment__text img { max-width: min(100%, 360px); height: auto; border-radius: 8px; }
.tabbar__dot { display: none; }
@media (max-width: 820px) {
    .tabbar__dot { display: block; position: absolute; top: 5px; left: calc(50% + 9px); width: 9px; height: 9px; border-radius: 50%; background: var(--magic); box-shadow: 0 0 8px rgba(111, 220, 207, .9); }
}
/* Chat send: icon + text on wide screens, a round icon button on phones; shop wallet smaller on phones */
.chat__send { gap: 8px; height: 46px; }
.chat__send-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
@media (max-width: 820px) {
    .chat__composer { grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; }
    .chat__input { min-height: 42px; }
    .chat__attach, .chat__send { width: 42px; height: 42px; padding: 0; justify-content: center; border-radius: 50%; }
    .chat__send-label { display: none; }
    .chat__send-icon { width: 20px; height: 20px; }
}
@media (max-width: 560px) {
    .wallet { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 6px; width: 100%; }
    .wallet__item { min-width: 0; padding: 6px 10px; }
    .wallet__item small { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .wallet__item strong { font-size: 14px; }
}
.gallery__item[hidden] { display: none; }

/* ==========================================================================
   Players' mini profile (modal or /u/{id}) and clickable names
   ========================================================================== */
.profile-link { color: inherit; cursor: pointer; }
.profile-link:hover { color: var(--gold-2); text-decoration: underline; text-underline-offset: 3px; }
.info-dialog--profile { width: min(94vw, 440px); }
.pcard { display: grid; gap: 14px; }
.pcard__head { display: flex; gap: 16px; align-items: center; }
.pcard__head .vip-frame { margin-bottom: 10px; }
.pcard__id { min-width: 0; display: grid; gap: 4px; }
.pcard__name { font: 700 22px/1.2 var(--font-display); color: var(--gold-2); margin: 0 26px 0 0; word-break: break-word; }
.pcard__meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.pcard__since { margin: 0; font-size: 13px; }
.pcard__seen { margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 13px; }
.pcard__seen:empty { display: none; }
.pcard__online { display: inline-flex; align-items: center; gap: 6px; color: #5bd47a; font-weight: 600; }
.pcard__online::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #5bd47a; box-shadow: 0 0 6px #5bd47a; }
.pcard__sub { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.pcard__chars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pcard__chars li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(0, 0, 0, .2); font-size: 14px; }
.pcard__char { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard__chars .muted { white-space: nowrap; font-size: 13px; }
.pcard__actions { display: flex; gap: 8px; }
.pager__gap { min-width: 22px; padding: 8px 0; text-align: center; color: var(--faint); }
.pager__arrow { font-size: 18px; line-height: 1; padding: 6px 10px; }
@media (max-width: 420px) { .pager { gap: 4px; } .pager__page { min-width: 32px; padding: 6px 8px; } }

/* Long item lists: cards outside the screen are not laid out or painted (and their animations idle) */
.item-grid > .item { content-visibility: auto; contain-intrinsic-size: auto 190px; }
@media (prefers-reduced-motion: reduce) { .item__icon::before, .item__icon::after { animation: none !important; } }.mono-code { display: inline-flex; align-items: center; gap: 8px; }
.mono-code code { font-size: 17px; font-weight: 700; letter-spacing: .08em; color: var(--gold-2); padding: 4px 10px; border-radius: 8px; border: 1px dashed rgba(226, 181, 90, .5); }
.pay-card__note { white-space: normal; }

/* ==========================================================================
   Battle pass (cabinet → Bonuses)
   ========================================================================== */
.pass__top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 18px; align-items: center; padding: 16px 18px; margin-bottom: 14px; box-shadow: none; }
.pass__xp { display: grid; gap: 4px; }
.pass__xp strong { font-size: 22px; color: var(--magic); }
.pass__how, .pass__paid { grid-column: 1 / -1; margin: 0; font-size: 13px; }
.pass__paid { color: var(--warn); }
.pass__paid.is-open { color: var(--ok); }
.pass__track { display: flex; gap: 8px; align-items: flex-start; }
.pass__levels { flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x proximity; overscroll-behavior-x: contain; scroll-padding-left: 2px; }
.pass__legend, .pass__col { flex: none; display: grid; grid-template-rows: 44px 118px 118px; gap: 8px; }
.pass__legend { width: 34px; padding-top: 2px; }
.pass__lvl--blank { visibility: hidden; }
.pass__row-label { display: grid; place-items: center; text-align: center; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.pass__row-label--paid { color: var(--gold-2); border-color: rgba(226, 181, 90, .45); }
.pass__col { width: 112px; scroll-snap-align: start; }
.pass__lvl { display: grid; place-items: center; align-content: center; border-radius: 10px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); line-height: 1.1; }
.pass__lvl b { font-size: 16px; }
.pass__lvl small { font-size: 10px; color: var(--faint); }
.pass__col.is-reached .pass__lvl { border-color: var(--magic); color: var(--magic); }
.pass__reward { position: relative; display: grid; justify-items: center; align-content: center; gap: 4px; padding: 8px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: center; }
.pass__reward--empty { color: var(--faint); }
.pass__icon { display: grid; place-items: center; width: 40px; height: 40px; font-size: 22px; color: var(--gold-2); }
.pass__label { font-size: 11px; line-height: 1.25; color: var(--muted); }
.pass__reward.is-ready { border-color: var(--gold); box-shadow: 0 0 12px rgba(226, 181, 90, .35); }
.pass__reward.is-claimed { opacity: .55; }
.pass__reward.is-locked { filter: grayscale(.7); opacity: .7; }
.pass__state { position: absolute; top: 4px; right: 6px; font-size: 13px; }
.pass__claim { margin: 0; }
.pass__claim .btn { padding: 4px 10px; font-size: 12px; }
@media (max-width: 560px) {
    .pass__top { grid-template-columns: minmax(0, 1fr); }
    .pass__col { width: 96px; }
    .pass__legend, .pass__col { grid-template-rows: 40px 110px 110px; }
}
.bp-edit { display: grid; gap: 6px; overflow-x: auto; }
.bp-edit__row { display: grid; grid-template-columns: 28px 100px repeat(2, minmax(240px, 1fr)); gap: 8px; align-items: center; min-width: 640px; }
.bp-edit__row--head { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.bp-edit__n { color: var(--faint); text-align: right; }
/* reward: type + amount on one line (amount fits 7+ digits), the item picker full width under them */
.bp-edit__reward { display: grid; grid-template-columns: minmax(110px, 1fr) 104px; gap: 4px; }
.bp-edit__reward > [name$="[item]"] { grid-column: 1 / -1; }
.bp-edit input[type=number] { -moz-appearance: textfield; appearance: textfield; min-width: 0; }
.bp-edit input[type=number]::-webkit-inner-spin-button, .bp-edit input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.bp-edit .input { padding: 7px 8px; font-size: 13px; }
/* Track labels as narrow vertical tabs, so they never cover the first level */
.pass__row-label { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; letter-spacing: .08em; padding: 6px 0; }
@media (max-width: 560px) { .pass__legend { width: 28px; } .pass__row-label { font-size: 10px; } }
.bp-edit__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Back to top (app.js shows it after about a screen of scrolling on long pages) */
.to-top { position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 79; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 1px solid rgba(226, 181, 90, .45); background: rgba(11, 13, 20, .9); color: var(--gold-2); cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s, border-color .2s; }
.to-top.is-shown { opacity: 1; transform: none; }
.to-top:hover { border-color: var(--gold); }
.to-top:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.to-top svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 820px) {
    body:has(.tabbar) .to-top { bottom: calc(76px + env(safe-area-inset-bottom)); }
    body:has(.chat__input:focus) .to-top { display: none; }
}
body:has(.cookie-bar) .to-top { display: none; }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }

/* Server status page (/status, data from cron/online.php) */
.status-page__today { margin: 0 0 14px; color: var(--muted); }
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 12px; }
.status-card { padding: 16px; display: grid; gap: 10px; }
.status-card__head { display: flex; align-items: center; gap: 10px; }
.status-card__name { margin: 0; font-size: 18px; flex: 1; }
.status-card__state { font-size: 12px; color: var(--muted); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); flex: none; }
.status-card.is-up .status-dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status-card__now { margin: 0; color: var(--muted); }
.status-card__now strong { color: var(--gold-2); font-size: 18px; }
.status-lines { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 6px; }
.status-lines li { display: flex; justify-content: space-between; gap: 6px; padding: 6px 10px; border-radius: 8px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); font-size: 13px; }
.status-lines li.is-closed { opacity: .6; }
.status-lines li.is-closed strong { color: var(--danger); font-weight: 600; }
.online__link { color: var(--gold-2); white-space: nowrap; }
/* Admin → Game: announcement form (interval/count only for repeating ones) */
.announce-mode { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.announce-loop { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.form:has(input[name="mode"][value="once"]:checked) .announce-loop { display: none; }
.admin-box__sub { margin: 14px 0 4px; font-size: 14px; color: var(--muted); }
.search--wrap { flex-wrap: wrap; }
.search--wrap .input--select { min-width: 0; flex: 1 1 140px; }
.admin .admin-box { min-width: 0; }
/* Character page (/character/{server}/{id}) */
.char-page { padding: 18px; display: grid; gap: 14px; }
.char-page__name { margin: 0; font: 700 22px/1.2 var(--font-display); word-break: break-word; }
.char-wallet { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.char-wallet__title { margin: 0; font-size: 15px; color: var(--muted); }
.char-link { margin-left: 4px; color: var(--faint); text-decoration: none; }
.char-link:hover { color: var(--gold-2); }
.char__name a { color: inherit; } .char__name a:hover { color: var(--gold-2); }
.game-export { border-top: 1px solid var(--line); padding: 8px 0; }
.game-export summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.game-export__head { margin: 8px 0 0; padding: 10px; max-height: 260px; overflow: auto; border-radius: 8px; background: #000; font: 12px/1.4 ui-monospace, Consolas, monospace; color: #cfd3e0; white-space: pre; }
/* Rating: equipped items as small icons (mount / equipment boards from GameRankings) */
.equip-row { display: flex; flex-wrap: wrap; gap: 3px; }
.equip-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--r, var(--line-2)); background: rgba(0, 0, 0, .3); }
.equip-icon img { width: 26px; height: 26px; object-fit: contain; }
.char-equip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.char-equip li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--r, var(--text)); }
.char-equip .equip-icon { flex: none; }
/* Cabinet character cards: equipped items as quality dots, mounts, link to the character page */
.char__gear { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; font-size: 12px; color: var(--muted); }
.char__gear-label { margin-right: 4px; }
.gear-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--r, var(--line-2)); box-shadow: 0 0 6px color-mix(in srgb, var(--r, transparent) 60%, transparent); }
.char__more { font-size: 13px; justify-self: start; }
.char-equip__text { display: grid; gap: 1px; min-width: 0; }
.char-equip__text small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.char-equip { grid-template-columns: 1fr; }

/* ==========================================================================
   VIP levels 21-100: eight animated tiers (one per 10 levels), each level with its own colour (--vh) and pace (--vsp).
   Frames draw only on pseudo-elements and animate transform/opacity (composited, no repaint per frame).
   Inline badges (rating, lists) stay still and only shine on hover, so long lists cost nothing.
   ========================================================================== */
.vip-level-plus { --vh: 40; --vsp: 1; --vc: hsl(var(--vh) 95% 62%); --vc2: hsl(calc(var(--vh) + 50) 95% 58%); --vd: hsl(var(--vh) 70% 18%); }
.vip-frame.vip-level-plus { isolation: isolate; }
.vip-level-plus .vip-photo { position: relative; z-index: 1; border-color: var(--vc); box-shadow: 0 0 10px color-mix(in srgb, var(--vc) 70%, transparent); }
.vip-frame.vip-level-plus::before, .vip-frame.vip-level-plus::after {
    content: ""; position: absolute; inset: -10%; border-radius: 50%; z-index: 0; pointer-events: none; will-change: transform, opacity;
}
.vip-level-plus .vip-badge {
    z-index: 3; overflow: hidden; border-color: var(--vc); color: #fff; text-shadow: 0 1px 2px #000, 0 0 6px var(--vd);
    background: linear-gradient(135deg, var(--vd), var(--vc) 55%, var(--vc2));
    box-shadow: 0 3px 8px rgba(0, 0, 0, .8), 0 0 10px color-mix(in srgb, var(--vc) 60%, transparent);
}
/* light sweep over the badge (transform only) */
.vip-level-plus .vip-badge::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .6) 50%, transparent 65%);
    transform: translateX(-120%); animation: vipSweep calc(3.2s / var(--vsp)) ease-in-out infinite;
}
/* relative (for the shine) but not moved: the floating badge's left/bottom must not apply here */
.vip-level-plus .vip-badge--inline { position: relative; inset: auto; transform: none; box-shadow: none; overflow: clip; } /* clip, not hidden: keeps the text baseline */
.vip-level-plus .vip-badge--inline::after { animation: none; }
.vip-level-plus:hover .vip-badge--inline::after { animation: vipSweep 1.2s ease-in-out 1; }
.avatar-edit.vip-level-plus .avatar-edit__hint { z-index: 4; }

@keyframes vipSweep { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes vipSpin { to { transform: rotate(360deg); } }
@keyframes vipSpinBack { to { transform: rotate(-360deg); } }
@keyframes vipBreath { 0%, 100% { opacity: .45; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes vipFlicker { 0%, 100% { opacity: .9; } 8% { opacity: .3; } 10% { opacity: 1; } 42% { opacity: .75; } 44% { opacity: .2; } 47% { opacity: 1; } 70% { opacity: .85; } }
@keyframes vipTwinkle { 0%, 100% { opacity: .25; transform: rotate(0deg) scale(.95); } 50% { opacity: 1; transform: rotate(180deg) scale(1.04); } }

/* Ring band just outside the photo: the photo covers 1 / 1.2 of the pseudo-element. */
.vip-tier-2::before, .vip-tier-3::before, .vip-tier-4::before, .vip-tier-5::before, .vip-tier-6::before, .vip-tier-8::before {
    -webkit-mask: radial-gradient(closest-side, transparent 78%, #000 81% 97%, transparent 100%);
            mask: radial-gradient(closest-side, transparent 78%, #000 81% 97%, transparent 100%);
}

/* 21-30 Ember: a breathing glow around the frame */
.vip-frame.vip-tier-1::before { background: radial-gradient(closest-side, transparent 72%, var(--vc) 82%, transparent 100%); animation: vipBreath calc(2.4s / var(--vsp)) ease-in-out infinite; }
.vip-tier-1 .vip-badge { background: linear-gradient(135deg, var(--vd), var(--vc)); }

/* 31-40 Frost: a dashed crystal ring turning slowly */
.vip-frame.vip-tier-2::before { background: repeating-conic-gradient(var(--vc) 0 10deg, transparent 10deg 22deg); animation: vipSpin calc(14s / var(--vsp)) linear infinite; }
.vip-frame.vip-tier-2::after { background: radial-gradient(closest-side, transparent 74%, color-mix(in srgb, var(--vc) 45%, transparent) 86%, transparent 100%); animation: vipBreath calc(3.5s / var(--vsp)) ease-in-out infinite; }
.vip-tier-2 .vip-badge { background: linear-gradient(135deg, var(--vd), var(--vc) 60%, #eafcff); color: #062330; text-shadow: 0 0 4px #fff; }

/* 41-50 Storm: an electric arc running round, flickering */
.vip-frame.vip-tier-3::before { background: conic-gradient(from 0deg, transparent 0 55%, var(--vc) 80%, #fff 88%, transparent 92%); animation: vipSpin calc(1.6s / var(--vsp)) linear infinite; }
.vip-frame.vip-tier-3::after { background: radial-gradient(closest-side, transparent 70%, color-mix(in srgb, var(--vc) 55%, transparent) 84%, transparent 100%); animation: vipFlicker calc(2.2s / var(--vsp)) steps(1) infinite; }
.vip-tier-3 .vip-badge { background: linear-gradient(135deg, #0b0620, var(--vd) 30%, var(--vc)); }

/* 51-60 Nebula: a two-colour ring turning, with a soft halo */
.vip-frame.vip-tier-4::before { background: conic-gradient(var(--vc), var(--vc2), var(--vd), var(--vc)); animation: vipSpin calc(5s / var(--vsp)) linear infinite; }
.vip-frame.vip-tier-4::after { inset: -18%; background: radial-gradient(closest-side, transparent 62%, color-mix(in srgb, var(--vc2) 40%, transparent) 78%, transparent 100%); animation: vipBreath calc(4s / var(--vsp)) ease-in-out infinite; }
.vip-tier-4 .vip-badge { background: linear-gradient(135deg, var(--vd), var(--vc), var(--vc2)); }

/* 61-70 Aurora: green-blue-violet lights turning both ways */
.vip-frame.vip-tier-5::before { background: conic-gradient(var(--vc), hsl(calc(var(--vh) + 60) 90% 60%), hsl(calc(var(--vh) + 130) 90% 65%), transparent 70%, var(--vc)); animation: vipSpin calc(6s / var(--vsp)) linear infinite; }
.vip-frame.vip-tier-5::after { inset: -16%; -webkit-mask: radial-gradient(closest-side, transparent 70%, #000 80% 90%, transparent 100%); mask: radial-gradient(closest-side, transparent 70%, #000 80% 90%, transparent 100%);
    background: conic-gradient(from 180deg, transparent 0 40%, hsl(calc(var(--vh) + 100) 90% 65%) 60%, transparent 80%); animation: vipSpinBack calc(9s / var(--vsp)) linear infinite; opacity: .8; }
.vip-tier-5 .vip-badge { background: linear-gradient(135deg, var(--vd), var(--vc), hsl(calc(var(--vh) + 130) 90% 60%)); }

/* 71-80 Solar: sun rays turning behind a golden ring */
.vip-frame.vip-tier-6::before { background: conic-gradient(var(--vc), #fff6c8, var(--vc2), #fff6c8, var(--vc)); animation: vipSpin calc(4s / var(--vsp)) linear infinite; }
.vip-frame.vip-tier-6::after { inset: -26%; -webkit-mask: radial-gradient(closest-side, transparent 58%, #000 66%, transparent 100%); mask: radial-gradient(closest-side, transparent 58%, #000 66%, transparent 100%);
    background: repeating-conic-gradient(color-mix(in srgb, var(--vc) 85%, transparent) 0 4deg, transparent 4deg 15deg); animation: vipSpin calc(18s / var(--vsp)) linear infinite; }
.vip-tier-6 .vip-badge { background: linear-gradient(135deg, #5a3600, var(--vc), #fff2b0); color: #2a1600; text-shadow: 0 0 4px #fff7d6; }

/* 81-90 Void: a dark ring with sparks orbiting it */
.vip-frame.vip-tier-7::before { background: radial-gradient(closest-side, transparent 76%, #05020c 80%, var(--vd) 88%, color-mix(in srgb, var(--vc) 70%, transparent) 94%, transparent 100%); animation: vipBreath calc(3s / var(--vsp)) ease-in-out infinite; }
.vip-frame.vip-tier-7::after { inset: -14%; background:
    radial-gradient(circle at 50% 3%, #fff 0 2.5%, var(--vc) 4%, transparent 7%),
    radial-gradient(circle at 97% 50%, var(--vc2) 0 2%, transparent 5.5%),
    radial-gradient(circle at 15% 80%, var(--vc) 0 2%, transparent 5.5%);
    animation: vipSpin calc(3s / var(--vsp)) linear infinite; }
.vip-tier-7 .vip-badge { background: linear-gradient(135deg, #000, var(--vd) 45%, var(--vc)); border-color: var(--vc2); }

/* 91-100 Celestial: a prismatic ring, a counter-turning star crown and a rainbow plate */
.vip-frame.vip-tier-8::before { background: conic-gradient(#ff3b3b, #ffb13b, #fff23b, #4bff6a, #3bd8ff, #4b5bff, #c13bff, #ff3bb8, #ff3b3b); animation: vipSpin calc(3s / var(--vsp)) linear infinite; }
.vip-frame.vip-tier-8::after { inset: -22%; background:
    radial-gradient(circle at 50% 4%, #fff 0 2.5%, transparent 5%), radial-gradient(circle at 96% 50%, #fff 0 2%, transparent 4.5%),
    radial-gradient(circle at 50% 96%, #fff 0 2.5%, transparent 5%), radial-gradient(circle at 4% 50%, #fff 0 2%, transparent 4.5%),
    radial-gradient(circle at 18% 18%, var(--vc) 0 1.6%, transparent 4%), radial-gradient(circle at 82% 82%, var(--vc) 0 1.6%, transparent 4%),
    radial-gradient(closest-side, transparent 66%, color-mix(in srgb, var(--vc) 35%, transparent) 76%, transparent 92%);
    animation: vipTwinkle calc(6s / var(--vsp)) ease-in-out infinite; }
.vip-tier-8 .vip-badge { background: linear-gradient(90deg, #ff3b3b, #ffb13b, #fff23b, #4bff6a, #3bd8ff, #4b5bff, #c13bff, #ff3bb8); border-color: #fff; text-shadow: 0 0 4px #000, 0 1px 2px #000; }
.vip-tier-8 .vip-badge:not(.vip-badge--inline)::before { content: "\2726 "; }
.vip-tier-8 .vip-photo { border-color: #fff; }

/* Small frames (lists): keep the ring, drop the outer extras */
.vip-frame--sm.vip-level-plus::after { display: none; }

@media (prefers-reduced-motion: reduce) {
    .vip-frame.vip-level-plus::before, .vip-frame.vip-level-plus::after, .vip-level-plus .vip-badge::after { animation: none !important; }
}

/* per level: colour and pace */
.vip-lv-21 { --vh: 18; --vsp: 1.00; }
.vip-lv-22 { --vh: 27; --vsp: 1.06; }
.vip-lv-23 { --vh: 36; --vsp: 1.12; }
.vip-lv-24 { --vh: 45; --vsp: 1.18; }
.vip-lv-25 { --vh: 54; --vsp: 1.24; }
.vip-lv-26 { --vh: 63; --vsp: 1.30; }
.vip-lv-27 { --vh: 72; --vsp: 1.36; }
.vip-lv-28 { --vh: 81; --vsp: 1.42; }
.vip-lv-29 { --vh: 90; --vsp: 1.48; }
.vip-lv-30 { --vh: 99; --vsp: 1.54; }
.vip-lv-31 { --vh: 190; --vsp: 1.00; }
.vip-lv-32 { --vh: 199; --vsp: 1.06; }
.vip-lv-33 { --vh: 208; --vsp: 1.12; }
.vip-lv-34 { --vh: 217; --vsp: 1.18; }
.vip-lv-35 { --vh: 226; --vsp: 1.24; }
.vip-lv-36 { --vh: 235; --vsp: 1.30; }
.vip-lv-37 { --vh: 244; --vsp: 1.36; }
.vip-lv-38 { --vh: 253; --vsp: 1.42; }
.vip-lv-39 { --vh: 262; --vsp: 1.48; }
.vip-lv-40 { --vh: 271; --vsp: 1.54; }
.vip-lv-41 { --vh: 255; --vsp: 1.00; }
.vip-lv-42 { --vh: 264; --vsp: 1.06; }
.vip-lv-43 { --vh: 273; --vsp: 1.12; }
.vip-lv-44 { --vh: 282; --vsp: 1.18; }
.vip-lv-45 { --vh: 291; --vsp: 1.24; }
.vip-lv-46 { --vh: 300; --vsp: 1.30; }
.vip-lv-47 { --vh: 309; --vsp: 1.36; }
.vip-lv-48 { --vh: 318; --vsp: 1.42; }
.vip-lv-49 { --vh: 327; --vsp: 1.48; }
.vip-lv-50 { --vh: 336; --vsp: 1.54; }
.vip-lv-51 { --vh: 300; --vsp: 1.00; }
.vip-lv-52 { --vh: 309; --vsp: 1.06; }
.vip-lv-53 { --vh: 318; --vsp: 1.12; }
.vip-lv-54 { --vh: 327; --vsp: 1.18; }
.vip-lv-55 { --vh: 336; --vsp: 1.24; }
.vip-lv-56 { --vh: 345; --vsp: 1.30; }
.vip-lv-57 { --vh: 354; --vsp: 1.36; }
.vip-lv-58 { --vh: 3; --vsp: 1.42; }
.vip-lv-59 { --vh: 12; --vsp: 1.48; }
.vip-lv-60 { --vh: 21; --vsp: 1.54; }
.vip-lv-61 { --vh: 135; --vsp: 1.00; }
.vip-lv-62 { --vh: 144; --vsp: 1.06; }
.vip-lv-63 { --vh: 153; --vsp: 1.12; }
.vip-lv-64 { --vh: 162; --vsp: 1.18; }
.vip-lv-65 { --vh: 171; --vsp: 1.24; }
.vip-lv-66 { --vh: 180; --vsp: 1.30; }
.vip-lv-67 { --vh: 189; --vsp: 1.36; }
.vip-lv-68 { --vh: 198; --vsp: 1.42; }
.vip-lv-69 { --vh: 207; --vsp: 1.48; }
.vip-lv-70 { --vh: 216; --vsp: 1.54; }
.vip-lv-71 { --vh: 42; --vsp: 1.00; }
.vip-lv-72 { --vh: 51; --vsp: 1.06; }
.vip-lv-73 { --vh: 60; --vsp: 1.12; }
.vip-lv-74 { --vh: 69; --vsp: 1.18; }
.vip-lv-75 { --vh: 78; --vsp: 1.24; }
.vip-lv-76 { --vh: 87; --vsp: 1.30; }
.vip-lv-77 { --vh: 96; --vsp: 1.36; }
.vip-lv-78 { --vh: 105; --vsp: 1.42; }
.vip-lv-79 { --vh: 114; --vsp: 1.48; }
.vip-lv-80 { --vh: 123; --vsp: 1.54; }
.vip-lv-81 { --vh: 268; --vsp: 1.00; }
.vip-lv-82 { --vh: 277; --vsp: 1.06; }
.vip-lv-83 { --vh: 286; --vsp: 1.12; }
.vip-lv-84 { --vh: 295; --vsp: 1.18; }
.vip-lv-85 { --vh: 304; --vsp: 1.24; }
.vip-lv-86 { --vh: 313; --vsp: 1.30; }
.vip-lv-87 { --vh: 322; --vsp: 1.36; }
.vip-lv-88 { --vh: 331; --vsp: 1.42; }
.vip-lv-89 { --vh: 340; --vsp: 1.48; }
.vip-lv-90 { --vh: 349; --vsp: 1.54; }
.vip-lv-91 { --vh: 330; --vsp: 1.00; }
.vip-lv-92 { --vh: 339; --vsp: 1.06; }
.vip-lv-93 { --vh: 348; --vsp: 1.12; }
.vip-lv-94 { --vh: 357; --vsp: 1.18; }
.vip-lv-95 { --vh: 6; --vsp: 1.24; }
.vip-lv-96 { --vh: 15; --vsp: 1.30; }
.vip-lv-97 { --vh: 24; --vsp: 1.36; }
.vip-lv-98 { --vh: 33; --vsp: 1.42; }
.vip-lv-99 { --vh: 42; --vsp: 1.48; }
.vip-lv-100 { --vh: 51; --vsp: 1.54; }

/* Cabinet → VIP rewards */
.vip-page__top { display: flex; gap: 22px; align-items: center; padding: 18px 20px 24px; margin-bottom: 16px; flex-wrap: wrap; }
.vip-page__state { display: grid; gap: 6px; flex: 1 1 260px; min-width: 0; }
.vip-page__state p { margin: 0; }
.vip-rewards__char { max-width: 420px; margin-bottom: 14px; }
.vip-levels { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.vip-lvl { display: grid; grid-template-columns: 76px 150px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.vip-lvl:not(.is-reached) { opacity: .62; }
.vip-lvl.is-current { border-color: var(--gold); box-shadow: 0 0 12px rgba(226, 181, 90, .3); }
.vip-lvl__badge .vip-badge--inline { margin: 0; font-size: 11px; }
.vip-lvl__meta { display: grid; font-size: 13px; font-variant-numeric: tabular-nums; }
.vip-lvl__gifts { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.vip-gift { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 10px; background: rgba(0, 0, 0, .25); font-size: 13px; min-width: 0; }
.vip-gift .pass__icon { width: 36px; height: 36px; display: grid; place-items: center; flex: none; }
.vip-gift__label { overflow: hidden; text-overflow: ellipsis; }
.vip-lvl__state { justify-self: end; }
@media (max-width: 640px) {
    .vip-lvl { grid-template-columns: auto 1fr auto; }
    .vip-lvl__gifts { grid-column: 1 / -1; grid-row: 2; }
    .vip-lvl__state { grid-row: 1; grid-column: 3; }
}

/* Admin → VIP */
.vip-fill { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0 0 14px; }
.vip-fill .field { margin: 0; width: 150px; }
.vip-fill .field__hint { flex-basis: 100%; margin: 0; }
.vip-edit__row { grid-template-columns: 34px 110px 72px 104px repeat(3, minmax(230px, 1fr)); min-width: 1060px; }
.vip-edit .bp-edit__row:not(.bp-edit__row--head) { padding: 6px 0; border-bottom: 1px solid var(--line); }
.vip-preview { padding: 12px 16px; margin-bottom: 14px; }
.vip-preview summary { cursor: pointer; }
.vip-preview__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 30px 12px; padding: 22px 4px 8px; }
.vip-preview__cell { display: grid; justify-items: center; gap: 22px; }

/* ---------- Notifications: toasts (bottom right; top on phones), the bell and its list ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; border-left-width: 4px; background-color: rgba(14, 16, 24, .96); box-shadow: 0 10px 28px rgba(0, 0, 0, .55); backdrop-filter: blur(6px); animation: toastIn .25s ease-out; transition: opacity .25s, transform .25s; }
.toast.is-leaving { opacity: 0; transform: translateY(8px); }
.toast a { color: inherit; text-decoration: underline; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 820px) {
    .toasts { top: calc(72px + env(safe-area-inset-top)); bottom: auto; right: 16px; left: 16px; width: auto; }
    .toast.is-leaving { transform: translateY(-8px); }
    @keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { .toast { animation: none; transition: none; } }

.bell { order: 3; position: relative; flex: none; display: grid; place-items: center; width: 40px; height: 40px; margin-left: 8px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); cursor: pointer; }
.bell:hover, .bell:focus-visible { color: var(--gold-2); border-color: var(--gold-3); }
.bell svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.bell__count { position: absolute; top: -6px; right: -6px; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.topbar__inner .nav { order: 2; }
@media (max-width: 1180px) {
    .bell { order: 0; margin-left: auto; }
    .bell + .nav-toggle { margin-left: 8px; }
}

.notif-dialog { width: min(560px, calc(100vw - 24px)); }
.notif-dialog__bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.notif-list { display: grid; gap: 6px; max-height: min(60vh, 560px); overflow-y: auto; }
.notif { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.notif.is-unread { border-color: var(--gold-3); background: rgba(226, 181, 90, .07); }
.notif__icon { font-size: 15px; line-height: 20px; text-align: center; }
.notif--success .notif__icon { color: #5fd08d; }
.notif--error .notif__icon { color: #ef6b6b; }
.notif--warn .notif__icon { color: #f0b04a; }
.notif--info .notif__icon { color: var(--magic); }
.notif__text { margin: 0; color: var(--text); font-size: 14px; word-break: break-word; }
.notif__time { font-size: 12px; color: var(--faint); }
.notif__del { border: 0; background: none; color: var(--faint); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 4px; }
.notif__del:hover { color: var(--danger); }
.notif__empty { margin: 10px 0; }
.notif__more { justify-self: center; margin-top: 4px; }

/* Desktop header: the logo never shrinks (it used to squeeze when the menu labels were long, e.g. in Russian),
   tighter gaps between the menu buttons. */
.brand, .brand__logo { flex: none; }
.brand__logo { object-fit: contain; max-width: 200px; }
@media (max-width: 560px) { .brand__logo { max-width: 150px; } }
@media (min-width: 1181px) {
    /* The header may use more width than the page content (1160 px): long labels (ru) fit without squeezing. */
    .topbar__inner.container { max-width: 1360px; gap: clamp(8px, 0.9vw, 14px); }
    .nav { gap: 2px; }
    .nav__link { padding: 8px clamp(6px, 0.65vw, 11px); }
    .nav__username { max-width: clamp(70px, 8vw, 140px); }
}

/* ---------- Guilds ---------- */
.guild-tag {
    display: inline-block; max-width: 13em; margin-left: 6px; padding: 0 7px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: -3px;
    font-size: 11px; line-height: 17px; border-radius: 6px; text-decoration: none;
    color: var(--magic); border: 1px solid color-mix(in srgb, var(--magic) 45%, transparent);
    background: color-mix(in srgb, var(--magic) 10%, transparent);
}
.guild-tag:hover { color: var(--gold-2); border-color: var(--gold-2); }
.guild-link { color: var(--text); font-weight: 600; text-decoration: none; }
.guild-link:hover { color: var(--gold-2); }
.char__guild { margin: 4px 0 0; }
.char__guild .guild-tag { margin-left: 0; }
.guild-avatar { color: var(--magic); }
.guild-members { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.guild-member { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.guild-member--leader { border-color: var(--gold); }
.guild-member--deputy, .guild-member--officer { border-color: var(--line-2); }
.guild-member__class { flex: none; border-radius: 50%; }
.guild-member__main { min-width: 0; flex: 1; }
.guild-member__name { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.guild-member__meta { display: block; margin-top: 2px; }
.guild-member--leader .guild-rank { color: var(--gold); border-color: var(--gold); }
.guild-rank { margin-left: 6px; vertical-align: 1px; }
.guild-status { margin: 0; padding-left: 18px; }
.territories { padding: 14px 16px; margin-bottom: 12px; box-shadow: none; }
.territories__title { margin: 0 0 8px; font-size: 15px; }
.territories__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.territories__list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.territories__map { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.terr-badge { margin-left: 6px; font-size: 11px; color: var(--gold); white-space: nowrap; }
.guild-terr { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.guild-terr__item { font-size: 12px; color: var(--gold); border-color: var(--gold); }
/* Guild name colours as in the game: blue = no territory, orange = a territory, red = Purgatory Island */
.guild-c--blue { --gc: #6fb0ff; }
.guild-c--orange { --gc: #ffa24a; }
.guild-c--red { --gc: #ff6b6b; }
.guild-link[class*="guild-c--"], .char-page__name[class*="guild-c--"] { color: var(--gc); }
.guild-tag[class*="guild-c--"] {
    color: var(--gc);
    border-color: color-mix(in srgb, var(--gc) 50%, transparent);
    background: color-mix(in srgb, var(--gc) 12%, transparent);
}
/* Guild bonuses */
.gbonus-edit__row { grid-template-columns: 34px 190px repeat(3, minmax(230px, 1fr)); min-width: 1000px; }
.gbonus-edit__name { font-weight: 600; }
.gbonus__form { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.gbonus__form .input--select { max-width: 220px; }
.gbonus .vip-lvl__meta strong { display: block; }
.gbonus .vip-lvl { grid-template-columns: minmax(150px, 220px) 1fr auto; }
@media (max-width: 640px) {
    .gbonus .vip-lvl { grid-template-columns: 1fr auto; }
    .gbonus .vip-lvl__gifts { grid-column: 1 / -1; grid-row: 2; }
    .gbonus .vip-lvl__state { grid-row: 1; grid-column: 2; }
}
.guild-gives { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 0; }

/* Quests (cabinet → Quests, Admin → Quests) */
.quest-edit__row { grid-template-columns: 28px 120px minmax(190px, 1.2fr) 90px 80px repeat(2, minmax(230px, 1fr)); min-width: 1100px; }
.ggoal-edit__row { grid-template-columns: 28px minmax(200px, 1.2fr) 110px repeat(2, minmax(230px, 1fr)); min-width: 900px; }
.quests { display: grid; gap: 10px; margin-bottom: 24px; }
.quests__title { margin: 0; font: 700 22px/1.2 var(--font-display); color: var(--gold-2); }
.quests__title small { font: 400 13px var(--font); margin-left: 8px; }
.quests__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.quest { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.quest.is-done { border-color: var(--gold); box-shadow: 0 0 12px rgba(226, 181, 90, .25); }
.quest.is-claimed { opacity: .65; }
.quest__main { flex: 1 1 auto; min-width: 0; display: grid; gap: 6px; }
.quest__name { font-size: 15px; }
.quest__bar { display: flex; align-items: center; gap: 10px; }
.quest__bar .progress { flex: 1 1 auto; max-width: 420px; }
.quest__count { font-size: 13px; color: var(--muted); white-space: nowrap; }
.quest__gifts { display: flex; flex-wrap: wrap; gap: 6px; }
.quest__state { flex: none; }
@media (min-width: 1100px) {
    .quests__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .quest { flex-wrap: wrap; }
    .quest__state { flex: 1 1 100%; display: flex; justify-content: flex-end; }
}

/* Login streak (cabinet, Admin → Завдання) */
.streak { padding: 14px 16px; display: grid; gap: 10px; margin-bottom: 18px; }
/* Cabinet cards (moderator reward, comeback, streak) right after a section (the cases): the usual 40 px between blocks,
   like .section's padding; before the next section no extra 18 px on top of its 40. */
.section + .streak { margin-top: 40px; }
.streak:has(+ .section) { margin-bottom: 0; }
.streak__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 14px; }
.streak__days { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.streak__day { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(0, 0, 0, .15); font-size: 13px; }
.streak__day small { color: var(--muted); }
.streak__day.is-done { border-color: var(--gold); background: rgba(226, 181, 90, .12); }
.comeback { border-color: var(--gold); box-shadow: 0 0 14px rgba(226, 181, 90, .25); }
.comeback p { margin: 0; }
.comeback-edit__row { grid-template-columns: 90px repeat(3, minmax(220px, 1fr)); min-width: 780px; }
.streak-edit__row { grid-template-columns: 90px repeat(2, minmax(230px, 1fr)); min-width: 600px; }

.ref-edit__row { grid-template-columns: 160px repeat(2, minmax(230px, 1fr)); min-width: 640px; }

/* Mentorship (cabinet → Наставництво, Admin → Наставництво) */
.mentor-edit__row { grid-template-columns: 90px repeat(4, minmax(220px, 1fr)); min-width: 1000px; }
.mentor__milestones { grid-template-columns: 1fr !important; }

/* Badges (cabinet → Значки, profile, Admin → Значки) */
.badges { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.badge-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; opacity: .55; filter: grayscale(.8); }
.badge-card.is-earned { opacity: 1; filter: none; border-color: var(--gold); }
.badge-card__icon { font-size: 30px; line-height: 1; flex: none; }
.badge-card__text { display: grid; gap: 2px; min-width: 0; }
.badge-card__date { color: var(--ok); }
.badge-card__reward { color: var(--gold-2); }
.badge-edit__row { grid-template-columns: 28px minmax(240px, 1fr) minmax(260px, 1fr); min-width: 600px; }
.pcard__badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.pcard__badge { font-size: 22px; line-height: 1; padding: 4px; border-radius: 8px; background: rgba(226, 181, 90, .1); cursor: help; }

/* Weekly growth contests (/contests, Admin → Змагання) */
.contest__timer { margin: 0 0 14px; color: var(--gold-2); font-weight: 600; }
.contests { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-bottom: 20px; }
.contest { padding: 14px 16px; display: grid; gap: 10px; align-content: start; }
.contest__title { margin: 0; font: 700 18px/1.2 var(--font-display); color: var(--gold-2); }
.contest__prizes { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.contest__range { color: var(--gold-2); font-weight: 600; }
.contest__me { margin: 0; padding: 6px 10px; border-radius: var(--radius-sm); background: rgba(226, 181, 90, .1); font-size: 14px; }
.contest__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.contest__row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; font-size: 14px; }
.contest__row.is-top .contest__place { color: var(--gold-2); font-weight: 700; }
.contest__row.is-me { background: rgba(226, 181, 90, .12); }
.contest__place { text-align: right; color: var(--muted); }
.contest__row--pct { grid-template-columns: 44px minmax(0, 1fr) auto; }
.contest__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contest__gain { color: var(--ok); font-weight: 600; }
.contest__value { font-size: 12px; }
.contest-edit { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px 12px; margin: 0; }
.contest-edit__row { grid-template-columns: 90px repeat(3, minmax(230px, 1fr)); min-width: 820px; }
.contest-week { padding: 14px 16px; display: grid; gap: 10px; margin-bottom: 14px; }

/* Guild treasury (cabinet → Guild bonuses, admin) */
.page-title--sub { font-size: 22px; margin: 28px 0 10px; }
.treasury { margin-top: 32px; display: grid; gap: 14px; }
.treasury__title { margin: 0; font: 700 24px/1.2 var(--font-display); color: var(--gold-2); }
.treasury .page-sub { margin: 0; }
.treasury__guild { display: grid; gap: 12px; padding: 14px 16px; }
.treasury__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }
.treasury__name { margin: 0 0 2px; font-size: 17px; }
.treasury__lots { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.treasury__lot { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(0, 0, 0, .15); }
.treasury__icon { flex: none; border-radius: 6px; }
.treasury__item { flex: 1 1 auto; min-width: 0; }
.treasury__item small { display: block; }
.treasury__qty { color: var(--gold-2); font-weight: 600; }
.treasury__form, .treasury__donate { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.treasury__form { justify-content: flex-end; }
.treasury__num { width: 84px; }
.treasury__for { max-width: 190px; min-height: 40px; }
.treasury__form > .input { min-height: 40px; }
.treasury__slot { min-width: 0; flex: 1 1 220px; max-width: 360px; }
.treasury__log summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.treasury__log ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
@media (min-width: 900px) {
    .treasury__lots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .treasury__lot { flex-wrap: wrap; }
    .treasury__form { flex: 1 1 100%; }
    .treasury__donate > * { flex: 1 1 100%; max-width: none; }
    .treasury__num { width: auto; }
}

/* ---------- Guild / character page: full width on desktop ---------- */
.page-wide { padding-top: 32px; }
.guild-bonuses { display: grid; gap: 10px; }
.guild-bonus { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(0, 0, 0, .15); }
.guild-bonus__name { margin: 0 0 4px; font-size: 14px; color: var(--gold-2); }
.guild-member { flex-wrap: wrap; gap: 2px 8px; }
.guild-member--head { display: none; }
.guild-member .gm-cell { order: 2; font-size: 12px; color: var(--muted); }
.guild-member .gm-cell::before { content: attr(data-l) " "; color: var(--faint); }
.guild-member .gm-cell + .gm-cell::before { content: "· " attr(data-l) " "; }
.guild-member__main { flex: 1 1 calc(100% - 50px); }
@media (min-width: 900px) {
    .char-page--wide { padding: 24px 28px; gap: 18px; }
    .char-page--wide .char__stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .char-page--wide .char__stats dd { font-size: 15px; }
    .char-page--wide .char-equip { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
    .guild-bonuses { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
    .guild-members { gap: 0; }
    .guild-member, .guild-member--head {
        display: grid; grid-template-columns: 34px minmax(220px, 2fr) 80px 150px 190px 110px;
        gap: 12px; align-items: center; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
    }
    .guild-member--head { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
    .guild-member--leader { border: 0; border-bottom: 1px solid var(--line); background: rgba(226, 181, 90, .07); }
    .guild-member .gm-cell { order: 0; font-size: 13px; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
    .guild-member--head .gm-cell { font-size: 11px; color: var(--faint); }
    .guild-member .gm-cell::before, .guild-member .gm-cell + .gm-cell::before { content: none; }
    .guild-member__main { min-width: 0; }
}
/* Cabinet character card: class / guild rank line, game wallet, details */
.char__sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.char__wallet { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.char__details summary { cursor: pointer; font-size: 13px; color: var(--gold-2); }
.char__details[open] summary { margin-bottom: 8px; }
.char__stats--small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.char__stats--small dd { font-size: 12px; }
.char__stats--small dt { overflow-wrap: anywhere; }
/* Admin → user: item log and inventory with icons */
.tx-filter { margin-bottom: 10px; flex-wrap: wrap; }
.tx-filter .input { width: auto; min-width: 140px; }
.tx-filter input[type="search"] { min-width: 220px; }
.tx-item { display: inline-flex; align-items: center; gap: 8px; min-width: 220px; }
#tx td.num, #tx td.num + td { white-space: nowrap; }
.tx-item img { flex: none; border-radius: 6px; }

/* Scheduled events: banners under the header (partials/event_banner.php) and Admin → Events */
.event-banners { display: grid; gap: 8px; width: min(1200px, calc(100% - 32px)); margin: 12px auto 0; }
.event-banner { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: linear-gradient(90deg, rgba(226, 181, 90, .14), var(--surface)); }
.event-banner.is-live { border-color: rgba(226, 181, 90, .55); }
.event-banner--xp { background: linear-gradient(90deg, rgba(111, 220, 207, .14), var(--surface)); }
.event-banner--case { background: linear-gradient(90deg, rgba(167, 139, 250, .16), var(--surface)); }
.event-banner[hidden] { display: none; }
.event-banner__icon { font-size: 24px; line-height: 1; }
.event-banner__body { display: grid; gap: 2px; flex: 1; min-width: 0; }
.event-banner__title { color: var(--gold-2); }
.event-banner__text { color: var(--muted); font-size: 14px; }
.event-banner__time { color: var(--muted); font-size: 13px; white-space: nowrap; }
.event-banner__time strong { color: var(--text); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
    .event-banner { flex-wrap: wrap; gap: 8px 10px; padding: 10px 12px; }
    .event-banner__body { flex-basis: calc(100% - 70px); }
    .event-banner__close { position: absolute; right: 8px; top: 6px; }
    .event-banner { position: relative; padding-right: 34px; }
    .event-banner__time { flex: 1; }
}
.event-params[hidden] { display: none; }
.event-params { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.event-cats { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.event-prize { grid-template-columns: 150px 110px minmax(0, 1fr) 110px; }
.event-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.case--event .case__price { color: var(--gold-2); }
.case__chances { list-style: none; margin: 0 0 8px; padding: 0; font-size: 12px; color: var(--muted); text-align: left; }
.event-prize > [name$="[item]"] { grid-column: auto; }
.event-prize + .event-prize { margin-top: 6px; }
@media (max-width: 640px) {
    .event-prize { grid-template-columns: minmax(0, 1fr) 90px; }
    .event-prize > [name$="[item]"] { grid-column: 1 / -1; }
}

/* Art / screenshot contests (/art-contests, Admin → Конкурси робіт) */
.art-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.art-card { display: grid; gap: 6px; color: var(--text); }
.art-card:hover { border-color: var(--gold-3); }
.art-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.art-card__title { color: var(--gold-2); font-size: 17px; }
.art-card--over { opacity: .8; }
.art-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.art-about__text { margin-bottom: 10px; line-height: 1.55; }
.art-mine { margin-bottom: 14px; }
.art-mine__entry { display: flex; gap: 14px; align-items: center; }
.art-mine__thumb { width: 120px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); }
.art-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.art-entry .media-card__body { display: grid; gap: 6px; }
.art-entry.is-voted { border-color: rgba(95, 208, 141, .55); }
.art-entry.is-place { border-color: var(--gold-3); }
.art-entry.is-hidden { opacity: .5; }
.art-entry__place { position: absolute; left: 8px; top: 8px; padding: 3px 9px; border-radius: 999px; background: rgba(11, 13, 20, .8); color: var(--gold-2); font-weight: 700; }
.art-entry__note { justify-self: start; }
.art-entry form { margin: 0; }
.art-hidden { display: grid; gap: 6px; padding-left: 18px; }
@media (max-width: 760px) {
    .art-top, .art-form { grid-template-columns: 1fr; }
}

/* Moderator elections (/elections, Admin → Вибори модераторів) */
.elect-list { display: grid; gap: 14px; }
.elect-card { display: grid; gap: 8px; }
.elect-card > .badge, .elect-card > span.muted { justify-self: start; }
.elect-card.is-elected { border-color: rgba(95, 208, 141, .55); }
.elect-card.is-voted { border-color: var(--gold-3); }
.elect-card.is-hidden { opacity: .55; }
.elect-card__head { display: flex; gap: 14px; align-items: center; }
.elect-card__photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.elect-card__who { display: grid; gap: 3px; flex: 1; min-width: 0; }
.elect-card__name { font-size: 17px; }
.elect-card__badges { display: flex; flex-wrap: wrap; gap: 4px; font-size: 18px; }
.elect-card__result { display: grid; justify-items: end; gap: 4px; text-align: right; }
.elect-card__result strong { font-size: 22px; color: var(--gold-2); }
.elect-card__motivation { margin: 0; line-height: 1.55; overflow-wrap: anywhere; }
.elect-card__meta { margin: 0; font-size: 13px; }
.elect-form { display: grid; gap: 10px; margin-bottom: 10px; }
.elect-reject { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0; }
.elect-reject .input { width: min(320px, 100%); padding: 6px 8px; font-size: 13px; }
tr.is-muted td { opacity: .5; }
@media (max-width: 640px) {
    .elect-card__head { flex-wrap: wrap; }
    .elect-card__result { justify-items: start; text-align: left; grid-auto-flow: column; align-items: center; }
}
/* Cabinet: confirmed e-mail = a check mark after the name (the VIP level is on the avatar frame) */
.profile__verified { display: inline-grid; place-items: center; width: 1.45em; height: 1.45em; margin-left: .45em; border-radius: 50%; background: var(--ok); color: #0b0d14; font-family: var(--font); font-size: .5em; font-weight: 900; line-height: 1; vertical-align: .35em; cursor: help; }

/* Admin → player → item operations: re-send / return a send to a character */
.tx-actions { min-width: 150px; }
.tx-actions__buttons { display: flex; flex-wrap: wrap; gap: 4px; }
.tx-actions form { margin: 0; }

/* Admin → player → inventory: change / destroy a stack */
.inv-admin summary { list-style: none; cursor: pointer; }
.inv-admin summary::-webkit-details-marker { display: none; }
.inv-admin__form { display: grid; gap: 6px; margin-top: 6px; min-width: 220px; }
.inv-admin__form .input { padding: 6px 8px; font-size: 13px; }
.inv-admin__bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.inv-admin__bulk .input { width: min(320px, 100%); }

/* Admin → Наставництво: a stage = level and / or power */
.mentor-edit__stage { display: grid; gap: 4px; }

/* Mentorship bans (Admin → Наставництво, the player page) */
.mentor-ban { margin-bottom: 12px; }
#mentor-ban details > summary { list-style: none; cursor: pointer; }
#mentor-ban details > summary::-webkit-details-marker { display: none; }
#mentor-ban .alert { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }

/* Cards of the art contests and moderator elections: inner padding like .contest / .streak (.card itself has none) */
.art-about, .art-prizes, .art-mine, .art-card, .elect-card { padding: 16px 18px; }
@media (max-width: 640px) {
    .art-about, .art-prizes, .art-mine, .art-card, .elect-card { padding: 14px; }
}
.bg-admin__current img.bg-admin__logo { object-fit: contain; background: #0b0d14; padding: 8px; }
/* "Next section" link under a home block, like the hero's download hint */
.section-next { display: table; margin: 26px auto 0; color: #cfd3e0; font-size: 14px; text-shadow: 0 1px 6px #000; }
.section-next:hover { color: var(--gold-2); }
.fav-preview { display: inline-flex; align-items: flex-end; gap: 14px; padding: 12px 16px; border-radius: 8px; border: 1px solid var(--line); background: #0b0d14; }
.bg-admin__current .fav-preview img { display: block; height: auto; padding: 0; border: 0; border-radius: 0; background: none; object-fit: contain; }
.bg-admin__current .fav-preview img:nth-child(1) { width: 64px; }
.bg-admin__current .fav-preview img:nth-child(2) { width: 32px; }
.bg-admin__current .fav-preview img:nth-child(3) { width: 16px; }
/* Admin → Головна сторінка: the header logo preview at its real size on a header-like bar */
.hdr-preview { display: inline-flex; align-items: center; min-height: 66px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--line); background: rgba(11, 13, 20, .82); }
.bg-admin__current .hdr-preview img { width: auto; height: 50px; max-width: 200px; padding: 0; border: 0; border-radius: 0; background: none; object-fit: contain; }
/* Home «Класи героїв»: class videos (ClassVideos, app.js) in place of the static art */
.class-video { display: grid; gap: 12px; margin-top: 22px; }
/* With a video the panel grows: the art column follows the taller text column, the image stays on the bottom edge */
.class-panel--video { align-items: end; }
/* Every class image gets the same height (the files go from 560x407 to 504x707): a 560 px tall box on the bottom edge,
   the image centred in it; a wide one (mage, assassin, archer) loses a little of its sides inside its own column. */
.class-panel--video .class-panel__art { height: 560px; display: flex; justify-content: center; align-items: flex-end; overflow: hidden; }
.class-panel--video .class-panel__art img { height: 100%; width: auto; max-width: none; max-height: none; flex: none; }
.class-panel--video .class-panel__body { padding: 30px 0 28px; }
.class-video__frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-sm, 10px); overflow: hidden; border: 1px solid var(--line); background: #05060a; box-shadow: 0 12px 40px rgba(0, 0, 0, .45); }
.class-video__player { display: block; width: 100%; height: 100%; object-fit: cover; background: #05060a; }
.class-video__play { position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; border: 2px solid var(--gold); background: rgba(11, 13, 20, .7); color: var(--gold-2); font-size: 28px; line-height: 1; cursor: pointer; box-shadow: 0 0 24px rgba(226, 181, 90, .35); transition: transform .2s, background .2s; }
.class-video__play:hover { transform: scale(1.06); background: rgba(226, 181, 90, .18); }
.class-video__play[hidden] { display: none; }
.class-video__controls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
.class-video__controls[hidden] { display: none; }
.class-video__controls .is-active { color: var(--gold-2); border-color: var(--gold); background: rgba(226, 181, 90, .12); }
.class-video__sound { min-width: 42px; }
@media (max-width: 1000px) {
    .class-panel--video .class-panel__art { height: 300px; }
    .class-panel--video .class-video__controls { justify-content: center; }
    .class-panel--video .class-panel__body { padding: 8px 0 22px; }
}
/* Admin → Головна сторінка → Відео класів */
.cv-admin__class { border-top: 1px solid var(--line); padding: 14px 0; display: grid; gap: 10px; }
.cv-admin__slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cv-admin__slot { display: grid; gap: 6px; align-content: start; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, .15); font-size: 13px; }
.cv-admin__slot img, .cv-admin__slot .cv-admin__noposter { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: #05060a; display: grid; place-items: center; color: var(--muted); }
.cv-admin__slot form { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cv-admin__slot .input { flex: 1 1 160px; }
/* Admin navigation (partials/admin_nav.php): a grouped sidebar fixed on the left from 1100 px, a drawer below that */
.admin-side { display: grid; align-content: start; gap: 6px; padding: 12px; background: rgba(11, 13, 20, .96); border-right: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain; z-index: 45; }
.admin-side__head { display: flex; gap: 6px; align-items: center; position: sticky; top: -12px; padding: 12px 0 6px; margin-top: -12px; background: inherit; z-index: 1; }
.admin-side__filter { flex: 1; min-width: 0; padding: 8px 10px; font-size: 13px; }
.admin-side__close { display: none; border: 0; background: none; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.admin-side__group { border-bottom: 1px solid rgba(255, 255, 255, .05); padding: 4px 0 6px; }
.admin-side__group summary { cursor: pointer; list-style: none; padding: 6px 8px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-radius: 6px; }
.admin-side__group summary::-webkit-details-marker { display: none; }
.admin-side__group summary::before { content: "▸"; display: inline-block; width: 14px; transition: transform .15s; }
.admin-side__group[open] summary::before { transform: rotate(90deg); }
.admin-side__group summary:hover { color: var(--text); }
.admin-side__link { display: block; padding: 7px 10px 7px 22px; border-radius: 6px; color: #cfd3e0; font-size: 14px; line-height: 1.3; }
.admin-side__link:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.admin-side__link.is-active { background: rgba(226, 181, 90, .12); color: var(--gold-2); box-shadow: inset 3px 0 0 var(--gold); }
.admin-side__link[hidden], .admin-side__group[hidden] { display: none; }
.admin-side__none { padding: 8px; font-size: 13px; }
.admin-side__open { display: none; margin: 0 0 16px; }
@media (min-width: 1100px) {
    .admin-side { position: fixed; top: var(--topbar-h, 67px); bottom: 0; left: 0; width: 240px; }
    body:has(.admin-side) .main { padding-left: 240px; }
    body:has(.admin-side) .footer { padding-left: 240px; }
}
@media (max-width: 1099px) {
    .admin-side__open { display: inline-flex; }
    .admin-side { position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); transform: translateX(-105%); transition: transform .2s ease; z-index: 120; box-shadow: 10px 0 40px rgba(0, 0, 0, .5); }
    .admin-side.is-open { transform: none; }
    .admin-side__close { display: block; }
    .admin-side__backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 110; }
    .admin-side__backdrop[hidden] { display: none; }
}

/* ---------- New server launch banner (partials/launch_banner.php, Admin → Новий сервер) ---------- */
.launch-wrap { margin-top: 28px; }
.launch { position: relative; overflow: hidden; border: 1px solid rgba(226, 181, 90, .55); border-radius: var(--radius); background: radial-gradient(120% 140% at 0% 0%, rgba(226, 181, 90, .16), transparent 55%), radial-gradient(120% 140% at 100% 100%, rgba(111, 220, 207, .12), transparent 55%), var(--surface); box-shadow: 0 0 24px rgba(226, 181, 90, .18); }
.launch__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .38; pointer-events: none; }
.launch--image::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11, 13, 20, .92) 0, rgba(11, 13, 20, .6) 60%, rgba(11, 13, 20, .35)); pointer-events: none; }
.launch__body { position: relative; display: grid; gap: 12px; justify-items: start; padding: 24px 28px; }
.launch__eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--magic); }
.launch.is-open .launch__eyebrow { color: var(--ok); }
.launch__title { margin: 0; font-family: var(--font-display); font-size: clamp(22px, 3.2vw, 34px); line-height: 1.15; color: var(--gold-2); }
.launch__text { margin: 0; max-width: 70ch; color: var(--text); }
.launch__timer { display: flex; gap: 8px; }
.launch__unit { display: grid; justify-items: center; min-width: 64px; padding: 8px 6px 6px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: rgba(11, 13, 20, .55); }
.launch__unit b { font-family: var(--font-display); font-size: 28px; line-height: 1; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.launch__unit small { margin-top: 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.launch__when { margin: 0; font-size: 13px; color: var(--muted); }
.launch__rewards { display: grid; gap: 6px; }
.launch__rewards-title { font-size: 13px; font-weight: 600; color: var(--muted); }
.launch__list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.launch__reward { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid color-mix(in srgb, var(--r, var(--line-2)) 55%, transparent); border-radius: 999px; background: rgba(11, 13, 20, .5); font-size: 13px; }
.launch__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); color: var(--gold-2); font-size: 16px; overflow: hidden; }
.launch__icon img { width: 32px; height: 32px; object-fit: contain; }
.launch__note { margin: 0; font-size: 12px; color: var(--faint); }
.launch__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 4px; }
.launch__actions form { margin: 0; }
.launch__hint { font-size: 14px; color: var(--muted); }
.launch__hint--warn { color: var(--warn); }
.launch__done { font-weight: 600; color: var(--ok); }
.launch__count { font-size: 13px; color: var(--muted); }
/* The launch strip inside the home hero (partials/launch_strip.php): seen without scrolling, in the flow under the
   buttons (so it never covers the logo, the characters or the header), dark glass so it stays readable on video. */
.launch-strip { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 18px; width: fit-content; max-width: min(440px, 100%);
    margin: 20px auto 0; padding: 12px 18px; border: 1px solid rgba(226, 181, 90, .55); border-radius: 18px; text-align: left;
    background: linear-gradient(90deg, rgba(226, 181, 90, .14), rgba(11, 13, 20, .8) 45%), rgba(11, 13, 20, .78); backdrop-filter: blur(6px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .45), 0 0 18px rgba(226, 181, 90, .16); }
.launch-strip__info { display: grid; line-height: 1.2; }
.launch-strip__eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--magic); }
.launch-strip.is-open .launch-strip__eyebrow { color: var(--ok); }
.launch-strip__name { font-family: var(--font-display); font-size: 18px; color: var(--gold-2); }
.launch-strip__timer { display: flex; gap: 4px; font-variant-numeric: tabular-nums; }
.launch-strip__timer .launch__unit { min-width: 42px; padding: 4px 3px 3px; background: rgba(0, 0, 0, .35); }
.launch-strip__timer .launch__unit b { font-size: 18px; }
.launch-strip__timer .launch__unit small { margin-top: 2px; font-size: 9px; }
.launch-strip__act { display: flex; align-items: center; gap: 12px; }
.launch-strip__act form { margin: 0; }
.launch-strip__act .btn { white-space: nowrap; }
.launch-strip__state { font-size: 13px; font-weight: 600; color: var(--ok); white-space: nowrap; }
.launch-strip__state--warn { color: var(--warn); }
.launch-strip__more { font-size: 12px; color: #cfd3e0; white-space: nowrap; }
.launch-strip__more:hover { color: var(--gold-2); }
@media (max-width: 760px) {
    .launch-wrap { margin-top: 20px; }
    .launch__body { padding: 18px 16px; }
    .launch__timer { gap: 6px; width: 100%; }
    .launch__unit { flex: 1; min-width: 0; }
    .launch__unit b { font-size: 24px; }
    .launch__actions .btn--lg { width: 100%; }
    .launch__actions form { width: 100%; }
    .launch-strip { margin-top: 16px; border-radius: var(--radius); padding: 10px 12px; gap: 8px 12px; }
    .launch-strip__info { text-align: center; width: 100%; }
    .launch-strip__act { width: 100%; justify-content: center; flex-wrap: wrap; }
}
.tag--bound { color: var(--gold-2); border-color: rgba(226, 181, 90, .45); }
.product__bound { margin: 0 0 10px; }
.launch-edit { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.launch-admin__img { width: min(480px, 100%); height: auto; aspect-ratio: 8 / 3; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line-2); }
.admin-box__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.table-wrap { overflow-x: auto; }
.badge--danger { color: #ffc4c4; border-color: rgba(239, 107, 107, .5); background: rgba(239, 107, 107, .1); }
.table tr.is-flagged td { background: rgba(239, 107, 107, .06); }
.table tr.is-current td { background: rgba(226, 181, 90, .07); }

/* ---------- Home: five screen-high blocks (templates/home.php) ---------- */
/* Each block is at least one screen under the sticky top bar (taller content just makes it taller, nothing is cut);
   the content is centred in it, the same previous / next links sit at the bottom. scroll-margin cancels the extra air
   of html scroll-padding, so a block jumped to fills the screen exactly. */
.home-block { position: relative; display: flex; flex-direction: column; min-height: calc(100vh - var(--topbar-h, 67px)); min-height: calc(100svh - var(--topbar-h, 67px));
    padding: 48px 0 16px; scroll-margin-top: -14px; }
.home-block + .home-block { border-top: 1px solid rgba(226, 181, 90, .12); }
.home-block__inner { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; width: 100%; }
.home-block__end { margin-top: 32px; }
.home-block .launch-wrap { margin: 0 0 22px; }
.home-block .showcase:last-of-type { margin-bottom: 0; }
.home-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 32px; padding: 26px 16px 0; }
.home-nav__link, .hero__download { color: #cfd3e0; font-size: 14px; text-shadow: 0 1px 6px #000; }
.home-nav__link:hover { color: var(--gold-2); }
@media (max-width: 760px) {
    .home-block { padding: 34px 0 12px; }
    .home-block__end { margin-top: 24px; }
}
/* Block map (wide screens): a line with a dot per block and its name under it; app.js marks the current block and
   shows the map from the second block on. */
.home-map { display: none; }
@media (min-width: 1380px) {
    .home-map { display: block; position: fixed; right: 14px; top: 50%; z-index: 30; transform: translateY(-50%); opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s; }
    .home-map.is-visible { opacity: 1; visibility: visible; }
}
.home-map__list { position: relative; display: flex; flex-direction: column; gap: 22px; margin: 0; padding: 0; list-style: none; }
.home-map__list::before { content: ""; position: absolute; left: 50%; top: 6px; bottom: 22px; width: 1px; background: linear-gradient(rgba(226, 181, 90, .15), rgba(226, 181, 90, .55), rgba(226, 181, 90, .15)); }
.home-map__dot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; text-decoration: none; }
.home-map__dot::before { content: ""; width: 11px; height: 11px; border: 1px solid var(--gold); border-radius: 50%; background: var(--bg); transition: transform .2s, background .2s; }
.home-map__dot:hover { color: var(--text); }
.home-map__dot.is-active { color: var(--gold-2); }
.home-map__dot.is-active::before { background: var(--gold-2); box-shadow: 0 0 10px var(--gold); transform: scale(1.25); }
.home-map__label { max-width: 86px; padding: 1px 6px; border-radius: 6px; background: rgba(11, 13, 20, .85); text-align: center; line-height: 1.25; }
@media (prefers-reduced-motion: reduce) { .home-map, .home-map__dot::before { transition: none; } }

/* Download cards: platform icons (assets/img/platform/*.svg) and the ⓘ install steps */
.dl-card { position: relative; padding-right: 52px; }
.dl-card__icon img { width: 34px; height: 34px; object-fit: contain; }
.dl-card__info { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(226, 181, 90, .45); border-radius: 50%;
    background: rgba(11, 13, 20, .6); color: var(--gold-2); font: italic 700 15px/1 Georgia, serif; cursor: pointer; }
.dl-card__info:hover, .dl-card__info:focus-visible { background: rgba(226, 181, 90, .16); }
.install-dialog { max-width: 520px; }
.install-dialog__title { display: flex; align-items: center; gap: 10px; margin: 0 36px 14px 0; font: 700 20px/1.2 var(--font-display); color: var(--gold-2); }
.install-dialog__title img { width: 28px; height: 28px; }
.install-dialog__steps { display: grid; gap: 10px; margin: 0; padding-left: 22px; }
.install-dialog__steps li { line-height: 1.5; }
.install-dialog__steps li::marker { color: var(--gold-2); font-weight: 700; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; }
.input--xs { width: 64px; }
.gcat td { vertical-align: middle; }
.gcat .input { min-width: 110px; }
/* Bigger reading pages: news, guides, gallery items; a photo gets nearly the whole screen */
.narrow--wide { max-width: 1040px; }
.narrow--media .media-view__frame img { max-height: 86vh; }
.news-list { grid-template-columns: repeat(auto-fill, minmax(min(460px, 100%), 1fr)); gap: 18px; }
.news-list .news-card { padding: 26px 28px; }
.news-list .news-card__title { font-size: 21px; }
.news-list .news-card__excerpt { font-size: 15px; }
.guide-grid { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)) !important; gap: 18px; }
.guide-card { grid-template-rows: 210px auto; }
.guide-card__title { font-size: 20px; }
.guide-card__text { font-size: 15px; -webkit-line-clamp: 4; }

/* Top-up page: the admin's text and the x2 event banner (Admin → Оплата) */
.topup-intro { padding: 14px 18px; margin-bottom: 16px; box-shadow: none; }
.topup-intro p { margin: 0; }
.x2-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; padding: 16px 20px; margin-bottom: 18px; border-color: rgba(111, 220, 207, .45);
    background: radial-gradient(120% 160% at 0% 0%, rgba(111, 220, 207, .14), transparent 60%), var(--surface); box-shadow: none; }
.x2-banner.is-on { border-color: var(--gold); background: radial-gradient(120% 160% at 0% 0%, rgba(226, 181, 90, .22), transparent 60%), var(--surface); box-shadow: 0 0 22px rgba(226, 181, 90, .25); }
.x2-banner__badge { display: grid; place-items: center; width: 64px; height: 64px; flex: none; border-radius: 16px; font: 800 28px/1 var(--font-display); color: #1b1407;
    background: linear-gradient(135deg, var(--gold-2), var(--gold-3)); }
.x2-banner__body { flex: 1 1 260px; display: grid; gap: 4px; }
.x2-banner__title { margin: 0; font: 700 20px/1.2 var(--font-display); color: var(--gold-2); }
.x2-banner__text, .x2-banner__when { margin: 0; font-size: 14px; color: var(--muted); }
.x2-banner__timer { display: grid; justify-items: end; gap: 2px; }
.x2-banner__timer small { font-size: 12px; color: var(--muted); }
.x2-banner__timer strong { font: 700 22px/1.1 var(--font-display); color: var(--gold-2); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .x2-banner__timer { justify-items: start; } }

/* Cases: the coins a case gives, and the premium bonus on it (Admin → Бонусні кейси) */
.case { position: relative; }
.case__reward { margin: 0; font-size: 13px; color: var(--gold-2); display: grid; gap: 2px; }
.case__with-premium { font-size: 11px; color: var(--violet); }
.case--boosted { border-color: rgba(167, 139, 250, .6); box-shadow: 0 0 16px rgba(167, 139, 250, .25); }
.case__boost { position: absolute; top: 8px; right: 8px; z-index: 1; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #efe8ff;
    background: linear-gradient(135deg, rgba(167, 139, 250, .85), rgba(111, 157, 255, .75)); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.casecfg__range { display: inline-flex; align-items: center; gap: 6px; }
.casecfg__range .input { width: 110px; }

/* Pre-registration modal (home) and the cabinet block «Нагороди за передреєстрацію» */
.launch-dialog { width: min(94vw, 860px); padding: 0; overflow: auto; }
.launch-dialog .launch { border: 0; border-radius: 0; box-shadow: none; }
.launch-dialog .sheet__close { z-index: 3; color: #fff; text-shadow: 0 1px 6px #000; }
.launch-rewards { padding: 14px 16px; display: grid; gap: 10px; margin-bottom: 18px; border-color: rgba(226, 181, 90, .5); }
.launch-rewards p { margin: 0; }
.launch-rewards .launch__list { margin: 0; }

/* Cabinet: premium time left next to the VIP title; the count of a bonus case in its upper corner */
.profile__vip-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.premium-left { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #e6dcff;
    background: rgba(167, 139, 250, .14); border: 1px solid rgba(167, 139, 250, .45); }
.profile__vip-link.btn { justify-self: start; margin-top: 4px; }
.case__count--corner { position: absolute; top: 8px; left: 10px; z-index: 1; margin: 0; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: rgba(11, 13, 20, .75); border: 1px solid var(--line-2); }
.case__count--corner strong { font-size: 14px; }
.launch-rewards { margin-top: 24px; }
/* Top-up rules after they were accepted: a chip that opens them in a modal */
.rules-chip-row { margin: 0 0 16px; }
.rules-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(95, 208, 141, .45); background: rgba(95, 208, 141, .08);
    color: #bff0d2; font: 600 13px/1.2 var(--font); cursor: pointer; }
.rules-chip:hover { background: rgba(95, 208, 141, .16); }
.rules-dialog { width: min(94vw, 620px); }
.profile__vip-link.btn--primary { color: #1b1407; font-size: 13px; }

/* Admin item picker (partials/item_picker.php) */
.item-pick-wrap { position: relative; display: block; min-width: 0; }
.item-pick-wrap > .input { width: 100%; padding-right: 40px; }
.bp-edit__reward > .item-pick-wrap { grid-column: 1 / -1; }
.item-pick-btn { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 32px; height: 30px; border: 1px solid var(--line-2); border-radius: 8px;
    background: var(--surface-2); color: var(--gold-2); font-size: 15px; line-height: 1; cursor: pointer; }
.item-pick-btn:hover { border-color: var(--gold-3); }
.item-picker { width: min(96vw, 980px); max-height: 92vh; display: none; }
.item-picker[open] { display: grid; grid-template-rows: auto auto auto 1fr auto; grid-template-columns: minmax(0, 1fr); gap: 10px; overflow-x: hidden; }
.item-picker > *, .item-picker__filters > * { min-width: 0; }
.item-picker__title { margin: 0 36px 0 0; font: 700 20px/1.2 var(--font-display); color: var(--gold-2); }
.item-picker__filters { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(2, minmax(140px, 1fr)) auto; gap: 8px; align-items: center; }
.item-picker__count { margin: 0; font-size: 12px; }
.item-picker__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 6px; overflow-y: auto; min-height: 200px; align-content: start; }
.item-picker__grid[aria-busy] { opacity: .5; }
.item-picker__item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid color-mix(in srgb, var(--r, var(--line-2)) 45%, var(--line)); border-radius: 10px;
    background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.item-picker__item:hover, .item-picker__item:focus-visible { border-color: var(--r, var(--gold)); background: var(--surface-2); }
.item-picker__item img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.item-picker__text { display: grid; min-width: 0; }
.item-picker__text strong { font-size: 13px; color: var(--r, var(--text)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-picker__text small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-picker__pager { display: flex; justify-content: center; align-items: center; gap: 12px; font-size: 13px; }
@media (max-width: 760px) { .item-picker__filters { grid-template-columns: 1fr 1fr; } .item-picker__filters [data-ip-q] { grid-column: 1 / -1; } }

/* Admin → Магазин: bulk bar and categories; shop: locked categories */
.store__actions { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; margin-bottom: 12px; box-shadow: none; }
.bulk-bar__count { font-size: 13px; color: var(--muted); }
.bulk-bar .field__hint { flex-basis: 100%; margin: 0; }
.tab__lock { font-size: 11px; opacity: .8; }

/* Admin → mystery case prizes: type, count, weight, then the item */
.mystery-rows { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.mystery-row { grid-template-columns: minmax(110px, 1fr) 90px 90px; }

/* Monthly check-in calendar (partials/checkin_calendar.php) */
.calendar { padding: 14px 16px; display: grid; gap: 12px; margin-bottom: 18px; }
.calendar__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.calendar__day { position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; min-height: 128px; padding: 22px 6px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: center; }
.calendar__num { position: absolute; top: 4px; left: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.calendar__icon { display: grid; place-items: center; width: 36px; height: 36px; font-size: 20px; color: var(--gold-2); }
.calendar__label { font-size: 11px; color: var(--muted); line-height: 1.2; }
.calendar__state { font-size: 12px; font-weight: 700; color: var(--ok); }
.calendar__day.is-marked { border-color: rgba(95, 208, 141, .5); background: rgba(95, 208, 141, .07); }
.calendar__day.is-today { border-color: var(--gold); box-shadow: 0 0 14px rgba(226, 181, 90, .3); }
.calendar__day.is-missed { opacity: .8; }
.calendar__day.is-later { opacity: .55; }
.calendar__day form { margin: 0; }
.calendar__day .btn--sm { padding: 4px 8px; font-size: 11px; }
.calendar__bonuses { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.calendar__bonuses-title { font-size: 13px; color: var(--muted); }
.calendar__bonus { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12px; }
.calendar__bonus.is-ready { border-color: var(--gold); }
.calendar__bonus.is-claimed { opacity: .6; }
.calendar__bonus form { margin: 0; }
@media (max-width: 760px) { .calendar__grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); } .calendar__day { min-height: 116px; } }
.cal-days summary { cursor: pointer; margin: 6px 0; }
.cal-days__grid { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.cal-days__row { display: grid; grid-template-columns: 28px 1fr; gap: 6px; align-items: start; }
.cal-days__n { font-weight: 700; color: var(--muted); padding-top: 8px; }

/* Cabinet profile buttons in rows by category (ProfileButtons) */
.profile__rows { display: grid; gap: 8px; }
.profile__row { display: grid; gap: 4px; }
.profile__row-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.profile__row .profile__links { margin: 0; }

/* Referrals: the inviter's share of the friends' purchases */
.ref-share { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(226, 181, 90, .4); background: rgba(226, 181, 90, .06); }
.ref-share__pct { font: 700 26px/1 var(--font-display); color: var(--gold-2); }
.ref-total { color: var(--gold-2); font-size: .8em; }

/* Guild war predictions: server cards, stake form, guild rating dialog */
.pred-servers { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); margin-bottom: 16px; }
.pred-server { display: grid; gap: 6px; padding: 18px; text-decoration: none; color: inherit; border: 1px solid var(--line-2);
    background: linear-gradient(160deg, rgba(226, 181, 90, .10), rgba(255, 255, 255, .02)); transition: transform .15s, border-color .15s; }
.pred-server:hover { transform: translateY(-2px); border-color: var(--gold-3); }
.pred-server__icon { font-size: 28px; line-height: 1; }
.pred-server__name { font: 700 20px/1.2 var(--font-display); color: var(--gold-2); }
.pred-server__meta, .pred-server__bal { font-size: 13px; color: var(--muted); }
.pred-server__state { justify-self: start; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, .06); color: var(--muted); }
.pred-server__state.is-open { background: rgba(95, 208, 141, .14); color: #bff0d2; }
.pred-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pred-bar .contest__timer { margin: 0; }
.pred-rating-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--gold-3);
    background: linear-gradient(135deg, rgba(226, 181, 90, .22), rgba(226, 181, 90, .06)); color: var(--gold-2); font: 700 14px/1.2 var(--font); cursor: pointer; }
.pred-rating-btn:hover { background: rgba(226, 181, 90, .3); }
.pred-balance { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.pred-terr.has-pick { border-color: rgba(226, 181, 90, .45); }
.pred-form { display: grid; grid-template-columns: minmax(0, 1fr) 92px auto; gap: 8px; align-items: center; }
.pred-form > .input { min-width: 0; }
@media (max-width: 420px) { .pred-form { grid-template-columns: minmax(0, 1fr) 80px; } .pred-form > .btn { grid-column: 1 / -1; } }
.pred-rating__sub { margin: 14px 0 6px; font-size: 14px; color: var(--gold-2); }
.pred-rating__terr, .pred-rating__top { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pred-rating__terr li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 8px; background: rgba(255, 255, 255, .03); font-size: 14px; }
.pred-rating__top li { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 8px; padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.pred-rating__top li > .muted { grid-column: 2; font-size: 12px; }
.pred-rating__top li.is-top { background: rgba(226, 181, 90, .1); }
.pred-rating__place { text-align: right; color: var(--gold-2); font-weight: 700; }
.pred-rating__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* Admin → Огляд: activity of the last 24 hours (partials/admin_activity.php) */
.watch__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; }
.watch__at { font-size: 13px; }
.watch__table { min-width: 640px; }
.watch__why { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.watch__rules { margin-top: 10px; font-size: 13px; color: var(--muted); }
.watch__rules summary { cursor: pointer; color: var(--gold-2); }
.watch__rules ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }

/* Cabinet header: VIP name under the avatar, premium time left after the name */
.profile__ava { display: grid; justify-items: center; gap: 14px; }
.profile__ava-title { max-width: 150px; justify-content: center; text-align: center; font-size: 12px; line-height: 1.2; }
.premium-left--name { margin-left: .5em; font: 600 13px/1.4 var(--font); letter-spacing: 0; text-transform: none; vertical-align: .35em; white-space: nowrap; cursor: help; }
.profile__vip-link .nav__badge { margin-left: 4px; }
@media (max-width: 560px) {
    .profile__ava { gap: 8px; }
    .profile__ava-title { max-width: 96px; font-size: 10.5px; }
    .premium-left--name { font-size: 12px; padding: 1px 8px; }
}

/* Battle pass: the claim button at the bottom of every slot; a clear claimed mark */
.pass__reward { grid-template-rows: auto 1fr auto; align-content: stretch; }
.pass__label { align-self: center; }
.pass__claim { align-self: end; }
.pass__reward.is-claimed { opacity: 1; border-color: rgba(111, 220, 207, .55); background: linear-gradient(180deg, rgba(111, 220, 207, .10), var(--surface)); }
.pass__reward.is-claimed .pass__icon, .pass__reward.is-claimed .pass__label { opacity: .5; }
.pass__state--claimed { top: 4px; right: 4px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--magic); color: #062330;
    font-size: 13px; font-weight: 900; box-shadow: 0 0 10px rgba(111, 220, 207, .6); }

/* Promo code cards: the activate button at the bottom of the card */
.promo-card { display: flex; flex-direction: column; }
.promo-card > .btn { align-self: flex-start; margin-top: auto; }
.promo-card > .promo-card__meta:has(+ .btn) { margin-bottom: 4px; }
@media (max-width: 560px) {
    .profile__rows { grid-column: 1 / -1; min-width: 0; }
}

/* Mystery case ×10: two buttons, and a window with all prizes revealed one by one */
.case__forms { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.case__forms > form[hidden] { display: none; }
.prize-many { width: min(94vw, 640px); }
.prize-many__grid { list-style: none; margin: 14px 0 6px; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.prize-many__item { display: grid; justify-items: center; align-content: start; gap: 6px; padding: 10px 6px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
    background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--c) 22%, transparent), rgba(5, 6, 10, .6) 75%); opacity: 0; transform: scale(.6) rotateY(90deg); }
.prize-many.is-revealed .prize-many__item { animation: prizeFlip .45s cubic-bezier(.2, 1.3, .4, 1) forwards; }
.prize-many.is-revealed .prize-many__item:nth-child(1) { animation-delay: 0.15s; }
.prize-many.is-revealed .prize-many__item:nth-child(2) { animation-delay: 0.27s; }
.prize-many.is-revealed .prize-many__item:nth-child(3) { animation-delay: 0.39s; }
.prize-many.is-revealed .prize-many__item:nth-child(4) { animation-delay: 0.51s; }
.prize-many.is-revealed .prize-many__item:nth-child(5) { animation-delay: 0.63s; }
.prize-many.is-revealed .prize-many__item:nth-child(6) { animation-delay: 0.75s; }
.prize-many.is-revealed .prize-many__item:nth-child(7) { animation-delay: 0.87s; }
.prize-many.is-revealed .prize-many__item:nth-child(8) { animation-delay: 0.99s; }
.prize-many.is-revealed .prize-many__item:nth-child(9) { animation-delay: 1.11s; }
.prize-many.is-revealed .prize-many__item:nth-child(10) { animation-delay: 1.23s; }
.prize-many__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; border: 2px solid var(--c); background: #05060a; font-size: 24px; color: var(--c);
    box-shadow: 0 0 14px color-mix(in srgb, var(--c) 50%, transparent); }
.prize-many__icon img { width: 40px; height: 40px; object-fit: contain; }
.prize-many__name { font-size: 11.5px; line-height: 1.25; color: var(--c); text-align: center; word-break: break-word; }
@keyframes prizeFlip { to { opacity: 1; transform: none; } }
@media (max-width: 560px) { .prize-many__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .prize-many__icon { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { .prize-many__item { opacity: 1; transform: none; } .prize-many.is-revealed .prize-many__item { animation: none; } }

/* Weekly giveaway: top 10 with mini profile links, VIP level and coin icons */
.gw__list li { display: flex; align-items: center; gap: 8px; }
.gw__list li::marker { color: var(--muted); }
.gw__who { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }
.gw__who .vip-badge--inline { margin-left: 2px; }
.gw__list li strong.gw__amount { float: none; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.gw__list .coin, .gw__stat .coin { width: 16px; height: 16px; vertical-align: -3px; }
.gw__list { counter-reset: gw; padding-left: 0; list-style: none; }
.gw__list li::before { counter-increment: gw; content: counter(gw) "."; flex: none; min-width: 20px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Social post bonus (cabinet/social.php, admin/social.php) */
.social-form { display: grid; gap: 10px; margin-bottom: 20px; padding: 20px 22px; }
.social-form .treasury__title { margin: 0 0 4px; }
.social-form__form select.input, .social-form__form input.input { height: 46px; }
@media (max-width: 560px) { .social-form { padding: 14px; } }
.social-form__text { margin: 0; color: var(--text); }
.social-form__form { display: grid; gap: 10px; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); align-items: end; }
.social-form__wide { grid-column: 1 / -1; }
.social-form__form .btn { justify-self: start; }
@media (max-width: 560px) { .social-form__form { grid-template-columns: minmax(0, 1fr); } }
.social-list, .social-review { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
.social-item { display: grid; gap: 6px; padding: 12px 14px; min-width: 0; }
.social-item--approved { border-color: rgba(95, 208, 141, .4); }
.social-item--rejected { opacity: .8; }
.social-item__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; }
.social-item__url { overflow-wrap: anywhere; font-size: 14px; }
.social-item__comment { margin: 0; font-size: 14px; color: var(--text); }
.social-item__date { font-size: 12px; }
.social-item__reward { color: var(--ok); font-size: 13px; }
.social-item__reason { color: var(--warn); font-size: 13px; }
.social-item__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.social-item__reject { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 260px; }
.social-item__reject .input { flex: 1 1 160px; min-width: 0; }

/* Chat: support inbox, unsubscribe page */
.chat-nav__empty { margin: 2px 10px 8px; font-size: 12px; }
.chatmail-off { max-width: 560px; margin: 24px auto; display: grid; gap: 12px; }

/* Top-up x2 banner on phones: one compact block (small badge beside the title, timer on one line, no date line) */
@media (max-width: 560px) {
    .x2-banner { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 6px 12px; padding: 10px 12px; margin-bottom: 12px; }
    .x2-banner__badge { width: 40px; height: 40px; border-radius: 10px; font-size: 18px; grid-row: 1 / span 2; align-self: start; }
    .x2-banner__body { gap: 2px; }
    .x2-banner__title { font-size: 16px; }
    .x2-banner__text, .x2-banner__when { display: none; } /* the title and the timer say it; the full text is on wider screens */
    .x2-banner__timer { grid-column: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; justify-items: start; }
    .x2-banner__timer strong { font-size: 16px; }
}

/* The prize windows are modals: fixed to the screen like every <dialog> (".prize { position: relative }" above made
   them sit in the page, so opening one and focusing its button scrolled the page to the top). */
.prize:modal { position: fixed; }

/* Mystery case: one split button, «Відкрити» + an «x10» edge on the right (the edge only from 10 cases on) */
.case__split { flex-wrap: nowrap; gap: 0; justify-content: stretch; width: 100%; }
.case__split > .case__split-main { flex: 1 1 auto; min-width: 0; }
.case__split > form[data-case-many] { flex: none; }
.case__split > .case__split-main:has(+ form[data-case-many]:not([hidden])) .case__btn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.case__split .case__btn--many { width: auto; padding-left: 12px; padding-right: 12px; border-top-left-radius: 0; border-bottom-left-radius: 0;
    border-left: 1px solid rgba(27, 20, 7, .45); box-shadow: inset 1px 0 0 rgba(255, 255, 255, .25); font-weight: 800; letter-spacing: .02em; }
.case__split > form[data-case-many] { display: flex; }
.case__split > form[data-case-many][hidden] { display: none; }.case__split { margin-top: 10px; }
.case .case__split > form { margin-top: 0; }
.case .case__split > .case__split-main { flex: 1 1 0; width: auto; }
.case .case__split > form[data-case-many] { width: auto; }
.case__split { align-items: center; }
.case .case__split > form { align-self: center; }

/* Shop / inventory views (partials/item_views.php): grid (the cards), list (a row per item), compact (small cards) */
.view-switch { display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.view-switch__btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: 600 13px/1 var(--font); cursor: pointer; }
.view-switch__btn:hover { color: var(--text); }
.view-switch__btn.is-active { background: var(--surface-2); color: var(--gold-2); box-shadow: inset 0 0 0 1px var(--line-2); }
@media (max-width: 420px) { .view-switch__text { display: none; } .view-switch__btn { padding: 7px 12px; font-size: 16px; } }
.item__price2, .item__buy { display: none; }

/* list: icon | name | price (and the other coin) | buy */
.item-grid--list { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.item-grid--list > .item { contain-intrinsic-size: auto 64px; grid-template-columns: 52px minmax(0, 1fr) auto auto; grid-template-rows: auto auto; justify-items: start; align-items: center;
    column-gap: 12px; row-gap: 2px; padding: 6px 12px 6px 6px; text-align: left; }
.item-grid--list > .item:hover { transform: none; }
.item-grid--list .item__icon { grid-row: 1 / span 2; width: 52px; height: 52px; border-radius: 10px; }
.item-grid--list .item__icon img { width: 44px; height: 44px; }
.item-grid--list .item__name { grid-column: 2; grid-row: 1 / span 2; min-height: 0; -webkit-line-clamp: 2; font-size: 14px; }
.item-grid--list .item__pack, .item-grid--list .item__qty { position: static; grid-column: 3; grid-row: 2; justify-self: end; }
.item-grid--list .item__new { position: static; grid-column: 3; grid-row: 1; justify-self: end; }
.item-grid--list .item__price { grid-column: 3; grid-row: 1; justify-self: end; position: relative; }
.item-grid--list .item__price .item__sale { position: static; margin-left: 4px; box-shadow: none; }
.item-grid--list .item__price2 { display: inline-flex; align-items: center; gap: 3px; grid-column: 3; grid-row: 2; justify-self: end; font-size: 12px; color: var(--muted); white-space: nowrap; }
.item-grid--list .item__price2 .coin { width: 14px; height: 14px; }
.item-grid--list .item__buy { display: inline-flex; grid-column: 4; grid-row: 1 / span 2; padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 700;
    color: #1b1407; background: linear-gradient(180deg, var(--gold-2), var(--gold)); }
.item-grid--list .item.is-sold-out .item__buy { background: var(--surface-2); color: var(--muted); }
.item-grid--list .item__tags { grid-column: 3 / -1; grid-row: 1; justify-self: end; justify-content: flex-end; }
.item-grid--list .item__qty + .item__name + .item__tags { grid-row: 1; }
@media (max-width: 560px) {
    .item-grid--list > .item { grid-template-columns: 46px minmax(0, 1fr) auto; column-gap: 10px; padding-right: 10px; }
    .item-grid--list .item__icon { width: 46px; height: 46px; }
    .item-grid--list .item__icon img { width: 38px; height: 38px; }
    .item-grid--list .item__name { font-size: 13px; }
    .item-grid--list .item__buy { display: none; } /* the whole row opens the item; no room for the button on phones */
}

/* compact: small cards, more per row */
.item-grid--compact { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.item-grid--compact > .item { contain-intrinsic-size: auto 140px; padding: 7px 5px 6px; gap: 3px; }
.item-grid--compact .item__icon { width: 50px; height: 50px; border-radius: 10px; }
.item-grid--compact .item__icon img { width: 42px; height: 42px; }
.item-grid--compact .item__name { font-size: 11.5px; }
.item-grid--compact .item__price { font-size: 12.5px; }
.item-grid--compact .item__price .item__sale { top: 42px; left: calc(50% + 8px); font-size: 10px; padding: 0 4px; }
.item-grid--compact .item__tags { display: none; }
@media (max-width: 560px) { .item-grid--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Shop: categories in a column on the left on wide screens (the strip on top on phones and tablets) */
@media (min-width: 1024px) {
    .shop-layout--side { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: start; }
    .shop-layout--side > .shop-cats { position: sticky; top: 84px; flex-direction: column; gap: 2px; margin: 0; padding: 8px; overflow: visible; border: 1px solid var(--line);
        border-radius: var(--radius); background: var(--surface); }
    .shop-layout--side > .shop-cats .tab { justify-content: space-between; width: 100%; margin: 0; padding: 9px 12px; border: 0; border-radius: 8px; text-align: left; }
    .shop-layout--side > .shop-cats .tab.is-active { background: var(--surface-2); color: var(--gold-2); box-shadow: inset 3px 0 0 var(--gold); }
}/* list: the pack size / quantity under the name (not over the second price) */
.item-grid--list .item__name { grid-row: 1; align-self: end; }
.item-grid--list > .item:not(:has(.item__pack, .item__qty)) .item__name { grid-row: 1 / span 2; align-self: center; }
.item-grid--list .item__pack, .item-grid--list .item__qty { grid-column: 2; grid-row: 2; justify-self: start; align-self: start; padding: 1px 7px; }

/* Item window: the currency and the buy button in one row, pinned to the bottom of the window while it scrolls */
.buy-form__bar { display: flex; align-items: stretch; gap: 8px; }
.buy-form__pay { flex: 1 1 auto; min-width: 0; display: flex; }
.buy-form__pay .currency-select { width: 100%; min-width: 0; }
.buy-form__btn { flex: 1 1 auto; justify-content: center; gap: 8px; white-space: nowrap; }
.buy-form__pay + .buy-form__btn { flex: 0 0 auto; }
.buy-form__btn-price { display: inline-flex; align-items: center; gap: 3px; padding-left: 8px; border-left: 1px solid rgba(27, 20, 7, .35); font-variant-numeric: tabular-nums; }
.buy-form__btn-price .coin { width: 16px; height: 16px; }
.sheet .buy-form__bar { position: sticky; bottom: -22px; z-index: 2; margin: 4px -22px -22px; padding: 12px 22px 16px; border-top: 1px solid var(--line);
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-2) 92%, transparent), var(--bg-2)); box-shadow: 0 -10px 18px rgba(5, 6, 10, .45); }
@media (max-width: 380px) { .buy-form__btn-price { padding-left: 6px; } .buy-form__btn { padding-left: 12px; padding-right: 12px; } }

/* Currencies: B-Coins blue so the two coins never look alike; GC / BC next to prices */
.coin--reward { width: 28px; height: 28px; margin: 0; vertical-align: middle; }
.cur-tag { margin-left: 2px; font-size: .68em; font-weight: 800; letter-spacing: .03em; color: var(--muted); vertical-align: 1px; }
.cur-tag--g { color: var(--gold-2); }
.cur-tag--b { color: #8fc8ff; }
.price-tag { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }

/* Top bar balances: GC and BC of the bonus server (layout.php) */
.nav-wallet { order: 3; display: flex; align-items: center; gap: 6px; margin-left: 8px; flex: none; color: var(--text); text-decoration: none; }
.nav-wallet__item { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 9px 0 6px; border-radius: 999px; border: 1px solid var(--line);
    background: var(--surface); font-size: 13px; white-space: nowrap; }
.nav-wallet__item--g { border-color: rgba(226, 181, 90, .45); }
.nav-wallet__item--b { border-color: rgba(143, 200, 255, .4); }
.nav-wallet__tag { font-size: 11px; font-weight: 800; color: var(--muted); }
.nav-wallet__item--g .nav-wallet__tag { color: var(--gold-2); }
.nav-wallet__item--b .nav-wallet__tag { color: #8fc8ff; }
.nav-wallet strong { font-variant-numeric: tabular-nums; }
.nav-wallet:hover .nav-wallet__item { border-color: var(--gold-3); }
@media (max-width: 1180px) { .nav-wallet { order: 0; margin-left: auto; } .nav-wallet + .bell { margin-left: 8px; } }
@media (max-width: 480px) { /* phones: both values stacked in one small block so the menu button keeps its place */
    .nav-wallet { flex-direction: column; align-items: stretch; gap: 1px; padding: 3px 8px 3px 5px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
    .nav-wallet__item { height: auto; padding: 0; border: 0; background: none; font-size: 11.5px; line-height: 1.25; gap: 3px; }
    .nav-wallet__item .coin { width: 13px; height: 13px; }
    .nav-wallet__tag { font-size: 10px; }
    .topbar .brand__logo { width: 92px; height: auto; }
}

/* Shop tools row: view switch + (phones) search icon and sort list */
.shop-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.shop-tools .view-switch { margin: 0; }
.shop-tools__m { display: none; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.shop-tools__search { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.shop-tools__search.is-active { color: var(--gold-2); border-color: var(--gold-3); }
.shop-tools__search svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.shop-tools__sort { flex: 1 1 auto; min-width: 0; display: flex; }
.shop-tools__sort .input { width: 100%; min-width: 0; height: 40px; }
.shop-search { width: min(94vw, 460px); }
.shop-search .search { margin-top: 18px; }
@media (max-width: 767px) {
    .shop-tools__m { display: flex; }
    .shop-tools { flex-wrap: nowrap; }
    /* the category strip stays under the top bar while scrolling */
    .shop-layout > .shop-cats { position: sticky; top: var(--topbar-h, 64px); z-index: 20; margin: 0 0 12px; background: rgb(11, 13, 20); box-shadow: 0 0 0 100vmax rgb(11, 13, 20); clip-path: inset(0 -100vmax); }
}/* Landscape phones and tablets: the categories in the side column too (shop and inventory) */
@media (orientation: landscape) and (min-width: 640px) and (max-width: 1023px) {
    .shop-layout--side { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; align-items: start; }
    .shop-layout--side > .shop-cats { position: sticky; top: calc(var(--topbar-h, 64px) + 8px); max-height: calc(100vh - var(--topbar-h, 64px) - 16px); overflow-y: auto;
        flex-direction: column; gap: 2px; margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: none; clip-path: none; }
    .shop-layout--side > .shop-cats .tab { justify-content: space-between; width: 100%; margin: 0; padding: 8px 10px; border: 0; border-radius: 8px; text-align: left; font-size: 13px; }
    .shop-layout--side > .shop-cats .tab.is-active { background: var(--surface-2); color: var(--gold-2); box-shadow: inset 3px 0 0 var(--gold); }
}
@media (min-width: 1024px) { .shop-layout--side > .shop-cats { top: calc(var(--topbar-h, 66px) + 12px); } }
@media (max-width: 480px) { /* phones: the bell right next to the menu button, room for the balances */
    .topbar__inner { gap: 8px; }
    .nav-wallet + .bell { margin-left: 6px; }
    .bell + .nav-toggle { margin-left: 4px; }
    .bell { width: 38px; height: 38px; }
}

/* Settings → active sessions */
.sessions__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 14px; }
.sessions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sessions__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.sessions__item.is-current { border-color: rgba(95, 208, 141, .45); }
.sessions__icon { font-size: 22px; flex: none; }
.sessions__main { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.sessions__main small { flex-basis: 100%; font-size: 12px; overflow-wrap: anywhere; }
.cabinet-security-link { margin: 18px 0 0; }
/* Wide screens: after the page links come balances, bell, language, settings (+ admin), logout. The nav's own items are
   laid out in the bar itself (display: contents) so the balances and the bell, outside it, can sit between them. */
@media (min-width: 1181px) {
    .topbar__inner .nav { display: contents; }
    .topbar__inner .nav > * { order: 2; }
    .topbar__inner .nav > .nav__spacer { order: 2; flex: 1 1 0; min-width: 4px; }
    .topbar__inner > .nav-wallet { order: 3; margin-left: 0; }
    .topbar__inner > .bell { order: 4; margin-left: 0; }
    .topbar__inner .nav > .lang-drop { order: 5; margin-right: 0; }
    .topbar__inner .nav > .nav__user { order: 6; }
    .topbar__inner .nav > .inline-form, .topbar__inner .nav > .btn { order: 7; }
}/* Narrower desktops: the balances stacked and the name hidden (the avatar stays) so the bar keeps one line */
@media (min-width: 1181px) and (max-width: 1499px) {
    .topbar__inner > .nav-wallet { flex-direction: column; align-items: stretch; gap: 1px; padding: 3px 8px 3px 5px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
    .topbar__inner > .nav-wallet .nav-wallet__item { height: auto; padding: 0; border: 0; background: none; font-size: 11.5px; line-height: 1.25; gap: 3px; }
    .topbar__inner > .nav-wallet .coin { width: 13px; height: 13px; }
    .nav__username { display: none; }
}

/* Shop tools row on computers: view switch, search field, sort buttons */
.shop-tools__d { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; flex: 1 1 auto; min-width: 0; }
.shop-tools__find { flex: 1 1 220px; max-width: 360px; margin: 0; }
.shop-tools__d .sorts { margin: 0; }
@media (max-width: 767px) { .shop-tools__d { display: none; } }
@media (max-width: 560px) { .view-switch__text { display: none; } .view-switch__btn { padding: 7px 11px; font-size: 16px; } } /* room for the sort list */
.shop-tools__sort .input { padding-right: 30px; text-overflow: ellipsis; }

/* List view: the "new" mark on the icon corner, never over the price; the discount a bit apart from GC/BC */
.item-grid--list .item__new { position: absolute; top: 3px; left: 3px; z-index: 2; grid-column: auto; grid-row: auto; margin: 0; padding: 1px 5px; font-size: 9px; line-height: 1.3; }
.item-grid--list .item__price .item__sale { margin-left: 6px; }
.item-grid--list .item__price { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }@media (max-width: 767px) { .store:has(> .shop-layout) { padding-top: 0; } .store:has(> .shop-layout) > .store__head { margin-bottom: 10px; } }
@media (min-width: 768px) {
    .shop-tools { flex-wrap: nowrap; }
    .shop-tools__d { flex-wrap: nowrap; }
    .shop-tools__find { flex: 1 1 160px; min-width: 140px; max-width: 320px; }
    .shop-tools__d .sorts { flex: none; flex-wrap: nowrap; }
}
@media (min-width: 768px) and (max-width: 1100px) { .shop-tools { flex-wrap: wrap; } } /* tablets: the search and sort may go under the switch */

/* Cabinet button groups: one group per line, its caption on the left and the buttons after it (wrapping under the
   buttons, not under the caption); on narrow phones the caption goes above. */
.profile__rows { display: grid; gap: 8px; }
.profile__row { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 4px 10px; }
.profile__row-label { flex: none; }
.profile__row .profile__links { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
@media (max-width: 560px) { .profile__row { grid-template-columns: minmax(0, 1fr); } }
.profile .profile__row .profile__links { grid-column: auto; } /* the phone rule spanning .profile__links over the profile grid must not push them under the caption */
@media (max-width: 560px) { .profile .profile__row .profile__links { grid-column: 1 / -1; } }

/* Shop / inventory pages fixed on the screen (pager_dock). Wide screens (1300 px+): a column in the free margin right
   of the content (the content keeps its width). Narrower: a small bar at the bottom of the screen, above the phone tab
   bar when there is one (not in the game's web view, which has none). */
.shop-main { scroll-margin-top: calc(var(--topbar-h, 64px) + 8px); }
.page-dock__m { display: none; }
@media (min-width: 1300px) {
    .page-dock > .pager { position: fixed; right: max(6px, calc((100vw - 1160px) / 2 - 64px)); top: 50%; transform: translateY(-50%); z-index: 40;
        flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 4px; margin: 0; padding: 6px; border-radius: 14px;
        border: 1px solid var(--line-2); background: rgba(16, 19, 29, .92); box-shadow: 0 10px 28px rgba(0, 0, 0, .45); backdrop-filter: blur(6px); }
    .page-dock > .pager .pager__page { min-width: 40px; padding: 7px 6px; }
    .page-dock > .pager .pager__gap { padding: 0; line-height: 1; }
}
@media (max-width: 1299px) {
    .page-dock > .pager { display: none; }
    .page-dock__m { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 78; display: flex; align-items: center; gap: 6px;
        padding: 5px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(16, 19, 29, .95); box-shadow: 0 8px 22px rgba(0, 0, 0, .5); backdrop-filter: blur(6px); }
    .page-dock__arrow { display: grid; place-items: center; width: 40px; height: 38px; border-radius: 10px; border: 1px solid var(--line); color: var(--gold-2); font-size: 22px; line-height: 1; text-decoration: none; }
    .page-dock__arrow.is-off { color: var(--faint); opacity: .5; }
    .page-dock__pick .input { height: 38px; min-width: 104px; padding: 0 28px 0 12px; font-weight: 700; text-align: center; }
    body.is-game .shop-main:has(> .page-dock) { padding-bottom: 64px; } /* game web view (no footer): the last items stay above the bar */
    body:has(.page-dock) .to-top { bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media (max-width: 820px) { /* the phone tab bar is shown (not in the game web view): the bar sits above it */
    body:has(.tabbar) .page-dock__m { bottom: calc(66px + env(safe-area-inset-bottom)); }
    body:has(.page-dock):has(.tabbar) .to-top { bottom: calc(130px + env(safe-area-inset-bottom)); }
}

/* Inventory: the number of items next to each category */
.tab__count { margin-left: 4px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--muted); background: rgba(255, 255, 255, .06); }
.tab.is-active .tab__count { color: var(--gold-2); }
/* Top-up: the ⓘ next to the rules opens the crediting / premium gift note */
.rules-chip-row { display: flex; align-items: center; gap: 8px; }
.topup-info-btn { flex: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface);
    color: var(--gold-2); font: 700 15px/1 Georgia, serif; font-style: italic; cursor: pointer; }
.topup-info-btn:hover { border-color: var(--gold-3); }
.rules-card__form { align-items: center; }/* Pages in .store: on phones the same top gap as the cabinet (16 px), not 28 */
@media (max-width: 560px) { .store { padding-top: 16px; } }

/* Compact desktop top bar: GC + BC in one pill, the avatar opens a menu with name, settings, language and logout.
   Phones / narrow screens (≤ 1180 px) keep the burger menu with the separate items. */
.user-drop { display: none; }
@media (min-width: 1181px) {
    .topbar__inner { min-height: 58px; }
    .topbar__inner.container { gap: clamp(6px, 0.7vw, 12px); }
    .topbar .brand__logo { width: 96px; height: auto; }
    .nav__link { padding: 6px clamp(5px, 0.55vw, 9px); }
    .nav__link .nav__badge { margin-left: 3px; min-width: 18px; padding: 0 5px; font-size: 10.5px; }
    .nav__classic { display: none !important; }
    .topbar__inner > .nav-wallet { flex-direction: row; align-items: center; gap: 0; height: 34px; padding: 0 2px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); }
    .topbar__inner > .nav-wallet .nav-wallet__item { height: auto; padding: 0 8px 0 6px; border: 0; border-radius: 0; background: none; font-size: 12.5px; line-height: 1; gap: 3px; }
    .topbar__inner > .nav-wallet .nav-wallet__item--b { border-left: 1px solid var(--line-2); }
    .topbar__inner > .nav-wallet .coin { width: 15px; height: 15px; }
    .topbar__inner > .nav-wallet:hover { border-color: var(--gold-3); }
    .topbar__inner > .bell { width: 34px; height: 34px; border-radius: 999px; }
    .topbar__inner > .bell svg { width: 18px; height: 18px; }
    .topbar__inner .nav > .user-drop { order: 6; display: block; position: relative; }
    .topbar__inner .nav > .lang-drop .lang-drop__current { height: 34px; }
}
@media (min-width: 1181px) and (max-width: 1499px) { /* undo the older stacked balances: the single pill fits */
    .topbar__inner > .nav-wallet .nav-wallet__tag { display: none; }
}
.user-drop > summary { list-style: none; cursor: pointer; }
.user-drop > summary::-webkit-details-marker { display: none; }
.user-drop__btn { display: flex; align-items: center; gap: 3px; height: 34px; padding: 0 6px 0 2px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--faint); }
.user-drop__btn .avatar { width: 28px; height: 28px; }
.user-drop__caret { font-size: 10px; }
.user-drop__btn:hover, .user-drop[open] .user-drop__btn, .user-drop__btn.is-active { border-color: var(--gold-3); color: var(--gold-2); }
.user-drop__menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 240px; display: grid; gap: 2px; padding: 8px; border-radius: 14px;
    border: 1px solid var(--line-2); background: var(--bg-2); box-shadow: var(--shadow); }
.user-drop__head { display: flex; align-items: center; gap: 10px; padding: 4px 6px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.user-drop__head > span { display: grid; min-width: 0; }
.user-drop__head b, .user-drop__head small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-drop__head small { color: var(--faint); font-size: 12px; }
.user-drop__item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: inherit; font-size: 14px; text-align: left; cursor: pointer; text-decoration: none; }
.user-drop__item:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.user-drop__item.is-active { color: var(--gold-2); }
.user-drop__langs { display: flex; align-items: center; gap: 4px; padding: 6px 10px; color: var(--muted); font-size: 14px; }
.user-drop__langs > span { margin-right: 4px; }
.user-drop__langs a { padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; text-decoration: none; }
.user-drop__langs a:hover { color: var(--text); border-color: var(--line-2); }
.user-drop__langs a.is-active { color: #0b0d14; background: var(--gold); border-color: var(--gold); }
.user-drop form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--line); }
.user-drop__out:hover { color: var(--danger); }
/* Admin → Shop: items per page and item views, two boxes side by side on wide screens */
.shop-admin-settings { display: grid; gap: 10px; justify-items: start; margin: 0 0 16px; }
.shop-admin-settings__grid { display: grid; gap: 14px; width: 100%; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.shop-admin-settings .shop-views-admin { margin: 0; display: grid; gap: 8px; align-content: start; }
.shop-pp { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.shop-pp .field { flex: 1 1 130px; max-width: 200px; margin: 0; display: grid; gap: 4px; }
.shop-pp .input { width: 100%; }
.shop-views-admin__checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
/* Groups inside a shop. Side menu (computers, landscape tablets): under the open shop, indented. Strip mode (phones):
   a second strip in the same style right under the shops, also staying under the top bar. */
.shop-subs { display: none; }
.shop-cats--sub .tab { font-size: 13px; }
.shop-layout > .shop-cats--sub { top: calc(var(--topbar-h, 64px) + var(--cats-h, 44px)); margin-top: -12px; }
@media (min-width: 1024px) {
    .shop-layout--side > .shop-cats--sub { display: none; }
    .shop-layout--side .shop-subs { display: grid; gap: 1px; margin: 2px 0 6px 12px; padding-left: 8px; border-left: 1px solid var(--line-2); }
    .shop-layout--side > .shop-cats .shop-subs .tab { padding: 6px 10px; font-size: 13px; color: var(--muted); }
    .shop-layout--side > .shop-cats .shop-subs .tab.is-active { background: none; box-shadow: none; color: var(--gold-2); font-weight: 600; }
    .shop-layout--side > .shop-cats .shop-subs .tab:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
}
@media (orientation: landscape) and (min-width: 640px) and (max-width: 1023px) {
    .shop-layout--side > .shop-cats--sub { display: none; }
    .shop-layout--side .shop-subs { display: grid; gap: 1px; margin: 2px 0 6px 10px; padding-left: 6px; border-left: 1px solid var(--line-2); }
    .shop-layout--side > .shop-cats .shop-subs .tab { padding: 6px 8px; font-size: 12.5px; color: var(--muted); }
    .shop-layout--side > .shop-cats .shop-subs .tab.is-active { background: none; box-shadow: none; color: var(--gold-2); font-weight: 600; }
}.shop-subs .tab { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.shop-subs .tab .tab__count { flex: none; }

/* Phones and tablets: the category / group strips (and other tab strips) scroll without the scrollbar line */
@media (max-width: 1023px) {
    .tabs { scrollbar-width: none; -ms-overflow-style: none; }
    .tabs::-webkit-scrollbar { display: none; }
}

/* Phones: page containers (cabinet, shop, settings, admin ...) with a small 5 px gap on every side; the home page
   blocks keep their own layout, the shop / inventory strips stay right under the top bar */
@media (max-width: 560px) {
    .main .container:not(.hero__inner):not(.home-block__inner) { padding: 5px; }
    .main .container.store:has(> .shop-layout) { padding-top: 0; }
}

/* Battle pass cells: the label never pushes the claim button out — two lines at most; item names on one line with «…»
   and the amount in full under them */
.pass__label { max-width: 100%; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.pass__label--item { display: grid; justify-items: center; -webkit-line-clamp: unset; }
.pass__name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pass__qty { font-weight: 700; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Item window: "where to" (site inventory / a character) on its own line above the pay + buy row, pinned with it */
.buy-form__bar--to { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.buy-form__to { grid-column: 1 / -1; display: flex; min-width: 0; }
.buy-form__to + .buy-form__btn { grid-column: 1 / -1; } /* free items: no currency, the button takes the row */
.buy-form__to .input { width: 100%; min-width: 0; }
/* Falling snow (layout.php, app.js): over everything, never in the way of clicks */
.snow { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 90; pointer-events: none; }
.snow[hidden] { display: none; }
.snow-toggle { position: fixed; left: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 79; width: 38px; height: 38px; display: grid; place-items: center;
    padding: 0; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(11, 13, 20, .85); color: #dff3ff; font-size: 18px; line-height: 1; cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .4); opacity: .75; transition: opacity .2s, color .2s; }
.snow-toggle:hover { opacity: 1; }
.snow-toggle.is-off { color: var(--faint); opacity: .5; }
body:has(.tabbar) .snow-toggle { bottom: calc(76px + env(safe-area-inset-bottom)); }
@media (min-width: 821px) { body:has(.tabbar) .snow-toggle { bottom: calc(18px + env(safe-area-inset-bottom)); } }
body:has(.page-dock) .snow-toggle { display: none; } /* shop / inventory pages: the page bar is at the bottom */.snow-admin__pair { display: flex; align-items: center; gap: 8px; }
.snow-admin__pair .input { width: 90px; }
.snow-admin__color { width: 64px; height: 40px; padding: 4px; }
/* Admin → Ефекти: preview box, shape choice, own pictures */
.fx-preview { position: relative; height: 200px; margin: 0 0 14px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line);
    background: radial-gradient(ellipse at 50% 120%, #1d2a44, #0b0d14 70%); }
.fx-preview__canvas { display: block; width: 100%; height: 100%; }
.fx-preview__label { position: absolute; left: 10px; top: 8px; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.fx-shapes { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; }
.fx-shapes legend { margin-bottom: 6px; }
.fx-shape { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.fx-shape:has(input:checked) { border-color: var(--gold); color: var(--gold-2); background: rgba(226, 181, 90, .08); }
.fx-images { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.fx-images__item { display: grid; justify-items: center; gap: 6px; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.fx-images__item img { width: 48px; height: 48px; object-fit: contain; }
.fx-upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fx-upload .input { max-width: 320px; }
/* News / guides shown as an automatic translation */
.article__tr { margin: -4px 0 14px; font-size: 13px; color: var(--muted); }
.article__tr:empty { display: none; }

/* Admin item form: game currency quick fill */
.gcur-fill { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.gcur-fill .chip { cursor: pointer; background: none; font: inherit; font-size: 12px; }

/* Admin menu: what waits for the staff (AdminAttention) */
.anav-count { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff;
    font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; letter-spacing: 0; text-transform: none; vertical-align: 1px; }
.admin-side__link { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* Inventory item: one form, «Відправити» with «Продати» as its right edge */
.item-act__btns { display: flex; align-items: stretch; }
.item-act__btns > .btn { margin: 0; }
.item-act__send { flex: 1 1 auto; min-width: 0; }
.item-act__send:has(+ .item-act__sell) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.item-act__sell { flex: none; padding-inline: 14px; border-top-left-radius: 0; border-bottom-left-radius: 0; border: 1px solid rgba(239, 107, 107, .55);
    border-left-color: rgba(0, 0, 0, .35); background: rgba(239, 107, 107, .12); color: #f3a0a0; font-weight: 700; }
.item-act__sell:hover { background: rgba(239, 107, 107, .22); color: #fff; }
/* Item window: pack size and discount on the icon; the bar: [where to | amount] over [pay with | buy] */
.product__icon { position: relative; }
.product__icon .item__pack { top: 4px; right: 4px; }
.product__sale { position: absolute; left: 4px; bottom: 4px; margin: 0; font-size: 12px; }
.buy-form__bar--rows { display: flex; flex-direction: column; gap: 8px; }
.buy-form__row { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.buy-form__row:empty { display: none; }
.buy-form__row > .buy-form__to { flex: 1 1 170px; min-width: 0; grid-column: auto; }
.buy-form__row > .buy-form__qty { flex: 1 1 240px; margin: 0; }
.buy-form__row > .buy-form__qty .input { min-width: 0; }
.buy-form__row > .buy-form__pay { flex: 1 1 auto; }
.buy-form__row > .buy-form__btn { flex: 0 0 auto; }
.buy-form__row > .buy-form__btn:only-child { flex: 1 1 auto; }.buy-form__row { flex-wrap: nowrap; }
.buy-form__row > .buy-form__to { flex: 1 1 auto; }
.buy-form__row > .buy-form__qty { flex: 0 1 auto; }
.buy-form__row > .buy-form__qty .input { width: 64px; text-align: center; }
.buy-form__row > .buy-form__qty:only-child { flex: 1 1 auto; }
.buy-form__row > .buy-form__qty:only-child .input { width: auto; flex: 1 1 auto; }
@media (max-width: 560px) { .buy-form__row > .buy-form__qty:not(:only-child) .stepper__btn--edge { display: none; } }

/* Steppers: − / + only (holding goes to min / max); no text selection or callout on a long press */
.stepper__btn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.stepper:not(:has(.stepper__btn--edge)) .input { flex: 1 1 auto; }

/* Shop / inventory: the «Підкатегорії» switch above the category menu */
.grp-switch { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 12px;
    font-weight: 600; text-decoration: none; white-space: nowrap; }
.grp-switch:hover { color: var(--text); }
.grp-switch__track { position: relative; width: 30px; height: 17px; flex: none; border-radius: 999px; background: rgba(255, 255, 255, .14); transition: background .15s; }
.grp-switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #cfd6e4; transition: transform .15s; }
.grp-switch.is-on .grp-switch__track { background: var(--gold); }
.grp-switch.is-on .grp-switch__track::after { transform: translateX(13px); background: #1a1206; }
@media (max-width: 1023px) { .shop-layout:not(.shop-layout--side) > .shop-cats > .grp-switch, .shop-cats > .grp-switch { align-self: center; } }/* phones (the strip): the switch stays at the left edge while the shops scroll under it */
.shop-layout:not(.shop-layout--side) > .shop-cats > .grp-switch, .shop-cats > .grp-switch:first-child { position: sticky; left: 0; z-index: 2; background: rgb(11, 13, 20); box-shadow: 8px 0 10px -6px rgb(11, 13, 20); }
@media (min-width: 1024px) { .shop-layout--side > .shop-cats > .grp-switch { position: static; box-shadow: none; background: none; margin: 0 0 4px; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; padding-bottom: 8px; width: 100%; } }
@media (orientation: landscape) and (min-width: 640px) and (max-width: 1023px) { .shop-layout--side > .shop-cats > .grp-switch { position: static; box-shadow: none; background: none; margin: 0 0 4px; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; padding-bottom: 8px; width: 100%; } }

/* Inventory: split by sub-categories / shops / not at all (above the menu; on phones pinned at the strip's left edge) */
.inv-split { display: inline-flex; flex: none; gap: 2px; padding: 3px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.inv-split__opt { padding: 5px 9px; border-radius: 7px; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.inv-split__opt:hover { color: var(--text); }
.inv-split__opt.is-active { color: #1a1206; background: var(--gold); }
.shop-cats > .inv-split:first-child { position: sticky; left: 0; z-index: 2; background: rgb(11, 13, 20); box-shadow: 8px 0 10px -6px rgb(11, 13, 20); align-self: center; }
@media (min-width: 1024px) { .shop-layout--side > .shop-cats > .inv-split { position: static; box-shadow: none; display: flex; margin: 0 0 6px; } .shop-layout--side > .shop-cats > .inv-split .inv-split__opt { flex: 1; text-align: center; } }
@media (orientation: landscape) and (min-width: 640px) and (max-width: 1023px) { .shop-layout--side > .shop-cats > .inv-split { position: static; box-shadow: none; display: flex; margin: 0 0 6px; } .shop-layout--side > .shop-cats > .inv-split .inv-split__opt { flex: 1; text-align: center; padding-inline: 4px; } }.inv-split__opt { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.inv-split__i { display: none; font-size: 14px; line-height: 1; }
/* the narrow side menu: smaller text so all three fit */
.shop-layout--side > .shop-cats > .inv-split .inv-split__opt { padding: 5px 3px; font-size: 11px; min-width: 0; }
/* phones (the strip): icons only, the names in the tooltips */
@media (max-width: 1023px) and (orientation: portrait), (max-width: 639px) {
    .shop-cats > .inv-split .inv-split__i { display: inline; }
    .shop-cats > .inv-split .inv-split__t { display: none; }
    .shop-cats > .inv-split .inv-split__opt { padding: 5px 8px; }
}
.shop-layout--side > .shop-cats > .inv-split .inv-split__opt { flex: 1 1 auto; }

/* Cabinet: server bonuses and the new player bonus; Admin → Бонуси серверів */
.sbon { display: grid; gap: 14px; }
.sbon__item { display: grid; gap: 8px; }
.sbon__item + .sbon__item { padding-top: 14px; border-top: 1px solid var(--line); }
.sbon__item p { margin: 0; }
.sbon__rewards { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sbon__reward { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); font-size: 13px; }
.sbon__icon { display: inline-grid; place-items: center; width: 22px; height: 22px; color: var(--gold-2); }
.sbon__icon .coin { width: 18px; height: 18px; margin: 0; }
.sbon form { margin: 0; }
.sbon-rewards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.sbon-rewards .bp-edit__reward { display: grid; gap: 6px; }
/* Admin → Бойовий пропуск / VIP: reward autofill settings */
.reward-fill { margin: 0 0 14px; padding: 12px 14px; }
.reward-fill > summary { cursor: pointer; }
.reward-fill[open] > summary { margin-bottom: 10px; }
.rf__grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.rf__grid .field { margin: 0; }
.rf__rars { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 10px 0 0; }
.rf__rars > .field__label { flex-basis: 100%; }
.rf__rar { font-size: 13px; }
.reward-fill .check { margin-top: 10px; }
.vip-preview__grid { max-height: 70vh; overflow-y: auto; }
/* Admin → Магазин → Предмети з гри */
.gimp-filter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
#gimp-form .bulk-bar { position: sticky; bottom: 8px; z-index: 5; margin-top: 10px; }

/* «Грати в браузері»: the game's web version (home page hero, cabinet) */
.btn--play { color: #06231f; background: linear-gradient(180deg, #8ff0e2, #4fc9b8); border: 1px solid rgba(111, 220, 207, .8); font-weight: 800;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .2), 0 6px 20px rgba(79, 201, 184, .35); }
.btn--play:hover { filter: brightness(1.07); color: #031512; }
.cabinet-play { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 18px 0 0; }
.cabinet-play .muted { font-size: 13px; }
/* Admin item page: copy into another shop */
.shop-copy { margin-top: 14px; align-items: end; flex-wrap: wrap; }
.shop-copy .field__hint { flex-basis: 100%; margin: 0; }

/* Admin → Сайт → Посилання у футері */
.flinks-table td:last-child { width: 100%; min-width: 110px; }
.flinks-table th, .flinks-table td { padding-left: 6px; padding-right: 6px; }
.flinks-table td:last-child .input { width: 100%; min-width: 0; }