/* Onest, вариативный, сабсеты как у Google Fonts. */
@font-face {
    font-family: "Onest";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/fonts/onest-cyrillic-ext.woff2") format("woff2");
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
    font-family: "Onest";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/fonts/onest-cyrillic.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: "Onest";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/fonts/onest-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Onest";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/fonts/onest-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bg: #f2f5fa;
    --surface: #fff;
    --text: #131822;
    --muted: #5d6879;
    --faint: #8d97a6;
    --line: #d5dde8;
    --line-soft: #e7edf5;

    --accent: #02baf2;
    --accent-dark: #0089b5;
    --accent-deep: #00769a;
    --accent-soft: rgba(2, 186, 242, .12);
    --on-accent: #fff;
    --on-accent-muted: rgba(255, 255, 255, .72);
    --glow: rgba(2, 186, 242, .08);

    --warm: rgba(158, 66, 88, .1);
    --warm-ink: #9e4258;
    --warm-deep: #7a3244;
    --warm-strong: #9e4258;
    --warm-strong-hover: #8a374a;

    --danger: #d63a3a;

    --scheme: light;
    --field-bg: rgba(19, 24, 34, .02);
    --hover: rgba(19, 24, 34, .04);
    --nav-bg: rgba(255, 255, 255, .9);
    --overlay: rgba(255, 255, 255, .86);
    --lightbox-bg: rgba(6, 10, 16, .92);
    --lightbox-btn: rgba(23, 29, 43, .8);
    --lightbox-ink: #e6ecf5;
    --on-warm: #fdf2f4;
    --on-warm-strong: #fff;
    --rare: #28948c;
    --epic: #7652ad;
    --mark-google-bg: #131822;
    --mark-google-ink: #f2f5fa;
    --dot-sapphire: #02baf2;
    --dot-gold: #9a7430;

    --radius: 10px;
    --radius-md: 6px;
    --radius-sm: 4px;

    /* Кнопки тиснёные: тень уходит, кнопка проваливается. */
    --btn-emboss: 0 3px var(--accent-deep);
    --btn-emboss-warm: 0 3px var(--warm-deep);
    --btn-emboss-plain: 0 3px var(--line);
    --btn-drop: 3px;
    --btn-size: 12px;
    --btn-tracking: .1em;

    --shadow-sm: 0 1px 0 rgba(19, 24, 34, .05);
    --shadow-md: 0 12px 32px rgba(19, 24, 34, .12);

    --font-heading: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Акцент — отдельная ось. */

:root[data-accent="gold"] {
    --accent: #9a7430;
    --accent-dark: #7f5f26;
    --accent-deep: #5f461a;
    --accent-soft: rgba(154, 116, 48, .12);
    --on-accent: #fffdf8;
    --on-accent-muted: rgba(255, 253, 248, .72);
    --glow: rgba(154, 116, 48, .07);
}

* { box-sizing: border-box; }

/* Фон и на html: иначе под коротким body градиент body повторяется полосой. */
html { background: var(--bg); }

body {
    margin: 0;
    background: var(--bg);
    /* Свет свечи сверху, чтобы чёрный не был плоским. */
    background-image: radial-gradient(1100px 520px at 50% -8%, var(--glow), transparent 60%);
    color: var(--text);
    font: 14px/1.65 var(--font-body);
    text-wrap: pretty;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.02em;
    margin: 0;
}

a { color: var(--accent-dark); text-underline-offset: 3px; }
a:hover { color: var(--accent-deep); }

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

input::placeholder, textarea::placeholder { color: var(--faint); }
:focus { outline: none; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

/* Counters and ranks sit in columns, so their digits must not jitter. */
.num { font-feature-settings: 'tnum' 1; }

/* — layout — */

.page {
    max-width: 560px;
    margin: 0 auto;
    padding: 28px 16px 48px;
}

.page--app { padding-bottom: 24px; }
.page--quiz { max-width: 560px; padding-top: 32px; }
.page--wide { max-width: 1280px; padding: 0 clamp(16px, 4vw, 48px) 56px; }

@media (min-width: 920px) {
    body { font-size: 15px; }

    .shell {
        display: grid;
        grid-template-columns: 232px minmax(0, 1fr);
        max-width: 1400px;
        min-height: 100vh;
        margin: 0 auto;
    }

    .page--app {
        max-width: none;
        margin: 0;
        padding: 40px clamp(28px, 4vw, 56px) 72px;
    }

    .page--quiz { max-width: 640px; }

    .card { padding: 32px 34px; }
}

/* Two content columns on wide screens, single flow below. */
@media (min-width: 1180px) {
    .cols {
        display: grid;
        grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
        gap: 0 48px;
        align-items: start;
    }
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.page-title { font-size: 28px; }
.page-sub { color: var(--muted); font-size: 13px; margin: 6px 0 0; }

.section-title {
    font-size: 20px;
    margin: 30px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line-soft);
}

.stack { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.stack--wide { gap: 10px; }

.hint { color: var(--faint); font-size: 12px; margin: 10px 0 0; }
.blank { color: var(--faint); }
.gap-top { margin-top: 22px; }

/* — buttons — */

.btn {
    position: relative;
    top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text);
    font: 600 var(--btn-size)/1.2 var(--font-body);
    letter-spacing: var(--btn-tracking);
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: var(--btn-emboss-plain);
    transition: border-color .15s, background-color .15s, color .15s, box-shadow .1s, top .1s;
}

.btn:hover { border-color: var(--accent); color: var(--accent-deep); background: none; }
.btn:active { box-shadow: none; top: var(--btn-drop); }

.btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    box-shadow: var(--btn-emboss);
}

.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--on-accent); }

