/* ==========================================================================
   L2 Darion — site público
   Portal do servidor: fundo escuro, metal champanhe da logo, painéis com
   moldura e cantos marcados, faixa de arte, tiles e colunas de dado vivo.
   ========================================================================== */

:root {
    color-scheme: dark;

    --ink: #0a0908;
    --ink-2: #100d0c;
    --panel: #15110f;
    --panel-2: #1c1714;
    --line: rgba(214, 192, 143, 0.2);
    --line-strong: rgba(214, 192, 143, 0.42);

    /* The brand metal: the logo champagne, light to dark. */
    --metal: #f0e3c4;
    --gold: #d6c08f;
    --gold-deep: #9b7f4e;

    --text: #e6e0d4;
    --text-dim: #a2977f;

    --online: #74c47a;
    --offline: #c0564a;

    --measure: 66ch;
    --page: 76rem;

    --serif: "Grenze", "Iowan Old Style", Palatino, serif;

    --step-0: 1.0625rem;
    --step-1: 1.1875rem;
    --step-2: clamp(1.3rem, 1.05rem + 0.9vw, 1.65rem);
    --step-3: clamp(1.7rem, 1.25rem + 1.8vw, 2.4rem);
    --step-4: clamp(2.4rem, 1.3rem + 4.6vw, 4.6rem);

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: var(--ink);
    color: var(--text);
    font-family: var(--serif);
    font-size: var(--step-0);
    line-height: 1.66;
}

/* --- Browser surfaces --------------------------------------------------- */

a {
    color: var(--metal);
    text-decoration-color: var(--gold-deep);
    text-underline-offset: 0.2em;
}

a:hover {
    color: var(--metal);
    text-decoration-color: var(--gold);
}

::selection {
    background: var(--gold);
    color: var(--ink);
}

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

* {
    scrollbar-color: var(--gold-deep) var(--ink-2);
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 11px;
    height: 11px;
}

::-webkit-scrollbar-track {
    background: var(--ink-2);
}

::-webkit-scrollbar-thumb {
    background: var(--gold-deep);
    border: 2px solid var(--ink-2);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* --- Structure ----------------------------------------------------------- */

.wrap {
    max-width: var(--page);
    margin-inline: auto;
    padding-inline: clamp(1rem, 3.5vw, 2.5rem);
}

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

.bar {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: rgba(10, 9, 8, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(6px);
}

.bar-inner {
    display: flex;
    align-items: center;
    gap: clamp(0.8rem, 2.5vw, 2rem);
    flex-wrap: wrap;
    padding-block: 0.7rem;
}

.brand img {
    display: block;
    height: 2.2rem;
    width: auto;
}

.nav {
    display: flex;
    gap: clamp(0.7rem, 1.8vw, 1.6rem);
    flex-wrap: wrap;
    align-items: center;
    margin-left: auto;
}

.nav a {
    position: relative;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding-block: 0.45rem;
}

.nav a:hover {
    color: var(--metal);
}

.nav a[aria-current="page"] {
    color: var(--metal);
}

.nav a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--gold);
}

/* --- Art band ------------------------------------------------------------ */

.hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--line-strong);
    background-color: var(--ink-2);
}

.hero-art {
    position: absolute;
    inset: 0;
    background-image: url("/img/hero-bg.webp");
    background-size: cover;
    background-position: 50% 42%;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, rgba(10, 9, 8, 0.82) 18%, rgba(10, 9, 8, 0.3) 52%, rgba(10, 9, 8, 0.5)),
        linear-gradient(to top, var(--ink) 1%, rgba(10, 9, 8, 0) 30%);
}

.hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: end;
    padding-top: clamp(2.75rem, 9vh, 4.5rem);
}

.hero-copy {
    padding-bottom: clamp(2.75rem, 9vh, 4.5rem);
}

.hero-figure {
    display: block;
    width: 100%;
    height: auto;
    max-height: 38rem;
    object-fit: contain;
    object-position: bottom;
    align-self: end;
    margin-bottom: -1px;
}

