/**
 * BEM blocks.
 *
 * Every block reads semantic tokens only; none of them names a colour outright,
 * which is what lets the light theme drop in without touching this file.
 */

/* ============ Layout shell ============ */
/*
 * Tied to the body on purpose. `post_class()` writes the post type as a class,
 * so every teaser of a page carried `page` too - and took the shell's column
 * and its `min-height: 100vh` with it: one hit on the search page came out as
 * a card the height of the screen. The same trap as the block names that
 * collide with `body_class()`, from the other end.
 */
body.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page__content {
    flex: 1 0 auto;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.container--narrow {
    max-width: var(--container-narrow);
}

.section {
    padding-block: var(--space-l);
}

.layout {
    display: grid;
    /*
     * minmax(0, …), not a bare 1fr: a 1fr track never goes narrower than its
     * widest unbreakable content, and on a phone the sidebar stacks into this
     * column - a long build name in "Популярные билды" (one line, ellipsis)
     * widened the whole page past the screen, the article with it.
     */
    grid-template-columns: minmax(0, 1fr);
    /* Columns need room to read as separate; rows do not, and the full gap
       left the section heading stranded between two stretches of empty space. */
    column-gap: var(--space-l);
    row-gap: var(--space-s);
}

/*
 * Three cells, not two columns with the heading buried in one of them: the
 * heading belongs to the first column alone, while the two panels underneath
 * have to start on the same line. Nesting the heading inside the first column
 * pushed that column's panel down by the heading's height and left the sidebar
 * riding up beside the heading instead.
 */
@media (min-width: 62rem) {
    .layout--with-aside {
        grid-template-columns: minmax(0, 1fr) 21rem;
        grid-template-areas:
            'head .'
            'main aside';
        align-items: start;
    }

    /* A single entry has no section heading above it, and the empty `head`
       row would still hold the row gap open over both columns. */
    .layout--no-head {
        grid-template-areas: 'main aside';
    }

    .layout__head { grid-area: head; }
    .layout__main { grid-area: main; }
    .layout__aside { grid-area: aside; }
}

/*
 * The track is capped at minmax(0, …), but a grid item keeps `min-width: auto`
 * and grows past its own track whenever its content has a wider minimum - an
 * unbroken link in a forum excerpt was enough to push the profile's column,
 * and the page with it, off the right of a phone. The track's cap only helps
 * once the cell is allowed to be narrower than its content.
 */
.layout > * {
    min-width: 0;
}

/* As a grid cell the heading is spaced by the row gap, so its own margin would
   only double the distance. Outside the media query too: the stacked layout
   gets the same gap. */
.layout__head {
    margin-bottom: 0;
}

/* ============ Ornament ============ */
/*
 * The colour of the engraving is set where the engraving is drawn, not on the
 * block. It used to live on `.ornament` itself, and since the meander and the
 * rule paint with `currentColor`, every panel on the site handed that dim ash
 * down to its own text: anything inside that did not name a colour of its own
 * came out at 1.9:1 against the page - the numbers of a stats table, the steps
 * of a quest journal. Every element that looked right was one that happened to
 * set `color`, which made the default a trap for the next one written.
 */

.ornament--corners {
    position: relative;
}

/*
 * The meander is drawn square: a rounded box cuts across its corner ring and
 * the rules meet the curve at an angle. The class is doubled so this outranks
 * whatever radius the host block sets — a card carries --radius-l — without
 * the ornament having to name the blocks it is used on.
 */
.ornament--corners.ornament--corners {
    border-radius: 0;
}

/*
 * Four corner meanders drawn as mask layers on a single pseudo-element.
 * Each corner has its own mirrored SVG, because a mask layer cannot be rotated
 * on its own — reusing one file and flipping it in CSS is what pushed the
 * brackets off their corners. The inset keeps them inside the rounded border
 * instead of straddling it.
 *
 * No opacity here on purpose: the rules fade out inside the mask itself, the
 * way the engraving on the artwork dissolves instead of stopping dead. Dimming
 * the whole layer would flatten that falloff back into a uniform grey.
 *
 * The sprite is 24px against a 24-unit viewBox, so it lands 1:1 on the pixel
 * grid and the 1px rules stay crisp instead of blurring across two pixels.
 */
.ornament--corners::before {
    content: '';
    position: absolute;
    inset: var(--ornament-inset, 7px);
    pointer-events: none;
    background: var(--color-ornament);

    /*
     * The sprite is 24px against a 24-unit viewBox, so it lands 1:1 on the
     * pixel grid and the 1px rules stay crisp instead of blurring across two.
     */
    --ornament-size: 24px;

    /*
     * How far the outer rule runs before it dissolves, as a share of the
     * block. It has to be relative: at a fixed length the frame looked stubby
     * on a wide panel, while on the artwork the rule always covers about a
     * fifth of the side. Width and height carry their own value so a short
     * block does not end up with rules meeting in the middle.
     */
    --ornament-run: 22%;
    --ornament-drop: 22%;

    -webkit-mask:
        var(--ornament-corner-tl) no-repeat left top / var(--ornament-size),
        var(--ornament-corner-tr) no-repeat right top / var(--ornament-size),
        var(--ornament-corner-bl) no-repeat left bottom / var(--ornament-size),
        var(--ornament-corner-br) no-repeat right bottom / var(--ornament-size),

        /* The outer rule, run along each side and left to dissolve. */
        linear-gradient(to right, #fff 25%, transparent) no-repeat left 0 top 1px / var(--ornament-run) 1px,
        linear-gradient(to left, #fff 25%, transparent) no-repeat right 0 top 1px / var(--ornament-run) 1px,
        linear-gradient(to right, #fff 25%, transparent) no-repeat left 0 bottom 1px / var(--ornament-run) 1px,
        linear-gradient(to left, #fff 25%, transparent) no-repeat right 0 bottom 1px / var(--ornament-run) 1px,
        linear-gradient(to bottom, #fff 25%, transparent) no-repeat left 1px top 0 / 1px var(--ornament-drop),
        linear-gradient(to bottom, #fff 25%, transparent) no-repeat right 1px top 0 / 1px var(--ornament-drop),
        linear-gradient(to top, #fff 25%, transparent) no-repeat left 1px bottom 0 / 1px var(--ornament-drop),
        linear-gradient(to top, #fff 25%, transparent) no-repeat right 1px bottom 0 / 1px var(--ornament-drop);
    mask:
        var(--ornament-corner-tl) no-repeat left top / var(--ornament-size),
        var(--ornament-corner-tr) no-repeat right top / var(--ornament-size),
        var(--ornament-corner-bl) no-repeat left bottom / var(--ornament-size),
        var(--ornament-corner-br) no-repeat right bottom / var(--ornament-size),

        /* The outer rule, run along each side and left to dissolve. */
        linear-gradient(to right, #fff 25%, transparent) no-repeat left 0 top 1px / var(--ornament-run) 1px,
        linear-gradient(to left, #fff 25%, transparent) no-repeat right 0 top 1px / var(--ornament-run) 1px,
        linear-gradient(to right, #fff 25%, transparent) no-repeat left 0 bottom 1px / var(--ornament-run) 1px,
        linear-gradient(to left, #fff 25%, transparent) no-repeat right 0 bottom 1px / var(--ornament-run) 1px,
        linear-gradient(to bottom, #fff 25%, transparent) no-repeat left 1px top 0 / 1px var(--ornament-drop),
        linear-gradient(to bottom, #fff 25%, transparent) no-repeat right 1px top 0 / 1px var(--ornament-drop),
        linear-gradient(to top, #fff 25%, transparent) no-repeat left 1px bottom 0 / 1px var(--ornament-drop),
        linear-gradient(to top, #fff 25%, transparent) no-repeat right 1px bottom 0 / 1px var(--ornament-drop);
}

.ornament__rule {
    height: 8px;
    background: var(--color-ornament);
    -webkit-mask: var(--ornament-rule) repeat-x left center / auto 8px;
    mask: var(--ornament-rule) repeat-x left center / auto 8px;
    opacity: 0.35;
}

/* ============ Header ============ */
.header {
    position: sticky;
    top: var(--admin-bar-height, 0px);
    z-index: 50;
    background: color-mix(in srgb, var(--color-canvas) 92%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: var(--border-thin) solid var(--color-border);
}

/*
 * The admin bar is fixed at 32px from 783px up and 46px below it, but at 600px
 * and under WordPress makes it absolute so it scrolls away — there the header
 * belongs at the very top again.
 */
body.admin-bar {
    --admin-bar-height: 46px;
}

@media screen and (min-width: 783px) {
    body.admin-bar {
        --admin-bar-height: 32px;
    }
}

@media screen and (max-width: 600px) {
    body.admin-bar {
        --admin-bar-height: 0px;
    }
}

.header__inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-m);
    min-height: var(--header-height);
}

.header__nav {
    margin-inline: auto;
}

.header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
}

/* ============ Logo ============ */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    flex-shrink: 0;
    color: inherit;
}

.logo:hover,
.logo:focus-visible {
    color: inherit;
    text-decoration: none;
}

.logo:hover .logo__title {
    color: var(--color-accent);
}

.logo__mark {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-s);
    flex-shrink: 0;
}

.logo__mark--empty {
    border: 2px solid var(--color-accent);
}

.logo__text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.logo__title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--color-text-strong);
}

.logo__tagline {
    font-size: var(--text-3xs);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* ============ Main navigation ============ */
/* The drawer's title bar and the page dimmer exist for narrow screens only. */
.main-nav__head,
.nav-backdrop {
    display: none;
}

.main-nav__list {
    display: flex;
    align-items: center;
    gap: var(--space-m);
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav__link {
    display: inline-block;
    padding: var(--space-3xs) 0;
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: var(--text-s);
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
}

.main-nav__link:hover,
.main-nav__item--current > .main-nav__link {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    text-decoration: none;
}

/* ============ Drop-down ============ */
/*
 * "Об игре" opens a list of the game pages, the way the uCoz bar did. On a
 * pointer it opens on hover and on focus; a click on the parent toggles it
 * too (navigation.js), which is what a touch screen at desktop width needs.
 * The parent link is a chevron-bearing "#" and never navigates.
 */
.main-nav__item--parent {
    position: relative;
}

.main-nav__item--parent > .main-nav__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3xs);
}

.main-nav__item--parent > .main-nav__link .icon {
    transition: rotate var(--duration) var(--ease);
}

.main-nav__item--parent.is-open > .main-nav__link .icon {
    rotate: 180deg;
}

@media (min-width: 62rem) {
    .main-nav__sub {
        position: absolute;
        top: calc(100% + var(--space-2xs));
        left: calc(-1 * var(--space-s));
        z-index: 30;
        min-width: 17rem;
        margin: 0;
        padding: var(--space-3xs);
        list-style: none;
        background: var(--color-canvas-alt);
        border: var(--border-thin) solid var(--color-border);
        border-radius: var(--radius-m);
        box-shadow: var(--shadow-m);
        opacity: 0;
        visibility: hidden;
        translate: 0 -4px;
        transition: opacity var(--duration) var(--ease),
                    translate var(--duration) var(--ease),
                    visibility 0s linear var(--duration);
    }

    /* A bridge over the gap between link and list, so the pointer can cross it. */
    .main-nav__sub::before {
        content: '';
        position: absolute;
        inset: calc(-1 * var(--space-2xs) - 2px) 0 auto;
        height: calc(var(--space-2xs) + 2px);
    }

    .main-nav__item--parent:hover > .main-nav__sub,
    .main-nav__item--parent:focus-within > .main-nav__sub,
    .main-nav__item--parent.is-open > .main-nav__sub {
        opacity: 1;
        visibility: visible;
        translate: 0 0;
        transition-delay: 0s;
    }

    .main-nav__sub-link {
        display: block;
        padding: var(--space-2xs) var(--space-s);
        border-radius: var(--radius-s);
        color: var(--color-text);
        font-family: var(--font-heading);
        font-size: var(--text-xs);
        font-weight: 700;
        letter-spacing: var(--tracking-wide);
        text-transform: uppercase;
        white-space: nowrap;
    }

    .main-nav__sub-link:hover,
    .main-nav__sub-link:focus-visible,
    .main-nav__item--current > .main-nav__sub-link {
        background: var(--color-surface-hover);
        color: var(--color-accent);
        text-decoration: none;
    }
}

/*
 * Hidden on wide screens; a 44px square on narrow ones, the same box as the
 * search toggle beside it. With text-sized padding it came out a squat
 * rectangle shorter than its neighbours, and the row read as misaligned.
 */
.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    background: none;
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-m);
    color: var(--color-text);
    cursor: pointer;
    transition: border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

.menu-toggle:hover,
.menu-toggle:focus-visible,
.menu-toggle[aria-expanded='true'] {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* ============ Button ============ */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2xs);
    padding: var(--space-2xs) var(--space-m);
    border: var(--border-thin) solid var(--color-border-strong);
    border-radius: var(--radius-m);
    background: transparent;
    color: var(--color-text-strong);
    font-family: var(--font-heading);
    font-size: var(--text-s);
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color var(--duration) var(--ease),
                border-color var(--duration) var(--ease),
                color var(--duration) var(--ease);
}

.button:hover,
.button:focus-visible {
    background: var(--color-accent-soft);
    border-color: var(--color-accent);
    color: var(--color-accent-hover);
    text-decoration: none;
}

.button--primary {
    border-color: var(--color-highlight);
    color: var(--color-text-strong);
    box-shadow: var(--shadow-glow);
}

.button--primary:hover,
.button--primary:focus-visible {
    background: var(--color-highlight-soft);
    border-color: var(--color-highlight);
    color: var(--color-text-strong);
}

.button--solid {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-on-accent);
}

.button--solid:hover,
.button--solid:focus-visible {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: var(--color-on-accent);
}

.button--ghost {
    border-color: transparent;
    padding-inline: var(--space-2xs);
}

.button--large {
    padding: var(--space-xs) var(--space-l);
    font-size: var(--text-m);
}

.button--small {
    padding: var(--space-3xs) var(--space-xs);
    font-size: var(--text-2xs);
}

/*
 * A button that drops to its icon on the narrow layout, where it stands in a
 * row of icon squares. The label is hidden the way .screen-reader-text hides
 * text rather than with display:none, so the button keeps its name for a
 * screen reader and for voice control.
 */
@media (max-width: 61.99rem) {
    .button--compact {
        width: 2.75rem;
        height: 2.75rem;
        padding: 0;
    }

    .button__label {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

/* ============ Hero ============ */
.hero {
    position: relative;
    isolation: isolate;
    /* The top padding is what lets the artwork read before the headline starts;
       below the buttons the next section brings its own, so this side is short. */
    padding-block: clamp(9rem, 36vh, 21rem) var(--space-xl);
    text-align: center;
    overflow: hidden;
}

.hero__art,
.hero__veil {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero__art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Keeps the figure's head clear of the headline. */
    object-position: center 6%;
}

.hero__veil {
    background: var(--hero-veil);
}

/*
 * A link over the whole banner (the forum's leads to the forum index). A layer
 * of its own rather than a stretched ::after on the title link: the title's
 * drop-shadow filter makes it the containing block, and the pseudo-element
 * would cover the title alone. Positioned after the copy in paint order, so it
 * takes every click; the copy is decoration on a link.
 */
.hero__link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

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

/*
 * The forum's hero: a banner, not a landing. Same art treatment, a third of
 * the height, and the copy set smaller so the section below starts above the
 * fold on a laptop.
 */
.hero--compact {
    /* A third of the height needs a shorter landing band, or the fade eats
       the banner itself. */
    --hero-fade: 4rem;
    padding-block: clamp(3.5rem, 12vh, 6rem) var(--space-xl);
}

/* The fight is in the upper half of the frame; a short band must keep the
   heroine's helmet and the raised blades in view, not the floor of skulls. */
.hero__art--forum {
    object-position: center 30%;
}

.hero__title--compact {
    font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
    line-height: 1;
}

.hero__lead--compact {
    margin-bottom: 0;
    font-size: var(--text-m);
}

.hero__badge {
    display: inline-block;
    margin-bottom: var(--space-m);
    padding: var(--space-3xs) var(--space-xs);
    border: var(--border-thin) solid var(--color-accent);
    border-radius: var(--radius-s);
    color: var(--color-accent);
    font-family: var(--font-heading);
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
}

.hero__title {
    margin: 0 0 var(--space-s);
    color: var(--color-heading);
    background-image: var(--gradient-heading);
    /*
     * Named here, not inherited from the h1 rule in base.css: the forum banner
     * renders the same title as a <p> on every page that has its own heading,
     * and there it came out in the body face at normal weight - the same words
     * looked thin on a topic and bold on the index.
     */
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-hero);
    line-height: 0.95;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    /* A net, not a layout rule: one long word on a narrow screen is clipped by
       the hero's own overflow, and a broken word beats a missing letter. */
    overflow-wrap: break-word;
    /*
     * drop-shadow, not text-shadow: once the glyphs are clipped out of a
     * gradient the letters themselves are transparent, and a text-shadow would
     * show straight through them as a smear. A filter shadows what was painted.
     */
    filter: drop-shadow(0 4px 30px rgba(0, 0, 0, 0.7));
}

/*
 * Engraved headings. The lettering on the key art runs from near-white at the
 * cap line into a deeper tone at the baseline, which is what makes it read as
 * cut into the surface rather than typed on top of it. The flat --color-heading
 * above each of these stays as the fallback, so a browser without
 * background-clip still renders a readable heading.
 */
@supports (background-clip: text) or (-webkit-background-clip: text) {
    .hero__title,
    .section-head__title,
    .widget__title,
    .lost__title {
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }
}

.hero__lead {
    max-width: 42rem;
    margin: 0 auto var(--space-l);
    font-size: var(--text-l);
    color: var(--color-text);
}

@media (max-width: 40rem) {
    .hero {
        padding-bottom: var(--space-l);
    }
}

/* ============ Art credit ============ */
/* No top margin: the credit used to sit under the hero art and now lives in
   the footer's baseline row, where a margin only knocks it out of line. */
.art-credit {
    font-size: var(--text-3xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.art-credit__link {
    color: var(--color-text-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.art-credit__link:hover {
    color: var(--color-accent);
}

.art-credit__role::before {
    content: ' · ';
}

/* ============ Card ============ */
.card {
    position: relative;
    background: var(--color-surface);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-l);
    padding: var(--space-m);
    transition: border-color var(--duration) var(--ease),
                transform var(--duration) var(--ease);
}

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

.card__icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    margin-bottom: var(--space-s);
    background: var(--color-accent-soft);
    color: var(--color-accent);
}


.card__title {
    margin: 0 0 var(--space-3xs);
    font-size: var(--text-xl);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.card__text {
    margin: 0;
    font-size: var(--text-s);
    color: var(--color-text-muted);
}

.card__link {
    color: inherit;
}

.card__link:hover,
.card__link:focus-visible {
    color: var(--color-accent);
    /* The whole card is the target; underlining the heading reads as noise. */
    text-decoration: none;
}

.card__link::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.cards {
    display: grid;
    gap: var(--space-s);
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

/* ============ Section heading ============ */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-s);
    margin-bottom: var(--space-m);
}

.section-head__title {
    margin: 0;
    color: var(--color-heading);
    background-image: var(--gradient-heading);
    font-size: var(--text-2xl);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

/* Inline-flex: base.css makes every svg a block, and the arrow fell onto a line of its own. */
.section-head__more {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3xs);
    font-size: var(--text-s);
    white-space: nowrap;
}

/* ============ Post teaser ============ */
.teaser {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    background: var(--color-surface);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-l);
    overflow: hidden;
    transition: border-color var(--duration) var(--ease);
}

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

@media (min-width: 40rem) {
    .teaser {
        grid-template-columns: 16rem 1fr;
    }

    /* No picture, no column: the grid would otherwise reserve 16rem of empty
       panel next to the text. */
    .teaser--plain {
        grid-template-columns: 1fr;
    }
}

.teaser__media {
    position: relative;
    background: var(--color-surface-sunken);
    min-height: 9rem;
    /* Keeps the hover zoom inside the picture's column. */
    overflow: hidden;
}

/*
 * Stacked layout only: the picture needs a height of its own when it sits above
 * the text. Beside the text it must stretch to the card instead, so no ratio is
 * imposed there - a fixed one left a strip of empty panel under the picture
 * whenever the text ran longer.
 */
@media (max-width: 39.999rem) {
    .teaser__media {
        aspect-ratio: 16 / 9;
        min-height: 0;
    }
}

.teaser__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* The imported pictures are 500x335 to 800x450 and the column is taller
       than any of them; without this they would sit at their own size with the
       panel showing through underneath. */
    position: absolute;
    inset: 0;
    /* A slow, slight zoom on hover; a multiple of the token, so reduced
       motion (duration 0) switches it off too. */
    transition: transform calc(var(--duration) * 3) var(--ease);
}

.teaser:hover .teaser__image {
    transform: scale(1.05);
}

.teaser__body {
    padding: var(--space-m);
}

.teaser__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-s);
    margin-bottom: var(--space-2xs);
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.teaser__title {
    margin: 0 0 var(--space-2xs);
    font-size: var(--text-xl);
    line-height: var(--leading-snug);
}

.teaser__link {
    color: var(--color-heading);
}

.teaser__link:hover {
    color: var(--color-accent);
    text-decoration: none;
}

/*
 * The whole card opens the entry: the card lit up on hover (and on a tap) but
 * only the title was a link. The links inside - the category, a mod's games -
 * are lifted above this layer; the badge already is (z-index 1).
 */
.teaser__link::after {
    content: '';
    position: absolute;
    inset: 0;
}

.teaser__category,
.teaser__game a {
    position: relative;
    z-index: 1;
}

/* Category chip, shown in the body only when there is no picture to lay the
   badge over. */
.teaser__category {
    color: var(--color-accent);
    font-weight: 700;
}

.teaser__category:hover {
    text-decoration: none;
}

.teaser__excerpt {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--text-s);
    line-height: var(--leading-normal);
}

.teaser-list {
    display: grid;
    gap: var(--space-s);
}

/* ============ Block content (posts and forum alike) ============ */
/*
 * These are Gutenberg's own classes, so they are styled once here rather than
 * in the forum sheet: news bodies came through the same uCoz converter and
 * carry the same spoilers, quotes and embeds, but forum.css is only loaded on
 * bbPress pages.
 */
.wp-block-details {
    background: var(--color-surface-sunken);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-m);
    padding: var(--space-2xs) var(--space-s);
    margin-bottom: var(--space-s);
}

/* Direct child: a skill block inside a spoiler brings a <summary> of its own,
   and it is not this one's caption. */
.wp-block-details > summary {
    cursor: pointer;
    color: var(--color-accent);
    font-family: var(--font-heading);
    font-size: var(--text-s);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

/*
 * Once open, the caption is a header rather than a button, so it takes a rule
 * under it and the body takes air. Both hang off [open] on purpose: a closed
 * spoiler has to stay one compact line, and a border under it there would read
 * as an empty panel.
 */
.wp-block-details[open] > summary {
    margin-bottom: var(--space-s);
    padding-bottom: var(--space-2xs);
    border-bottom: var(--border-thin) solid var(--color-border);
}

/* The last block inside brings its own bottom margin, which would double the
   panel's padding at the foot. */
.wp-block-details > *:last-child {
    margin-bottom: 0;
}

/* ============ Front page intro ============ */
/*
 * Plays on every load of the front page. Everything here hangs off .tq-intro,
 * which Theme\Intro puts on <html>, so the page never depends on an animation
 * having run: with the class absent - anywhere but the front page - these
 * rules simply do not exist and the markup is already in its finished state.
 *
 * animation-fill-mode is `both`, so the hidden starting frame applies only
 * while an animation is actually attached.
 */
@media (prefers-reduced-motion: no-preference) {
    /* The art rises out of black rather than fading in over the background:
       brightness is what reads as emerging from darkness, opacity alone just
       reads as a slow image load. */
    .tq-intro .hero__art {
        animation: tq-emerge 1400ms var(--ease) both;
    }

    /*
     * The veil is not animated: it is what lands the art on the page, and
     * while it faded in the picture spent the first second ending on a hard
     * edge at the bottom. Over art that starts at brightness 0.05 there is
     * nothing to see through it anyway.
     */

    /* The copy follows the art rather than arriving with it. */
    .tq-intro .hero__badge {
        animation: tq-rise 700ms var(--ease) 500ms both;
    }

    .tq-intro .hero__title {
        animation: tq-rise 700ms var(--ease) 620ms both;
    }

    .tq-intro .hero__lead {
        animation: tq-rise 700ms var(--ease) 740ms both;
    }

    /* The section shortcuts come up one after another, 80ms apart: enough to
       read as a sequence, not enough to wait for. */
    .tq-intro .cards > * {
        animation: tq-rise 650ms var(--ease) both;
    }

    .tq-intro .cards > *:nth-child(1) { animation-delay: 860ms; }
    .tq-intro .cards > *:nth-child(2) { animation-delay: 940ms; }
    .tq-intro .cards > *:nth-child(3) { animation-delay: 1020ms; }
    .tq-intro .cards > *:nth-child(4) { animation-delay: 1100ms; }
}

@keyframes tq-emerge {
    from {
        opacity: 0;
        filter: brightness(0.05) saturate(0.4);
        scale: 1.04;
    }

    to {
        opacity: 1;
        filter: none;
        scale: 1;
    }
}

@keyframes tq-rise {
    from {
        opacity: 0;
        translate: 0 18px;
    }

    to {
        opacity: 1;
        translate: 0 0;
    }
}

/* ============ Badge ============ */
.badge {
    position: absolute;
    display: inline-block;
    top: var(--space-2xs);
    left: var(--space-2xs);
    z-index: 1;
    padding: 2px var(--space-2xs);
    border-radius: var(--radius-s);
    background: var(--color-highlight);
    color: var(--color-on-highlight);
    font-family: var(--font-heading);
    font-size: var(--text-3xs);
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.badge:hover {
    background: var(--color-accent);
    color: var(--color-on-accent);
    text-decoration: none;
}

.badge--success { background: var(--color-success); color: var(--tq-ink-990); }
.badge--info { background: var(--color-info); color: var(--tq-ink-990); }

/* ============ Widget ============ */
.widget {
    background: var(--color-surface);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-l);
    padding: var(--space-m);
    margin-bottom: var(--space-s);
}

.widget__title {
    margin: 0 0 var(--space-s);
    padding-bottom: var(--space-2xs);
    border-bottom: var(--border-thin) solid var(--color-border);
    color: var(--color-heading);
    background-image: var(--gradient-heading);
    font-size: var(--text-l);
    letter-spacing: var(--tracking-wide);
    text-align: center;
    text-transform: uppercase;
}

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

.widget li + li {
    margin-top: var(--space-2xs);
}

/* ============ Knowledge base mentions ============ */
/*
 * A name of the base in a post, a comment or a message (Db\Mentions): an
 * inline link with the thing's icon, and a card on hover. The card floats in
 * <body> (`position: fixed`), so no post can clip it.
 *
 * The name wraps like any other words, except between the icon and the first
 * word: `white-space: nowrap` on the whole link left a four-word name a line's
 * worth of empty space ahead of it, and no nowrap at all dropped the icon at
 * the end of one line with its name on the next. Db\Mentions wraps the two in
 * `__lead` for this.
 */
.db-mention {
    display: inline;
}

.db-mention__lead {
    white-space: nowrap;
}

/*
 * A quieter underline. A guide names a skill in half its sentences, and at the
 * full weight of `.article__content a` the paragraph read as a row of links
 * rather than as prose. Doubled class for the usual reason: the prose rules
 * (`.article__content a`, `.post-content a`, `.comment__text a`) are (0,1,1)
 * and beat a lone class. Hover brings it back to full strength.
 */
.db-mention.db-mention {
    text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.db-mention.db-mention:hover,
.db-mention.db-mention:focus-visible {
    text-decoration-color: currentColor;
}

/*
 * Two classes on purpose: the text blocks size their pictures with
 * `.post-content img`, `.article__content img`, `.comment__text img`
 * (`height: auto`, one class and a tag), which beat a single class - and a
 * tall icon (a bow is 64x256) then grew four lines high in the middle of text.
 */
.db-mention .db-mention__icon {
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    max-width: none;
    margin-right: 0.2em;
    border-radius: 0;
    object-fit: contain;
    vertical-align: -0.2em;
}

.db-tip-panel {
    position: fixed;
    z-index: 1000;
    width: max-content;
    max-width: min(22rem, calc(100vw - 16px));
    padding: var(--space-s);
    background: var(--color-surface-raised);
    border: var(--border-thin) solid var(--color-border-strong);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-m);
    pointer-events: none;
}

.db-tip {
    display: grid;
    gap: var(--space-2xs);
    color: var(--color-text);
    font-size: var(--text-xs);
    line-height: var(--leading-snug);
}

.db-tip__head {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.db-tip__figure {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    background: var(--color-surface-sunken);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-s);
}

.db-tip__icon {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.db-tip__titles {
    display: grid;
    gap: var(--space-3xs);
    min-width: 0;
}

.db-tip__name {
    color: var(--color-text-strong);
    font-family: var(--font-heading);
    font-size: var(--text-s);
    font-weight: 700;
}

.db-tip__name--magical {
    color: var(--color-rarity-magical);
}

.db-tip__name--rare {
    color: var(--color-rarity-rare);
}

.db-tip__name--epic,
.db-tip__name--set {
    color: var(--color-rarity-epic);
}

.db-tip__name--legendary {
    color: var(--color-rarity-legendary);
}

.db-tip__name--lesser,
.db-tip__name--greater,
.db-tip__name--divine {
    color: var(--color-rarity-artifact);
}

.db-tip__facts,
.db-tip__line {
    color: var(--color-text-muted);
}

.db-tip__text,
.db-tip__line {
    margin: 0;
}

.db-tip__stats {
    padding-top: var(--space-2xs);
    border-top: var(--border-thin) solid var(--color-border);
}

/* The base's stat list, at the card's size. */
.db-tip__stats .db-props__item {
    font-size: var(--text-xs);
    line-height: var(--leading-snug);
}

/* ============ Item of the day (sidebar) ============ */
/*
 * One column: the icon on a line of its own, the name and what it is under
 * it, then the stats full width and small. The surface is the sidebar's .widget.
 */
.item-day {
    margin: 0;
}

.item-day__head {
    display: grid;
    justify-items: center;
    gap: var(--space-s);
    color: inherit;
    text-align: center;
}

.item-day__head:hover,
.item-day__head:focus-visible {
    text-decoration: none;
}

.item-day__figure {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 6rem;
    height: 6rem;
    background: var(--color-surface-sunken);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-m);
}

/* Item icons are not square (a spear is 64x256): fit, do not crop. */
.item-day__icon {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
}

.item-day__text {
    display: grid;
    gap: var(--space-3xs);
    min-width: 0;
}

.item-day__name {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: var(--leading-snug);
    color: var(--color-text-strong);
}

.item-day__head:hover .item-day__name {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.item-day__name--magical {
    color: var(--color-rarity-magical);
}

.item-day__name--rare {
    color: var(--color-rarity-rare);
}

.item-day__name--epic {
    color: var(--color-rarity-epic);
}

.item-day__name--legendary {
    color: var(--color-rarity-legendary);
}

.item-day__name--lesser,
.item-day__name--greater,
.item-day__name--divine {
    color: var(--color-rarity-artifact);
}

.item-day__facts {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.item-day__stats {
    margin-top: var(--space-s);
    padding-top: var(--space-s);
    border-top: var(--border-thin) solid var(--color-border);
}

/* The base's stat list, tightened: the widget's list spacing doubled its gap. */
.item-day__stats .db-props__item {
    margin-top: 0;
    font-size: var(--text-xs);
    line-height: var(--leading-snug);
}

.item-day__reqs {
    margin: var(--space-s) 0 0;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.item-day__more,
.build-feed__more {
    margin: var(--space-s) 0 0;
    font-size: var(--text-s);
}

.item-day__link,
.build-feed__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3xs);
    color: var(--color-text-muted);
}

.item-day__link:hover,
.item-day__link:focus-visible,
.build-feed__link:hover,
.build-feed__link:focus-visible {
    color: var(--color-accent);
    text-decoration: none;
}

/* ============ Popular builds (sidebar) ============ */
/* Rows like the forum feed beside it: crests, name, one line of facts. */
.popular-builds {
    margin: 0;
}

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

.build-feed__item {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: var(--space-xs);
}

/* Specific enough to beat the widget's own list spacing. */
.build-feed__item + .build-feed__item {
    margin-top: var(--space-xs);
    padding-top: var(--space-xs);
    border-top: var(--border-thin) solid var(--color-border);
}

.build-feed__crests {
    display: flex;
    grid-row: 1 / span 2;
}

/* The second crest tucks under the first: two masteries, one badge. */
.build-feed__crest {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.build-feed__crest + .build-feed__crest {
    margin-left: -10px;
}

.build-feed__title {
    overflow: hidden;
    color: var(--color-text-strong);
    font-size: var(--text-s);
    font-weight: 700;
    line-height: var(--leading-snug);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The whole row opens the build. */
.build-feed__title::after {
    content: '';
    position: absolute;
    inset: 0;
}

.build-feed__item:hover .build-feed__title {
    color: var(--color-accent);
}

.build-feed__title:hover {
    text-decoration: none;
}

.build-feed__meta {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2xs);
    min-width: 0;
    margin: var(--space-3xs) 0 0;
    color: var(--color-text-muted);
    font-size: var(--text-3xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.build-feed__facts {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.build-feed__views {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: var(--space-3xs);
    font-variant-numeric: tabular-nums;
}

/* ============ Steam player counter ============ */
/* The block draws no surface of its own: inside a widget area the sidebar
   already wraps it in .widget, and a second panel read as a frame in a frame. */
.steam-players {
    margin: 0;
}

/* The list resets itself rather than relying on `.widget ul`: outside a widget
   area - in the block editor, for one - that ancestor does not exist, and the
   rows came back with bullets. */
.steam-players__list {
    display: grid;
    gap: var(--space-s);
    list-style: none;
    margin: 0;
    padding: 0;
}

/* The rows carry their own rule, so the default widget list spacing would
   stack a second gap on top of it. */
.steam-players__item + .steam-players__item {
    margin-top: 0;
    padding-top: var(--space-s);
    border-top: var(--border-thin) solid var(--color-border);
}

.steam-players__game {
    margin: 0;
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: var(--text-s);
    letter-spacing: var(--tracking-wide);
    text-align: center;
    text-transform: uppercase;
}

.steam-players__count {
    margin: var(--space-3xs) 0 0;
    color: var(--color-accent);
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    font-weight: 700;
    line-height: 1;
    text-align: center;
    /* The figure is replaced in place every few minutes; tabular digits keep
       it from shifting width as the number changes. */
    font-variant-numeric: tabular-nums;
}

.steam-players__label {
    margin: var(--space-3xs) 0 0;
    color: var(--color-text-muted);
    font-size: var(--text-3xs);
    letter-spacing: var(--tracking-wide);
    text-align: center;
    text-transform: uppercase;
}

.steam-players__note {
    margin: var(--space-s) 0 0;
    padding-top: var(--space-2xs);
    border-top: var(--border-thin) solid var(--color-border);
    color: var(--color-text-muted);
    font-size: var(--text-3xs);
    line-height: var(--leading-snug);
    text-align: center;
}
/* ============ Tag list ============ */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3xs);
}

.tags__item {
    padding: var(--space-3xs) var(--space-2xs);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-s);
    font-family: var(--font-heading);
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--color-text);
}

.tags__item:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    text-decoration: none;
}

/* ============ Footer ============ */
.footer {
    position: relative;
    isolation: isolate;
    margin-top: var(--space-2xl);
    padding-block: var(--space-xl) var(--space-m);
    background: var(--color-canvas-alt);
    border-top: var(--border-thin) solid var(--color-border);
    overflow: hidden;
}

/*
 * Positioning context for the art. Without it the picture anchored to the
 * footer itself and bled to the edge of the viewport, which on a wide screen
 * put it a long way from the column it belongs to.
 */
.footer__inner {
    position: relative;
}

.footer__art {
    position: absolute;
    /* The gutter, not zero: absolute offsets resolve against the padding box,
       so zero would push the art back out into the container's margin. */
    right: var(--gutter);
    bottom: 0;
    z-index: -1;
    width: min(46rem, 70%);
    opacity: 0.16;
    /*
     * Faded on every side it can be seen from. While the art bled off the
     * viewport only its left edge needed softening; bounded by the container it
     * now ends inside the page, and a straight cut there reads as a seam.
     * Two layers intersected: one across, one up. Where mask-composite is not
     * supported the layers merely add up, which softens less rather than breaking.
     */
    mask-image:
        linear-gradient(to right, transparent 0%, #000 45%, #000 88%, transparent 100%),
        linear-gradient(to top, #000 55%, transparent 100%);
    mask-composite: intersect;
    -webkit-mask-image:
        linear-gradient(to right, transparent 0%, #000 45%, #000 88%, transparent 100%),
        linear-gradient(to top, #000 55%, transparent 100%);
    -webkit-mask-composite: source-in;
    pointer-events: none;
}

.footer__grid {
    display: grid;
    gap: var(--space-l);
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

/*
 * The site name heads the first column in a larger type than the other
 * columns' titles; one fixed line box for both starts every column's body
 * at the same height.
 */
.footer__title,
.footer__brand {
    margin: 0 0 var(--space-s);
    line-height: 2rem;
}

.footer__title {
    color: var(--color-heading);
    font-size: var(--text-m);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
}

.footer__text {
    font-size: var(--text-s);
    color: var(--color-text-muted);
    max-width: 28rem;
}

.footer__bottom {
    margin-top: var(--space-l);
    padding-top: var(--space-s);
    border-top: var(--border-thin) solid var(--color-border);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-s);
    justify-content: space-between;
    /* Baseline, not stretch: the two runs of text are set at different sizes,
       and aligning their boxes left them sitting at different heights. */
    align-items: baseline;
    font-size: var(--text-2xs);
    color: var(--color-text-muted);
}

/* Privacy and cookies: a quiet pair beside the copyright, a dot between. */
.footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
    margin-right: auto;
}

.footer__legal-link {
    color: inherit;
}

/* Inline-block: a link's underline is not carried into an atomic inline box,
   so the separator stays bare when the link beside it is hovered. */
.footer__legal-link + .footer__legal-link::before {
    content: '·';
    display: inline-block;
    margin-right: var(--space-2xs);
    color: var(--color-text-muted);
}

.footer__legal-link:hover {
    color: var(--color-accent);
}

/* ============ Support the site ============ */
.support__text {
    margin: 0 0 var(--space-s);
    color: var(--color-text-muted);
    font-size: var(--text-s);
    line-height: 1.5;
    text-align: center;
}

.support__button {
    display: flex;
    justify-content: center;
    gap: var(--space-2xs);
    width: 100%;
}

.footer__support {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    margin-top: var(--space-s);
    color: var(--color-text-muted);
}

.footer__support:hover {
    color: var(--color-accent);
    text-decoration: none;
}

/* ============ Ad places ============ */
/* A plain frame in the flow of the page, labelled; never laid over content. */
.placement {
    display: grid;
    gap: var(--space-3xs);
    min-width: 0;
}

.placement[hidden],
/* Google had nothing to show here: no empty frame. */
.placement:has(.placement__unit[data-ad-status='unfilled']) {
    display: none;
}

/*
 * The sidebar place is a block, so the widget area wraps it in a `.widget`
 * shell: the unit is not a panel, and a hidden or unfilled place must not
 * leave that shell standing in the column as an empty frame.
 */
.widget:has(> .placement) {
    padding: 0;
    border: 0;
    background: none;
}

.widget:has(> .placement[hidden]),
.widget:has(> .placement .placement__unit[data-ad-status='unfilled']) {
    display: none;
}

.placement__label {
    color: var(--color-text-muted);
    font-size: var(--text-3xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.placement__unit {
    display: block;
    /* Room held for the unit while it loads, so the page does not jump. */
    min-height: 250px;
    border-radius: var(--radius-m);
    overflow: hidden;
}

/* In the stand-in box the label sits inside the frame, in its top corner. */
.placement__label--inset {
    position: absolute;
    top: var(--space-xs);
    left: var(--space-s);
    font-family: var(--font-main);
}

.placement__unit--preview {
    position: relative;
    display: grid;
    place-items: center;
    border: var(--border-thin) dashed var(--color-border-strong);
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
}

.placement--article,
.placement--db {
    margin-block: var(--space-m);
}

/* ============ Cookie notice ============ */
/* A strip pinned to the foot of the screen, over the page, until a choice is made. */
.cookie-notice {
    position: fixed;
    inset-inline: var(--space-s);
    bottom: var(--space-s);
    z-index: 90;
    /* As wide as what it says, not a bar across the screen. */
    inline-size: fit-content;
    max-width: 52rem;
    margin-inline: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-xs) var(--space-m);
    padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-m);
    border: var(--border-thin) solid var(--color-border-strong);
    border-radius: var(--radius-m);
    background: var(--color-surface-raised);
    box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 0.45);
    font-size: var(--text-s);
    line-height: 1.5;
    animation: cookie-notice-in 0.3s ease-out;
}

/* A display rule outranks the browser's own [hidden]; say it again. */
.cookie-notice[hidden],
.cookie-notice__panel[hidden] {
    display: none;
}

.cookie-notice__text {
    margin: 0;
    /* Shrinks into two lines before the buttons leave its row. */
    flex: 1 1 16rem;
    color: var(--color-text);
}

.cookie-notice__link {
    color: var(--color-link);
    white-space: nowrap;
}

.cookie-notice__actions {
    flex: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
}

.cookie-notice__panel {
    flex-basis: 100%;
    min-inline-size: 0;
    margin: 0;
    padding: var(--space-s) 0 0;
    border: 0;
    border-top: var(--border-thin) solid var(--color-border);
    display: grid;
    gap: var(--space-xs);
}

.cookie-notice__option {
    display: flex;
    align-items: flex-start;
    gap: var(--space-xs);
    color: var(--color-text-muted);
    cursor: pointer;
}

.cookie-notice__option strong {
    color: var(--color-text-strong);
    font-weight: 600;
}

.cookie-notice__option input {
    flex-shrink: 0;
    margin-top: 0.2em;
}

.cookie-notice__save {
    justify-self: start;
}

@keyframes cookie-notice-in {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }
}

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

@media (max-width: 40rem) {
    /* A button that wraps under the text sits in the middle of its line. */
    .cookie-notice {
        justify-content: center;
        padding: var(--space-s);
    }

    /* Free to wrap on a narrow phone rather than run past the edge. */
    .cookie-notice__actions {
        flex: 0 1 auto;
        justify-content: center;
    }

    /* The open panel can be taller than a phone's screen. */
    .cookie-notice--open {
        max-height: calc(100vh - 2 * var(--space-s));
        overflow-y: auto;
    }
}

/* The footer's "cookie settings" is a button set as one of the links beside it. */
.footer__legal-link--button {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

/* ============ Social links ============ */
.social {
    display: flex;
    gap: var(--space-2xs);
    list-style: none;
    margin: 0;
    padding: 0;
}

.social__link {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-m);
    color: var(--color-text-muted);
}

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

/* ============ Responsive nav ============ */
/*
 * Narrow screens: logo on the left, the three controls - search, account,
 * burger - as one right-hand cluster. The menu is a drawer that slides in
 * from the right over the page: expanding it inside the sticky header pushed
 * the whole page down on every tap. The logo pushes the cluster over with an
 * auto margin; on wide screens that job belongs to the navigation.
 */
@media (max-width: 61.99rem) {
    /*
     * backdrop-filter, like filter, turns an element into the containing
     * block for fixed-position descendants - the drawer would have been
     * positioned inside the 78px bar. The blur is not worth that here.
     */
    .header {
        backdrop-filter: none;
        background: color-mix(in srgb, var(--color-canvas) 96%, transparent);
    }

    .header__inner {
        gap: var(--space-2xs);
        padding-block: var(--space-2xs);
    }

    .logo {
        margin-inline-end: auto;
    }

    .site-search {
        order: 1;
    }

    .header__actions {
        order: 2;
    }

    .menu-toggle {
        display: inline-flex;
        order: 3;
    }

    /*
     * Three controls stand side by side here, so they are cut to one shape:
     * a 2.75rem square in the same frame. Before this the magnifier had no
     * frame at all, the avatar was a bare circle of its own size and only the
     * burger was boxed - three heights and three alignments inside 200px.
     */
    .site-search__toggle,
    .account__toggle,
    .menu-toggle {
        width: 2.75rem;
        height: 2.75rem;
        padding: 0;
        border: var(--border-thin) solid var(--color-border);
        border-radius: var(--radius-m);
    }

    .account__toggle {
        justify-content: center;
        max-width: none;
    }

    /* The name and the chevron would burst the square; the name is the first
       line of the menu that opens anyway, and the avatar is the affordance. */
    .user-chip__name,
    .account__toggle .icon--chevron {
        display: none;
    }

    /* Nothing is left in the square but the avatar, so the unread count is
       pinned to its corner: in the row it stretched the chip past the frame
       the other two controls share. */
    .account__toggle {
        position: relative;
        overflow: visible;
    }

    .account__toggle .user-chip__badge {
        position: absolute;
        top: -0.25rem;
        right: -0.25rem;
        min-width: 1.125rem;
        line-height: 1.125rem;
        box-shadow: 0 0 0 2px var(--color-canvas);
    }

    .header__nav {
        position: fixed;
        inset: 0 0 0 auto;
        z-index: 60;
        display: flex;
        flex-direction: column;
        width: min(20rem, 85vw);
        margin: 0;
        padding: var(--space-s) var(--space-m) var(--space-l);
        overflow-y: auto;
        background: var(--color-canvas-alt);
        border-left: var(--border-thin) solid var(--color-border);
        box-shadow: var(--shadow-m);
        translate: 100% 0;
        visibility: hidden;
        transition: translate var(--duration) var(--ease),
                    visibility 0s linear var(--duration);
    }

    .header__nav.is-open {
        translate: 0 0;
        visibility: visible;
        transition-delay: 0s;
    }

    .main-nav__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: var(--space-s);
        padding-bottom: var(--space-2xs);
        border-bottom: var(--border-thin) solid var(--color-border);
    }

    .main-nav__caption {
        color: var(--color-text-muted);
        font-family: var(--font-heading);
        font-size: var(--text-2xs);
        letter-spacing: var(--tracking-wider);
        text-transform: uppercase;
    }

    .main-nav__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.75rem;
        height: 2.75rem;
        padding: 0;
        background: none;
        border: var(--border-thin) solid var(--color-border);
        border-radius: var(--radius-m);
        color: var(--color-text);
        cursor: pointer;
    }

    .main-nav__close:hover,
    .main-nav__close:focus-visible {
        border-color: var(--color-accent);
        color: var(--color-accent);
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 55;
        padding: 0;
        border: 0;
        background: color-mix(in srgb, var(--color-canvas) 65%, transparent);
        opacity: 0;
        visibility: hidden;
        cursor: pointer;
        transition: opacity var(--duration) var(--ease),
                    visibility 0s linear var(--duration);
    }

    .nav-backdrop.is-open {
        opacity: 1;
        visibility: visible;
        transition-delay: 0s;
    }

    .main-nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    /* Whole-row tap targets; the underline of the wide layout would be a
       stub under the first word here, so the current item is marked by colour. */
    .main-nav__link {
        display: block;
        padding: var(--space-xs) 0;
        font-size: var(--text-m);
        border-bottom: var(--border-thin) solid var(--color-border);
    }

    .main-nav__item:last-child > .main-nav__link {
        border-bottom-color: transparent;
    }

    .main-nav__link:hover,
    .main-nav__item--current > .main-nav__link {
        border-bottom-color: var(--color-border);
    }

    /* In the drawer the section is always unfolded: one tap less, and the
       parent is a "#" that would otherwise do nothing visible. */
    .main-nav__item--parent > .main-nav__link {
        display: flex;
        justify-content: space-between;
        border-bottom-color: transparent;
    }

    .main-nav__item--parent > .main-nav__link .icon {
        display: none;
    }

    .main-nav__sub {
        margin: 0 0 var(--space-xs);
        padding: 0 0 0 var(--space-s);
        list-style: none;
        border-left: 2px solid var(--color-border);
    }

    .main-nav__sub-link {
        display: block;
        padding: var(--space-2xs) 0;
        color: var(--color-text);
        font-family: var(--font-heading);
        font-size: var(--text-s);
        font-weight: 700;
        letter-spacing: var(--tracking-wide);
        text-transform: uppercase;
    }

    .main-nav__sub-link:hover,
    .main-nav__item--current > .main-nav__sub-link {
        color: var(--color-accent);
        text-decoration: none;
    }
}

/* Page scroll is held while the drawer is open; the class is set by navigation.js. */
.has-drawer {
    overflow: hidden;
}

/*
 * The drawer lives inside the header's stacking context, and the admin bar
 * sits at 99999: for a logged-in admin the drawer's own title bar vanished
 * under it. While the drawer is open the header outranks the admin bar - the
 * drawer is modal, so nothing behind it needs to be reachable anyway.
 */
.has-drawer .header {
    z-index: 100000;
}

@media (prefers-reduced-motion: reduce) {
    .header__nav,
    .nav-backdrop {
        transition: none;
    }
}

@media (max-width: 40rem) {
    .logo__tagline {
        display: none;
    }

    .logo__title {
        font-size: var(--text-l);
    }
}

/* ============ Icon ============ */
.icon {
    flex-shrink: 0;
    vertical-align: -0.15em;
}

/* ============ Sidebar ============ */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-s);
}

.sidebar .widget {
    margin-bottom: 0;
}

/* ============ Search form ============ */
.search-form {
    --search-control: 2.75rem;

    display: flex;
    gap: var(--space-2xs);
}

/* A square outline button the height of the field, as on the trade board:
   a solid cream block beside the field outshouted the page. */
.search-form__submit {
    flex-shrink: 0;
    width: var(--search-control);
    height: var(--search-control);
    justify-content: center;
    padding: 0;
}

.search-form__field {
    flex: 1 1 auto;
    min-width: 0;
    height: var(--search-control);
}

/* The search page: the form above the results, a line of help when empty. */
.search-page__form {
    margin-bottom: var(--space-m);
}

.search-page__hint {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--text-s);
}

/* ============ Article ============ */
/*
 * The article sits on a panel rather than straight on the page background: on
 * a dark canvas a bare column of text reads as an unstyled page, and the news
 * needs a sheet to sit on the way the cards do.
 */
.article {
    padding: var(--space-l) var(--space-xl);
    background: var(--color-surface);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-l);
}

@media (max-width: 40rem) {
    .article {
        padding: var(--space-m) var(--space-s);
    }
}

.article__header {
    margin-bottom: var(--space-m);
    padding-bottom: var(--space-s);
    border-bottom: var(--border-thin) solid var(--color-border);
}

.article__title {
    font-size: var(--text-3xl);
    letter-spacing: -0.01em;
}

.article__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-s);
    margin: 0;
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/*
 * base.css makes every svg a block, so that an image never leaves a descender
 * gap under it. An icon set in a line of text is the exception: as a block it
 * pushed the date onto its own line. These rows put icon and text back on one
 * line themselves rather than changing the rule for every svg on the site.
 */
.article__meta > *,
.teaser__meta > * {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3xs);
    white-space: nowrap;
}