.btn--ghost {
    background: none;
    border-color: var(--accent);
    color: var(--accent-dark);
    box-shadow: none;
}

.btn--ghost:hover { background: var(--accent-soft); color: var(--accent-deep); }

.btn--quiet {
    background: none;
    border-color: transparent;
    color: var(--muted);
    box-shadow: none;
}

.btn--quiet:hover { border-color: var(--line); color: var(--text); background: none; }

.btn--warm {
    background: var(--warm-strong);
    border-color: var(--warm-strong);
    color: var(--on-warm);
    box-shadow: var(--btn-emboss-warm);
}

.btn--warm:hover { background: var(--warm-strong-hover); border-color: var(--warm-strong-hover); color: var(--on-warm-strong); }

.btn--dashed {
    border-style: dashed;
    border-color: var(--line);
    background: none;
    color: var(--muted);
    font-weight: 500;
    letter-spacing: .1em;
    box-shadow: none;
}

.btn--bad {
    border-color: var(--danger);
    background: none;
    color: var(--danger);
    box-shadow: none;
}

.btn--bad:hover { background: var(--danger); border-color: var(--danger); color: var(--on-accent); }

.btn--small { padding: 9px 16px; font-size: 10px; }
.btn--block { display: flex; width: 100%; }
.btn:disabled { opacity: .4; cursor: default; }
.btn:disabled:hover { border-color: var(--line); color: var(--text); background: none; }
.btn--primary:disabled:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.btn--link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
}

.btn--ghost:active, .btn--quiet:active, .btn--dashed:active, .btn--link:active { top: 0; }

.btn--link:hover { background: none; color: var(--accent-deep); }
.btn--link-bad, .btn--link-bad:hover { color: var(--danger); }

.btn--back {
    display: inline-block;
    padding: 0;
    border: 0;
    background: none;
    color: var(--faint);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .06em;
    text-decoration: none;
    cursor: pointer;
}

.btn--back:hover { background: none; color: var(--muted); }
.btn--back + .page-title { margin-top: 12px; }

/* — cards and rows — */

.card {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 28px 26px;
}

.card--tight { padding: 16px 20px; }
.card--center { text-align: center; }
.card--center .avatar { margin: 0 auto; }
.card--center h1 { margin-top: 14px; }
.card--center .hp { justify-content: center; }
.card--center .hp .meter { max-width: 220px; }