.hero h1 {
    margin: 0;
    font-size: var(--step-4);
    font-weight: 700;
    line-height: 0.96;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--metal);
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55), 0 14px 38px rgba(0, 0, 0, 0.65);
    max-width: 14ch;
}

.hero-sub {
    max-width: 42ch;
    margin: 1.1rem 0 0;
    font-size: var(--step-1);
    color: var(--text);
}

.hero .plates {
    margin-top: 1.8rem;
}

.hero-state {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.5rem 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text);
}

/* --- Action plates ------------------------------------------------------- */

.plates {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.plate {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.9rem 1.7rem;
    font-family: var(--serif);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    overflow: hidden;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.plate-gold {
    background-color: var(--gold);
    color: #140f0a;
    box-shadow: inset 0 0 0 1px var(--metal), 0 8px 20px rgba(0, 0, 0, 0.5);
}

.plate-gold::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(104deg, transparent 42%, rgba(255, 255, 255, 0.38) 50%, transparent 58%);
    transform: translateX(-120%);
    transition: transform 0.6s var(--ease);
    z-index: 0;
}

.plate-gold:hover {
    background-color: var(--metal);
    /* Explicit on purpose: the global a:hover rule outranks .plate-gold. */
    color: #140f0a;
}

.plate-gold:hover::after,
.plate-gold:focus-visible::after {
    transform: translateX(120%);
}

.plate-ink {
    color: var(--metal);
    background-color: rgba(10, 9, 8, 0.5);
    box-shadow: inset 0 0 0 1px var(--gold-deep);
}

.plate-ink:hover {
    background-color: rgba(214, 192, 143, 0.12);
    color: var(--metal);
}

.plate svg {
    width: 1.05em;
    height: 1.05em;
    flex: none;
}

/* The label and the icon sit above the sheen: otherwise ::after hides both on hover. */
.plate > * {
    position: relative;
    z-index: 1;
}

.plates-left {
    justify-content: flex-start;
    margin-top: 1.4rem;
}

.plates-center {
    justify-content: center;
    margin-top: 1.75rem;
}

/* --- Status and rates strip --------------------------------------------- */

.strip {
    background-color: var(--panel);
    background-image: url("/img/grain.png");
    background-repeat: repeat;
    background-size: 96px 96px;
    border-bottom: 1px solid var(--line);
}

.strip-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 clamp(1rem, 3vw, 2.5rem);
    padding-block: 0.85rem;
}

.strip dl {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0;
    padding-block: 0.25rem;
}

.strip dt {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.strip dd {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--metal);
    font-variant-numeric: tabular-nums lining-nums;
}

.strip .state {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-right: auto;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.82rem;
}

.pip {
    /* Inline by default a span ignores width and height, and the dot collapses into a hairline. */
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: var(--offline);
    box-shadow: 0 0 0 3px rgba(192, 86, 74, 0.18);
}

.pip-on {
    background: var(--online);
    box-shadow: 0 0 0 3px rgba(116, 196, 122, 0.18);
}

.strip-more {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    text-decoration: none;
}

.strip-more:hover {
    color: var(--metal);
}

/* --- Art tiles ----------------------------------------------------------- */

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1.1rem;
    padding-block: clamp(2rem, 5vh, 3rem);
}

.tile {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    text-decoration: none;
    background-color: var(--panel);
    box-shadow: inset 0 0 0 1px var(--line-strong);
}

.tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease), filter 0.4s var(--ease);
    filter: saturate(0.9) brightness(0.72);
}

.tile:hover img,
.tile:focus-visible img {
    transform: scale(1.04);
    filter: saturate(1) brightness(0.86);
}

.tile-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.4rem 1.2rem 1.1rem;
    background: linear-gradient(to top, rgba(10, 9, 8, 0.94) 32%, rgba(10, 9, 8, 0));
    color: var(--metal);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.tile-label .tile-desc {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--text-dim);
}

.tile:hover {
    box-shadow: inset 0 0 0 1px var(--gold);
}

/* --- Framed panels ------------------------------------------------------- */

.panels {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1.1rem;
    padding-bottom: clamp(2.5rem, 6vh, 4rem);
    align-items: start;
}