.teaser__short {
    display: none;
}

/* On a phone the comment count is a number, as the views are: with the words
   the meta took two lines under every picture. */
@media (max-width: 40rem) {
    /* Out of sight, not out of the page: a screen reader still says the words. */
    .teaser__long {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .teaser__short {
        display: inline;
    }
}

.icon {
    flex-shrink: 0;
}

.article__kicker {
    margin: 0 0 var(--space-2xs);
    font-family: var(--font-heading);
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
}

.article__category {
    color: var(--color-accent);
}

.article__category:hover {
    text-decoration: none;
    color: var(--color-accent-hover);
}

.article__media {
    margin: 0 0 var(--space-m);
}

.article__thumbnail {
    width: 100%;
    height: auto;
    border-radius: var(--radius-l);
}

/*
 * The body is set for reading rather than for contrast, on the same tokens the
 * forum uses: these pages carry decade-old news with long paragraphs, and the
 * near-white on near-black that works for a heading is punishing here.
 */
/* `anywhere`: a pasted link is one long word, and on a phone it ran past the panel and widened the page. */
.article__content {
    color: var(--color-text-reading);
    font-size: var(--text-m);
    line-height: var(--leading-reading);
    overflow-wrap: anywhere;
}

/* A step down on a phone, as in the forum: 16px left five words to a line. */
@media (max-width: 40rem) {
    .article__content {
        font-size: var(--text-s);
    }
}

.article__content > * {
    max-width: 100%;
}

/*
 * The prose rhythm of an article body, at zero specificity.
 *
 * `:where()` and not a plain descendant selector, because the body is not only
 * prose: it carries the site's own blocks, and `.article__content p` (0,1,1)
 * beat every component class (0,1,0) inside them. A knowledge-base card in a
 * build guide took the article's 1.5rem between paragraphs and the article's
 * list indent, and came out half again as tall as the same card in a listing -
 * measured on /builds/, where its three lines stood a finger apart.
 *
 * At zero specificity these are defaults: anything with a class of its own
 * wins, and the text around it still reads as text.
 */
.article__content :where(p, ul, ol) {
    margin-block: 0 var(--space-m);
}

.article__content :where(ul, ol) {
    padding-inline-start: var(--space-l);
}

.article__content :where(li + li) {
    margin-top: var(--space-2xs);
}

.article__content h2,
.article__content h3,
.article__content h4 {
    margin-block: var(--space-l) var(--space-xs);
    color: var(--color-heading);
    line-height: var(--leading-snug);
}

.article__content :where(img) {
    height: auto;
    border-radius: var(--radius-m);
}

.article__content figure {
    margin-block: var(--space-m);
}

.article__content figcaption {
    margin-top: var(--space-2xs);
    color: var(--color-text-muted);
    font-size: var(--text-s);
    text-align: center;
}

/* Imported YouTube embeds: 33 of the news items carry one, and an iframe with
   no ratio of its own collapses to a strip. */
.article__content .wp-block-embed iframe,
.article__content iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
}