.card .page-head h2 { font-size: 17px; }
.card .page-head + .meter { margin-top: 12px; }
.card .meter + .btn--link { display: inline-block; margin-top: 12px; }

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 13px 16px;
}

.row--link { cursor: pointer; text-decoration: none; color: inherit; }
.row--link:hover { border-color: var(--accent); color: inherit; }
.row--mine { border-color: var(--accent); background: var(--accent-soft); }

.row__body { display: block; min-width: 0; }
.row__name { display: block; font-weight: 600; font-size: 14px; }
.row__meta { display: block; color: var(--faint); font-size: 12px; }
.row__actions { display: flex; align-items: center; gap: 6px; }

a.row__name { text-decoration: none; color: inherit; }
a.row__name:hover { color: var(--accent-dark); }

.person { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
a.person { text-decoration: none; color: inherit; }

.avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-family: var(--font-heading);
    font-size: 17px;
}

img.avatar { object-fit: cover; }

.avatar--sm { width: 28px; height: 28px; font-size: 13px; }
.avatar--md { width: 48px; height: 48px; font-size: 21px; }
.avatar--lg { width: 84px; height: 84px; font-size: 34px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    background: none;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .05em;
}

.chip--gold { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }

.badge {
    display: inline-grid;
    place-items: center;
    min-width: 19px;
    height: 19px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--warm-strong);
    color: var(--on-warm);
    font-size: 10px;
    font-weight: 700;
}

.note {
    background: var(--accent-soft);
    border-left: 2px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--accent-deep);
    padding: 12px 16px;
    margin: 16px 0 0;
    font-size: 13px;
}

.note--warm { background: var(--warm); border-left-color: var(--warm-strong); color: var(--warm-deep); }
.note--bad { background: none; border-left: 0; color: var(--danger); padding: 0; margin: 0 0 12px; }

.meter {
    height: 3px;
    border-radius: 999px;
    background: var(--line-soft);
    overflow: hidden;
}

.meter span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.meter--hp span { background: var(--warm-strong-hover); }

/* — forms — */

.card form { margin-top: 22px; }
.row__actions form { margin-top: 0; }
.field { margin-bottom: 18px; }

.field > label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.field .error { display: block; margin-top: 6px; color: var(--danger); font-size: 13px; }
.field--bad input, .field--bad select, .field--bad textarea { border-color: var(--danger); }

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--field-bg);
    color: inherit;
    font: 14px/1.4 var(--font-body);
    transition: border-color .15s;
    color-scheme: var(--scheme);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus { border-color: var(--accent); }

textarea { border-radius: var(--radius-sm); resize: vertical; }

input[type="file"] {
    width: 100%;
    padding: 20px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--muted);
    font: 13px/1.4 var(--font-body);
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 16px;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--accent-dark);
    font: 600 11px/1.2 var(--font-body);
    letter-spacing: .1em;
    text-transform: uppercase;
    cursor: pointer;
}

.with-unit, .range { display: flex; align-items: center; gap: 8px; }
.with-unit .unit { color: var(--faint); font-size: 13px; }

/* Дата рождения тремя списками: календарь на телефоне листается годами. */
.date-parts { display: flex; gap: 8px; }
.date-parts select { flex: 4 1 0; min-width: 0; }
.date-parts select:first-child { flex: 2 1 0; }
.date-parts select:last-child { flex: 3 1 0; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }

.choice {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: none;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s;
}

.choice input { accent-color: var(--accent); }
.choice:hover { border-color: var(--accent); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.choice--none { color: var(--faint); }

.locked { margin: 0; font-size: 15px; }
.locked span { display: block; color: var(--faint); font-size: 12px; font-weight: 400; }

/* — tom-select под поля формы — */

.ts-wrapper { width: 100%; }

.ts-wrapper.single .ts-control,
.ts-wrapper.single.input-active .ts-control {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--field-bg);
    background-image: none;
    color: inherit;
    font: 14px/1.4 var(--font-body);
    box-shadow: none;
    transition: border-color .15s;
}