.panel {
    position: relative;
    background-color: var(--panel);
    background-image: url("/img/grain.png");
    background-repeat: repeat;
    background-size: 96px 96px;
    box-shadow: inset 0 0 0 1px var(--line);
    padding: 1.3rem clamp(1rem, 2.5vw, 1.6rem) 1.5rem;
}

/*
 * Empilhados, dois painéis nunca se encostam. Antes isto dependia de cada página pôr uma .section
 * por painel; numa página que empilha dois (bosses, olympiad) eles colavam, com as molduras de
 * canto brigando uma com a outra.
 */
.panel + .panel,
.panel + .marginal,
.marginal + .panel,
.cols + .panel,
.panel + .cols,
.table-scroll + .panel {
    margin-top: clamp(1.1rem, 2.5vw, 1.8rem);
}

/* Dentro de uma grade o espaço é do gap: a margem aqui empurraria o segundo painel para baixo e
   desalinharia o par. */
.cols > .panel + .panel {
    margin-top: 0;
}

/* Corner marks. */
.panel::before,
.panel::after {
    content: "";
    position: absolute;
    width: 13px;
    height: 13px;
    border: 1px solid var(--gold);
    pointer-events: none;
}

.panel::before {
    top: -1px;
    left: -1px;
    border-right: 0;
    border-bottom: 0;
}

.panel::after {
    right: -1px;
    bottom: -1px;
    border-left: 0;
    border-top: 0;
}

.panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 0.85rem;
    margin-bottom: 0.9rem;
    border-bottom: 1px solid var(--line);
}

.panel-head h2,
.panel-head h3 {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--metal);
}

.more {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    text-decoration: none;
    white-space: nowrap;
}

.more:hover {
    color: var(--metal);
}

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

.roll {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums lining-nums;
}

.roll caption {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--metal);
    padding-bottom: 0.7rem;
}

.roll th,
.roll td {
    text-align: left;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid var(--line);
}

.roll thead th {
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
    border-bottom-color: var(--line-strong);
    white-space: nowrap;
}

.roll tbody tr:last-child th,
.roll tbody tr:last-child td {
    border-bottom: 0;
}

.roll tbody tr:hover td,
.roll tbody tr:hover th {
    background-color: rgba(214, 192, 143, 0.05);
}

.roll th[scope="row"] {
    font-weight: 500;
    color: var(--text);
}

.roll .rank {
    width: 2.8rem;
    color: var(--gold);
    font-weight: 700;
}

.roll .num {
    text-align: right;
    font-weight: 600;
    color: var(--metal);
}

.roll .dim {
    color: var(--text-dim);
}

.roll a {
    color: var(--metal);
    text-decoration-color: var(--gold-deep);
    text-underline-offset: 0.2em;
}

.roll-compact th,
.roll-compact td {
    padding: 0.42rem 0.6rem;
}

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

/* --- Inner pages --------------------------------------------------------- */

.page-head {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--line-strong);
    background-color: var(--ink-2);
}

.page-head-art {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: 50% 45%;
    filter: saturate(0.85);
}

.page-head::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(10, 9, 8, 0.95) 28%, rgba(10, 9, 8, 0.55));
}

.page-head-inner {
    position: relative;
    z-index: 2;
    padding-block: clamp(2.2rem, 7vh, 3.6rem);
}

.page-head h1 {
    margin: 0;
    font-size: var(--step-3);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--metal);
    line-height: 1.06;
    max-width: 24ch;
}

.page-head .lead {
    margin: 0.9rem 0 0;
    max-width: var(--measure);
    color: var(--text);
}

.section {
    padding-block: clamp(2rem, 5vh, 3.2rem);
    border-top: 1px solid var(--line);
}

.section:first-of-type {
    border-top: 0;
}

.section > h2 {
    margin: 0 0 1.2rem;
    font-size: var(--step-2);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--metal);
}

.section h3 {
    margin: 1.8rem 0 0.6rem;
    font-size: var(--step-1);
    font-weight: 600;
    color: var(--text);
}

.section p {
    max-width: var(--measure);
}

.section p a,
.prose a {
    color: var(--metal);
    text-decoration-color: var(--gold-deep);
    text-underline-offset: 0.2em;
}