/*
 * Tables in prose: one rounded panel, rows parted by hairlines, no grid.
 * The block library draws a full cell grid and a 3px rule under the head
 * with (0,1,1) selectors, so each of these names the content block as well.
 * A table wider than a phone scrolls inside its figure, not the page.
 */
.article__content .wp-block-table {
    overflow-x: auto;
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-m);
    background: var(--color-surface);
}

.article__content .wp-block-table table {
    margin: 0;
    border-collapse: collapse;
    font-size: var(--text-s);
    line-height: 1.5;
}

.article__content .wp-block-table thead {
    border: 0;
    background: var(--color-surface-raised);
}

.article__content .wp-block-table th,
.article__content .wp-block-table td {
    border: 0;
    padding: var(--space-xs) var(--space-s);
    text-align: left;
    vertical-align: top;
}

.article__content .wp-block-table th {
    border-bottom: var(--border-thin) solid var(--color-border);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* A third column holds short values (a term, a date): one line, as narrow as it is. */
/* The article breaks words `anywhere`; in a table that let auto layout squeeze a
   column down to one letter a line. A cell breaks between words only, and a table
   too wide for the screen scrolls inside its frame. */
.article__content .wp-block-table th,
.article__content .wp-block-table td {
    overflow-wrap: normal;
}

.article__content .wp-block-table tbody tr + tr td {
    border-top: var(--border-thin) solid var(--color-border);
}

.article__content .wp-block-table tbody tr:hover {
    background: var(--color-surface-hover);
}

/* The name column: the keys are what the reader looks up. */
.article__content .wp-block-table td:first-child {
    color: var(--color-text-strong);
}

.article__content .wp-block-table code {
    display: inline-block;
    margin: 0.1em 0;
    padding: 0.1em 0.4em;
    border-radius: var(--radius-s);
    background: var(--color-surface-sunken);
    font-size: 0.875em;
    white-space: nowrap;
}

.article__content blockquote {
    margin: var(--space-m) 0;
    padding: var(--space-s) var(--space-m);
    background: var(--color-surface-sunken);
    border-inline-start: 2px solid var(--color-border-accent);
}

.article__content blockquote > *:last-child {
    margin-bottom: 0;
}

.article__content cite {
    display: block;
    margin-top: var(--space-2xs);
    color: var(--color-text-muted);
    font-size: var(--text-s);
}

.article__content pre {
    padding: var(--space-s);
    overflow-x: auto;
    background: var(--color-surface-sunken);
    border: var(--border-thin) solid var(--color-border);
    font-size: var(--text-s);
}

.article__content a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Where the news was copied from; the old site kept the link and so do we. */
.article__source {
    margin-top: var(--space-l);
    padding-top: var(--space-s);
    border-top: var(--border-thin) solid var(--color-border);
    color: var(--color-text-muted);
    font-size: var(--text-s);
}

/* ============ Source credit (tq/source) ============ */
/*
 * The credit a translated guide carries. Quiet by design - it is not what the
 * reader came for - but set apart from the prose so it cannot be mistaken for
 * the author's own words. The doubled class on the link is the same fix as on
 * `.db-card__link`: `.article__content a` underlines every link inside a guide
 * and outranks a lone component class.
 */
.credit {
    margin: 0 0 var(--space-m);
    padding: var(--space-xs) var(--space-s);
    border: var(--border-thin) solid var(--color-border);
    border-inline-start: 3px solid var(--color-accent);
    border-radius: var(--radius-m);
    background: color-mix(in srgb, var(--color-surface-sunken) 80%, transparent);
    font-size: var(--text-s);
}

.credit__label {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.credit__text {
    margin: var(--space-3xs) 0 0;
    color: var(--color-text);
    overflow-wrap: anywhere;
}

.credit__link.credit__link {
    color: var(--color-link);
    text-decoration: none;
}

.credit__link.credit__link:hover,
.credit__link.credit__link:focus-visible {
    text-decoration: underline;
}

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

.credit__note {
    margin: var(--space-3xs) 0 0;
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
}

/* In the editor the box is the form: four fields, stacked. */
.credit--editing {
    display: grid;
    gap: var(--space-2xs);
}

/*
 * Core draws `TextControl` for the console's light chrome - a white field with
 * dark text - and inside our canvas that reads as four holes punched in the
 * panel. The canvas sheet already repaints `InputControl`, but `TextControl`
 * is a plain input of its own class, so it is repainted here, where the block
 * keeps the rest of its look. One class deep is enough to outrank core.
 */
.credit--editing .components-base-control__label {
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.credit--editing .components-text-control__input {
    padding: var(--space-3xs) var(--space-2xs);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-s);
    background: var(--color-surface-sunken);
    box-shadow: none;
    color: var(--color-text);
    font-family: inherit;
    font-size: var(--text-s);
}

.credit--editing .components-text-control__input::placeholder {
    color: var(--color-text-muted);
}

/* One line on focus, not two: the ring lies over the border, as on our forms. */
.credit--editing .components-text-control__input:focus {
    border-color: var(--color-border-accent);
    box-shadow: none;
    outline: var(--border-thin) solid var(--color-border-accent);
    outline-offset: -1px;
}

/* ============ Previous / next post ============ */
.post-nav {
    display: grid;
    gap: var(--space-s);
    margin-top: var(--space-xl);
}

@media (min-width: 40rem) {
    .post-nav {
        grid-template-columns: 1fr 1fr;
    }
}

.post-nav__link {
    display: grid;
    gap: var(--space-3xs);
    padding: var(--space-s) var(--space-m);
    background: var(--color-surface);
    border: var(--border-thin) solid var(--color-border);
    transition: border-color var(--duration) var(--ease);
}

.post-nav__link:hover {
    border-color: var(--color-accent);
    text-decoration: none;
}

/* The later item sits on the right and reads from the right, so the pair works
   as one control rather than as two identical boxes. */
.post-nav__link--next {
    text-align: end;
}

@media (min-width: 40rem) {
    .post-nav__link--next:only-child {
        grid-column: 2;
    }
}

.post-nav__label {
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.post-nav__title {
    color: var(--color-heading);
    font-size: var(--text-s);
    line-height: var(--leading-snug);
}

/* ============ Imported content ============ */
/*
 * Smileys rewritten by the uCoz converter. Shared by forum posts, news bodies
 * and comments, so this cannot sit in forum.css: base.css makes every img a
 * block, and without this rule a smiley at the end of a sentence drops onto
 * its own line.
 */
/*
 * The size of the letters beside it: a smiley is a word in the sentence, not
 * a picture in it. Lifted off the baseline the way a glyph sits, rather than
 * hung from text-bottom, which left it standing a head above the line.
 *
 * The class is doubled because `.post-content img { height: auto }` in
 * forum.css is as specific as one class and comes later in the cascade: the
 * smiley was drawn at the 20 pixels of its own attributes whatever was
 * written here.
 */
.tq-smiley.tq-smiley {
    display: inline-block;
    vertical-align: -0.125em;
    width: auto;
    /* 1em, not the 1.2-1.4 an emoji font is usually given: this artwork fills
       its square edge to edge, where a glyph keeps air around itself. */
    height: 1em;
    margin: 0 0.05em;
}

/*
 * The smiley picker. One panel, two homes: the comment and message forms open
 * it under their toolbar (built in comment-editor.js), the forum's block
 * editor opens it in a popover (assets/js/editor/smilies.js). Both print
 * these classes, so the picker looks the same wherever a member writes.
 */
.smilies {
    display: grid;
    gap: var(--space-2xs);
    /* A set width, not a share of the parent: inside a popover the parent is
       sized by what is in it, and a panel asking for 100% of that collapsed
       into one column of faces down the edge of the page. */
    width: 22rem;
    max-width: calc(100vw - var(--space-m) * 2);
    padding: var(--space-2xs);
    background: var(--color-surface-raised);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-m);
}

/*
 * On a phone the panel is nearly as wide as the page: in the forum's popover
 * it covered the form it writes into, and the editor slid it sideways until
 * it hung off the edge. Smaller cells, a shorter grid, and a width that
 * leaves the page showing around it.
 */
@media (max-width: 30rem) {
    .smilies {
        width: 17rem;
    }

    .smilies__grid {
        grid-template-columns: repeat(auto-fill, minmax(1.75rem, 1fr));
        max-height: 10rem;
    }

    .smilies__item img {
        width: 20px;
        height: 20px;
    }
}

/* `display` from a stylesheet beats the browser's own [hidden] rule whatever
   its specificity, so the panel the form builds hidden was drawn all the same
   - and closing it did nothing. */
.smilies[hidden] {
    display: none;
}

.smilies__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3xs);
}

.smilies__tab {
    padding: var(--space-3xs) var(--space-2xs);
    border: var(--border-thin) solid transparent;
    border-radius: var(--radius-s);
    background: transparent;
    color: var(--color-text-muted);
    font-size: var(--text-3xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    cursor: pointer;
}

.smilies__tab:hover {
    color: var(--color-text);
}

.smilies__tab[aria-pressed='true'] {
    border-color: var(--color-border);
    background: var(--color-surface-sunken);
    color: var(--color-accent);
}

/* Auto-fill, not a fixed count: the panel is as wide as the form allows and
   the faces fill it without a column of air at the end. */
.smilies__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(2rem, 1fr));
    gap: 2px;
    max-height: 13rem;
    overflow-y: auto;
}

.smilies__item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xs);
    border: 0;
    border-radius: var(--radius-s);
    background: transparent;
    cursor: pointer;
}

.smilies__item:hover,
.smilies__item:focus-visible {
    background: var(--color-surface-sunken);
}

.smilies__item img {
    width: 24px;
    height: 24px;
}

/* Under the toolbar of a comment or a message, where it is part of the form
   rather than a layer over the page. */
/* In a form the panel is a layer over the page, as it is in the forum's
   editor - not a block wedged between the toolbar and the field, which pushed
   everything below it down and stood short of both edges. The element it
   hangs from is a <span> the script finds, and the four forms that print one
   keep it in a different kind of parent (block, flex column, grid), so the
   offset cannot be written here: comment-editor.js marks the parent with this
   class and sets the panel's top from the toolbar it belongs to. */
.smilies-anchor {
    position: relative;
}

.smilies-anchor > .smilies {
    position: absolute;
    z-index: 5;
    box-shadow: var(--shadow-m);
}

/* In the forum's editor the panel is the whole of the popover - the class
   lands on the content box itself when a Dropdown places it, and on the
   popover around it otherwise. */
.smilies-popover,
.smilies-popover .components-popover__content {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

/* ============ Comments ============ */
.comments {
    margin-top: var(--space-xl);
}

.comments__title {
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
    margin: 0 0 var(--space-m);
    padding-bottom: var(--space-s);
    border-bottom: var(--border-thin) solid var(--color-border);
    color: var(--color-heading);
    font-size: var(--text-xl);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.comments__count {
    color: var(--color-text-muted);
    font-size: var(--text-m);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

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

.comments__list,
.comments__list .children {
    display: grid;
    gap: var(--space-s);
    margin: 0;
    padding: 0;
    list-style: none;
}

/*
 * Replies hang off a rule under their parent. Every level steps in by the
 * same amount; the walker stops nesting at thread_comments_depth and lays
 * deeper answers out flat at that level, so the indent has a known ceiling.
 * `.children` is the walker's own class - it cannot be renamed without a
 * custom walker, and the list is the one place it appears.
 */
.comments__list .children {
    margin-top: var(--space-s);
    padding-inline-start: var(--space-m);
    border-inline-start: 2px solid var(--color-border);
}

@media (max-width: 40rem) {
    .comments__list .children {
        padding-inline-start: var(--space-xs);
    }
}

.comment__body {
    padding: var(--space-s) var(--space-m);
    background: var(--color-surface);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-m);
    transition: border-color var(--duration) var(--ease);
}

/* Deep link (#comment-N) lands on this one: mark it, quietly. */
.comment:target > .comment__body {
    border-color: var(--color-accent);
}

.comment__header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-xs);
}

.comment__avatar {
    flex-shrink: 0;
}

.comment__image {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.comment__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-3xs) var(--space-xs);
    min-width: 0;
}

.comment__author {
    color: var(--color-heading);
    font-family: var(--font-heading);
    font-size: var(--text-m);
}

.comment__author:hover {
    color: var(--color-accent);
    text-decoration: none;
}

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

.comment__time {
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
    font-variant-numeric: tabular-nums;
}

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

/* A comment a moderator took away, still holding up an answer below it.
   Dashed, because it is the outline of something that is no longer there. */
.comment__removed {
    margin: 0;
    padding: var(--space-xs) var(--space-m);
    border: var(--border-thin) dashed var(--color-border);
    border-radius: var(--radius-m);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.comment__pending {
    margin: 0 0 var(--space-xs);
    color: var(--color-info);
    font-size: var(--text-s);
}

/* Set for reading, same tokens as a forum post: this is the same kind of text. */
.comment__text {
    color: var(--color-text-reading);
    font-size: var(--text-m);
    line-height: var(--leading-reading);
    overflow-wrap: anywhere;
}

/* The same step down an article takes on a phone: a comment is read in the
   same column and had no reason to be the larger of the two. */
@media (max-width: 40rem) {
    .comment__text {
        font-size: var(--text-s);
    }
}

.comment__text > *:first-child {
    margin-top: 0;
}

.comment__text > *:last-child {
    margin-bottom: 0;
}

.comment__text p {
    margin-block: 0 var(--space-xs);
}

.comment__text img {
    max-width: 100%;
    height: auto;
}

/*
 * A comment that is nothing but a smiley came through the converter as an
 * image block. As a figure it would sit on a line of its own like a photo;
 * inline it reads as the grin it was.
 */
.comment__text .wp-block-image {
    display: inline-block;
    margin: 0;
}

.comment__text blockquote {
    margin: var(--space-xs) 0;
    padding: var(--space-2xs) var(--space-s);
    background: var(--color-surface-sunken);
    border-inline-start: 2px solid var(--color-border-accent);
    font-size: var(--text-s);
}

.comment__text cite {
    display: block;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-style: normal;
}

.comment__text a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.comment__text code {
    padding: 0 0.3em;
    background: var(--color-surface-sunken);
    border-radius: var(--radius-s);
}

/*
 * Five links of one weight in one row said nothing about which of them a
 * reader wants. The row is cut off from the text by a rule, as a forum post's
 * is, and split the same way: what the staff can do stays quiet on the left,
 * "Ответить" is a button at the other end.
 */
.comment__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2xs) var(--space-s);
    margin-top: var(--space-s);
    padding-top: var(--space-s);
    border-top: var(--border-thin) solid var(--color-border);
    font-size: var(--text-xs);
}

/* comment-reply.js finds the link by this core class, so it stays. */
.comment__actions .comment-reply-link {
    display: inline-flex;
    align-items: center;
    margin-inline-start: auto;
    padding: var(--space-3xs) var(--space-xs);
    border: var(--border-thin) solid var(--color-border-accent);
    border-radius: var(--radius-s);
    background: var(--color-surface-raised);
    color: var(--color-heading);
    font-family: var(--font-heading);
    font-size: var(--text-3xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    white-space: nowrap;
}

.comment__actions .comment-reply-link:hover,
.comment__actions .comment-reply-link:focus-visible {
    border-color: var(--color-accent);
    color: var(--color-accent);
    text-decoration: none;
}

/*
 * Moderation sits in the same row as "Ответить": a form each, because these
 * change something and the page carries no script of its own. The button is
 * stripped back to the look of the links beside it.
 */
.comment__mod {
    display: contents;
}

.comment__mod-button {
    width: 100%;
    border: 0;
    background: none;
    font: inherit;
    text-align: start;
    cursor: pointer;
}

/* The two that take the comment away are told apart by what they do on
   hover, not by standing out while being read. */
.post-mod__item .comment__mod-button--danger:hover,
.post-mod__item .comment__mod-button--danger:focus-visible {
    color: var(--color-danger);
}

/*
 * The "..." menu of a post or a comment: a <details>, so it works without
 * JavaScript; account.js adds closing on a click outside and on Esc. It lives
 * here and not in forum.css because a comment is read outside the forum - the
 * rule the theme already learned from .topic-feed and .wp-block-details.
 */
.post-mod {
    position: relative;
}

.post-mod__toggle {
    display: inline-flex;
    padding: var(--space-3xs);
    border-radius: var(--radius-s);
    color: var(--color-text-muted);
    cursor: pointer;
    list-style: none;
}

.post-mod__toggle::-webkit-details-marker {
    display: none;
}

.post-mod__toggle:hover,
.post-mod[open] .post-mod__toggle {
    color: var(--color-accent);
}

/*
 * The surface is on the wrapper, not on the list: bbpress.css blanks the
 * background and padding of every <ul> under #bbpress-forums with an id
 * selector, and the menu was see-through with the post showing behind it.
 */
.post-mod__menu {
    position: absolute;
    bottom: calc(100% + var(--space-3xs));
    left: 0;
    z-index: 60;
    min-width: 11rem;
    padding: var(--space-3xs);
    background: var(--color-surface-raised);
    border: var(--border-thin) solid var(--color-border-strong);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-m);
}

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

.post-mod__item a,
.post-mod__item button {
    display: block;
    padding: var(--space-3xs) var(--space-2xs);
    border-radius: var(--radius-s);
    color: var(--color-text);
    font-size: var(--text-2xs);
    white-space: nowrap;
}

.post-mod__item a:hover,
.post-mod__item a:focus-visible,
.post-mod__item button:hover,
.post-mod__item button:focus-visible {
    background: var(--color-surface);
    color: var(--color-accent);
    text-decoration: none;
}

/* ============ Comment form ============ */
.comment-form {
    margin-top: var(--space-l);
    padding: var(--space-m);
    background: var(--color-surface);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-m);
}

/* The refusal the server sent back about this very submission: under the
   field, above the button, where the text it is about is still standing. */
.comment-form__error {
    margin: 0 0 var(--space-s);
    padding: var(--space-xs) var(--space-s);
    background: var(--color-surface-sunken);
    border-inline-start: 2px solid var(--color-danger);
    border-radius: var(--radius-s);
    color: var(--color-text);
    font-size: var(--text-s);
}

/*
 * Moved under a comment by comment-reply.js: sits inside the thread, so the
 * full section gap above it would open a hole in the list. It steps in by the
 * same amount a reply does and gets the same guide line, because that is what
 * it is about to become - the line is drawn by this box rather than by the
 * list around it, which has no say in where the form lands.
 */
.comment .comment-form {
    position: relative;
    margin-top: var(--space-s);
    margin-inline-start: var(--space-m);
}

.comment .comment-form::before {
    content: '';
    position: absolute;
    inset-block: 0;
    inset-inline-start: calc(var(--space-m) * -1);
    width: 2px;
    background: var(--color-border);
}

@media (max-width: 40rem) {
    .comment .comment-form {
        margin-inline-start: var(--space-xs);
    }

    .comment .comment-form::before {
        inset-inline-start: calc(var(--space-xs) * -1);
    }
}

.comment-form__title {
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
    margin: 0 0 var(--space-s);
    font-size: var(--text-l);
}

.comment-form__cancel {
    font-size: var(--text-xs);
    font-weight: normal;
    letter-spacing: 0;
    text-transform: none;
}

.comment-form__row {
    margin: 0 0 var(--space-s);
}

.comment-form__textarea {
    min-height: 8rem;
    resize: vertical;
    line-height: var(--leading-normal);
}

/*
 * Formatting buttons, drawn as one strip fused to the top of the textarea:
 * the field loses its top corners and the strip its bottom border, so the two
 * read as a single control rather than a row of chips floating above a box.
 */
.comment-form__toolbar,
.pm-form__toolbar,
.profile-form__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3xs);
    padding: var(--space-3xs);
    background: var(--color-surface-sunken);
    border: var(--border-thin) solid var(--color-border);
    border-bottom: 0;
    border-radius: var(--radius-m) var(--radius-m) 0 0;
}

.comment-form__toolbar + .comment-form__textarea,
.pm-form__toolbar + .pm-form__field,
.profile-form__toolbar + .profile-form__textarea {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* The profile row is a grid with a gap of its own, and the gap would show as a
   seam between the strip and the field it is fused to - pull it back. */
.profile-form__toolbar {
    margin-bottom: calc(var(--space-3xs) * -1);
}

.comment-form__tool,
.pm-form__tool,
.profile-form__tool {
    /* A square around an 18px icon: base.css gives svg `display: block`, so
       the button has to do the centring itself. */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    padding: var(--space-3xs);
    border: var(--border-thin) solid transparent;
    border-radius: var(--radius-s);
    background: transparent;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    line-height: 1.4;
    cursor: pointer;
    transition: color var(--duration) var(--ease),
                border-color var(--duration) var(--ease);
}

.comment-form__tool:hover,
.comment-form__tool:focus-visible,
.pm-form__tool:hover,
.pm-form__tool:focus-visible,
.profile-form__tool:hover,
.profile-form__tool:focus-visible {
    border-color: var(--color-border-strong);
    color: var(--color-text-strong);
}

.comment-form__submit {
    display: flex;
    justify-content: flex-end;
    margin: 0;
}

.comment-form__login {
    margin: 0;
    color: var(--color-text-muted);
}

/* ============ Not found ============ */
/*
 * The 404 fills whatever is left between header and footer, so the two stay
 * pinned to the edges of the viewport on a page with three lines of copy.
 * The shell is already a column flex with min-height 100vh; the <main> just
 * has to pass that stretch down. :has() keeps this to the one page that needs
 * it without a body class in a selector; where it is unsupported the footer
 * still sits at the bottom, the copy simply is not centred vertically.
 */
.page__content:has(.lost) {
    display: flex;
    flex-direction: column;
}

.lost {
    position: relative;
    isolation: isolate;
    display: flex;
    flex: 1 0 auto;
    align-items: center;
    /* Tall enough for the creature to be the page, not an illustration in it. */
    min-height: min(78vh, 46rem);
    padding-block: var(--space-2xl);
    overflow: hidden;
}

.lost__art,
.lost__veil,
.lost__code {
    position: absolute;
    inset: 0;
    z-index: -1;
}

/*
 * Full bleed, so the picture has no edges to show: its studio backdrop runs
 * to the section's own edges and the veil below fades those into the canvas.
 * Mirrored, because the creature stands on the left of the frame and the
 * copy needs that side - flipped, it faces the words instead of the void.
 */
.lost__art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 38% 45%;
    transform: scaleX(-1);
}

@media (prefers-reduced-motion: no-preference) {
    .lost__art {
        animation: lost-drift 10s ease-in-out infinite alternate;
    }
}

/* A slow surface swell, not a bob: the figure is a sea creature at rest.
   The mirror is part of every keyframe, or the animation would unflip it. */