.ts-wrapper.focus .ts-control,
.ts-wrapper.dropdown-active .ts-control { border-color: var(--accent); box-shadow: none; }
.ts-wrapper.dropdown-active .ts-control { border-radius: var(--radius-sm); }
.field--bad .ts-control { border-color: var(--danger); }

.ts-control input, .ts-control input::placeholder { color: inherit; }
.ts-wrapper .ts-control > input::placeholder { color: var(--faint); }
.ts-wrapper.single .ts-control { cursor: pointer; }
.ts-wrapper.single .ts-control .item { background: none; color: inherit; }
/* Строка поиска стоит рядом со значением, а не под ним: иначе поле раздваивается по высоте. */
.ts-wrapper.single .ts-control { flex-wrap: nowrap; }
.ts-wrapper.single .ts-control > input { min-width: 0; }
.ts-wrapper.single.ts-searching .ts-control .item { display: none; }

.ts-dropdown {
    margin-top: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: inherit;
    box-shadow: var(--shadow-md);
    font-size: 14px;
}

.ts-dropdown .option { padding: 10px 14px; }
.ts-dropdown .active { background: var(--accent-soft); color: var(--accent-deep); }
.ts-dropdown .selected { font-weight: 600; }
.ts-dropdown .no-results { padding: 10px 14px; color: var(--faint); }

.ts-dropdown .optgroup-header {
    padding: 8px 14px 4px;
    background: none;
    color: var(--faint);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.ts-dropdown .highlight { background: var(--accent-soft); border-radius: var(--radius-sm); }

/* — nav: bottom bar on mobile, sidebar on desktop — */

.nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
}

.nav__brand { display: none; }

.nav__items {
    display: flex;
    justify-content: space-around;
    max-width: 560px;
    margin: 0 auto;
    padding: 8px 6px calc(10px + env(safe-area-inset-bottom));
}

.nav__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 52px;
    padding: 6px 8px;
    color: var(--faint);
    text-decoration: none;
}

.nav__item:hover { color: var(--muted); }
.nav__item--on, .nav__item--on:hover { color: var(--accent-dark); }

.nav__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav__item--on .nav__icon { color: var(--accent); }

/* Полоска по верхнему краю панели; -8px — padding-top .nav__items. */
.nav__item--on::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--accent);
}

.nav__label { font-size: 9px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
/* Семь вкладок в ряд — на узких экранах им нужно меньше воздуха. */
@media (max-width: 400px) {
    .nav__item { min-width: 46px; padding: 6px 4px; }
}

.nav__badge { position: absolute; top: 0; right: 4px; min-width: 16px; height: 16px; font-size: 9px; }

@media (min-width: 920px) {
    .nav {
        position: sticky;
        top: 0;
        height: 100dvh;
        display: flex;
        flex-direction: column;
        gap: 36px;
        padding: 32px 18px;
        overflow: hidden;
        background: linear-gradient(165deg, color-mix(in srgb, var(--accent) 10%, var(--surface)) 0%, var(--bg) 70%);
        backdrop-filter: none;
        border-top: 0;
        border-right: 1px solid var(--line-soft);
    }

    /* Пузыри-декор в тему бренда. */
    .nav::before, .nav::after {
        content: "";
        position: absolute;
        border-radius: 50%;
        background: color-mix(in srgb, var(--accent) 7%, transparent);
        pointer-events: none;
    }

    .nav::before { top: -30px; right: -40px; width: 150px; height: 150px; }
    .nav::after { bottom: 60px; right: -10px; width: 60px; height: 60px; }

    .nav__brand {
        display: flex;
        align-items: center;
        gap: 11px;
        padding: 0 12px;
        color: var(--accent);
        text-decoration: none;
        position: relative;
        z-index: 1;
    }

    .nav__brand .brand-word { height: 22px; }

    .nav__brand:hover { color: var(--accent-deep); }

    .nav__items {
        flex-direction: column;
        justify-content: flex-start;
        gap: 4px;
        max-width: none;
        margin: 0;
        padding: 0;
        position: relative;
        z-index: 1;
    }

    .nav__item {
        flex-direction: row;
        gap: 13px;
        min-width: 0;
        padding: 11px 13px;
        border-radius: 12px;
    }

    .nav__item:hover { background: var(--hover); }

    .nav__item--on, .nav__item--on:hover {
        background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 75%, #fff));
        color: var(--on-accent);
        box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 38%, transparent);
    }

    .nav__item--on .nav__icon { color: inherit; }
    .nav__item--on::before { display: none; }

    .nav__label { font-size: 11px; letter-spacing: .18em; }
    .nav__badge { position: static; margin-left: auto; }
}