.section code,
.prose code {
    font-family: var(--serif);
    font-weight: 600;
    color: var(--gold);
}

.section strong,
.prose strong {
    color: var(--metal);
    font-weight: 600;
}

.cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
    gap: clamp(1.1rem, 3vw, 2rem);
    align-items: start;
}

/* Two panels side by side read as a pair, so they end at the same line. */
.cols-even {
    align-items: stretch;
}

/* --- In-page index ------------------------------------------------------- */

.on-this-page {
    padding-block: 0.9rem;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 3.6rem;
    background-color: rgba(10, 9, 8, 0.95);
    backdrop-filter: blur(6px);
    z-index: 10;
}

.on-this-page-inner {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.on-this-page a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.on-this-page a:hover {
    color: var(--metal);
}

/* --- Entries (systems, rules, FAQ) --------------------------------------- */

.entries {
    display: grid;
    gap: 0;
}

.entry {
    border-top: 1px solid var(--line);
    padding-block: 1.1rem;
}

.entry:first-child {
    border-top: 0;
}

.entry > summary {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    cursor: pointer;
    list-style: none;
    font-size: var(--step-1);
    font-weight: 600;
    color: var(--text);
}

.entry > summary::-webkit-details-marker {
    display: none;
}

.entry > summary::before {
    content: "";
    flex: none;
    width: 0.4rem;
    height: 0.4rem;
    margin-top: 0.55em;
    background: var(--gold-deep);
    rotate: 45deg;
    transition: background-color 0.2s var(--ease), rotate 0.3s var(--ease);
}

.entry[open] > summary::before,
.entry > summary:hover::before {
    background: var(--metal);
    rotate: 135deg;
}

.entry > summary:hover {
    color: var(--metal);
}

.entry .tag {
    margin-left: auto;
    flex: none;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    box-shadow: inset 0 0 0 1px var(--gold-deep);
    padding: 0.25rem 0.5rem;
}

.entry-body {
    padding: 0.8rem 0 0 1.2rem;
}

.entry-body p {
    margin: 0 0 0.8rem;
    max-width: var(--measure);
}

.entry-body > :last-child {
    margin-bottom: 0;
}

.pairs {
    margin: 0.9rem 0 0;
    display: grid;
    gap: 0;
    max-width: var(--measure);
}

.pairs > div {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--line);
}

.pairs dt {
    color: var(--text-dim);
    font-size: 0.92rem;
}

.pairs dd {
    margin: 0;
    text-align: right;
    font-variant-numeric: tabular-nums lining-nums;
}

/* The figure that proves a live server: one step above its neighbours, never a giant number. */
.pairs dd.lead {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--metal);
}

.marginal {
    margin: 1.2rem 0 0;
    padding: 0.85rem 1.1rem;
    border-left: 2px solid var(--gold-deep);
    background-color: rgba(214, 192, 143, 0.05);
    font-size: 0.93rem;
    max-width: var(--measure);
}

.absent {
    margin: 0;
    padding: 1rem 1.15rem;
    border: 1px dashed var(--line-strong);
    color: var(--text-dim);
}

/* --- Steps (download) ---------------------------------------------------- */

.steps {
    counter-reset: step;
    list-style: none;
    margin: 0;
    padding: 0;
}

.steps > li {
    counter-increment: step;
    position: relative;
    padding-left: 3.2rem;
    padding-block: 1.3rem;
    border-top: 1px solid var(--line);
}

.steps > li:first-child {
    border-top: 0;
}

.steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 1.25rem;
    width: 2.1rem;
    height: 2.1rem;
    display: grid;
    place-content: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--metal);
    background-color: var(--panel-2);
    box-shadow: inset 0 0 0 1px var(--gold-deep);
}

.steps h2,
.steps h3 {
    margin: 0 0 0.4rem;
    font-size: var(--step-1);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--metal);
}

.steps p {
    margin: 0 0 0.6rem;
    max-width: var(--measure);
}

.steps small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.dl-howto {
    margin: 0.8rem 0 0;
    padding-left: 1.2rem;
    color: var(--text-dim);
    max-width: var(--measure);
}