@keyframes lost-drift {
    from {
        transform: scaleX(-1) translateY(1.2%) scale(1.02);
    }

    to {
        transform: scaleX(-1) translateY(-1.2%) scale(1.04);
    }
}

/*
 * Fades the picture into the page along the top and bottom, and darkens the
 * side the copy stands on. color-mix is what lets the canvas token take an
 * alpha without a second, hard-coded colour.
 */
.lost__veil {
    background:
        linear-gradient(180deg, var(--color-canvas) 0%, transparent 22%, transparent 74%, var(--color-canvas) 100%),
        linear-gradient(90deg,
            color-mix(in srgb, var(--color-canvas) 90%, transparent) 0%,
            color-mix(in srgb, var(--color-canvas) 62%, transparent) 42%,
            transparent 68%);
}

/*
 * The number stands over the creature as an outline only: filled, it would
 * fight the art for the eye. The stroke is set in the muted text colour, not
 * a border tone - a border-grey hairline at half opacity vanished into the
 * backdrop, most of all on a phone where the number sits over the picture.
 */
.lost__code {
    display: grid;
    place-items: center;
    justify-content: end;
    padding-inline-end: 4vw;
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: clamp(10rem, 30vw, 26rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    opacity: 0.8;
    user-select: none;
}

@supports (-webkit-text-stroke: 1px currentColor) {
    .lost__code {
        -webkit-text-stroke: 2px var(--color-text-muted);
        color: transparent;
        filter: drop-shadow(0 2px 18px rgba(0, 0, 0, 0.8));
    }
}

.lost__inner {
    display: grid;
}

.lost__body {
    display: grid;
    gap: var(--space-s);
    justify-items: start;
    max-width: 34rem;
}

.lost__badge {
    margin: 0;
    padding: var(--space-3xs) var(--space-xs);
    border: var(--border-thin) solid var(--color-accent);
    border-radius: var(--radius-s);
    color: var(--color-accent);
    font-family: var(--font-heading);
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
}

.lost__title {
    margin: 0;
    color: var(--color-heading);
    background-image: var(--gradient-heading);
    font-size: clamp(var(--text-3xl), 5vw, var(--text-hero));
    line-height: 0.95;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    /* Same reason as the hero: clipped glyphs need a filter shadow, not text-shadow. */
    filter: drop-shadow(0 4px 30px rgba(0, 0, 0, 0.7));
}

.lost__lead {
    margin: 0;
    color: var(--color-text-strong);
    font-size: var(--text-l);
    line-height: var(--leading-reading);
}

.lost__path {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--text-s);
    overflow-wrap: anywhere;
}

.lost__url {
    padding: 0 0.35em;
    background: var(--color-surface-sunken);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-s);
    color: var(--color-text);
}

.lost__links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-xs);
}

/*
 * Narrow screens: the creature takes the upper half, the copy the lower, so
 * the veil turns by ninety degrees - clear on top, canvas at the foot.
 */
@media (max-width: 62rem) {
    .lost {
        align-items: end;
        min-height: min(88vh, 52rem);
    }

    .lost__art {
        object-position: 50% 20%;
    }

    .lost__veil {
        background:
            linear-gradient(180deg,
                var(--color-canvas) 0%,
                transparent 14%,
                transparent 42%,
                color-mix(in srgb, var(--color-canvas) 88%, transparent) 66%,
                var(--color-canvas) 100%);
    }

    .lost__code {
        align-content: start;
        justify-content: center;
        padding: var(--space-l) 0 0;
        font-size: clamp(9rem, 44vw, 16rem);
        -webkit-text-stroke-width: 1.5px;
    }

    .lost__body {
        justify-items: center;
        max-width: none;
        text-align: center;
    }

    .lost__links {
        justify-content: center;
    }
}

/* ============ Notice ============ */
/* One line of feedback above a form. The coloured edge is the only thing that
   changes between kinds: a tinted background would compete with the fields. */
.notice {
    margin: 0 0 var(--space-m);
    padding: var(--space-xs) var(--space-s);
    border: var(--border-thin) solid var(--color-border);
    border-inline-start: 3px solid var(--color-info);
    border-radius: var(--radius-m);
    background: color-mix(in srgb, var(--color-surface-sunken) 80%, transparent);
    color: var(--color-text);
    font-size: var(--text-s);
}

.notice--success {
    border-inline-start-color: var(--color-success);
}

.notice--error {
    border-inline-start-color: var(--color-danger);
}

.notice__text {
    margin: 0;
}

.notice__text + .notice__text {
    margin-top: var(--space-3xs);
}

/* ============ Contact form ============ */
/*
 * The Contact Form 7 form on the contacts page. The form template carries these
 * classes itself (`html_class`, `class:`); the `.wpcf7*` rules restyle what the
 * plugin prints around it - its sheet colours them in light-theme hex, at
 * `.wpcf7 form …` strength, hence the extra class.
 */
.contact-form {
    display: grid;
    gap: var(--space-s);
    max-width: 36rem;
    font-size: var(--text-m);
    line-height: var(--leading-normal);
}

.contact-form__row {
    display: grid;
    gap: var(--space-3xs);
}

.contact-form__label {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.contact-form__field {
    padding: var(--space-xs) var(--space-s);
    color: var(--color-text-strong);
}

.contact-form__field:focus {
    border-color: var(--color-accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.contact-form__actions {
    display: flex;
    align-items: center;
    gap: var(--space-s);
}

.contact-form .wpcf7-not-valid-tip {
    margin-top: var(--space-3xs);
    color: var(--color-danger);
    font-size: var(--text-xs);
}

.contact-form .wpcf7-not-valid {
    border-color: var(--color-danger);
}

.wpcf7 .contact-form .wpcf7-response-output {
    margin: 0;
    padding: var(--space-xs) var(--space-s);
    border: var(--border-thin) solid var(--color-border);
    border-inline-start: 3px solid var(--color-info);
    border-radius: var(--radius-m);
    background: color-mix(in srgb, var(--color-surface-sunken) 80%, transparent);
    color: var(--color-text);
    font-size: var(--text-s);
}

.wpcf7 .contact-form.sent .wpcf7-response-output {
    border-color: var(--color-border);
    border-inline-start-color: var(--color-success);
}

.wpcf7 .contact-form.failed .wpcf7-response-output,
.wpcf7 .contact-form.aborted .wpcf7-response-output,
.wpcf7 .contact-form.spam .wpcf7-response-output,
.wpcf7 .contact-form.invalid .wpcf7-response-output {
    border-color: var(--color-border);
    border-inline-start-color: var(--color-danger);
}

/* ============ Auth screens ============ */
/*
 * Sign-in, registration and the password screens share one stage: the hall of
 * the Fates behind, the pitch on the left, the framed panel on the right. The
 * shell is stretched the same way as the 404 so the footer stays at the
 * bottom even when the form is short.
 */
.page--auth .page__content {
    display: flex;
    flex-direction: column;
}

.auth {
    position: relative;
    isolation: isolate;
    display: flex;
    flex: 1 0 auto;
    align-items: center;
    padding-block: var(--space-2xl);
    overflow: hidden;
}

.auth__art,
.auth__veil {
    position: absolute;
    inset: 0;
    z-index: -1;
}

/* Full bleed and dimmed by the veil rather than by opacity: opacity would
   grey the gold threads, the veil keeps their colour and lowers their light. */
.auth__art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 42%;
}

/*
 * Three layers: a flat dim over everything, a darker pool where the panel
 * stands so the fields do not fight the threads, and a fade into the canvas
 * along the top and bottom so the stage joins the header and footer.
 */
.auth__veil {
    background:
        linear-gradient(180deg, var(--color-canvas) 0%, transparent 18%, transparent 82%, var(--color-canvas) 100%),
        radial-gradient(ellipse 60% 80% at 72% 50%,
            color-mix(in srgb, var(--color-canvas) 55%, transparent) 0%,
            transparent 70%),
        color-mix(in srgb, var(--color-canvas) 58%, transparent);
}

.auth__inner {
    display: grid;
    gap: var(--space-xl);
    align-items: center;
}

@media (min-width: 62rem) {
    .auth__inner {
        grid-template-columns: minmax(0, 1fr) minmax(24rem, 27rem);
        gap: var(--space-3xl);
    }
}

/* The pitch is for a screen with room beside the form; on a phone it would
   only push the fields under the fold, and the panel carries its own title. */
.auth__intro {
    display: none;
}

@media (min-width: 62rem) {
    .auth__intro {
        display: block;
        max-width: 34rem;
    }
}

.auth__eyebrow {
    margin: 0 0 var(--space-xs);
    color: var(--color-accent);
    font-family: var(--font-heading);
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
}

.auth__pitch {
    margin: 0 0 var(--space-m);
    color: var(--color-heading);
    background-image: var(--gradient-heading);
    font-family: var(--font-heading);
    font-size: clamp(var(--text-3xl), 4.2vw, 4rem);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    filter: drop-shadow(0 4px 30px rgba(0, 0, 0, 0.7));
}

.auth__text {
    margin: 0 0 var(--space-m);
    color: var(--color-text);
    font-size: var(--text-l);
    line-height: var(--leading-normal);
}

.auth__perks {
    display: grid;
    gap: var(--space-2xs);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* A short rule for a bullet, in the accent: the meander's own vocabulary. */
.auth__perk {
    position: relative;
    padding-inline-start: var(--space-m);
    color: var(--color-text-reading);
}

.auth__perk::before {
    content: '';
    position: absolute;
    top: 0.75em;
    left: 0;
    width: 0.875rem;
    height: 1px;
    background: var(--color-accent);
}

/*
 * The panel is a card that lets the art through: near-opaque surface with a
 * blur behind it, the meander on its corners. The inset is a touch larger
 * than the default so the corner rings sit clear of the thicker border.
 */
.auth__panel {
    --ornament-inset: 9px;

    position: relative;
    padding: var(--space-xl) var(--space-l);
    background: color-mix(in srgb, var(--color-surface) 90%, transparent);
    border: var(--border-thin) solid var(--color-border-strong);
    box-shadow: var(--shadow-m);
    backdrop-filter: blur(14px);
}

@media (max-width: 40rem) {
    .auth__panel {
        padding: var(--space-l) var(--space-m);
    }
}

.auth__title {
    margin: 0 0 var(--space-m);
    color: var(--color-heading);
    background-image: var(--gradient-heading);
    font-size: var(--text-2xl);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-wide);
    text-align: center;
    text-transform: uppercase;
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
    .auth__pitch,
    .auth__title {
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }
}

.auth__lead,
.auth__closed {
    margin: 0 0 var(--space-m);
    color: var(--color-text);
    font-size: var(--text-s);
    line-height: var(--leading-normal);
}

.auth__closed {
    text-align: center;
}

.auth__switch {
    margin: var(--space-m) 0 0;
    color: var(--color-text-muted);
    font-size: var(--text-s);
    text-align: center;
}

.auth__switch-link {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth__switch-link:hover,
.auth__switch-link:focus-visible {
    color: var(--color-accent-hover);
}

.auth__switch-button {
    width: 100%;
}

/* ============ Auth form ============ */
.auth-form {
    display: grid;
    gap: var(--space-s);
}

.auth-form__row {
    display: grid;
    gap: var(--space-3xs);
}

.auth-form__label {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

/* The base sheet frames the field; this only sizes it for a form that is the
   whole page rather than a widget, and lets a hint of the art through it. */
.auth-form__field {
    padding: var(--space-xs) var(--space-s);
    background: color-mix(in srgb, var(--color-surface-sunken) 85%, transparent);
    color: var(--color-text-strong);
}

.auth-form__field:focus {
    border-color: var(--color-accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

/* An autofilled field: the inset fill from base.css plus this field's focus ring - one shadow would drop the other. */
.auth-form__field:-webkit-autofill {
    box-shadow: 0 0 0 1000px var(--color-surface-sunken) inset;
}

.auth-form__field:-webkit-autofill:focus {
    box-shadow: 0 0 0 1000px var(--color-surface-sunken) inset, 0 0 0 3px var(--color-accent-soft);
}

/* A label that cautions rather than names: the vote below it replaces one
   that is already counted. */
.auth-form__label--warning {
    color: var(--color-warning);
}

.auth-form__hint {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.auth-form__secret {
    position: relative;
}

.auth-form__secret .auth-form__field {
    padding-inline-end: 3rem;
}

.auth-form__reveal {
    position: absolute;
    top: 50%;
    right: var(--space-2xs);
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: var(--radius-s);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    translate: 0 -50%;
    transition: color var(--duration) var(--ease);
}

.auth-form__reveal:hover,
.auth-form__reveal:focus-visible,
.auth-form__reveal.is-active {
    color: var(--color-accent);
}

.auth-form__options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2xs) var(--space-s);
    font-size: var(--text-s);
}

.auth-form__check {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    color: var(--color-text);
    cursor: pointer;
}

.auth-form__checkbox {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--color-accent);
}

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

.auth-form__aside:hover,
.auth-form__aside:focus-visible {
    color: var(--color-accent);
}

.auth-form__submit {
    width: 100%;
    margin-top: var(--space-2xs);
}

/* Off-screen, not display:none: a bot that reads computed styles would skip
   a hidden field, one that only parses the markup fills it in. */
.auth-form__trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ============ Profile ============ */
/*
 * One column about the member (the card), one with what they wrote (tabs and
 * the screen under them). No panel around either: the card is a column of
 * text, and the lists below are rows behind hairlines - a frame around every
 * block made the page a stack of boxes.
 */
.profile {
    display: grid;
    gap: var(--space-xl);
    align-items: start;
}

@media (min-width: 56rem) {
    .profile {
        grid-template-columns: 17.5rem minmax(0, 1fr);
    }
}

/* A container, so the screens in it size from the column, not from the window:
   the edit form's two columns need the room the card now takes. */
.profile__main {
    display: grid;
    gap: var(--space-l);
    align-content: start;
    min-width: 0;
    container-type: inline-size;
}

.profile-card {
    display: grid;
    gap: var(--space-m);
    align-content: start;
    min-width: 0;
    font-size: var(--text-s);
}

/* 8rem: the avatars carried over from uCoz are about 100px, and stretched
   wider they went soft. */
.profile-card__portrait {
    position: relative;
    width: 8rem;
    aspect-ratio: 1;
}

/* In the column, the portrait stands centred over the text; as the header on
   a narrow screen it sits beside the name instead. */
@media (min-width: 56rem) {
    .profile-card__portrait {
        justify-self: center;
    }
}

.profile-card__avatar {
    width: 100%;
    height: 100%;
    border: var(--border-thin) solid var(--color-border-strong);
    border-radius: 50%;
    object-fit: cover;
}

/* "Here now": the same green as the dot on a forum post's avatar. */
.profile-card__online {
    position: absolute;
    right: 6%;
    bottom: 6%;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--color-success);
    box-shadow: 0 0 0 4px var(--color-canvas);
}

.profile-card__who {
    display: grid;
    gap: var(--space-2xs);
    min-width: 0;
}

/* The name and the chevron that opens the names before it. */
.profile-card__title {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    min-width: 0;
}

.profile-card__name {
    margin: 0;
    color: var(--color-heading);
    font-size: var(--text-2xl);
    line-height: var(--leading-tight);
    /* Nicknames run long and some are one unbroken string. */
    overflow-wrap: anywhere;
}

.profile-card__sub {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3xs) var(--space-xs);
    margin: 0;
    color: var(--color-text-muted);
}

/* The group's colour by its kind, as under a forum post's avatar. */
.profile-card__role--staff {
    color: var(--color-warning);
}

.profile-card__role--guild {
    color: var(--color-accent);
}

.profile-card__role--blocked {
    color: var(--color-danger);
    font-weight: 700;
}

.profile-card__about {
    margin: 0;
    color: var(--color-text-strong);
    overflow-wrap: anywhere;
}

.profile-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
}

.profile-card__actions .button {
    flex: 1 1 auto;
    justify-content: center;
    white-space: nowrap;
}

.profile-card__scores {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2xs);
}

.profile-card__scores--one {
    grid-template-columns: minmax(0, 1fr);
}

/* Reputation and warnings: the two numbers about the member rather than by
   them, each a door to its own screen. */
.profile-score {
    display: grid;
    gap: var(--space-3xs);
    padding: var(--space-xs) var(--space-s);
    background: var(--color-surface);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-m);
    color: inherit;
}

.profile-score:hover,
.profile-score:focus-visible,
.profile-score--current {
    border-color: var(--color-border-accent);
    text-decoration: none;
}

.profile-score__value {
    display: inline-flex;
    align-items: center;
    color: var(--color-text-strong);
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.profile-score--alert .profile-score__value,
.profile-score--alert .profile-score__label {
    color: var(--color-warning);
}

.profile-score__label {
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
}

.profile-card__facts {
    display: grid;
    gap: var(--space-2xs);
    margin: 0;
    padding: 0;
    list-style: none;
}

.profile-card__fact {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    min-width: 0;
    color: var(--color-text);
    overflow-wrap: anywhere;
}

.profile-card__icon {
    display: inline-flex;
    justify-content: center;
    width: 1rem;
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.profile-card__icon--flag .flag {
    height: 0.75rem;
}

.profile-card__now {
    color: var(--color-success);
}

.profile-card__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3xs);
    color: inherit;
}

.profile-card__link:hover,
.profile-card__link:focus-visible {
    color: var(--color-accent);
    text-decoration: none;
}

.profile-card__platforms {
    margin: 0;
    gap: var(--space-xs);
}

/* Where to find the member and the signature: each behind a rule with its caption. */
.profile-card__group,
.profile-card__staff {
    display: grid;
    gap: var(--space-2xs);
    min-width: 0;
    padding-top: var(--space-s);
    border-top: var(--border-thin) solid var(--color-border);
}

.profile-card__caption {
    margin: 0;
    color: var(--color-text-muted);
    font-family: inherit;
    font-size: var(--text-3xs);
    font-weight: 500;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.profile-card__signature {
    color: var(--color-text-muted);
    overflow-wrap: anywhere;
}

.profile-card__staff-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    color: var(--color-text-muted);
    cursor: pointer;
    list-style: none;
}

.profile-card__staff-toggle::-webkit-details-marker {
    display: none;
}

.profile-card__staff-toggle:hover {
    color: var(--color-accent);
}

/* The chevron last in the row points down when the box is open. */
.profile-card__staff-toggle .icon:last-child {
    margin-left: auto;
    transition: rotate 0.15s ease;
}

.profile-card__staff[open] .profile-card__staff-toggle .icon:last-child {
    rotate: 180deg;
}

.profile-staff {
    margin-top: var(--space-xs);
}

/*
 * Narrower than the two columns, the card is the page's header: the portrait
 * beside the name, everything else under them across the full width, and the
 * facts as one wrapping line rather than a column of short ones.
 */
@media (max-width: 55.99rem) {
    .profile-card {
        grid-template-columns: 5.5rem minmax(0, 1fr);
        column-gap: var(--space-m);
    }

    .profile-card__portrait {
        width: 5.5rem;
    }

    .profile-card__online {
        right: 2%;
        bottom: 2%;
        width: 0.875rem;
        height: 0.875rem;
        box-shadow: 0 0 0 3px var(--color-canvas);
    }

    .profile-card__who {
        align-self: center;
    }

    .profile-card > :not(.profile-card__portrait, .profile-card__who) {
        grid-column: 1 / -1;
    }

    .profile-card__actions .button {
        flex: 0 1 auto;
    }

    .profile-card__scores {
        grid-template-columns: repeat(2, minmax(0, 12rem));
    }

    /* The facts and where to find: two even columns, not a list as long as
       the card is wide nor a wrapping line that leaves them ragged. */
    .profile-card__facts,
    .profile-card .contacts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--space-m);
    }
}

/*
 * Tabs: the overview and each kind of writing, its count beside it. They
 * scroll sideways on a phone instead of wrapping into a second row.
 */
.profile-tabs {
    display: flex;
    gap: var(--space-3xs);
    border-bottom: var(--border-thin) solid var(--color-border);
    overflow-x: auto;
    scrollbar-width: none;
}

.profile-tabs__tab {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    margin-bottom: -1px;
    padding: var(--space-xs) var(--space-s);
    border-bottom: 2px solid transparent;
    color: var(--color-text);
    font-size: var(--text-s);
    white-space: nowrap;
}

.profile-tabs__tab:hover,
.profile-tabs__tab:focus-visible {
    color: var(--color-heading);
    text-decoration: none;
}

.profile-tabs__tab--current {
    border-bottom-color: var(--color-accent);
    color: var(--color-heading);
}

.profile-tabs__count {
    min-width: 1.5rem;
    padding: 0 var(--space-2xs);
    border-radius: 999px;
    background: var(--color-surface-hover);
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
    font-variant-numeric: tabular-nums;
    line-height: 1.375rem;
    text-align: center;
}

/* The overview's one feed of topics, replies and comments. */
.profile-feed {
    margin: 0;
    padding: 0;
    list-style: none;
}

.profile-feed__item {
    display: grid;
    gap: var(--space-3xs);
    min-width: 0;
    padding: var(--space-s) 0;
    border-bottom: var(--border-thin) solid var(--color-border);
}

.profile-feed__item:first-child {
    padding-top: 0;
}

.profile-feed__meta {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
}

.profile-feed__title {
    color: var(--color-text-strong);
    font-weight: 500;
    overflow-wrap: anywhere;
}

.profile-feed__title:hover,
.profile-feed__title:focus-visible {
    color: var(--color-accent);
    text-decoration: none;
}

/* Two lines at most: the row says what it is, the entry itself says the rest. */
.profile-feed__excerpt {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--color-text-reading);
    font-size: var(--text-s);
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

/* The edit form's two columns, by the column's width rather than the window's. */
@container (max-width: 52rem) {
    .profile-form__columns {
        grid-template-columns: 1fr;
    }

    .profile-form__column + .profile-form__column {
        padding-inline-start: 0;
        border-inline-start: 0;
    }
}

/*
 * Former names, the way Steam shows them: a chevron beside the name, a panel
 * under it. A <details> element, so it opens with no script at all; account.js
 * only adds what <details> has no notion of - closing on Escape or a click
 * outside.
 */
.former-names {
    position: relative;
    /* The chevron sits on the name's line, not on the panel's. */
    align-self: center;
}

.former-names__toggle {
    display: inline-flex;
    padding: var(--space-3xs);
    border-radius: var(--radius-s);
    color: var(--color-text-muted);
    cursor: pointer;
    list-style: none;
}

.former-names__toggle::-webkit-details-marker {
    display: none;
}

.former-names__toggle:hover,
.former-names[open] .former-names__toggle {
    color: var(--color-accent);
}

.former-names__menu {
    position: absolute;
    top: calc(100% + var(--space-3xs));
    left: 0;
    z-index: 60;
    min-width: 14rem;
    max-width: min(20rem, 70vw);
    padding: var(--space-2xs);
    background: var(--color-surface-raised);
    border: var(--border-thin) solid var(--color-border-strong);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-m);
}

.former-names__empty {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--text-s);
}