.brand-mark { flex-shrink: 0; color: var(--accent); }

/* — landing — */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1280px;
    margin: 0 auto;
    padding: 26px clamp(16px, 4vw, 48px);
    border-bottom: 1px solid var(--line-soft);
}

.topbar__brand { display: flex; align-items: center; gap: 12px; color: var(--accent); }
.topbar__brand .brand-word { height: 26px; }
a.topbar__brand { color: var(--accent); text-decoration: none; }
a.topbar__brand:hover { color: var(--accent-dark); }

.hero-copy { padding: clamp(32px, 6vw, 72px) 0 20px; text-align: center; }

.eyebrow {
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .32em;
    text-transform: uppercase;
}

.hero-copy h1 { font-size: clamp(38px, 6vw, 72px); line-height: 1.1; margin: 16px 0 0; }
.hero-copy p { max-width: 52ch; margin: 20px auto 0; color: var(--muted); font-size: 15px; line-height: 1.7; }

.slogan { transition: opacity .3s; }
.slogan--fade { opacity: 0; }

.collage { margin-bottom: 16px; }

.collage__title {
    font-size: 26px;
    margin: 44px 0 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line-soft);
    text-align: center;
}

.collage__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tile {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: border-color .2s, box-shadow .2s;
}

.tile:hover { border-color: var(--accent); box-shadow: var(--shadow-md); color: inherit; }

.tile__photo {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--line-soft);
    transition: transform .4s;
}

.tile:hover .tile__photo { transform: scale(1.03); }

.tile__rank {
    position: absolute;
    top: 0;
    left: 0;
    padding: 4px 11px;
    background: var(--overlay);
    border-right: 1px solid var(--accent);
    border-bottom: 1px solid var(--accent);
    border-radius: 0 0 var(--radius-sm) 0;
    color: var(--accent-dark);
    font-family: var(--font-heading);
    font-size: 14px;
}

.tile__caption { display: block; padding: 9px 12px 10px; background: var(--surface); position: relative; }
.tile__name { display: block; font-family: var(--font-heading); font-size: 15px; font-weight: 500; }