.dl-howto li {
    padding-block: 0.18rem;
}

.dl-howto li::marker {
    color: var(--gold-deep);
}

/* --- Castle sheet -------------------------------------------------------- */

.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0 clamp(1.2rem, 3vw, 2.5rem);
    margin: 0;
}

.facts > div {
    padding-block: 0.85rem;
    border-top: 1px solid var(--line);
}

.facts dt {
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
}

.facts dd {
    margin: 0;
    font-size: var(--step-1);
    color: var(--text);
    font-variant-numeric: tabular-nums lining-nums;
}

.facts .dim {
    display: block;
    font-size: 0.86rem;
    color: var(--text-dim);
    font-variant-numeric: normal;
}

.facts-single {
    grid-template-columns: minmax(0, 1fr);
}

.clan-list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
}

.clan-list li {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    align-items: baseline;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--line);
}

.clan-list .name {
    font-weight: 600;
    color: var(--text);
}

.clan-list .dim {
    color: var(--text-dim);
    font-size: 0.88rem;
}

/* --- Tops de servidor ----------------------------------------------------- */

.vote-banners {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.9rem;
}

/*
 * Cada top entrega a arte que quer: uma de 120x60, outra de 290x106, um ícone quadrado. Soltas
 * numa linha viram tamanhos brigando, então cada uma entra na mesma caixa, com a arte contida.
 * A caixa é pequena de propósito: isto é rodapé, não chamada principal.
 */
.vote-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4.8rem;
    height: 2.2rem;
    padding: 0.25rem 0.35rem;
    background-color: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 0 0 1px var(--line);
    overflow: hidden;
    /* Se a arte do top sair do ar, sobra o alt: que ele leia como rótulo. */
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    text-align: center;
    text-decoration: none;
}

.vote-banner img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.78;
    transition: opacity 0.25s var(--ease);
}

.vote-banner:hover,
.vote-banner:focus-visible {
    background-color: rgba(214, 192, 143, 0.08);
    box-shadow: inset 0 0 0 1px var(--gold-deep);
    color: var(--metal);
}

.vote-banner:hover img,
.vote-banner:focus-visible img {
    opacity: 1;
}

/* O pixel conta a visita no top; não é para ser visto. */
.vote-pixel {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

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

.foot {
    border-top: 1px solid var(--line-strong);
    background-color: var(--ink-2);
    margin-top: clamp(2rem, 6vh, 4rem);
}

.foot-inner {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding-block: 2rem 2.5rem;
    color: var(--text-dim);
    font-size: 0.88rem;
}

.foot a {
    color: var(--gold);
    text-decoration-color: var(--gold-deep);
    text-underline-offset: 0.2em;
}

.foot a:hover {
    color: var(--metal);
}

.tongues {
    display: flex;
    gap: 0.9rem;
    align-items: baseline;
}

.tongues a {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
}

.tongues a[aria-current="true"] {
    color: var(--metal);
    text-decoration: underline;
    text-decoration-color: var(--gold);
}

/*
 * O rodapé tem quatro colunas: quem somos, as páginas, a conta, e os tops. Antes era só a fila de
 * banners e a linha legal, e os banners — a parte menos importante — eram a única coisa ali.
 */
.foot-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
    gap: clamp(1.4rem, 3vw, 2.6rem);
    padding-block: clamp(2rem, 4vh, 2.8rem);
}

.foot-brand img {
    display: block;
    opacity: 0.85;
}

.foot-brand p {
    margin: 0.9rem 0 0;
    font-size: 0.9rem;
    color: var(--text-dim);
    max-width: 28ch;
}

.foot-discord {
    display: inline-block;
    margin-top: 0.9rem;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.foot-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
}

.foot-links a {
    font-size: 0.92rem;
    color: var(--text-dim);
    text-decoration: none;
}

.foot-links a:hover,
.foot-links a:focus-visible {
    color: var(--metal);
    text-decoration: underline;
    text-decoration-color: var(--gold-deep);
    text-underline-offset: 0.25em;
}

.foot-discord {
    text-decoration: none;
}