.former-names__caption {
    margin: 0 0 var(--space-3xs);
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.former-names__list {
    display: grid;
    gap: var(--space-3xs);
    margin: 0;
    padding: 0;
    list-style: none;
}

.former-names__was {
    display: block;
    color: var(--color-text);
    font-size: var(--text-s);
    overflow-wrap: anywhere;
}

.former-names__when {
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
}

/*
 * Platforms: a row of marks, no labels. The name of each is in the title and
 * repeated for a screen reader, because a logo is not a word. Printed in the
 * profile header and, smaller, under the avatar of a forum post - which is why
 * it lives here and not in forum.css.
 */
.platforms {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
    margin: var(--space-2xs) 0 0;
    padding: 0;
    list-style: none;
}

.platforms__item {
    display: inline-flex;
    color: var(--color-text-muted);
}

/* A mark with an account behind it leads to it. */
.platforms__link {
    display: inline-flex;
    color: inherit;
}

.platforms__link:hover,
.platforms__link:focus-visible {
    color: var(--color-accent);
}

.platforms--compact {
    justify-content: center;
    gap: var(--space-3xs);
}

/*
 * Reputation: the number, the form under it and the history. The number is
 * printed in three places - the profile header, the reputation screen and the
 * author of a forum post - so it lives here rather than in forum.css.
 */
.reputation-score {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.reputation-score--up {
    color: var(--color-success);
}

.reputation-score--down {
    color: var(--color-danger);
}

/*
 * The popup the forum opens on the reputation number. A <dialog>, so the
 * browser handles the backdrop, Escape and the focus trap; the script only
 * fills it. Without the script the number is still a link to the profile.
 */
.popup {
    width: min(32rem, calc(100vw - 2 * var(--space-m)));
    max-height: min(32rem, 80vh);
    padding: 0;
    background: var(--color-surface-raised);
    color: var(--color-text);
    border: var(--border-thin) solid var(--color-border-strong);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-m);
    overflow: hidden;
    /* A column: the name and the form at the top, the footer at the bottom,
       and only the history between them moves. */
    display: flex;
    flex-direction: column;
    /* Opens into place rather than appearing: the box and the backdrop fade
       together, and the dialog is already its full height, so filling it
       scrolls the inside instead of resizing the window under the cursor. */
    opacity: 0;
    transform: translateY(0.5rem);
    transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.popup.is-open {
    opacity: 1;
    transform: none;
}

.popup::backdrop {
    background: rgb(0 0 0 / 55%);
    opacity: 0;
    transition: opacity var(--duration) var(--ease);
}

.popup.is-open::backdrop {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .popup,
    .popup::backdrop {
        transition: none;
    }
}

/* The close button floats over the box: a row of its own cost a line of
   height at the top of every popup. */
.popup__close-form {
    position: absolute;
    top: var(--space-2xs);
    right: var(--space-2xs);
    z-index: 1;
}

.popup__close {
    display: inline-flex;
    padding: var(--space-3xs);
    background: none;
    border: 0;
    border-radius: var(--radius-s);
    color: var(--color-text-muted);
    font-size: var(--text-m);
    line-height: 1;
    cursor: pointer;
}

.popup__body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    padding: var(--space-s);
    overflow: hidden;
}

.popup__loading {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 12rem;
    margin: 0;
    color: var(--color-text-muted);
}

.popup__close:hover,
.popup__close:focus-visible {
    color: var(--color-accent);
}

.popup__error {
    margin: 0 0 var(--space-2xs);
    color: var(--color-danger);
    font-size: var(--text-s);
}

.reputation-box {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.reputation-box__score {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2xs);
    margin: 0;
    padding-right: var(--space-l);
    color: var(--color-heading);
    font-family: var(--font-heading);
    font-size: var(--text-s);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.reputation-box__meta {
    margin: var(--space-3xs) 0 0;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

/*
 * A popup is read in a glance, so everything in it is a step smaller than on
 * the screen of its own: the field, the buttons and the lines of the history.
 */
.reputation-box .reputation-form {
    margin-top: var(--space-xs);
    padding-top: var(--space-xs);
    border-top: var(--border-thin) solid var(--color-border);
}

.reputation-box .reputation-form__text {
    min-height: 3.5rem;
    padding: var(--space-2xs);
    font-size: var(--text-s);
}

.reputation-box .button {
    padding: var(--space-3xs) var(--space-xs);
    font-size: var(--text-2xs);
}

/* The only part that scrolls. `min-height: 0` because a flex child refuses
   to shrink past its content without it, and the list would push the footer
   out of the dialog instead of scrolling. */
.reputation-box .reputation-list {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: var(--space-xs);
    padding-top: var(--space-xs);
    border-top: var(--border-thin) solid var(--color-border);
    gap: var(--space-2xs);
    overflow-y: auto;
    /* Room for the scrollbar, so the trash mark is not under it, and a last
       line of air: the last vote drops its own rule and padding and would
       otherwise end against the footer. */
    padding-right: var(--space-2xs);
    padding-bottom: var(--space-xs);
}

.reputation-box .reputation-list__item {
    gap: var(--space-3xs) var(--space-2xs);
    padding-bottom: var(--space-2xs);
}

.reputation-box .reputation-list__text {
    font-size: var(--text-s);
}

.reputation-box .profile-list__empty {
    margin: var(--space-xs) 0 0;
    font-size: var(--text-s);
}

/* Stands still under the list, with a rule of its own. */
.reputation-box__more {
    flex: none;
    margin: 0;
    padding-top: var(--space-xs);
    border-top: var(--border-thin) solid var(--color-border);
    font-size: var(--text-xs);
}

.reputation-box__head {
    flex: none;
}

.reputation-form {
    display: grid;
    gap: var(--space-2xs);
    margin-top: var(--space-s);
}

.reputation-form__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2xs);
}

.reputation-form__hint {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.reputation-list {
    display: grid;
    gap: var(--space-s);
    margin: 0;
    padding: 0;
    list-style: none;
}

.reputation-list__item {
    display: grid;
    grid-template-columns: 2.5rem 1fr auto;
    gap: var(--space-3xs) var(--space-2xs);
    align-items: start;
    padding-bottom: var(--space-xs);
    border-bottom: var(--border-thin) solid var(--color-border);
}

.reputation-list__item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.reputation-list__mark {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.reputation-list__mark--up {
    color: var(--color-success);
}

.reputation-list__mark--down {
    color: var(--color-danger);
}

.reputation-list__body {
    min-width: 0;
}

.reputation-list__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2xs);
    margin: 0 0 var(--space-3xs);
}

.reputation-list__author {
    font-size: var(--text-s);
    font-weight: 700;
}

/* The row is a line of text, not a toolbar: the button is a mark beside it. */
.reputation-list__trash {
    display: inline-flex;
    padding: var(--space-3xs);
    background: none;
    border: 0;
    border-radius: var(--radius-s);
    color: var(--color-text-muted);
    cursor: pointer;
}

.reputation-list__trash:hover,
.reputation-list__trash:focus-visible {
    color: var(--color-danger);
}

.reputation-list__date,
.reputation-list__source {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.reputation-list__text {
    margin: 0;
    color: var(--color-text-reading);
    font-size: var(--text-s);
    overflow-wrap: anywhere;
}

/*
 * Warnings. The scale is the point of the screen: a number out of five says
 * how far it is to a block, and the lit steps say it without reading.
 */
.warn-level {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.warn-level--on {
    color: var(--color-warning);
}

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

.warn-scale {
    display: flex;
    gap: var(--space-3xs);
    margin: 0 0 var(--space-2xs);
    padding: 0;
    list-style: none;
}

.warn-scale__step {
    flex: 1 1 0;
    height: 0.35rem;
    background: var(--color-border);
    border-radius: var(--radius-s);
}

.warn-scale__step--lit {
    background: var(--color-warning);
}

/* The block itself, stated rather than left to the group name. */
.warn-state {
    display: flex;
    align-items: baseline;
    gap: var(--space-2xs);
    margin: 0 0 var(--space-xs);
    color: var(--color-danger);
    font-size: var(--text-s);
}

.warn-state__text {
    color: var(--color-text-reading);
}

.warn-actions {
    display: grid;
    gap: var(--space-m);
    margin-top: var(--space-s);
    padding-top: var(--space-s);
    border-top: var(--border-thin) solid var(--color-border);
}

.warn-actions__form {
    display: grid;
    gap: var(--space-2xs);
}

.warn-actions__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2xs);
}

.warn-actions__term {
    width: auto;
}

.warn-actions__hint {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.warn-list {
    display: grid;
    gap: var(--space-s);
    margin: 0;
    padding: 0;
    list-style: none;
}

.warn-list__item {
    display: grid;
    grid-template-columns: 8.5rem 1fr;
    gap: var(--space-3xs) var(--space-2xs);
    align-items: start;
    padding-bottom: var(--space-xs);
    border-bottom: var(--border-thin) solid var(--color-border);
}

.warn-list__item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.warn-list__kind {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.warn-list__kind--warn {
    color: var(--color-warning);
}

.warn-list__kind--block {
    color: var(--color-danger);
}

/* Taking something back reads as relief, so both liftings share one colour. */
.warn-list__kind--lift {
    color: var(--color-success);
}

.warn-list__body {
    min-width: 0;
}

.warn-list__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2xs);
    margin: 0 0 var(--space-3xs);
}

.warn-list__author {
    font-size: var(--text-s);
    font-weight: 700;
}

.warn-list__date,
.warn-list__term {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.warn-list__text {
    margin: 0;
    color: var(--color-text-reading);
    font-size: var(--text-s);
    overflow-wrap: anywhere;
}

@media (max-width: 36rem) {
    .warn-list__item {
        grid-template-columns: 1fr;
    }
}

/*
 * The same warnings in the forum's popup. A column: the scale, the state and
 * the moderator's forms stand still at the top, the footer at the bottom, and
 * only the log between them moves.
 */
.warn-box {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.warn-box__head {
    flex: none;
}

.warn-box__score {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2xs);
    margin: 0 0 var(--space-2xs);
    padding-right: var(--space-l);
    color: var(--color-heading);
    font-family: var(--font-heading);
    font-size: var(--text-s);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.warn-box .warn-state {
    margin-bottom: 0;
    font-size: var(--text-xs);
}

/* A popup is read in a glance: the forms lose their hints (the rules are
   written out on the screen of their own) and stand a step smaller. */
.warn-box .warn-actions {
    gap: var(--space-xs);
    margin-top: var(--space-xs);
    padding-top: var(--space-xs);
}

.warn-box .warn-actions__hint {
    display: none;
}

.warn-box .warn-actions__form {
    gap: var(--space-3xs);
}

.warn-box .auth-form__field {
    min-height: 0;
    padding: var(--space-3xs) var(--space-2xs);
    font-size: var(--text-s);
}

.warn-box .auth-form__label {
    font-size: var(--text-2xs);
}

.warn-box .button {
    padding: var(--space-3xs) var(--space-xs);
    font-size: var(--text-2xs);
}

/* The only part that scrolls. `min-height: 0` because a flex child refuses to
   shrink past its content without it, and the log would push the footer out of
   the dialog instead of scrolling. */
.warn-box .warn-list {
    flex: 1 1 auto;
    min-height: 0;
    gap: var(--space-2xs);
    margin-top: var(--space-xs);
    padding-top: var(--space-xs);
    border-top: var(--border-thin) solid var(--color-border);
    overflow-y: auto;
    /* Room for the scrollbar, and a last line of air: the last entry drops its
       own rule and padding and would otherwise end against the footer. */
    padding-right: var(--space-2xs);
    padding-bottom: var(--space-xs);
}

.warn-box .warn-list__item {
    grid-template-columns: 1fr;
    gap: var(--space-3xs);
    padding-bottom: var(--space-2xs);
}

.warn-box .warn-list__text {
    font-size: var(--text-s);
}

.warn-box .profile-list__empty {
    margin: var(--space-xs) 0 0;
    font-size: var(--text-s);
}

/* Stands still under the log, with a rule of its own. */
.warn-box__more {
    flex: none;
    margin: 0;
    padding-top: var(--space-xs);
    border-top: var(--border-thin) solid var(--color-border);
    font-size: var(--text-xs);
}

/*
 * The information block (tq/notice): the frame the old forum's [info],
 * [moder], [admin] and [warn] drew with a script on the page. The colour is
 * the whole signal, so the frame is quiet - a tinted edge and a label - and
 * the text inside reads like the rest of the message.
 */
.notice-block {
    --notice-color: var(--color-info);
    margin: var(--space-s) 0;
    padding: var(--space-xs) var(--space-s);
    background: color-mix(in srgb, var(--notice-color) 8%, transparent);
    border-left: 3px solid var(--notice-color);
    border-radius: var(--radius-s);
}

.notice-block--warning {
    --notice-color: var(--color-warning);
}

.notice-block--moder {
    --notice-color: var(--color-success);
}

.notice-block--admin {
    --notice-color: var(--color-danger);
}

.notice-block__label {
    display: flex;
    align-items: center;
    gap: var(--space-3xs);
    margin: 0 0 var(--space-3xs);
    color: var(--notice-color);
    font-size: var(--text-2xs);
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

/* The last paragraph inside brings its own margin, and it would push the
   frame open at the bottom. */
.notice-block__body > *:last-child {
    margin-bottom: 0;
}

.notice-block__body > *:first-child {
    margin-top: 0;
}

/* Where to find a member outside the site: a mark and the handle beside it. */
.contacts {
    display: grid;
    gap: var(--space-3xs);
    margin: 0;
    padding: 0;
    list-style: none;
}

.contacts__item {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    min-width: 0;
}

.contacts__icon {
    display: inline-flex;
    color: var(--color-text-muted);
}

.contacts__value {
    font-size: var(--text-s);
    overflow-wrap: anywhere;
}

/*
 * The platform checkboxes in the profile form, on a grid rather than in a
 * wrapping row: the names differ in length ("PC" against "Nintendo Switch"),
 * and a row packed them two and four to a line with the boxes at random
 * offsets. Columns as wide as the longest name, as many as the panel holds.
 */
.platform-choice {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
    gap: var(--space-2xs) var(--space-s);
}

.platform-choice__option {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: var(--space-2xs);
    min-width: 0;
    color: var(--color-text);
    font-size: var(--text-s);
    cursor: pointer;
}

/* The mark keeps its own column so the names start on one line. */
.platform-choice__option .icon {
    color: var(--color-text-muted);
}

/* ============ Profile activity ============ */
.profile-activity {
    display: grid;
    gap: var(--space-l);
}

/* Same as `.layout > *`: a cell that may not be narrower than its content
   carries the widest line in it straight out to the edge of the page. */
.profile-activity > * {
    min-width: 0;
}

.profile-list {
    min-width: 0;
}

.profile-list__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-s);
    margin-bottom: var(--space-s);
    padding-bottom: var(--space-2xs);
    border-bottom: var(--border-thin) solid var(--color-border);
}

.profile-list__title {
    margin: 0;
    font-size: var(--text-m);
}

.profile-list__more {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3xs);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    white-space: nowrap;
}

.profile-list__more:hover,
.profile-list__more:focus-visible {
    color: var(--color-accent);
    text-decoration: none;
}

.profile-list__empty {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--text-s);
}

.profile-list__items {
    display: grid;
    gap: var(--space-s);
    margin: 0;
    padding: 0;
    list-style: none;
}

.profile-entry {
    display: grid;
    gap: var(--space-3xs);
}

.profile-entry + .profile-entry {
    padding-top: var(--space-s);
    border-top: var(--border-thin) solid var(--color-border);
}

.profile-entry__title {
    color: var(--color-text-strong);
    font-family: var(--font-heading);
    font-size: var(--text-m);
    font-weight: 700;
    /*
     * Titles and excerpts carry bare links from the forum, and a 64-character
     * URL is wider than a phone. `anywhere`, not `break-word`: both break the
     * line, but only `anywhere` lowers the element's minimum width, and it is
     * that minimum which a grid cell (min-width: auto) hands up to the column
     * - the text wrapped and the panel still stuck out past the screen.
     */
    overflow-wrap: anywhere;
}

.profile-entry__title:hover,
.profile-entry__title:focus-visible {
    color: var(--color-accent);
    text-decoration: none;
}

.profile-entry__excerpt {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--color-text-reading);
    font-size: var(--text-s);
    line-height: var(--leading-normal);
}

.profile-entry__time {
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
}

/*
 * Public or private, as a badge that is also the switch: the icon and word
 * say what the build is now, the title says what a press does.
 */
.build-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3xs);
    padding: var(--space-3xs) var(--space-2xs);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-s);
    background: var(--color-surface-sunken);
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    cursor: pointer;
}

.build-badge--private {
    border-color: var(--color-border-strong);
    color: var(--color-text-strong);
}

.build-badge:hover,
.build-badge:focus-visible {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.build-badge--danger:hover,
.build-badge--danger:focus-visible {
    border-color: var(--color-danger);
    color: var(--color-danger);
}

/* ============ Profile facts (the staff box) ============ */
/* Label above value rather than beside it: the values are names and dates of
   unpredictable length, and a two-column list of them never lines up. */
.profile-facts {
    display: grid;
    gap: var(--space-2xs);
    margin: 0;
}

.profile-facts__label {
    color: var(--color-text-muted);
    font-size: var(--text-3xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.profile-facts__value {
    margin: 0 0 var(--space-2xs);
    color: var(--color-text);
    font-size: var(--text-s);
    overflow-wrap: anywhere;
}

.profile-facts__code {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
}

/*
 * Address and flag on one line, centred against each other. The address is
 * monospaced and the flag is an emoji, so their boxes have different heights
 * and neither baseline nor `vertical-align` lines them up reliably - a row
 * that centres its items does.
 */
.profile-facts__value--ip {
    display: flex;
    align-items: center;
    gap: var(--space-3xs);
}

/*
 * The flag itself: an SVG from assets/img/flags, not an emoji (Windows has no
 * font for those and printed the two letters of the code instead). base.css
 * gives every img `display: block`, so one standing in a line of text says
 * otherwise; the hairline keeps a white flag - Japan, Finland - from bleeding
 * into the panel behind it.
 */
.flag {
    display: inline-block;
    /* Sized from the text beside it, not from the width the markup carries:
       at a fixed 18px the flag stood taller than the line it sits in, and it
       sits in lines of four different sizes (the address under an avatar, the
       facts of a profile, the console). The width follows the ratio. */
    width: auto;
    height: 0.8em;
    vertical-align: -0.08em;
    border-radius: 1px;
    box-shadow: 0 0 0 1px rgb(255 255 255 / 12%);
}

.profile-facts__flag {
    display: inline-flex;
    line-height: 1;
}

/* Beside an address the flag stands in for the country's name, which spelled
   out took two lines of a narrow panel - there the name is its title, and the
   cursor says so. Beside the name itself (the country a member picked) there
   is nothing to reveal. */
.profile-facts__flag[title] {
    cursor: help;
}

/*
 * The forum signature, wherever it prints: inside a post and on the profile.
 * It is one or two lines, and what people carried over from uCoz is a userbar
 * - a picture about 350x20. The cap keeps a stray full-size screenshot from
 * standing taller than the post it signs.
 */
.signature__image {
    display: inline-block;
    max-width: 100%;
    max-height: 5rem;
    width: auto;
    height: auto;
    vertical-align: middle;
    border-radius: var(--radius-s);
}

.signature__link {
    color: inherit;
}

.signature__link:hover,
.signature__link:focus-visible {
    color: var(--color-accent);
}

.profile-staff__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
    margin: var(--space-s) 0 0;
}

/* ============ Profile listing and edit ============ */
.profile-single,
.profile-edit {
    min-width: 0;
}

.profile-single__back {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs) var(--space-m);
    margin: 0 0 var(--space-s);
}

/* The arrow points forward in the icon set; here it leads back. */
.profile-single__back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3xs);
    color: var(--color-text-muted);
    font-size: var(--text-s);
}

.profile-single__back-link:hover,
.profile-single__back-link:focus-visible {
    color: var(--color-accent);
    text-decoration: none;
}

.profile-single__back-link .icon {
    rotate: 180deg;
}

/* No panel and no meander: like the rest of the profile, the form is the
   column's content, not a box inside it. */
.profile-form {
    display: grid;
    gap: var(--space-l);
}

/*
 * Two columns rather than one strip of eleven controls: in a single column the
 * panel was twice as tall as the screen with half its width empty, and the
 * save button never showed up with the fields it saves.
 *
 * Both columns are grid items, so they stretch to the taller one on their own;
 * the rule between them is drawn on the second column rather than in the gap,
 * because a gap cannot carry a line.
 */
.profile-form__columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-l);
}

.profile-form__column {
    display: grid;
    gap: var(--space-l);
    align-content: start;
    min-width: 0;
}

.profile-form__column + .profile-form__column {
    padding-inline-start: var(--space-l);
    border-inline-start: var(--border-thin) solid var(--color-border);
}

/*
 * A fieldset's legend is not laid out by the fieldset: the browser lifts it out
 * and draws it over the top border, so the grid's row gap never applies between
 * the heading and the first thing under it - the only air there was the padding
 * the UA sheet puts on a fieldset, which `padding: 0` took away. The padding is
 * back, on the top edge alone, and it is what separates every group's heading
 * from its contents.
 */
.profile-form__group {
    display: grid;
    gap: var(--space-s);
    /* A fieldset will not shrink below its content by default (the UA sheet
       gives it `min-inline-size: min-content`): the file picker's row then
       pushed every field of the column out over the rule beside it. */
    min-inline-size: 0;
    margin: 0;
    padding: var(--space-xs) 0 0;
    border: 0;
}

.profile-form__legend {
    padding: 0;
    color: var(--color-heading);
    font-family: var(--font-heading);
    font-size: var(--text-m);
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

/* The hint of a group is not a row of it: it explains the heading, so it keeps
   the heading's own distance instead of a full row gap. */
.profile-form__note {
    margin-top: 0;
}

.profile-form__avatar {
    display: flex;
    align-items: flex-start;
    gap: var(--space-m);
}

.profile-form__avatar-image {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: var(--border-thin) solid var(--color-border-strong);
    flex-shrink: 0;
}

.profile-form__avatar-controls {
    display: grid;
    gap: var(--space-2xs);
    min-width: 0;
}

.profile-form__file {
    max-width: 100%;
    color: var(--color-text-muted);
    font-size: var(--text-s);
}

.profile-form__textarea {
    resize: vertical;
    line-height: var(--leading-normal);
}

.profile-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

/* Two columns of labelled fields need about 26rem each; below that they are
   two cramped columns rather than one readable one. */
@media (max-width: 62rem) {
    .profile-form__columns {
        grid-template-columns: 1fr;
    }

    .profile-form__column + .profile-form__column {
        padding-inline-start: 0;
        border-inline-start: 0;
    }
}

@media (max-width: 40rem) {
    .profile-form__avatar {
        flex-direction: column;
    }
}

/* ============ Gallery ============ */
/*
 * Justified rows, the way photo sites tile: every picture in a row has the
 * same height and a width in proportion to its own shape, so each row runs
 * edge to edge without cropping. It is plain flexbox: a tile's basis and its
 * share of the leftover space are both proportional to its ratio, which keeps
 * the heights in a row equal whatever the gap.
 *
 * Columns (the previous layout) left every column ending at its own height -
 * a ragged bottom no amount of tuning removes.
 */
.gallery {
    --gallery-row: 13rem;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-s);
    margin-bottom: var(--space-l);
}

@media (max-width: 40rem) {
    .gallery {
        --gallery-row: 7rem;
        gap: var(--space-2xs);
    }
}

.tile {
    flex: var(--ratio, 1.3333) 1 calc(var(--ratio, 1.3333) * var(--gallery-row));
    min-width: 0;
}

.tile__link {
    position: relative;
    display: block;
    overflow: hidden;
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-m);
    background: var(--color-surface);
}

.tile__link:hover,
.tile__link:focus-visible {
    border-color: var(--color-accent);
    text-decoration: none;
}

/*
 * The frame holds the picture's own proportions, from the inline `--ratio`, so
 * the whole page is laid out before the first file arrives.
 *
 * The last row stretches to the edge like the others, and with one or two
 * pictures left that would make them twice the size of the rest. The cap stops
 * that: past it the frame keeps its width and crops the picture instead. The
 * width is definite, so the cap clamps the height and is not transferred
 * through the ratio into a narrower box.
 */
.tile__frame {
    display: block;
    width: 100%;
    aspect-ratio: var(--ratio, 1.3333);
    max-height: calc(var(--gallery-row) * 1.5);
}

.tile__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: scale var(--duration) var(--ease), opacity var(--duration) var(--ease);
}

.tile__link:hover .tile__image {
    scale: 1.03;
}

/* The caption only appears under the pointer: 36 titles at once would read as
   a list with pictures attached, not as a gallery. */
.tile__overlay {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-2xs);
    padding: var(--space-s) var(--space-2xs) var(--space-2xs);
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82));
    opacity: 0;
    transition: opacity var(--duration) var(--ease);
}

.tile__link:hover .tile__overlay,
.tile__link:focus-visible .tile__overlay {
    opacity: 1;
}

.tile__title {
    color: var(--color-text-strong);
    font-family: var(--font-heading);
    font-size: var(--text-s);
    font-weight: 700;
    line-height: var(--leading-tight);
    /* Two lines, then an ellipsis: some titles are whole sentences. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tile__comments {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
}

/* Touch has no hover: there the caption is always on, or it never shows. */
@media (hover: none) {
    .tile__overlay {
        opacity: 1;
    }
}

/* ============ Album tabs ============ */
.album-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
    margin-bottom: var(--space-m);
}

.album-tabs__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3xs);
    padding: var(--space-3xs) var(--space-s);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-m);
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: var(--text-s);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.album-tabs__link:hover,
.album-tabs__link:focus-visible {
    border-color: var(--color-accent);
    color: var(--color-accent);
    text-decoration: none;
}

.album-tabs__link--current {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

.album-tabs__count {
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
    font-variant-numeric: tabular-nums;
}

/* ============ Single picture ============ */
.photo__stage {
    margin: 0 0 var(--space-m);
    text-align: center;
}

.photo__zoom {
    display: block;
    cursor: zoom-in;
}

/*
 * Bounded by the viewport, not by the column: a 1280x1024 screenshot shown at
 * full column width on a laptop pushes its own title off the screen.
 */
.photo__image {
    max-height: min(78vh, 46rem);
    width: auto;
    max-width: 100%;
    margin-inline: auto;
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-m);
    background: var(--color-surface);
}

.photo__header {
    margin-bottom: var(--space-m);
}

.photo__description {
    margin-bottom: var(--space-l);
}

.section-head__note {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--text-s);
}

/* ============ Knowledge base ============ */
.page--db .layout,
.page--db__listing,
.page--db__entry {
    --db-gutter: var(--space-m);
}

.db-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
    margin-bottom: var(--space-m);
}

/* The map: a square of the same height as the words beside it. Its name is
   in the markup for the one place that has room to print it - the phone. */
.db-nav__link--icon {
    display: inline-flex;
    gap: var(--space-2xs);
    padding-inline: var(--space-2xs);
    align-items: center;
    justify-content: center;
}

.db-nav__label {
    display: none;
}

/*
 * Tight on purpose: seven of these, the game switch and the language all
 * share one line, and the padding is the only part of them that can give.
 */
.db-nav__link {
    padding: var(--space-3xs) var(--space-xs);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-m);
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.db-nav__link:hover,
.db-nav__link:focus-visible {
    border-color: var(--color-border-accent);
    color: var(--color-accent);
    text-decoration: none;
}

.db-nav__link--current {
    border-color: var(--color-border-accent);
    background: var(--color-surface-raised);
    color: var(--color-heading);
}

/* ---- Category and act bars ---- */
/*
 * A table, not a row of chips: nineteen categories wrapped into ragged lines
 * that were hard to scan. The cell lines are drawn inside each cell rather
 * than by a 1px grid gap, because a row that does not fill up would leave the
 * gap colour showing as blocks where the missing cells are.
 */
.db-cats {
    display: grid;
    grid-template-columns: repeat(var(--db-cats-columns, 5), minmax(0, 1fr));
    position: relative;
    margin-bottom: var(--space-m);
    background: var(--color-surface);
    border-radius: var(--radius-m);
    overflow: hidden;
}

/*
 * The frame, laid over the lines of the last column and the last row instead
 * of beside them. A border on the panel itself sits one pixel further out
 * than the line a cell draws at its own edge, and the two read as a double
 * rule down the right side and along the bottom. Drawn by the pseudo-element
 * - the last thing painted - it also survives a filled cell in the first
 * column, which would cover a frame painted with the panel's background.
 */