.tile__foot {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
    color: var(--faint);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tile__likes { color: var(--accent-dark); font-weight: 600; letter-spacing: normal; text-transform: none; }

.ladder-teaser {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 52px;
    padding: 26px 30px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.ladder-teaser h2 { font-size: 22px; color: var(--accent-deep); }

.ladder-teaser__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.ladder-teaser__list li {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 5px 12px;
    font-size: 12px;
    color: var(--muted);
}

.ladder-teaser__list b { color: var(--accent-dark); font-weight: 600; }

.landing__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 40px;
    padding: 28px 0 0;
    border-top: 1px solid var(--line-soft);
}

.landing__stamp { color: var(--faint); font-size: 12px; margin: 0; letter-spacing: .04em; }

/* — sign-in — */

.auth {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}

.auth__card {
    width: min(400px, 92vw);
    padding: 44px 36px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.auth__mark {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    margin: 0 auto;
    border: 1px solid var(--accent);
    border-radius: 50%;
    background: var(--accent-soft);
}

.auth__card h1 { font-size: 28px; margin-top: 20px; }
.auth__card p { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.auth__card .slogan { color: var(--accent-dark); font-family: var(--font-heading); font-size: 16px; }
.auth__ways { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }

.mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: normal;
}

.mark--yandex { background: #fc3f1d; color: #fff; }
.mark--google { background: var(--mark-google-bg); color: var(--mark-google-ink); }
.mark--telegram { background: #29a1da; color: #fff; }

/* — quiz — */

.quiz-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--faint);
    letter-spacing: .06em;
}

.quiz-head h2 { font-size: 22px; color: var(--text); letter-spacing: .01em; }

.steps { display: flex; gap: 6px; margin: 16px 0 26px; }
.steps span { flex: 1; height: 2px; background: var(--line); }
.steps span.on { background: var(--accent); }

.quiz-nav { display: flex; gap: 10px; margin-top: 20px; }
.quiz-nav .btn--primary { flex: 1; }
.later { margin-top: 16px; text-align: center; }

.shots {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.shots li { text-align: center; }

.shots img {
    display: block;
    width: 96px;
    height: 128px;
    margin-bottom: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.preview img { width: 72px; height: 96px; border: 1px solid var(--line); border-radius: var(--radius-sm); object-fit: cover; }

.block {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 16px 20px;
}

.block h2 { font-family: var(--font-body); font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.block .btn--link { white-space: nowrap; }

.summary { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 5px 16px; margin: 8px 0 0; }
.summary dt { color: var(--faint); font-size: 12px; }
.summary dd { margin: 0; font-size: 13px; color: var(--muted); }

/* — hero — */

.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero-top h1 { font-size: 24px; }
.hero-class { color: var(--accent-dark); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; margin-top: 2px; }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 10px;
    margin: 22px 0 12px;
    padding: 0;
    list-style: none;
}

.stats li {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 16px 8px 13px;
    text-align: center;
}

.stats b { display: block; font-family: var(--font-heading); font-size: 26px; font-weight: 500; color: var(--accent-dark); }
.stats span { display: block; margin-top: 4px; color: var(--faint); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }

.xp { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.xp + .meter { margin-top: 10px; }

.paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }

.paths__card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 16px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
}

.paths__card--on { border-color: var(--accent); background: var(--accent-soft); }
.paths__head { font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.paths__card form { display: flex; justify-content: center; }
.paths__card .btn { align-self: center; margin-top: 8px; }
.paths-switch summary { color: var(--faint); font-size: 12px; cursor: pointer; margin-bottom: 10px; letter-spacing: .04em; }

.chest {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 26px;
    padding: 22px 24px;
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
}

.chest h2 { font-size: 20px; color: var(--accent-deep); }
.chest p { margin: 5px 0 0; color: var(--accent-dark); font-size: 13px; }
.chest .hint { color: var(--muted); }

.inventory { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }

.inventory__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.inventory__name { display: block; font-size: 14px; font-weight: 600; }
.inventory__meta { display: block; color: var(--faint); font-size: 12px; }
.inventory__item .rarity { margin-top: 8px; }

.rarity {
    display: inline-block;
    border: 1px solid currentColor;
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    white-space: nowrap;
}

.rarity--common { color: var(--faint); }
.rarity--rare { color: var(--rare); }
.rarity--epic { color: var(--epic); }
.rarity--legendary { color: var(--accent-dark); }

.feed__fresh {
    background: var(--warm-strong);
    color: var(--on-warm);
    border-radius: var(--radius-sm);
    padding: 1px 7px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.feed__guard { display: block; color: var(--accent-dark); font-size: 13px; }

/* — arena and another hero — */

.hp { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; }
.hp .meter { flex: 1; }
.hp__value { font-size: 12px; white-space: nowrap; letter-spacing: .04em; }

.hero-view__stats { display: flex; justify-content: center; gap: 20px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.hero-view__stats b { color: var(--text); }
.hero-view__actions { justify-content: center; margin-top: 20px; }

.hero-view__where { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.hero-view__status { margin: 14px 0 0; color: var(--accent-deep); font-family: var(--font-heading); font-size: 17px; }
.hero-view__seeking { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.hero-view__note { margin: 12px 0 0; color: var(--muted); }
.hero-view__note + .hero-view__note { margin-top: 8px; }

.gallery__main {
    width: 100%;
    max-width: 300px;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--bg);
    cursor: zoom-in;
}

.gallery__thumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }

.gallery__thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    opacity: .55;
    cursor: pointer;
}

.gallery__thumb:hover { opacity: .8; }
.gallery__thumb--on, .gallery__thumb--on:hover { opacity: 1; outline: 1px solid var(--accent); outline-offset: 2px; }

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--lightbox-bg);
    cursor: zoom-out;
}

.lightbox[hidden] { display: none; }
.lightbox__photo { max-width: 100%; max-height: 100%; object-fit: contain; cursor: default; }

/* Over the photo, not beside it: on a phone there is no room next to it. */
.lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--lightbox-btn);
    color: var(--lightbox-ink);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }

.lightbox__nav:hover { border-color: var(--accent); color: var(--accent-dark); }

body.no-scroll { overflow: hidden; }

.gift-form { display: flex; gap: 8px; align-items: center; max-width: 420px; }
.gift-form select { flex: 1; }

/* — ladder — */

.ladder { display: flex; flex-direction: column; gap: 6px; margin: 18px 0 0; padding: 0; list-style: none; }

.ladder__row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 12px 16px;
}