.foot-discord:hover {
    text-decoration: underline;
    text-decoration-color: var(--gold-deep);
    text-underline-offset: 0.25em;
}

.foot-vote p {
    margin: 0.7rem 0 0;
    font-size: 0.88rem;
    color: var(--text-dim);
    max-width: 32ch;
}

/* A linha legal e os idiomas fecham o rodapé, separados do resto por um fio. */
.foot-inner {
    border-top: 1px solid var(--line);
}

@media (max-width: 64rem) {
    .foot-grid {
        grid-template-columns: 1fr 1fr;
    }

    .foot-brand,
    .foot-vote {
        grid-column: 1 / -1;
    }
}

@media (max-width: 40rem) {
    .foot-grid {
        grid-template-columns: 1fr;
    }
}

/* --- One moment of motion: the art settles as the page opens ------------- */

@media (prefers-reduced-motion: no-preference) {
    .hero-art {
        animation: settle 1.4s var(--ease) both;
    }

    .hero-inner > * {
        animation: rise 0.8s var(--ease) both;
    }

    .hero-inner > *:nth-child(2) {
        animation-delay: 0.08s;
    }

    .hero-inner > *:nth-child(3) {
        animation-delay: 0.16s;
    }

    .hero-inner > *:nth-child(4) {
        animation-delay: 0.24s;
    }

    @keyframes settle {
        from {
            transform: scale(1.06);
        }
        to {
            transform: scale(1);
        }
    }

    @keyframes rise {
        from {
            transform: translateY(0.7rem);
        }
        to {
            transform: none;
        }
    }
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 64rem) {
    .panels {
        grid-template-columns: minmax(0, 1fr);
    }

    /* The character is the page signature: when narrow it sits behind the copy, never gone. */
    .hero-inner {
        grid-template-columns: minmax(0, 1fr);
        padding-bottom: 0;
    }

    /* The character gets a band of its own, above the copy: the face stays clear of text. */
    .hero-figure {
        order: -1;
        position: static;
        width: min(58%, 17rem);
        height: auto;
        max-height: 19rem;
        margin: 0 -0.5rem -0.5rem auto;
        object-position: bottom right;
        opacity: 0.95;
    }

    .hero-copy {
        position: relative;
        z-index: 2;
        padding-bottom: clamp(1.75rem, 6vh, 2.5rem);
    }

    .hero::after {
        background:
            linear-gradient(to bottom, rgba(10, 9, 8, 0.35) 30%, rgba(10, 9, 8, 0.86) 62%),
            linear-gradient(to top, rgba(10, 9, 8, 0.92) 1%, rgba(10, 9, 8, 0) 26%);
    }
}