.db-cats::after {
    content: "";
    position: absolute;
    inset: 0;
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-m);
    pointer-events: none;
}

.db-cats--acts {
    --db-cats-columns: 4;
}

.db-cats--halves {
    --db-cats-columns: 2;
}

.db-cats__count {
    margin-inline-start: var(--space-2xs);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
}

.db-cats__link {
    padding: var(--space-2xs) var(--space-s);
    /* The rule between this cell and the next; at the panel's own edge the
       frame above it falls on the same pixels (see .db-cats::after). */
    box-shadow: inset calc(var(--border-thin) * -1) calc(var(--border-thin) * -1) 0 var(--color-border);
    color: var(--color-text-muted);
    font-size: var(--text-s);
    line-height: 1.4;
}

.db-cats__link:hover,
.db-cats__link:focus-visible {
    background: var(--color-surface-hover);
    color: var(--color-accent);
    text-decoration: none;
}

.db-cats__link--current {
    background: var(--color-surface-raised);
    color: var(--color-heading);
}

/* ---- Filter row ---- */
.db-toolbar {
    --db-control: 2.5rem;

    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
    align-items: stretch;
    margin-bottom: var(--space-m);
}

.db-toolbar__field {
    flex: 1 1 14rem;
    min-width: 0;
}

/*
 * One height for the row. The field, the selects and the button each size
 * themselves from their own padding and font, so left alone they land on
 * three different heights.
 */
.db-toolbar input,
.db-toolbar select,
.db-toolbar .button,
.db-lang select,
.db-lang .button {
    height: var(--db-control);
    padding-block: 0;
}

.db-toolbar__field input {
    width: 100%;
}

.db-toolbar__select select {
    min-width: 10rem;
}

/* ---- Tabs: difficulties, variants, tiers, skill levels ---- */
.db-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3xs);
    margin-bottom: var(--space-s);
}

.db-tabs__tab {
    min-width: 2rem;
    padding: var(--space-3xs) var(--space-xs);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-s);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    text-align: center;
}

.db-tabs__tab:hover,
.db-tabs__tab:focus-visible {
    border-color: var(--color-border-accent);
    color: var(--color-accent);
    text-decoration: none;
}

.db-tabs__tab--current {
    border-color: var(--color-border-accent);
    background: var(--color-surface-raised);
    color: var(--color-heading);
}

/*
 * One card on its own, placed in an article or a forum reply by the block.
 * Everything below it is the same card a listing prints, so it only needs the
 * air a paragraph would have had in its place.
 */
.db-entry {
    margin-bottom: var(--space-m);
}

/*
 * A forum post is a surface of its own, and a card of the same surface in it
 * read as no card at all. Placed by the block, the card sits one step above.
 */
.db-entry .db-card:not(.db-card--bare) {
    background: var(--color-surface-raised);
}

/*
 * A saved build quoted by the `tq/build` block. Compact: one line that is a
 * link. Full: a card for an article about the build.
 */
.build-embed {
    margin-bottom: var(--space-m);
}

/*
 * An article and a forum post underline every link in their text
 * (`.article__content a`, `.post-content a` in forum.css, loaded later); the
 * card is not text. The doubled class outweighs both.
 */
.build-embed.build-embed a {
    text-decoration: none;
}

.build-card {
    display: flex;
    gap: var(--space-s);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-m);
    background: var(--color-surface-raised);
}

.build-card--compact {
    align-items: center;
    padding: var(--space-2xs) var(--space-s);
    color: var(--color-text);
    text-decoration: none;
}

.build-card--compact:hover,
.build-card--compact:focus-visible {
    border-color: var(--color-border-strong);
    background: var(--color-surface-hover);
}

.build-card--gone {
    margin: 0;
    padding: var(--space-s);
    border-style: dashed;
    background: none;
    color: var(--color-text-muted);
    font-size: var(--text-s);
}

.build-card--full {
    flex-direction: column;
    /* Not less: the corner meander would lie on the text on a phone. */
    padding: var(--space-l);
    border-radius: 0;
}

.build-card__head {
    display: flex;
    gap: var(--space-s);
    align-items: center;
}

.build-card__crests {
    display: inline-flex;
    flex: none;
    gap: var(--space-3xs);
}

.build-card__crest {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
}

.build-card--full .build-card__crest {
    width: 2.5rem;
    height: 2.5rem;
}

.build-card__text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.build-card__title {
    margin: 0;
    color: var(--color-heading);
    font-family: var(--font-heading);
    font-size: var(--text-m);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.build-card--full .build-card__title {
    font-size: var(--text-l);
}

.build-card__title-link {
    color: inherit;
    text-decoration: none;
}

.build-card__title-link:hover {
    color: var(--color-link-hover);
}

.build-card__meta {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.build-card__ai {
    color: var(--color-info);
}

.build-card__go {
    display: inline-flex;
    flex: none;
    gap: var(--space-3xs);
    align-items: center;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.build-card--compact:hover .build-card__go {
    color: var(--color-accent);
}

/*
 * A build in a profile's list: the compact card with the date and the author's
 * buttons. Buttons cannot live in a link, so the title's link stretches over
 * the card and the buttons are raised above it.
 */
.build-card--entry {
    position: relative;
}

.build-card--private {
    border-style: dashed;
}

.build-card__stretch::after {
    content: '';
    position: absolute;
    inset: 0;
}

/* The two crests of a pair overlap a little, as in the builder's class picker. */
.build-card__crests--pair {
    gap: 0;
}

.build-card__crests--pair .build-card__crest + .build-card__crest {
    margin-inline-start: -0.5rem;
}

/* The full card's crests are larger; the overlap grows with them. */
.build-card--full .build-card__crests--pair .build-card__crest + .build-card__crest {
    margin-inline-start: -0.75rem;
}

.build-card__controls {
    position: relative;
    z-index: 1;
    display: flex;
    flex: none;
    align-items: stretch;
    gap: var(--space-3xs);
}

.build-card__form {
    display: flex;
    margin: 0;
}

/*
 * On a phone the word on the badge goes and the icon stays (globe or lock,
 * the word still read out): with it, the two buttons took half the row and
 * the title and date broke into a column of single words.
 */
@media (max-width: 40rem) {
    .build-badge__text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

.build-card__skills,
.build-card__resist-list,
.build-card__gear {
    margin: 0;
    padding: 0;
    list-style: none;
}

.build-card__value {
    margin: 0;
    color: var(--color-text-strong);
    font-variant-numeric: tabular-nums;
    /* "-34%" and "191" never break over two lines. */
    white-space: nowrap;
}

.build-card__section {
    display: grid;
    gap: var(--space-s);
    padding-top: var(--space-s);
    border-top: var(--border-thin) solid var(--color-border);
}

.build-card__heading {
    display: flex;
    gap: var(--space-2xs);
    align-items: baseline;
    margin: 0;
    color: var(--color-heading);
    font-family: var(--font-heading);
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

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

/* The four big numbers under the header: life, energy, damage, DPS. */
.build-card__summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: var(--space-2xs);
    margin: 0;
}

.build-card__tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--space-3xs);
    padding: var(--space-xs) var(--space-s);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-s);
    border-top: 2px solid var(--tile, var(--color-border-strong));
    background: var(--color-surface-sunken);
}

.build-card__tile--life { --tile: var(--color-life); }
.build-card__tile--mana { --tile: var(--color-energy); }

.build-card__tile-label {
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
    line-height: var(--leading-tight);
}

.build-card__tile-value {
    margin: 0;
    color: var(--color-text-strong);
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    white-space: nowrap;
}

/* Attributes on one side, the resistance strip on the other; one column when narrow. */
.build-card__numbers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: var(--space-s) var(--space-l);
    align-items: start;
}

/* Attributes, abilities, armour: label and number in a row. */
.build-card__stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: var(--space-3xs) var(--space-m);
    margin: 0;
    font-size: var(--text-s);
}

.build-card__stat {
    display: flex;
    gap: var(--space-2xs);
    align-items: baseline;
    justify-content: space-between;
    min-width: 0;
    padding-bottom: var(--space-3xs);
    border-bottom: var(--border-thin) dotted var(--color-border);
}

.build-card__stat-label {
    min-width: 0;
    color: var(--color-text-muted);
    line-height: var(--leading-tight);
}

.build-card__resists {
    padding: var(--space-2xs) 0;
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-s);
    /* The icons have no transparency: their own ground is near black. */
    background: var(--color-canvas);
}

/* Eight resistances, as the game's sheet lists them: two rows of four. */
.build-card__resist-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* The rules between the cells are a table's: none on the first column or the first row. */
.build-card__resist {
    display: flex;
    flex-direction: column;
    gap: var(--space-3xs);
    align-items: center;
    padding-block: var(--space-3xs);
    border-inline-start: var(--border-thin) solid var(--color-border);
    cursor: help;
}

.build-card__resist:nth-child(4n + 1) {
    border-inline-start: 0;
}

.build-card__resist:nth-child(n + 5) {
    border-top: var(--border-thin) solid var(--color-border);
}

.build-card__resist-icon {
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
}

.build-card__resist-value {
    color: var(--color-text-strong);
    font-size: var(--text-xs);
    /* Its own line height: in a forum post bbPress sets 18px, which left the bottom deeper than the top. */
    line-height: 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.build-card__resist--low .build-card__resist-value {
    color: var(--color-danger);
}

.build-card__resist--capped .build-card__resist-value {
    color: var(--color-success);
}

/* One column per mastery: its bar, then every skill with points, tree order. */
.build-card__trees {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: var(--space-s) var(--space-l);
}

.build-card__tree {
    display: grid;
    align-content: start;
    min-width: 0;
}

.build-card__tree-head {
    display: flex;
    gap: var(--space-2xs);
    align-items: center;
    margin: 0;
    padding: var(--space-3xs) 0;
    border-bottom: var(--border-thin) solid var(--color-border-strong);
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.build-card__tree-crest {
    flex: none;
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
}

.build-card__tree-name {
    flex: 1 1 auto;
    min-width: 0;
}

.build-card__skills {
    display: grid;
}

.build-card__skill {
    display: flex;
    gap: var(--space-2xs);
    align-items: center;
    min-width: 0;
    padding: var(--space-3xs) 0;
    border-bottom: var(--border-thin) solid var(--color-border);
    font-size: var(--text-xs);
}

.build-card__skill-icon {
    flex: none;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: var(--radius-s);
}

.build-card__skill-name {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--color-text);
    line-height: var(--leading-tight);
}

.build-card__skill--featured .build-card__skill-name {
    color: var(--color-text-strong);
}

.build-card__skill--featured .build-card__skill-icon {
    box-shadow: 0 0 0 var(--border-thin) var(--color-accent);
}

.build-card__key {
    display: inline-flex;
    vertical-align: middle;
    color: var(--color-accent);
}

.build-card__gear {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 0 var(--space-l);
}

.build-card__item {
    display: flex;
    gap: var(--space-2xs);
    align-items: center;
    min-width: 0;
    padding: var(--space-3xs) 0;
    border-bottom: var(--border-thin) solid var(--color-border);
}

/* Item icons are not square (a spear is 64×256): the box keeps them in. */
.build-card__item-icon {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
}

.build-card__item-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.build-card__item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--text-xs);
    line-height: var(--leading-tight);
}

.build-card__item-name {
    color: var(--color-text-strong);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.build-card__item-name--magical {
    color: var(--color-rarity-magical);
}

.build-card__item-name--rare {
    color: var(--color-rarity-rare);
}

.build-card__item-name--epic {
    color: var(--color-rarity-epic);
}

.build-card__item-name--legendary {
    color: var(--color-rarity-legendary);
}

.build-card__item-name--lesser,
.build-card__item-name--greater,
.build-card__item-name--divine {
    color: var(--color-rarity-artifact);
}

.build-embed a.build-card__item-name:hover,
.build-embed a.build-card__item-name:focus-visible {
    text-decoration: underline;
}

.build-card__relic {
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
}

.build-card__actions {
    margin: 0;
}

/* ---- Card grid: two columns of cards with a meander ---- */
.db-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-m);
    margin-bottom: var(--space-l);
}

.db-card {
    position: relative;
    display: flex;
    gap: var(--space-s);
    padding: var(--space-m);
    background: var(--color-surface);
    border: var(--border-thin) solid var(--color-border);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/*
 * The whole card is the target, not the words in it. Where the card is one
 * link, the padding moves onto the link; where it only has a title link (item
 * and affix cards), that link stretches an invisible layer over the card.
 * A listing card has no other links (decision of the site): the only thing
 * lifted above the layer is the skill fold's toggle.
 */
.db-card:has(> .db-card__link) {
    padding: 0;
}

.db-card:has(> .db-card__link) .db-card__link {
    padding: var(--space-m);
}

.db-card--item .db-card__link::after,
.db-card--affix .db-card__link::after {
    content: '';
    position: absolute;
    inset: 0;
}

.db-card--item .db-card__link:hover,
.db-card--affix .db-card__link:hover {
    color: color-mix(in srgb, var(--color-accent) 50%, var(--color-heading));
}

.db-card--bare {
    padding: 0;
    border: 0;
    background: none;
}

.db-card__link {
    display: flex;
    gap: var(--space-s);
    align-items: center;
    width: 100%;
    color: inherit;
}

.db-card--affix .db-card__main {
    width: 100%;
}

.db-card--creature .db-card__link,
.db-card--set .db-card__link,
.db-card--mastery .db-card__link {
    align-items: flex-start;
}

.db-card__aside {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2xs);
    flex: 0 0 6.5rem;
}

.db-card__figure {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 6.5rem;
    min-height: 4rem;
}

.db-card__figure--portrait {
    width: 6.5rem;
    height: 6.5rem;
    /* The portrait must not touch the frame it sits in. */
    padding: 0.5rem;
    background: var(--color-canvas-alt);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-s);
    overflow: hidden;
}

.db-card__icon {
    max-width: 100%;
    height: auto;
}

.db-card__portrait {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.db-card__main {
    display: block;
    min-width: 0;
    flex: 1 1 auto;
}

.db-card__title {
    display: block;
    margin: 0 0 var(--space-3xs);
    font-family: var(--font-heading);
    font-size: var(--text-m);
    font-weight: 700;
    line-height: var(--leading-tight);
    color: var(--color-heading);
}

/*
 * The link fills the card, so the base underline would run under every line
 * of it. The card lights up instead - which is also what the cursor is
 * actually pointing at.
 *
 * Doubled class: a card quoted in a post, a news story or a comment sits
 * under `.post-content a` / `.article__content a` / `.comment__text a`, which
 * underline every link and outrank a lone class.
 */
.db-card__link.db-card__link {
    text-decoration: none;
}

/*
 * Half-way to the hover colours (decision of the site): a card is a large
 * target, and the full accent over a whole panel flashed as the cursor
 * crossed a column of them. The panel keeps its fill; a ring just outside
 * the border and a soft glow lift it instead.
 */
.db-card__link:hover .db-card__title,
.db-card__link:focus-visible .db-card__title {
    color: color-mix(in srgb, var(--color-accent) 50%, var(--color-heading));
}

.db-card:has(.db-card__link:hover),
.db-card:has(.db-card__link:focus-visible) {
    border-color: color-mix(in srgb, var(--color-border-accent) 50%, var(--color-border));
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--color-border-accent) 35%, transparent),
        0 0.5rem 1.5rem -0.75rem color-mix(in srgb, var(--color-accent) 25%, transparent);
}

@media (prefers-reduced-motion: reduce) {
    .db-card {
        transition: none;
    }
}

.db-card__meta {
    display: block;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    line-height: var(--leading-normal);
}

.db-card__game {
    margin: 0 0 var(--space-2xs);
    color: var(--color-text-muted);
    font-size: var(--text-3xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.db-card__line {
    margin: 0 0 var(--space-3xs);
    color: var(--color-text);
    font-size: var(--text-s);
}

.db-card__descr {
    display: block;
    margin: var(--space-2xs) 0;
    color: var(--color-text-muted);
    font-size: var(--text-s);
    font-style: italic;
    line-height: var(--leading-normal);

    /* A note's text is the whole of it, and the game writes it in paragraphs:
       the line breaks are the content, not formatting of the source. */
    white-space: pre-line;
}

.db-card__reqs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3xs) var(--space-s);
    margin: var(--space-s) 0 0;
    padding-top: var(--space-2xs);
    border-top: var(--border-thin) solid var(--color-border);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

/* The game paints rarity, and a reader looks for that colour first. */
.db-card__rarity {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--text-3xs);
    letter-spacing: var(--tracking-wide);
    text-align: center;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.db-card__rarity--magical {
    color: var(--color-rarity-magical);
}

.db-card__rarity--rare {
    color: var(--color-rarity-rare);
}

.db-card__rarity--epic {
    color: var(--color-rarity-epic);
}

.db-card__rarity--legendary {
    color: var(--color-rarity-legendary);
}

.db-card__rarity--lesser,
.db-card__rarity--greater,
.db-card__rarity--divine {
    color: var(--color-rarity-artifact);
}

/* ---- One entry: wide, two columns ---- */
.db-single {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: var(--space-m);
}

/*
 * The entry is a grid, so the row gap is the spacing between its panels and
 * anything a panel asks for on top of it is simply added: the strip of
 * rarities on a set page stood 24px under the bonuses and 40px above the
 * pieces, because the strip carries the margin it needs when it sits inside
 * a panel. Grid margins do not collapse, so here it has to stop asking.
 */
.db-single > .db-tabs {
    margin-bottom: 0;
}

/*
 * Both panels are as tall as the entry itself, and a long drop table scrolls
 * inside its own. That means the row must not be sized by the table: the
 * side's content is taken out of the flow, so the height comes from the left
 * column, and the panel stretches to it.
 */
.db-single__side {
    position: relative;
    min-height: 24rem;
}

.db-single__scroll {
    position: absolute;
    inset: var(--space-l);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* The heading stays put; only the rows under it move. */
.db-single__list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;

    /*
     * The bar is drawn by the site, not by the system: macOS hides it until
     * you scroll and Windows paints a wide light one, so the same panel looks
     * like two different components. Both declarations are needed - Firefox
     * and Chrome 121+ read the standard pair, older WebKit the pseudo-elements
     * below - and Chrome ignores the pseudo-elements once it sees these.
     */
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-accent) transparent;
}

.db-single__list::-webkit-scrollbar {
    width: 8px;
}

.db-single__list::-webkit-scrollbar-track {
    background: var(--color-canvas-alt);
    border-radius: var(--radius-s);
}

.db-single__list::-webkit-scrollbar-thumb {
    background: var(--color-border-accent);
    border-radius: var(--radius-s);
}

.db-single__list::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* A skill with nothing to summon has no second column; it takes the row. */
.db-single__main:only-child {
    grid-column: 1 / -1;
}

.db-single__main,
.db-single__side,
.db-panel {
    padding: var(--space-l);
    background: var(--color-surface);
    border: var(--border-thin) solid var(--color-border);
}

/*
 * A quest reads as a sequence and a set is a panel plus its pieces, so both
 * stack down the page instead of running two columns.
 */
.db-single--quest,
.db-single--set {
    grid-template-columns: minmax(0, 1fr);
}

.db-panel__title {
    margin: 0 0 var(--space-s);
    font-size: var(--text-m);
}

.db-single__head {
    display: flex;
    gap: var(--space-m);
    align-items: flex-start;
    margin-bottom: var(--space-m);
}

.db-single__figure {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 12rem;
    height: 12rem;
    padding: 0.5rem;
    background: var(--color-canvas-alt);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-s);
    overflow: hidden;
}

.db-single__figure--icon {
    width: 8rem;
    height: 8rem;
}