.ladder__row--me { background: var(--accent-soft); border-color: var(--accent); }
.ladder__rank { width: 28px; font-family: var(--font-heading); font-size: 18px; color: var(--accent-dark); }
.ladder__name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; text-decoration: none; color: inherit; }
.ladder__name:hover { color: var(--accent-dark); }
.ladder__class { color: var(--faint); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.ladder__xp { color: var(--muted); font-size: 12px; }

/* — shop — */

.goods { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }

.goods__card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 16px;
}

.goods__head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.goods__name { font-size: 14px; font-weight: 600; }
.goods__meta { color: var(--faint); font-size: 12px; margin-top: 3px; }
/* Cards in a row differ in height; the buttons still line up at the bottom. */
.goods__deals { display: flex; flex-direction: column; gap: 6px; margin-top: auto; padding-top: 12px; }
.goods__deals .btn { width: 100%; }

/* — mail — */

.thread { display: flex; flex-direction: column; gap: 8px; max-width: 760px; margin: 16px 0 0; padding: 0; list-style: none; }

.thread li {
    align-self: flex-start;
    max-width: 80%;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 11px 15px;
    font-size: 14px;
}

.thread li.mine { align-self: flex-end; background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.thread li.fresh { border-color: var(--warm-strong-hover); }
.thread .row__meta { display: block; margin-top: 3px; }
.thread li.mine .row__meta { color: var(--on-accent-muted); }

.mail-form { display: flex; gap: 8px; align-items: flex-end; max-width: 760px; margin-top: 16px; }
.mail-form textarea { flex: 1; }

/* — account — */

.cards { display: flex; flex-direction: column; gap: 10px; }

@media (min-width: 1180px) {
    .cards { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
    .cards > form, .cards > .btn { grid-column: 1 / -1; justify-self: start; }
    .cards .btn--block { width: auto; }
}

.keys { margin: 12px 0 0; padding: 0; list-style: none; }

.keys li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid var(--line-soft);
    font-size: 14px;
}

.keys li:first-child { border-top: 0; }
.keys li form:not([hidden]) { display: flex; }

.keys .provider { display: flex; align-items: center; gap: 9px; }

.accents { display: flex; gap: 8px; margin-top: 12px; }

.accents .choice { gap: 9px; font-family: var(--font-body); color: var(--text); }
.accents .choice--on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }

.accent-dot { width: 13px; height: 13px; border-radius: 50%; }
.accent-dot--gold { background: var(--dot-gold); }
.accent-dot--sapphire { background: var(--dot-sapphire); }

/* — рейд — */

.raid-skill { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.raid-skill .meter { flex: 1; min-width: 120px; }
.raid-skill__value { font-size: 13px; color: var(--muted); }
.raid-skill__note { font-size: 12px; color: var(--faint); }

.raid-form { margin-top: 22px; }
.raid-form .field { margin-bottom: 0; }

.raid-form__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

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

.raid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.raid-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 18px 16px;
}

.raid-card__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.raid-card__head:hover { color: var(--accent-deep); }
.raid-card__head .avatar { margin-bottom: 8px; }