@media (max-width: 48rem) {
    .bar-inner {
        row-gap: 0.4rem;
    }

    .nav {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
        gap: 0.35rem 0.9rem;
    }

    .nav a:last-child {
        margin-left: auto;
        color: var(--metal);
    }

    .nav a {
        font-size: 0.7rem;
        letter-spacing: 0.1em;
    }

    .hero-inner {
        padding-block: 2.75rem;
    }

    .strip-inner {
        gap: 0 1.2rem;
    }

    .strip .state {
        width: 100%;
        margin-right: 0;
    }

    .plate {
        flex: 1 1 13rem;
        justify-content: center;
    }

    .on-this-page {
        top: 0;
    }

    .foot-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Each page header art (no inline style: the site CSP is strict). */
.head-server {
    background-image: url("/img/server-cidade.webp");
}

.head-rankings {
    background-image: url("/img/rankings-fortaleza.webp");
}

.head-castles {
    background-image: url("/img/news-castelo.webp");
}

.head-castle {
    background-image: url("/img/rankings-fortaleza.webp");
}

.head-bosses {
    background-image: url("/img/bosses.webp");
}

.head-olympiad {
    background-image: url("/img/olympiad.webp");
}

/* Pronta para a página do tutorial do Wardrobe, que entra quando a produção subir. */
.head-wardrobe {
    background-image: url("/img/wardrobe.webp");
}

.head-store {
    background-image: url("/img/server-cidade.webp");
}

/* The package cards: the coin pile is the first thing read, the price the second. */
.pack {
    text-align: center;
    padding-top: 0.4rem;
}

.pack .panel-head {
    border-bottom: 0;
    padding-bottom: 0;
}

.pack-art {
    padding: 0.8rem 0 0.2rem;
}

.pack-art svg {
    width: clamp(120px, 19vw, 160px);
    height: auto;
}

/* The title sits right under the pile, and the price right under the title: three lines of the
   same thought, not three separate blocks. */
.pack .panel-head h3 {
    margin: 0;
}

.pack .store-price {
    margin-top: 0.5rem;
}

/* The last package is the cheapest per coin: it is the one worth pointing at. */
.pack-best {
    box-shadow: inset 0 0 0 1px var(--gold);
}

.pack .store-note {
    justify-content: center;
}

.pack .plates {
    justify-content: center;
}

/* The three package panels sit side by side: without this the shortest one floats, and the
   prices stop lining up with each other. */
.cols > .panel {
    display: flex;
    flex-direction: column;
}

.cols > .panel .plates {
    margin-top: auto;
}

/* What the price is in, and the discount beside it: one line, so every card has the same shape. */
.store-note {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0.2rem 0 1rem;
    color: var(--text-dim);
    font-size: 0.92rem;
}

/* The price of a package, the one number the whole page is about. */
.store-price {
    font-family: var(--display);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    color: var(--gold);
    margin: 0.6rem 0 0;
}

.head-clan {
    background-image: url("/img/news-cavaleiro.webp");
}

.head-download {
    background-image: url("/img/wiki-cidade.webp");
}

.panel-stack {
    margin-top: 1.1rem;
}

/* A small label, used above lists and columns. */
.rubric {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--metal);
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0.7rem;
}

.rubric-dim {
    color: var(--text-dim);
    font-weight: 600;
    letter-spacing: 0.18em;
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* Gloss: the server figures beside the page header. */
.glosa {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr));
    gap: 0.8rem 1.4rem;
    margin: 1.4rem 0 0;
    padding-top: 1.1rem;
    border-top: 1px solid var(--line);
    max-width: 40rem;
}

.glosa dt {
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.glosa dd {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--metal);
    font-variant-numeric: tabular-nums lining-nums;
}

.glosa-note {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* The news page header. */
.head-news {
    background-image: url("/img/news-castelo.webp");
}

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

.news-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1.1rem;
}

.news-entry {
    display: grid;
    grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
    gap: 0 1.4rem;
    align-items: start;
    background-color: var(--panel);
    background-image: url("/img/grain.png");
    background-repeat: repeat;
    background-size: 96px 96px;
    box-shadow: inset 0 0 0 1px var(--line);
    padding: 1.1rem;
}

.news-entry:has(.news-body:only-child) {
    grid-template-columns: minmax(0, 1fr);
}

.news-cover img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    filter: saturate(0.9) brightness(0.82);
}

.news-cover:hover img {
    filter: saturate(1) brightness(0.95);
}

.news-date {
    margin: 0 0 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.news-body h2 {
    margin: 0 0 0.5rem;
    font-size: var(--step-2);
    font-weight: 700;
    line-height: 1.14;
}

.news-body h2 a {
    color: var(--metal);
    text-decoration: none;
}

.news-body h2 a:hover {
    text-decoration: underline;
    text-decoration-color: var(--gold);
    text-underline-offset: 0.2em;
}

.news-body p {
    margin: 0;
    color: var(--text);
}

.news-article {
    max-width: 68ch;
}

.news-figure {
    display: block;
    width: 100%;
    height: auto;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 0 0 1px var(--line);
}

.news-article h2,
.news-article h3 {
    margin: 1.8rem 0 0.6rem;
    font-weight: 700;
    color: var(--metal);
}

.news-article p {
    margin: 0 0 1rem;
}

.news-article ul,
.news-article ol {
    margin: 0 0 1rem;
    padding-left: 1.3rem;
}

.news-article li::marker {
    color: var(--gold-deep);
}

.news-back {
    margin-top: 1.75rem;
}

@media (max-width: 48rem) {
    .news-entry {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.9rem;
    }
}