.db-single__portrait,
.db-single__icon {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.db-single__heading {
    min-width: 0;
}

.db-single__kind {
    margin: 0 0 var(--space-3xs);
    color: var(--color-text-muted);
    font-size: var(--text-3xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.db-single__title {
    margin: 0;
    font-size: var(--text-xl);
    line-height: var(--leading-tight);
}

.db-single__descr {
    margin: 0 0 var(--space-m);
    color: var(--color-text-reading);
    font-size: var(--text-s);
    line-height: var(--leading-reading);
}

.db-single__side-title {
    margin: 0 0 var(--space-s);
    font-size: var(--text-m);
}

/* ---- Facts, properties, relations ---- */
.db-facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: var(--space-3xs) var(--space-s);
    margin: 0 0 var(--space-m);
    font-size: var(--text-s);
}

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

.db-facts dd {
    margin: 0;
    color: var(--color-text);
}

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

/*
 * On a phone the labels of the knowledge base are longer than the numbers
 * beside them ("Максимальный уровень умения" against "6"), and a max-content
 * column left the value a few characters wide - the note behind it came out
 * one word per line. Below this width the pair reads as two lines instead.
 */
@media (max-width: 30rem) {
    .db-facts {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .db-facts dd + dt {
        margin-top: var(--space-2xs);
    }
}

/*
 * A rolled number's span ("37-52"): a dropped item lands anywhere in it.
 *
 * The marking is OFF by the user's decision: the frames broke a tooltip into
 * boxes and read louder than the property they belonged to. The span is still
 * printed - `Db\Spread::html()` on the server, `spreadText()` in the gear
 * tooltip - so turning the marking back on is this rule and nothing else; the
 * frame it used to draw is kept below.
 */
.spread {
    /* Numbers of a span still stay on one line together. */
    white-space: nowrap;
}

/*
.spread {
    display: inline-block;
    margin: 0 0.2em;
    padding: 0 0.3em;
    border: var(--border-thin) solid var(--color-border-strong);
    border-radius: var(--radius-s);
    background: var(--color-surface-sunken);
    color: var(--color-success);
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
    white-space: nowrap;
}
*/

.db-props {
    margin-bottom: var(--space-s);
}

/*
 * The bottom margin is there for the block that follows the list. When the
 * list is the last thing in a panel - a card without requirements, a skill
 * box, a tab of set bonuses - nothing follows it and the margin only adds
 * itself to that panel's padding: a finger of empty space under the final
 * stat. Nothing can follow a last child, so the rule needs no help from the
 * template that placed the list.
 */
.db-props:last-child {
    margin-bottom: 0;
}

/*
 * The skill box prints its stats straight after the italic line of prose, and
 * the list carries no top margin of its own: the first number sat on the last
 * line of the description as if it were part of the sentence.
 */
.db-skill__descr + .db-props,
.db-skill__summon + .db-props {
    margin-top: var(--space-2xs);
}

.db-props__title {
    margin: 0 0 var(--space-2xs);
    font-size: var(--text-s);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.db-props__list {
    display: grid;
    gap: var(--space-3xs);
    margin: 0;
    padding: 0;
    list-style: none;
}

.db-props__item {
    /* The list is a grid with its own gap; the zero margin is against the
       article body's `li + li`, which a card inside a post would pick up. */
    margin: 0;
    color: var(--color-text-reading);
    font-size: var(--text-s);
    line-height: var(--leading-normal);
}

/* A granted skill the game shows as a panel rather than as one line. */
.db-props__item--card {
    margin-block: var(--space-2xs);
}

/* The item spaces the box: its own top margin made the gap above uneven. */
.db-props__item--card > .db-skill {
    margin-top: 0;
}

/*
 * Grid items do not collapse margins: two cards in a row stacked the first
 * one's bottom margin, the list gap and the second one's top margin. A run
 * of cards keeps only the list gap.
 */
.db-props__item--card + .db-props__item--card {
    margin-top: calc(-1 * var(--space-2xs));
}

.db-props__item--group {
    padding-inline-start: var(--space-xs);
    border-inline-start: var(--border-thin) solid var(--color-border-accent);
}

.db-props__chance {
    display: block;
    color: var(--color-text-muted);
}

.db-relation {
    margin-top: var(--space-m);
}

.db-relation__title {
    margin: 0 0 var(--space-2xs);
    padding-bottom: var(--space-2xs);
    border-bottom: var(--border-thin) solid var(--color-border);
    font-size: var(--text-s);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.db-relation__note {
    margin: 0 0 var(--space-xs);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    line-height: var(--leading-snug);
}

/* Tier strip of a relic or charm: a label, then the piece counts. */
.db-tier {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs) var(--space-xs);
    align-items: center;
    margin-bottom: var(--space-s);
}

.db-tier__label {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.db-tabs--inline {
    margin-bottom: 0;
}

.db-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: var(--space-s);
}

.db-grid__cell {
    padding: var(--space-s);
    background: var(--color-canvas-alt);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-s);
}

.db-grid__title {
    margin: 0 0 var(--space-2xs);
    color: var(--color-heading);
    font-family: var(--font-heading);
    font-size: var(--text-s);
}

.db-links {
    display: grid;
    gap: var(--space-3xs);
    margin: 0;
    padding: 0;
    list-style: none;
}

.db-links__item {
    display: flex;
    gap: var(--space-2xs);
    align-items: center;
    font-size: var(--text-s);
}

.db-links__icon {
    flex: 0 0 auto;
}

.db-links__note {
    margin-inline-start: auto;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
}

/* ---- A skill, granted by an item or summoned by another skill ---- */
.db-skill {
    margin-top: var(--space-2xs);
    padding: var(--space-xs);
    background: var(--color-canvas-alt);
    border: var(--border-thin) solid var(--color-border);
    border-inline-start: 2px solid var(--color-border-accent);
    border-radius: var(--radius-s);
}

.db-skill__head {
    display: flex;
    gap: var(--space-2xs);
    align-items: center;
}

/*
 * The name is an inline element inside a block, so it takes the line box of
 * whatever encloses the card - reading leading in a list of properties. Half
 * of that leading sits under the name and half over the level line, and the
 * two of them read as a gap where none was asked for. The head sets its own.
 */
.db-skill__body {
    line-height: var(--leading-snug);
}

.db-skill__icon {
    flex: 0 0 auto;
}

/*
 * Doubled class for the same reason as `.db-card__link`: a skill box printed
 * in a guide, a post or a comment sits under `.article__content a` /
 * `.post-content a` / `.comment__text a`, and the underline made the name
 * read as a sentence link inside the card.
 */
.db-skill__name.db-skill__name {
    font-family: var(--font-heading);
    font-size: var(--text-s);
    text-decoration: none;
}

.db-skill__meta {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.db-skill__descr {
    margin: var(--space-2xs) 0 0;
    color: var(--color-text-reading);
    font-size: var(--text-s);
    font-style: italic;
    line-height: var(--leading-normal);
}

/* How many creatures the skill puts out at this level (Query::summon). */
.db-skill__summon {
    margin: var(--space-2xs) 0 0;
    color: var(--color-text-muted);
    font-size: var(--text-s);
}

.db-skill__meta span + span::before {
    content: ' · ';
}

/* A bonus to a skill or mastery: the game's own sentence stands for the name. */
.db-skill__bonus {
    margin: 0;
    color: var(--color-text-reading);
    font-size: var(--text-xs);
    line-height: 1.3;
}

/*
 * In a listing the skill's text and numbers fold behind its head. The head
 * is lifted over the card's stretched link, or a click on it would open the
 * entry instead of the fold.
 */
.db-skill--collapsible > .db-skill__head {
    position: relative;
    z-index: 1;
    cursor: pointer;
    list-style: none;
}

.db-skill--collapsible > .db-skill__head::-webkit-details-marker {
    display: none;
}

.db-skill__toggle {
    display: inline-flex;
    margin-inline-start: auto;
    padding: var(--space-3xs);
    color: var(--color-text-muted);
    transition: transform 0.15s ease, color 0.15s ease;
}

.db-skill--collapsible > .db-skill__head:hover .db-skill__toggle {
    color: var(--color-accent);
}

.db-skill--collapsible[open] .db-skill__toggle {
    transform: rotate(180deg);
}

/*
 * ---- The folded box of the skill block (tq/db-skill) ----
 *
 * A guide names half a dozen skills, and six open boxes are a page of their
 * own: the block is a two-line head - who and at what level, then the numbers
 * that matter - and everything else sits behind the toggle.
 */
.db-skill--folded > .db-skill__head {
    align-items: flex-start;
}

/*
 * Name and level on the first line, the digest across the second. The body is
 * a wrapping row rather than a column, which is what puts the level beside the
 * name instead of under it.
 */
.db-skill--folded .db-skill__body {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 var(--space-2xs);
    /*
     * Takes the row and shrinks: without `flex: 1 1 auto` the body is sized by
     * its content, and the digest's `flex-basis: 100%` then resolves against a
     * width that is itself the digest - so the body grew to the full line of
     * numbers and squeezed the chevron out of the head. `min-width: 0` is what
     * lets the ellipsis happen at all.
     */
    flex: 1 1 auto;
    min-width: 0;
}

.db-skill--folded .db-skill__meta,
.db-skill--folded .db-skill__digest {
    margin: 0;
}

/* The numbers take the whole second line, however short the name is. */
.db-skill--folded .db-skill__digest {
    flex: 1 0 100%;
    overflow: hidden;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    line-height: var(--leading-snug);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Open, the head is a heading over the text rather than a summary of it. */
.db-skill--folded[open] .db-skill__digest {
    display: none;
}

/*
 * The skill block (tq/db-skill). The box inside it is the same `.db-skill` an
 * item's card prints, so the wrapper only gives it the air a block standing on
 * its own needs - the box's own top margin is for a box following a line of
 * text inside a card.
 */
.db-skill-block {
    margin-block: var(--space-s);
}

.db-skill-block > .db-skill {
    margin-top: 0;
}

/* The skill's own facts - when it opens, how far it goes - under its text. */
.db-skill__facts {
    margin-top: var(--space-2xs);
}

/*
 * The skill chosen is no longer in the base. Said rather than left out: a
 * guide that writes "вкладываем сюда:" above the block would otherwise end in
 * a hole.
 */
.db-skill-block--gone .db-skill-block__gone {
    margin: 0;
    padding: var(--space-s);
    border: var(--border-thin) dashed var(--color-border);
    border-radius: var(--radius-s);
    color: var(--color-text-muted);
    font-size: var(--text-s);
}

@media (prefers-reduced-motion: reduce) {
    .db-skill__toggle {
        transition: none;
    }
}

/*
 * The fold slides open without a script: `::details-content` is the part the
 * toggle hides, and `interpolate-size` lets its height travel to `auto`.
 * A browser that knows neither simply opens it at once, as before.
 */
@media (prefers-reduced-motion: no-preference) {
    .db-skill--collapsible {
        interpolate-size: allow-keywords;
    }

    .db-skill--collapsible::details-content {
        block-size: 0;
        overflow: hidden;
        transition: block-size 0.25s ease, content-visibility 0.25s allow-discrete;
    }

    .db-skill--collapsible[open]::details-content {
        block-size: auto;
    }
}

/* ---- Tables of drops, sources and abilities ---- */
.db-table {
    width: 100%;
    margin-bottom: var(--space-m);
    border-collapse: collapse;
    font-size: var(--text-s);
    font-variant-numeric: tabular-nums;
}

.db-table th,
.db-table td {
    padding: var(--space-3xs) var(--space-2xs);
    border-bottom: var(--border-thin) solid var(--color-border);
    text-align: start;
    vertical-align: middle;
}

.db-table th {
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

/*
 * Doubled with the element: `.db-table td` is a class plus an element and so
 * outranks a lone class, which is why the numbers stayed left of their column.
 */
.db-table th.db-table__num,
.db-table td.db-table__num {
    text-align: end;
    white-space: nowrap;
}

.db-table__icon {
    width: 2rem;
    padding-inline-end: 0;
}

/*
 * Item icons are not square: a spear is 64x256 in the sprite sheet, and the
 * base rule (height: auto) lets it keep that ratio, which stretched its row
 * to four times the others. The cell boxes the icon instead.
 */
.db-table__icon img,
.db-links__icon,
.db-skill__icon,
.db-tree__icon {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
    flex: 0 0 auto;
}

/*
 * A drop list is read for what is worth killing for, and the game says that
 * with colour. The class is doubled because `a:hover` is a class plus an
 * element: a single class would lose the colour the moment the pointer
 * reached the name.
 */
.db-table__name.db-table__name--magical {
    color: var(--color-rarity-magical);
}

.db-table__name.db-table__name--rare {
    color: var(--color-rarity-rare);
}

.db-table__name.db-table__name--epic {
    color: var(--color-rarity-epic);
}

.db-table__name.db-table__name--legendary {
    color: var(--color-rarity-legendary);
}

.db-table__name.db-table__name--lesser,
.db-table__name.db-table__name--greater,
.db-table__name.db-table__name--divine {
    color: var(--color-rarity-artifact);
}

.db-table__note,
.db-table__more {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

/*
 * The affix ladder puts notes under a cell's own value - the windows of the
 * other rarities under the one shown, the tier's own name over its lines -
 * and the note is an inline span everywhere else, so they ran into the value.
 */
.db-table--affix .db-table__note {
    display: block;
}

/* ---- Mastery trees ---- */
.db-tree {
    margin-bottom: var(--space-m);
    padding: var(--space-l);
    background: var(--color-surface);
    border: var(--border-thin) solid var(--color-border);
}

.db-tree__head {
    display: flex;
    gap: var(--space-s);
    align-items: center;
    margin-bottom: var(--space-s);
}

.db-tree__title {
    margin: 0;
    font-size: var(--text-l);
}

.db-tree__game {
    margin-inline-start: auto;
    color: var(--color-text-muted);
    font-size: var(--text-3xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.db-tree__descr {
    margin: 0 0 var(--space-s);
    color: var(--color-text-muted);
    font-size: var(--text-s);
    font-style: italic;
    line-height: var(--leading-normal);
}

.db-tree__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: var(--space-2xs);
}

.db-tree__skill {
    display: flex;
    gap: var(--space-2xs);
    align-items: center;
    padding: var(--space-3xs) var(--space-2xs);
    border: var(--border-thin) solid transparent;
    border-radius: var(--radius-s);
    color: var(--color-text);
    font-size: var(--text-s);
    line-height: var(--leading-tight);
}

.db-tree__skill:hover,
.db-tree__skill:focus-visible {
    border-color: var(--color-border-accent);
    background: var(--color-canvas-alt);
    color: var(--color-accent);
    text-decoration: none;
}

.db-tree__skill--head {
    border-color: var(--color-border-accent);
}

.db-tree__crest {
    flex: 0 0 auto;
    width: 4rem;
    height: 4rem;
    object-fit: contain;
}

/* ---- Quest lists ---- */
.db-quests {
    margin-bottom: var(--space-m);
    padding: var(--space-l);
    background: var(--color-surface);
    border: var(--border-thin) solid var(--color-border);
}

.db-quests__head {
    display: flex;
    gap: var(--space-s);
    align-items: baseline;
    margin-bottom: var(--space-s);
}

.db-quests__title {
    margin: 0;
    font-size: var(--text-l);
}

.db-quests__count {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.db-quests__group {
    margin: var(--space-s) 0 var(--space-2xs);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.db-quests__list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-2xs);
    margin: 0;
    padding: 0;
    list-style: none;
}

.db-quests__item {
    display: flex;
}

.db-quests__link {
    flex: 1 1 auto;
    padding: var(--space-2xs) var(--space-s);
    background: var(--color-canvas-alt);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-s);
    color: var(--color-text);
    font-size: var(--text-s);
}

.db-quests__link:hover,
.db-quests__link:focus-visible {
    border-color: var(--color-border-accent);
    background: var(--color-surface-hover);
    text-decoration: none;
}

.db-quests__name {
    display: block;
    font-weight: 700;
    line-height: var(--leading-tight);
}

.db-quests__number {
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.db-quests__where {
    display: flex;
    gap: var(--space-2xs);
    align-items: baseline;
    margin-top: var(--space-3xs);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.db-quests__area {
    min-width: 0;
}

/* The area level, held in the corner of the row. */
.db-quests__level {
    margin-inline-start: auto;
    font-variant-numeric: tabular-nums;
}

/* ---- Quest journal ---- */
.db-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-m);
}

/* A quest with a journal but no objectives takes the row on its own. */
.db-columns > :only-child {
    grid-column: 1 / -1;
}

.db-journal__list {
    counter-reset: db-step;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--color-text-reading);
    font-size: var(--text-s);
    line-height: var(--leading-normal);
}

.db-journal__step {
    position: relative;
    counter-increment: db-step;
    padding-inline-start: 2.5rem;
    padding-bottom: var(--space-s);
}

.db-journal__step:last-child {
    padding-bottom: 0;
}

/* The numbered bead, and the rail joining it to the next one. */
.db-journal__step::before {
    content: counter(db-step);
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border: var(--border-thin) solid var(--color-border-accent);
    border-radius: 50%;
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
    font-variant-numeric: tabular-nums;
}

.db-journal__step::after {
    content: '';
    position: absolute;
    inset-inline-start: calc(0.75rem - 0.5px);
    top: 1.5rem;
    bottom: 0;
    width: 1px;
    background: var(--color-border);
}

.db-journal__step:last-child::after {
    display: none;
}

.db-empty {
    color: var(--color-text-muted);
    font-size: var(--text-s);
}

/* ---- Titan Quest II ---- */
/* The younger game ships icons up to 128 px wide, where the first game's are
   64 px: left at the figure's width they tower over the lines beside them. */
/*
 * A fixed cell, and the icon fits inside it. The younger game's icons carry
 * the item's inventory footprint - 128x128 for one square, 128x64 for two -
 * so a cap on one side alone let a wide one tower over a tall one. Measured,
 * not capped: `max-*` rather than `width: 100%`, because a few icons are
 * smaller than the cell and upscaling them only blurs the art.
 */
.db-card--tq2 .db-card__figure {
    /* The column stays as wide as the rarity word needs; only the picture
       inside it is pinned to a square. */
    width: 4rem;
    height: 4rem;
    min-height: 0;
}

.db-card--tq2 .db-card__icon {
    max-width: 100%;
    max-height: 100%;
}

/* The icon belongs beside the name, not above it: `img` is a block element
   in this theme, so the pair needs a line of its own. */
.db-drop {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
}

.db-drop__icon {
    flex: 0 0 auto;
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
}


/* Which game the base is being read in: a segmented switch, because the two
   are one choice with two positions rather than two links that happen to be
   next to each other. Colours measured off the design: the selected half is
   filled with the same accent a selected tab outlines itself with. */
.db-games {
    display: inline-flex;
    flex-wrap: nowrap;
    border: var(--border-thin) solid var(--color-border-accent);
    border-radius: var(--radius-m);
    /* The fill of a selected half has to stop at the rounded corner. */
    overflow: hidden;
}

/* As tight as the section pills beside it: the three controls share one
   line, and the padding is the only part of them that can give. */
.db-games__link {
    padding: var(--space-3xs) var(--space-xs);
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    white-space: nowrap;
}

.db-games__link:hover,
.db-games__link:focus-visible {
    /* The halves are a control, not prose: base.css underlines a link on
       hover, and a rule under one half of a segmented switch reads as a
       second selected state. */
    color: var(--color-heading);
    text-decoration: none;
}

.db-games__link--current,
.db-games__link--current:hover {
    background: var(--color-border-accent);
    color: var(--color-heading);
}

/* The body of an entry that is neither a card nor a stack of panels: an
   ability, which is a heading and its text per level. */
.db-single__body {
    min-width: 0;
}

.db-single__text {
    margin-bottom: var(--space-s);
    color: var(--color-text-reading);
    font-size: var(--text-s);
    line-height: var(--leading-reading);
}

.db-single__text:last-child {
    margin-bottom: 0;
}

/* A creature's numbers are a column per area level, so the table can be wider
   than the panel on a phone. It scrolls on its own rather than pushing the
   page sideways. */
.db-wide {
    margin-bottom: var(--space-m);
    overflow-x: auto;
}

.db-table--grid {
    margin-bottom: 0;
    min-width: 30rem;
}

.db-table--grid th[scope="row"] {
    /* The stat's name, not a column heading: read as text, not as a label. */
    color: var(--color-text);
    font-family: inherit;
    font-size: var(--text-s);
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
}

.db-table__group th {
    padding-top: var(--space-xs);
    color: var(--color-heading);
}

/* Mastery tiers: a tier is a heading, and inside it the actives and the
   passives are two groups, as the game shows them. */
.db-tree__slogan {
    margin: var(--space-3xs) 0 0;
    color: var(--color-accent);
    font-size: var(--text-s);
    font-style: italic;
}

.db-tree__tier {
    margin-top: var(--space-m);
}

.db-tree__tier-title {
    margin: 0 0 var(--space-2xs);
    font-size: var(--text-m);
}

.db-tree__group {
    margin: var(--space-2xs) 0;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

/* A modifier's text, one block per rank. */
.db-skill__rank {
    /* The first one has to clear the head it just unfolded from, not sit on it. */
    margin-top: var(--space-xs);
}

.db-skill__rank + .db-skill__rank {
    padding-top: var(--space-xs);
    border-top: var(--border-thin) solid var(--color-border);
}


.db-skill__rank-label {
    margin: 0 0 var(--space-3xs);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

/* ---- Language switch and game build ---- */
/*
 * Two rows, always: the game and the language on the first, the sections
 * across the second. They used to share one line and wrap, and with a
 * seventh section (the map) the line broke in the middle - the language
 * dropped under the sections and sat alone against the right edge, with the
 * strip reading as two unrelated fragments. Fixed rows say which choice is
 * which at every width, and the next section will not move them again.
 */
/*
 * One line: the game, its sections, the language. The map is an icon in the
 * sections rather than a seventh word, which is what keeps the line a line.
 */
.db-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-xs) var(--space-s);
    margin-bottom: var(--space-m);
}

.db-bar .db-games,
.db-bar .db-nav {
    margin-bottom: 0;
}

.db-lang {
    /* Shorter than a form control elsewhere: this one rides in the section
       strip, where its height sets the height of the whole line. */
    --db-control: 2.125rem;

    display: flex;
    gap: var(--space-2xs);
    align-items: center;
    margin-inline-start: auto;
}

.db-lang__version {
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
    font-variant-numeric: tabular-nums;
    line-height: var(--leading-tight);
    text-align: end;
}

.db-lang__caption {
    display: block;
    font-size: var(--text-3xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.db-lang__field select {
    min-width: 7rem;
    /* The chevron is a background image placed from the right edge
       (base.css), so tightening the padding has to move it too. */
    padding-inline-start: var(--space-2xs);
    padding-inline-end: calc(var(--space-2xs) * 2 + 12px);
    background-position: right var(--space-2xs) center;
    font-size: var(--text-2xs);
}

/* The script submits on change; the button is the fallback without it. */
.db-lang__go {
    display: none;
}

@media (max-width: 62rem) {
    /*
     * Two rows on a tablet: the game and the language above, the sections
     * across the full width below. Side by side at this width the sections
     * get a column too narrow for them and wrap into three ragged pairs
     * with the rest of the line standing empty.
     *
     * Every cell is named rather than left to auto-placement: the sections
     * span both columns, and a spanning item moves the placement cursor
     * past the row it lands in, so the language after it would start a row
     * of its own.
     */
    .db-bar {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .db-bar .db-games {
        grid-row: 1;
        grid-column: 1;
    }

    .db-bar .db-lang {
        grid-row: 1;
        grid-column: 2;
    }

    .db-bar .db-nav {
        grid-row: 2;
        grid-column: 1 / -1;
    }

    .db-cats {
        --db-cats-columns: 3;
    }

    .db-quests__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .db-cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .db-single,
    .db-columns {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Stacked, the side has the page to grow into; nothing scrolls inside. */
    .db-single__side {
        min-height: 0;
    }

    .db-single__scroll {
        position: static;
        display: block;
        overflow: visible;
    }

    .db-single__list {
        overflow: visible;
    }
}

@media (max-width: 40rem) {
    .db-cats {
        --db-cats-columns: 2;
    }

    .db-quests__list {
        grid-template-columns: minmax(0, 1fr);
    }

    .db-single__main,
    .db-single__side,
    .db-panel,
    .db-tree,
    .db-quests {
        padding: var(--space-m);
    }

    .db-single__head,
    .db-card--item {
        flex-direction: column;
    }

    .db-card__aside,
    .db-single__figure {
        align-self: center;
    }

    /*
     * One control to a line: the switch, then the language, then the grid of
     * sections. Side by side the language field has nowhere to shrink to.
     */
    .db-bar {
        grid-template-columns: minmax(0, 1fr);
    }

    /* One column, so the cells the tablet rules placed side by side have
       to be put back in it: a `grid-column: 2` here would open a second,
       implicit column instead. */
    .db-bar .db-games {
        grid-row: 1;
        grid-column: 1;
    }

    .db-bar .db-lang {
        grid-row: 2;
        grid-column: 1;
    }

    .db-bar .db-nav {
        grid-row: 3;
    }

    /* Centred it reads as the choice over the grid below, not as a pair of
       links left behind in the corner. */
    .db-bar .db-games {
        margin-inline: auto;
    }

    /* Six sections as an even 3 x 2 grid rather than two ragged rows. */
    .db-nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .db-nav__link {
        padding-inline: var(--space-3xs);
        font-size: var(--text-2xs);
        text-align: center;
    }

    /*
     * Seven cells never fill a row of three, and the odd one out stretched
     * across a third of the width read as a mistake. The map takes the whole
     * last row instead, and the room that gives it is enough for its name.
     */
    .db-nav__link--icon {
        grid-column: 1 / -1;
    }

    .db-nav__label {
        display: inline;
    }

    /* Build on the left, language on the right, across the full width. */
    .db-lang {
        justify-content: space-between;
        margin-inline-start: 0;
    }

    .db-lang__version {
        text-align: start;
    }

    /*
     * Search and its button on the first line, the selects two to a line
     * under it. The field is the first label, so the selects are the even
     * (left column) and odd (right) labels after it; a lone last select takes
     * the whole line.
     */
    .db-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    }

    .db-toolbar__field {
        grid-column: 1 / 3;
        grid-row: 1;
    }

    .db-toolbar .button {
        grid-column: 3;
        grid-row: 1;
    }

    .db-toolbar__select:nth-of-type(even) {
        grid-column: 1;
    }

    .db-toolbar__select:nth-of-type(odd) {
        grid-column: 2 / -1;
    }

    .db-toolbar__select:nth-of-type(even):last-of-type {
        grid-column: 1 / -1;
    }

    .db-toolbar__select select {
        width: 100%;
        min-width: 0;
    }
}

/* ============ Pagination ============ */
/*
 * The gap belongs on the wrapper too, not only on `.nav-links`: that div is
 * printed by the_posts_pagination(), while a screen that calls
 * paginate_links() itself - the profile lists, the reputation history, the
 * inbox - puts the links straight into this element, and without a gap here
 * they stood edge to edge.
 */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2xs);
    margin-top: var(--space-l);
}

.pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
}

.pagination .page-numbers {
    display: grid;
    place-items: center;
    min-width: 2.4rem;
    height: 2.4rem;
    padding-inline: var(--space-2xs);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-m);
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: var(--text-s);
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    border-color: var(--color-accent);
    color: var(--color-accent);
    text-decoration: none;
}

.pagination .page-numbers.current {
    background: var(--color-accent-soft);
}

/* The ellipsis is a gap in the sequence, not a page you can go to; boxed like
   the numbers it reads as a disabled button. */
.pagination .page-numbers.dots {
    border-color: transparent;
    color: var(--color-text-muted);
}

/* ============ Footer navigation ============ */
.footer__nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-3xs);
    font-size: var(--text-s);
}

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

.footer__nav a:hover {
    color: var(--color-accent);
}

/* ============ Header search ============ */
/*
 * The search sits between the navigation and the account chip, and the open
 * panel is anchored to it rather than to the header bar. Anchored to the bar it
 * ran to the right edge and covered the nickname - which is what it opens next
 * to, not over.
 */
.site-search {
    position: relative;
    display: flex;
    align-items: center;
}

/* While the field is open the button would only add a second frame. */
.site-search.is-open .site-search__toggle {
    display: none;
}

/*
 * Open, the search takes the middle of the bar and runs from the logo to the
 * account chip. The navigation gives up its space rather than merely being
 * covered: while it only turned invisible, that reserved width was what kept
 * the field from reaching the logo.
 */
.site-search.is-open {
    flex: 1;
}

/* Wide screens only: on narrow ones the menu is a drawer and takes no bar space,
   and display: none here would leave the burger opening nothing. */
@media (min-width: 62rem) {
    .header__inner:has(.site-search.is-open) .header__nav {
        display: none;
    }
}

.site-search__panel {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    translate: 0 -50%;
    z-index: 20;
    /*
     * The frame lives here and nowhere else. The field inside is transparent and
     * borderless, so the panel and the suggestion list below it read as one box
     * instead of a frame within a frame.
     */
    background: var(--color-canvas-alt);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-m);
}

.site-search__panel:has(.live-results:not([hidden])) {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.site-search__form {
    position: relative;
    display: flex;
    align-items: center;
}

.site-search__field {
    flex: 1;
    min-width: 0;
    /* The panel's frame adds its border: together they are the 2.75rem of
       the account chip and the narrow-screen squares beside it. */
    height: calc(2.75rem - 2 * var(--border-thin));
    background: none;
    border: 0;
    border-radius: 0;
    /* The right inset reserves the submit button's width so typed text never
       slides underneath the magnifier. */
    padding: 0 2.75rem 0 var(--space-s);
    color: var(--color-text-strong);
    font-size: var(--text-m);
}

.site-search__field:focus {
    outline: none;
}

.site-search__field::-webkit-search-cancel-button {
    filter: invert(0.6);
}

/* Sits over the right end of the field and submits the form. */
.site-search__submit {
    position: absolute;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: calc(2.75rem - 2 * var(--border-thin));
    padding: 0;
    background: none;
    border: 0;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color var(--duration) var(--ease);
}

.site-search__submit:hover,
.site-search__submit:focus-visible {
    color: var(--color-accent);
}

/*
 * The suggestions hang below the panel rather than growing inside it: the panel
 * keeps its vertical centre on the header, and a growing panel pushed the field
 * up out of view. border-top is dropped so the two boxes share one line.
 */
.live-results {
    position: absolute;
    top: 100%;
    left: -1px;
    right: -1px;
    list-style: none;
    margin: 0;
    padding: var(--space-3xs);
    background: var(--color-canvas-alt);
    border: var(--border-thin) solid var(--color-border);
    border-top: 0;
    border-radius: 0 0 var(--radius-m) var(--radius-m);
    box-shadow: var(--shadow-m);
    max-height: min(60vh, 24rem);
    overflow-y: auto;
}

/*
 * Narrow screens: the open field takes the whole bar. The search stops being
 * the panel's positioning box (static, so the panel anchors to .header__inner)
 * and the panel runs gutter to gutter over logo and buttons alike. Anchored to
 * the search itself it was a field the width of one icon.
 */
@media (max-width: 61.99rem) {
    .site-search.is-open {
        position: static;
        flex: 0 0 auto;
    }

    .site-search__panel {
        left: var(--gutter);
        right: var(--gutter);
    }
}

.live-results__link {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2xs);
    padding: var(--space-2xs) var(--space-xs);
    border-radius: var(--radius-s);
    color: var(--color-text);
    font-size: var(--text-s);
}

.live-results__link:hover,
.live-results__link:focus-visible {
    background: var(--color-surface-hover);
    color: var(--color-accent);
    text-decoration: none;
}

/*
 * The name keeps the row: the kind on the right never wraps, so without a
 * shrinkable box a long name pushed it out of the panel.
 */
.live-results__title {
    min-width: 0;
}

.live-results__type {
    flex-shrink: 0;
    font-size: var(--text-3xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.live-results__empty {
    padding: var(--space-2xs) var(--space-xs);
    font-size: var(--text-s);
    color: var(--color-text-muted);
}

/* ============ Search results ============ */
/*
 * What the reader typed, inside a title - in the suggestions under the field
 * and in the lists on the results page alike. Not a highlighter stripe: the
 * surface is dark, and a filled background on one syllable read as a second
 * row. The match is brought up to the heading's colour instead, and gives the
 * colour back on a row that is hovered, so the row stays one colour.
 */
.search-mark {
    background: none;
    color: var(--color-heading);
    font-weight: 600;
}

.live-results__link:hover .search-mark,
.live-results__link:focus-visible .search-mark,
.search-list__link:hover .search-mark,
.search-list__link:focus-visible .search-mark,
.db-hits__link:hover .search-mark,
.db-hits__link:focus-visible .search-mark {
    color: inherit;
}

/*
 * A result is a row: the title and the section it was found in. The surface,
 * the dividers and the hover are the knowledge-base list's, so both halves of
 * the page read as one list.
 */
.search-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--color-surface);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-l);
    overflow: hidden;
}

.search-list__item + .search-list__item {
    border-top: var(--border-thin) solid var(--color-border);
}

.search-list__link {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2xs) var(--space-s);
    padding: var(--space-xs) var(--space-s);
    color: var(--color-text);
}