.raid-card__photo {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    margin-bottom: 8px;
    object-fit: cover;
    border-radius: var(--radius-md);
    background: var(--line-soft);
}
.raid-card__name { font-family: var(--font-heading); font-size: 18px; }
.raid-card__meta { color: var(--faint); font-size: 12px; margin: 0; }

.raid-card__status {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-style: italic;
    text-align: center;
}

.raid-card__hint { margin: 4px 0 0; color: var(--warm-ink); font-size: 12px; text-align: center; }

.raid-card__acts { display: flex; gap: 8px; margin-top: auto; padding-top: 12px; }
.raid-card__acts .btn { flex: 1; padding-left: 8px; padding-right: 8px; }

/* The raid a visitor plays on the landing. */
.ftue { margin: 28px 0 8px; }

.ftue__intro { max-width: 60ch; margin-bottom: 20px; }
.ftue__intro p { color: var(--muted); }

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

.ftue__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 22px 18px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    text-align: center;
    transition: border-color .15s ease, transform .15s ease;
}

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

.ftue__shot { position: relative; width: 100%; margin-bottom: 10px; }

/* Затемнение под кнопками: на светлом снимке подписи иначе не читаются. */
.ftue__shot::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 46%;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    background: linear-gradient(to top, rgba(6, 10, 16, .8), rgba(6, 10, 16, 0));
    pointer-events: none;
}

.ftue__photo {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--radius-md);
    background: var(--line-soft);
}

.ftue__name { font-size: 20px; margin: 0; }
.ftue__meta { margin: 0; color: var(--faint); font-size: 13px; }
.ftue__status { margin: 6px 0 0; color: var(--muted); font-size: 14px; font-style: italic; }

.ftue__acts {
    position: absolute;
    z-index: 1;
    inset: auto 10px 12px;
    display: flex;
    gap: 8px;
}

.ftue__act {
    position: relative;
    top: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font: 600 11px/1.1 var(--font-body);
    letter-spacing: var(--btn-tracking);
    text-transform: uppercase;
    cursor: pointer;
    animation: ftue-act-float 2.8s ease-in-out infinite alternate;
    transition: background-color .15s, box-shadow .1s, top .1s;
}

.ftue__act-icon { font-size: 24px; line-height: 1; }

.ftue__act--shield {
    background: var(--warm-strong);
    border-color: var(--warm-strong);
    color: var(--on-warm);
    box-shadow: var(--btn-emboss-warm);
}

.ftue__act--shield:hover { background: var(--warm-strong-hover); border-color: var(--warm-strong-hover); }

.ftue__act--strike {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    box-shadow: var(--btn-emboss);
    animation-delay: -1.4s;
}

.ftue__act--strike:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.ftue__act:hover, .ftue__act:focus-visible { animation-play-state: paused; }
.ftue__act:active { box-shadow: none; top: var(--btn-drop); }

@keyframes ftue-act-float {
    from { transform: translateY(-3px); }
    to { transform: translateY(3px); }
}

@media (prefers-reduced-motion: reduce) {
    .ftue__act { animation: none; }
}

.ftue__gate {
    display: block;
    padding: 26px 24px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
}

.ftue__gate p { color: var(--muted); max-width: 46ch; }

@media (max-width: 720px) {
    .ftue__hand { grid-template-columns: minmax(0, 1fr); gap: 10px; }

    .ftue__card { padding: 14px; }

    .ftue__name { font-size: 17px; }

    .ftue__acts { inset: auto 12px 14px; gap: 10px; }
    .ftue__act { padding: 12px 6px; font-size: 12px; }
    .ftue__act-icon { font-size: 28px; }
}

/* — site footer — */

.site-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 10px;
    padding: 20px 16px 32px;
    font-size: 13px;
}

.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--text); }
.site-foot__dot { color: var(--faint); }
.site-foot__copy { color: var(--faint); }

/* Room for the bottom nav. */
body:has(.nav) .site-foot { padding-bottom: 100px; }

@media (min-width: 920px) {
    body:has(.nav) .site-foot { padding-bottom: 32px; }
}