.search-list__link:hover,
.search-list__link:focus-visible {
    background: var(--color-surface-hover);
    color: var(--color-accent);
    text-decoration: none;
}

.search-list__title {
    min-width: 0;
    font-size: var(--text-m);
}

/* The path never wraps a word of its own; on a narrow screen it drops under
   the title instead, which is what the wrapping row above is for. */
.search-list__path {
    flex-shrink: 0;
    font-size: var(--text-3xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* ============ Knowledge-base matches on the search page ============ */
/*
 * The entries of the base are not teasers: they have no picture worth a card
 * and no text to quote, so they come as rows - icon, name, what kind of thing
 * it is - under a heading of their own, below what the site itself published.
 */
.db-hits {
    margin-top: var(--space-l);
}

.db-hits__head {
    margin-bottom: var(--space-s);
}

.db-hits__list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--color-surface);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-l);
    overflow: hidden;
}

.db-hits__item + .db-hits__item {
    border-top: var(--border-thin) solid var(--color-border);
}

.db-hits__link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-2xs) var(--space-s);
    color: var(--color-text);
}

.db-hits__link:hover,
.db-hits__link:focus-visible {
    background: var(--color-surface-hover);
    color: var(--color-accent);
    text-decoration: none;
}

/* The slot keeps its width whether or not the entry has a picture, so the
   names of a mixed list still start on one line. */
.db-hits__figure {
    flex: 0 0 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
}

/*
 * Boxed, because the pictures are not square: a spear's icon is 64x256 and
 * base.css gives every image `height: auto`, which made its row four times
 * the height of its neighbours.
 */
.db-hits__icon {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
}

.db-hits__name {
    flex: 1;
    min-width: 0;
    font-size: var(--text-s);
}

.db-hits__kind {
    flex-shrink: 0;
    font-size: var(--text-3xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.db-hits__more {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2xs);
    margin: var(--space-xs) 0 0;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

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

/* ============ Recent forum activity (sidebar, any page) ============ */
/* Like the Steam counter: the widget shell around it already draws the
   surface, so the block itself adds no margin of its own. */
.forum-latest {
    margin: 0;
}

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

.topic-feed__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: var(--space-2xs);
}

.topic-feed__item + .topic-feed__item {
    margin-top: var(--space-xs);
    padding-top: var(--space-xs);
    border-top: var(--border-thin) solid var(--color-border);
}

.topic-feed__avatar {
    grid-row: 1 / span 2;
    line-height: 0;
}

.topic-feed__image {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-s);
    object-fit: cover;
}

.topic-feed__title {
    display: block;
    color: var(--color-text-strong);
    font-size: var(--text-s);
    line-height: var(--leading-snug);
}

.topic-feed__title:hover {
    color: var(--color-accent);
    text-decoration: none;
}

.topic-feed__meta {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2xs);
    margin: var(--space-3xs) 0 0;
    font-size: var(--text-3xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.topic-feed__author {
    color: var(--color-highlight);
}

/* ============ Signed-in user ============ */
.user-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    max-width: 12rem;
    /* As tall as the search panel next to it. */
    height: 2.75rem;
    padding: var(--space-3xs) var(--space-2xs);
    border: var(--border-thin) solid var(--color-border);
    /* Same corner as the search panel beside it: two controls on one row read
       as a pair only if they are cut the same way. */
    border-radius: var(--radius-m);
    color: var(--color-text);
}

.user-chip:hover,
.user-chip:focus-visible {
    border-color: var(--color-accent);
    color: var(--color-accent);
    text-decoration: none;
}

.user-chip__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
}

.user-chip__name {
    /* Nicknames run long; the chip must not stretch the header. */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-heading);
    font-size: var(--text-s);
    font-weight: 700;
}


/* ============ Account menu ============ */
/*
 * A <details> element: it opens and closes on its own, so the menu works
 * before any script runs. The panel is absolute so opening it cannot grow the
 * header - the same reason the search results hang below their panel instead
 * of inside it.
 */
.account {
    position: relative;
}

.account__toggle {
    cursor: pointer;
    list-style: none;
}

/* The disclosure triangle is replaced by the chevron in the markup. */
.account__toggle::-webkit-details-marker {
    display: none;
}

.account__menu {
    position: absolute;
    top: calc(100% + var(--space-2xs));
    right: 0;
    z-index: 60;
    min-width: 14rem;
    padding: var(--space-2xs);
    background: var(--color-surface-raised);
    border: var(--border-thin) solid var(--color-border-strong);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-m);
}

/* The name is inside the chip on a wide screen and hidden on a phone, where
   the menu is the only place it can be read. */
.account__head {
    margin: 0 0 var(--space-3xs);
    padding: var(--space-3xs) var(--space-2xs);
    border-bottom: var(--border-thin) solid var(--color-border);
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.account__link {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    padding: var(--space-2xs);
    border-radius: var(--radius-s);
    color: var(--color-text);
    font-size: var(--text-s);
    white-space: nowrap;
}

.account__link:hover,
.account__link:focus-visible {
    background: var(--color-surface-hover);
    color: var(--color-accent);
    text-decoration: none;
}

/* Leaving is set apart from the two links that stay on the site. */
.account__link--exit {
    margin-top: var(--space-3xs);
    border-top: var(--border-thin) solid var(--color-border);
    border-radius: 0 0 var(--radius-s) var(--radius-s);
    color: var(--color-text-muted);
}

/* Unread messages: a count on the chip (it stays when the name hides on a
   phone) and beside the menu's link. */
.user-chip__badge,
.account__count,
.profile-card__count {
    min-width: 1.25rem;
    padding: 0 var(--space-3xs);
    border-radius: 999px;
    background: var(--color-accent);
    color: var(--color-on-accent);
    font-size: var(--text-3xs);
    font-weight: 700;
    line-height: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.account__count {
    margin-left: auto;
}

/* The chevron follows the menu's state, as it does in the main navigation. */
.account[open] .icon--chevron {
    rotate: 180deg;
}

/*
 * A column that was given a width keeps it instead of growing into whatever
 * a flexible neighbour leaves over.
 *
 * Core says the same thing, but only inside `@media (min-width: 782px)`; this
 * is the same rule without the condition, and there is deliberately nothing
 * else here. An earlier version moved the gap inside the following column so
 * that the percentages would add up to exactly 100 - and the editor then drew
 * the focus ring of a selected column around that padding, with the gap
 * inside the selection. The real cause of the widths drifting was elsewhere
 * (the block's stylesheet never reached the canvas, see
 * TQ\Forum\BlockEditor::iframed_assets), so the gap is a gap again.
 */
.wp-block-column[style*='flex-basis'] {
    flex-grow: 0;
}

/*
 * "Cards of the same height" on a columns block.
 *
 * The columns themselves are already equal - a flex row stretches them - but
 * what is inside one is only as tall as itself, so two panels side by side
 * ended at different lines and the shorter one read as unfinished. The column
 * becomes a column-flex box and what it holds is told to fill it.
 *
 * The class is written by the option on the block (TQ\Content\ColumnOptions),
 * so nothing changes for a columns block that did not ask for it.
 */
.wp-block-columns.is-tq-equal-cards > .wp-block-column {
    display: flex;
    flex-direction: column;
}

/*
 * The stretch has to travel all the way down.
 *
 * Making the column a flex box only stretched the block's own wrapper - the
 * `<div class="db-entry">` around a card, and in the editor two more wrappers
 * inside that. The card itself kept its content height and the option looked
 * like it had done nothing at all. So each wrapper on the way is a flex box
 * too, and what it holds is told to fill it, down to the card.
 */
.wp-block-columns.is-tq-equal-cards > .wp-block-column > *,
.wp-block-columns.is-tq-equal-cards .db-entry > *,
.wp-block-columns.is-tq-equal-cards .db-entry__preview > *,
.wp-block-columns.is-tq-equal-cards .db-entry__card > * {
    flex: 1 1 auto;
    min-height: 0;
}

.wp-block-columns.is-tq-equal-cards .db-entry,
.wp-block-columns.is-tq-equal-cards .db-entry__preview,
.wp-block-columns.is-tq-equal-cards .db-entry__card {
    display: flex;
    flex-direction: column;
}

/* ============ File archive (mods) ============ */
.teaser__game {
    margin: 0 0 var(--space-2xs);
    font-family: var(--font-heading);
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.teaser__game a {
    color: inherit;
}

/*
 * Filter panel of the archive: two groups side by side, each a caption over a
 * plain list that flows into columns. Lists rather than a table of cells - the
 * grid lines made a filter look like a spreadsheet.
 */
.mod-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-m) var(--space-l);
    margin-bottom: var(--space-m);
    padding: var(--space-m) var(--space-l);
    border: var(--border-thin) solid var(--color-border);
    background: var(--color-surface-sunken);
}

.mod-filter__group {
    min-width: 0;
}

.mod-filter__title {
    margin: 0 0 var(--space-2xs);
    padding-bottom: var(--space-3xs);
    border-bottom: var(--border-thin) solid var(--color-border);
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: var(--text-3xs);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
}

.mod-filter__list {
    columns: 2 9rem;
    column-gap: var(--space-m);
    margin: 0;
    padding: 0;
    list-style: none;
}

.mod-filter__item {
    break-inside: avoid;
}

.mod-filter__link {
    display: flex;
    align-items: baseline;
    gap: var(--space-2xs);
    padding: var(--space-3xs) 0 var(--space-3xs) var(--space-s);
    position: relative;
    color: var(--color-text);
    font-size: var(--text-s);
    line-height: 1.4;
}

/* The marker: a short rule, lit on the chosen entry. */
.mod-filter__link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 0.375rem;
    height: 1px;
    background: var(--color-border-strong);
}

.mod-filter__link:is(a):hover,
.mod-filter__link:is(a):focus-visible {
    color: var(--color-accent);
    text-decoration: none;
}

.mod-filter__link--current {
    color: var(--color-heading);
    font-weight: 700;
}

.mod-filter__link--current::before {
    width: 0.5rem;
    height: 2px;
    margin-top: -0.5px;
    background: var(--color-accent);
}

.mod-filter__link--empty {
    color: var(--color-text-muted);
    opacity: 0.45;
}

.mod-filter__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mod-filter__count {
    flex-shrink: 0;
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

/*
 * No smaller padding on phones: the corner meander takes ~31px from the edge
 * (7px inset + a 24px sprite), and 1rem put the first line of text on it.
 * The same holds for the facts and download panels below.
 */
@media (max-width: 48rem) {
    .mod-filter {
        grid-template-columns: 1fr;
    }
}

/*
 * Facts panel: a grid of label-over-value cells on the meander panel, the
 * same surface as the profile head and the knowledge-base panels. Cells are
 * separated by a hairline on their top edge, so a half-filled last row does
 * not show a block of line colour where a cell is missing.
 */
.mod-facts {
    margin: 0 0 var(--space-m);
    padding: var(--space-m) var(--space-l);
    border: var(--border-thin) solid var(--color-border);
    background: var(--color-surface-sunken);
}

/*
 * Always two columns: auto-fill dropped to one in the narrowed overview
 * column, and a tall facts panel stretched the cover picture beside it into a
 * thin strip. Languages sit in the grid like any other fact for the same
 * reason - a full-width row of their own only added height.
 */
.mod-facts__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-s) var(--space-m);
    margin: 0;
}

@media (max-width: 26rem) {
    .mod-facts__list {
        grid-template-columns: 1fr;
    }
}

.mod-facts__item {
    min-width: 0;
}

.mod-facts__label {
    margin-bottom: var(--space-3xs);
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: var(--text-3xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.mod-facts__value {
    margin: 0;
    color: var(--color-text-strong);
    font-size: var(--text-s);
    overflow-wrap: anywhere;
}

.mod-facts__value--tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3xs);
}

.mod-facts__tag {
    padding: 0 var(--space-2xs);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-s);
    color: var(--color-text);
    font-size: var(--text-2xs);
    line-height: 1.8;
}

/*
 * Overview row of an entry: the facts panel and, beside it in a narrower
 * column (~38%), the cover screenshot. Both stretch to the taller one; without
 * a picture the facts panel takes the whole row (:only-child).
 */
.mod-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: var(--space-m);
    margin: 0 0 var(--space-m);
}

.mod-overview > :only-child {
    grid-column: 1 / -1;
}

.mod-overview > .mod-facts {
    margin: 0;
}

/*
 * The cover: just the picture, rounded, filling its column and cropped to it,
 * with "+N" over it when there are more. No panel, border or meander - beside
 * the framed facts panel a second frame only made two boxes.
 */
.mod-cover {
    display: flex;
    min-height: 12rem;
}

.mod-cover__link {
    position: relative;
    display: block;
    flex: 1;
    overflow: hidden;
    border-radius: var(--radius-m);
}

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

.mod-cover__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: scale var(--duration) var(--ease);
}

.mod-cover__link:hover .mod-cover__image {
    scale: 1.03;
}

/* A small capture is shown whole and centred, never enlarged. */
.mod-cover--small .mod-cover__link {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mod-cover--small .mod-cover__image {
    position: static;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    border-radius: var(--radius-m);
    object-fit: contain;
}

.mod-cover--small .mod-cover__link:hover .mod-cover__image {
    scale: 1;
}

.mod-cover__more {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--color-canvas) 55%, transparent);
    color: var(--color-text-strong);
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
    transition: background var(--duration) var(--ease);
}

.mod-cover__link:hover .mod-cover__more {
    background: color-mix(in srgb, var(--color-canvas) 40%, transparent);
}

@media (max-width: 62rem) {
    .mod-overview {
        grid-template-columns: 1fr;
    }

    .mod-cover {
        min-height: 0;
    }

    .mod-cover__link {
        aspect-ratio: 16 / 10;
    }

    .mod-cover--small .mod-cover__link {
        aspect-ratio: auto;
    }
}

/*
 * Download panel: the link rows and, beneath them, the file size and count.
 * The rows are the only clickable things in the panel and look like it - a
 * full-width strip with a number and an arrow.
 */
.mod-download {
    display: grid;
    gap: var(--space-s);
    margin-top: var(--space-m);
    padding: var(--space-m) var(--space-l);
    border: var(--border-thin) solid var(--color-border);
    background: var(--color-surface);
}

/* Set like the section heads: condensed capitals with the engraved gradient. */
.mod-download__title {
    margin: 0;
    color: var(--color-heading);
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    line-height: var(--leading-tight);
    text-align: center;
    text-transform: uppercase;
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
    .mod-download__title {
        background-image: var(--gradient-heading);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }
}

.mod-download__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs) var(--space-m);
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--text-2xs);
}

.mod-download__meta > * {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3xs);
}

.mod-download__links {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
    margin: 0;
    padding: 0;
    list-style: none;
}

.mod-download__link {
    display: flex;
    align-items: center;
    gap: var(--space-s);
    padding: var(--space-2xs) var(--space-s);
    border: var(--border-thin) solid var(--color-border-strong);
    background: var(--color-surface-sunken);
    color: var(--color-text-strong);
    transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}

.mod-download__link:hover,
.mod-download__link:focus-visible {
    border-color: var(--color-accent);
    background: var(--color-surface-hover);
    text-decoration: none;
}

.mod-download__number {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: var(--border-thin) solid var(--color-border-strong);
    color: var(--color-accent);
    font-family: var(--font-heading);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.mod-download__label {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    font-family: var(--font-heading);
    font-size: var(--text-m);
    font-weight: 700;
    line-height: var(--leading-tight);
}

.mod-download__host {
    overflow: hidden;
    color: var(--color-text-muted);
    font-family: var(--font-main);
    font-size: var(--text-2xs);
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mod-download__arrow {
    display: inline-flex;
    flex-shrink: 0;
    color: var(--color-text-muted);
    transition: transform var(--duration) var(--ease), color var(--duration) var(--ease);
}

.mod-download__link:hover .mod-download__arrow,
.mod-download__link:focus-visible .mod-download__arrow {
    color: var(--color-accent);
    transform: translateX(3px);
}

.mod-download__lock-text {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    margin: 0 0 var(--space-s);
    color: var(--color-text);
}

.mod-download__lock-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
}


/* ============ Private messages ============ */
/*
 * The inbox (`pm-inbox`, rows `pm-thread`) and a conversation (`pm-dialog`,
 * messages `pm-message`, form `pm-form`). They fill the main column of the
 * profile, next to its aside.
 */
.pm__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-s);
    margin-bottom: var(--space-m);
}

.pm__title {
    margin: 0;
}

.pm-find {
    display: flex;
    gap: var(--space-2xs);
    flex: 1 1 18rem;
    max-width: 26rem;
}

.pm-find__field {
    flex: 1;
    min-width: 0;
}

.pm-empty {
    padding: var(--space-xl) var(--space-l);
    background: var(--color-surface);
    text-align: center;
}

.pm-empty__text {
    margin: 0 0 var(--space-2xs);
    color: var(--color-heading);
    font-family: var(--font-heading);
    font-size: var(--text-l);
}

.pm-empty__hint {
    margin: 0;
    color: var(--color-text-muted);
}

.pm-list {
    margin: 0 0 var(--space-m);
    padding: 0;
    list-style: none;
    background: var(--color-surface);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-m);
}

.pm-thread {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-s);
    padding: var(--space-s) var(--space-m);
}

.pm-thread + .pm-thread {
    border-top: var(--border-thin) solid var(--color-border);
}

.pm-thread:hover {
    background: var(--color-surface-hover);
}

.pm-thread__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pm-thread__avatar--gone,
.pm-message__avatar--gone {
    background: var(--color-surface-sunken);
}

.pm-thread__body {
    flex: 1;
    min-width: 0;
}

.pm-thread__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-s);
    margin: 0 0 var(--space-3xs);
}

.pm-thread__name {
    overflow: hidden;
    color: var(--color-heading);
    font-family: var(--font-heading);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The whole row opens the conversation. */
.pm-thread__name::after {
    content: '';
    position: absolute;
    inset: 0;
}

.pm-thread__name:hover {
    color: var(--color-accent);
    text-decoration: none;
}

.pm-thread__time {
    flex-shrink: 0;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
}

.pm-thread__excerpt {
    margin: 0;
    overflow: hidden;
    color: var(--color-text-muted);
    font-size: var(--text-s);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-thread__you {
    color: var(--color-text);
}

.pm-thread--unread .pm-thread__excerpt {
    color: var(--color-text-strong);
}

.pm-thread__count {
    min-width: 1.5rem;
    padding: 0 var(--space-2xs);
    border-radius: 999px;
    background: var(--color-accent);
    color: var(--color-on-accent);
    font-size: var(--text-2xs);
    font-weight: 700;
    line-height: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

/* Own last message not read yet: a hollow dot. */
.pm-thread__state {
    width: 0.625rem;
    height: 0.625rem;
    border: var(--border-thin) solid var(--color-accent);
    border-radius: 50%;
    flex-shrink: 0;
}

/* Delete button: above the row's link overlay, so it is clicked, not the row. */
.pm-thread__remove {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    margin: 0;
}

.pm-thread__remove-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: var(--border-thin) solid transparent;
    border-radius: var(--radius-s);
    background: none;
    color: var(--color-text-muted);
    cursor: pointer;
}

.pm-thread__remove-button:hover {
    border-color: var(--color-border);
    color: var(--color-heading);
}

.pm-dialog__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-s);
    padding: var(--space-m) var(--space-l);
    background: var(--color-surface);
}

.pm-dialog__who {
    display: flex;
    align-items: center;
    gap: var(--space-s);
    min-width: 0;
    color: var(--color-heading);
}

.pm-dialog__who:hover {
    color: var(--color-accent);
    text-decoration: none;
}

.pm-dialog__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pm-dialog__names {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pm-dialog__name {
    overflow: hidden;
    font-family: var(--font-heading);
    font-size: var(--text-l);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-dialog__group {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.pm-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
}

.pm-dialog__action {
    margin: 0;
}

/* The conversation scrolls inside itself, so the form stays in reach. */
.pm-dialog__body {
    max-height: min(65vh, 40rem);
    margin: var(--space-s) 0;
    padding: var(--space-s) 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.pm-dialog__older {
    margin: 0 0 var(--space-s);
    text-align: center;
}

.pm-dialog__empty {
    margin: var(--space-l) 0;
    color: var(--color-text-muted);
    text-align: center;
}

.pm-dialog__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-s);
    margin: 0;
    padding: 0;
    list-style: none;
}

.pm-message {
    display: flex;
    align-items: flex-end;
    gap: var(--space-2xs);
    max-width: 85%;
    /* A message linked as #m123 lands clear of the scroller's top edge. */
    scroll-margin-top: var(--space-l);
}

.pm-message--own {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.pm-message__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pm-message__bubble {
    min-width: 0;
    padding: var(--space-2xs) var(--space-s);
    background: var(--color-surface-raised);
    border: var(--border-thin) solid var(--color-border);
    border-radius: var(--radius-m);
}

.pm-message--own .pm-message__bubble {
    background: var(--color-accent-soft);
    border-color: var(--color-border-accent);
}

.pm-message:target .pm-message__bubble {
    border-color: var(--color-accent);
}

.pm-message__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2xs);
    margin: 0 0 var(--space-3xs);
    font-size: var(--text-2xs);
}

.pm-message__author {
    color: var(--color-heading);
    font-weight: 700;
}

.pm-message__time,
.pm-message__state {
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.pm-message--seen .pm-message__state {
    color: var(--color-success);
}

.pm-message__text {
    color: var(--color-text-reading);
    line-height: var(--leading-reading);
    overflow-wrap: anywhere;
}

/* Member's own markup (the comment set), so tags it is. */
.pm-message__text p {
    margin: 0;
}

.pm-message__text p + p,
.pm-message__text blockquote {
    margin-top: var(--space-2xs);
}

.pm-message__text blockquote {
    margin-bottom: 0;
    padding: var(--space-2xs) var(--space-s);
    background: var(--color-surface-sunken);
    border-inline-start: 2px solid var(--color-border-accent);
    font-size: var(--text-s);
}

.pm-message__text a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pm-message__picture {
    display: inline-block;
    max-width: 100%;
    vertical-align: top;
}

.pm-message__image {
    max-width: 100%;
    max-height: 20rem;
    width: auto;
    height: auto;
    border-radius: var(--radius-s);
}

.pm-message__text code {
    padding: 0 0.3em;
    background: var(--color-surface-sunken);
    border-radius: var(--radius-s);
}

.pm-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}

.pm-form__editor {
    display: flex;
    flex-direction: column;
}

.pm-form__field {
    width: 100%;
    min-height: 5rem;
    resize: vertical;
}

.pm-form__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-s);
}

.pm-form__hint {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

@media (max-width: 40rem) {
    .pm-thread {
        padding: var(--space-s);
    }

    .pm-dialog__head {
        padding: var(--space-m) calc(var(--space-l) + var(--space-2xs));
    }

    .pm-message {
        max-width: 100%;
    }

    .pm-form__hint {
        display: none;
    }
}

/* ============ Trade reputation (Trade\Reputation): the board, a listing, the profile ============ */
.trade-rep {
    display: inline-flex;
    gap: var(--space-3xs);
    font-size: var(--text-2xs);
    font-variant-numeric: tabular-nums;
}

.trade-rep__pos {
    color: var(--color-success);
}

.trade-rep__neg {
    color: var(--color-danger);
}

.trade-rep--none {
    color: var(--color-text-muted);
    text-transform: none;
    letter-spacing: 0;
}

/* ============ Page titles on a phone ============ */
/*
 * One size for the heading of a page, whatever the section: 36px and 28px
 * both took a headline three words to the line and read as the page's banner
 * rather than its title. The hero of the front page and the 404 keep their
 * own scale - they are art, not headings over a list.
 *
 * The rule is last in the sheet on purpose: every selector here is a single
 * class, the same specificity as the declaration it overrides, so it only
 * wins by coming after it. The forum has its own two titles in forum.css and
 * the board of the trade one in trade.css, each next to its own definition.
 */
@media (max-width: 40rem) {
    .article__title,
    .section-head__title,
    .auth__title,
    .profile-card__name,
    .db-single__title {
        font-size: var(--text-xl);
    }
}
