/* =============================================================================
   Shaiya Devoted — components
   Everything a page is assembled from. Each block is self-contained, reads only
   tokens, and is shown with its variants at /design-system.

     1. The logo              8. Panels, arch, niche, vellum   15. Dialog, palette
     2. Masthead              9. Stats (ledger) and rows       16. Countdown, bars
     3. Menus and drawer     10. Badges, chips, faction marks  17. Loading states
     4. Footer               11. Alerts and toasts             18. Empty state
     5. Headings and rules   12. Forms                         19. Responsive
     6. Buttons and links    13. Tabs and filters
     7. Icon buttons         14. Tables and pagination
   ========================================================================== */

/* 1. The logo -----------------------------------------------------------------
   The name is always the logo image (partials.wordmark), never set in type.
   Sizes: default (masthead, drawer), --md (footer), --lg (hero, sign-in). */
.logo { display: block; width: 156px; height: auto; filter: drop-shadow(0 8px 14px rgb(0 0 0 / .65)); transition: width var(--dur-2) var(--ease); }
.logo--md { width: 260px; }
.logo--lg { width: min(760px, 92vw); filter: drop-shadow(0 18px 30px rgb(0 0 0 / .7)) drop-shadow(0 0 60px rgb(var(--c-teal) / .25)); }

/* 2. Masthead ----------------------------------------------------------------
   Two tiers: a strip for the realm's state and the account, then the
   navigation split around the mark. Once the page scrolls the strip folds away. */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: calc(var(--z-header) + 1); background: var(--ground); }
.hud { position: sticky; top: env(safe-area-inset-top, 0px); z-index: var(--z-header); view-transition-name: hud; background: linear-gradient(180deg, rgb(var(--c-ground) / .96), rgb(var(--c-ground) / .8)); backdrop-filter: blur(14px) saturate(130%); -webkit-backdrop-filter: blur(14px) saturate(130%); border-bottom: 1px solid var(--line); transition: box-shadow var(--dur-2), background var(--dur-2); }
.hud.is-scrolled { box-shadow: 0 16px 40px -22px #000; }
.masthead__strip { height: 34px; overflow: hidden; border-bottom: 1px solid var(--line); background: rgb(0 0 0 / .28); font-size: 12.5px; color: var(--mute); transition: height var(--dur-2) var(--ease), border-color var(--dur-2); }
.hud.is-scrolled .masthead__strip { height: 0; border-color: transparent; }
.masthead__strip > .wrap { display: flex; align-items: center; gap: 22px; height: 34px; }
.masthead__status { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; color: inherit; text-decoration: none; }
.masthead__status b, .masthead__time b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.masthead__account { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.masthead__link { display: inline-flex; align-items: center; min-height: 34px; color: var(--soft); text-decoration: none; transition: color var(--dur-1); }
.masthead__link:hover, .masthead__link--gold { color: var(--gold-hi); }
.masthead__search { display: inline-flex; align-items: center; gap: 7px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; transition: color var(--dur-1); }
.masthead__search:hover { color: var(--ink); }
.masthead__bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: clamp(18px, 2.4vw, 36px); height: 70px; transition: height var(--dur-2) var(--ease); }
.hud.is-scrolled .masthead__bar { height: 60px; }
.masthead__brand { position: relative; z-index: 1; display: flex; padding-inline: 6px; margin-block: -4px -10px; text-decoration: none; }
.hud.is-scrolled .masthead__brand .logo { width: 132px; }
.icon-btn.masthead__burger { display: none; justify-self: end; }

.mainnav { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.mainnav--left { justify-content: flex-end; }
.mainnav__link { position: relative; display: inline-flex; align-items: center; gap: 5px; padding: 10px 0; border: 0; background: none; cursor: pointer; font: 600 .78rem/1 var(--font-label); letter-spacing: .16em; text-transform: uppercase; text-decoration: none; white-space: nowrap; color: var(--soft); transition: color var(--dur-1); }
.mainnav__link .icon { width: .85em; height: .85em; rotate: 90deg; transition: rotate var(--dur-2) var(--ease); }
.mainnav__link[aria-expanded="true"] .icon { rotate: -90deg; }
.mainnav__link::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 5px; height: 5px; background: var(--gold-hi); transform: translate(-50%, 2px) rotate(45deg) scale(0); transition: transform var(--dur-2) var(--ease); }
.mainnav__link:is(:hover, [aria-current], .is-active, [aria-expanded="true"]) { color: var(--gold-hi); }
.mainnav__link:is(:hover, [aria-current], .is-active)::after { transform: translate(-50%, 2px) rotate(45deg) scale(1); }

.progress-line { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: blink 2.2s infinite; }
.dot--off { background: var(--bad); box-shadow: 0 0 10px var(--bad); animation: none; }

/* 3. Menus and drawer ------------------------------------------------------ */
.menu { position: relative; }
.menu__button { display: inline-flex; align-items: center; gap: 8px; padding: 2px 0; border: 0; background: none; cursor: pointer; color: var(--soft); }
.menu__button:hover { color: var(--gold-hi); }
.menu__panel { position: absolute; right: 0; top: calc(100% + 12px); z-index: var(--z-menu); width: 264px; padding: 8px; background: linear-gradient(180deg, rgb(var(--c-surface-2)), rgb(var(--c-surface))); border: 1px solid var(--line-2); box-shadow: var(--lift-3); }
.menu__panel:not([hidden]) { animation: menu-in var(--dur-2) var(--ease); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) } }
.menu__head { padding: 10px 12px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.menu__head b { display: block; font: 600 1.2rem/1.2 var(--font-display); }
.menu__head small { font-size: 12.5px; color: var(--mute); }
.menu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; text-align: left; text-decoration: none; cursor: pointer; font-size: 14px; color: var(--soft); transition: background var(--dur-1), color var(--dur-1); }
.menu__item .icon { color: var(--bronze); }
.menu__item:hover { background: rgb(var(--c-gold) / .09); color: var(--ink); }
.menu__item--danger:hover { color: var(--bad); }
.avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--gold-face); color: var(--on-accent); font: 700 12px/1 var(--font-label); }
.bell { position: relative; display: inline-grid; place-items: center; color: var(--mute); }
.bell:hover { color: var(--gold-hi); }
.bell__count { position: absolute; top: -8px; right: -10px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--gold); color: var(--on-accent); font: 700 10px/16px var(--font-body); text-align: center; }

/* The wide menus under Explore and Community. */
.megamenu { left: 50%; right: auto; top: calc(100% + 14px); translate: -50% 0; width: 330px; padding: 10px; }
.megamenu--wide { width: min(680px, 92vw); display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.megamenu[hidden] { display: none; }
.megamenu__item { display: flex; align-items: center; gap: 13px; padding: 9px 12px; border: 1px solid transparent; text-decoration: none; color: var(--soft); transition: background var(--dur-1), border-color var(--dur-1); }
.megamenu__item:is(:hover, [aria-current]) { background: rgb(var(--c-gold) / .08); border-color: var(--line); }
.megamenu__item b { display: block; font: 600 1.12rem/1.2 var(--font-display); color: var(--ink); }
.megamenu__item small { display: block; font-size: 12.5px; line-height: 1.35; color: var(--mute); }

.drawer { position: fixed; inset: 0; z-index: var(--z-drawer); display: grid; grid-template-columns: 1fr min(88vw, 370px); }
.drawer__scrim { border: 0; background: rgb(0 0 0 / .66); backdrop-filter: blur(4px); animation: fade var(--dur-2); }
.drawer__panel { display: flex; flex-direction: column; gap: 2px; padding: 18px; padding-right: max(18px, env(safe-area-inset-right)); overflow-y: auto; background: linear-gradient(180deg, rgb(var(--c-surface-2)), rgb(var(--c-ground))); border-left: 1px solid var(--line-2); animation: drawer-in var(--dur-3) var(--ease); }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0 } }
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.drawer__label { margin: 16px 12px 4px; font: var(--label); letter-spacing: var(--label-track); text-transform: uppercase; color: var(--gold); }
.drawer__link { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; text-decoration: none; font: 600 1.2rem/1.2 var(--font-display); color: var(--soft); border-left: 1px solid transparent; }
.drawer__link .icon { width: 18px; height: 18px; color: var(--bronze); }
.drawer__link:is(:hover, [aria-current]) { color: var(--gold-hi); border-left-color: var(--gold); background: linear-gradient(90deg, rgb(var(--c-gold) / .1), transparent); }

/* 4. Footer ---------------------------------------------------------------- */
.footer { position: relative; margin-top: auto; padding-block: 56px calc(30px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, rgb(var(--c-surface)), rgb(var(--c-ground))); }
.footer::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: var(--gold-rule); }
.footer__grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 36px; }
.footer h2 { margin: 0 0 14px; font: var(--label); letter-spacing: var(--label-track); text-transform: uppercase; color: var(--gold); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 14.5px; }
.footer a { text-decoration: none; color: var(--soft); transition: color var(--dur-1); }
.footer a:hover { color: var(--gold-hi); }
.footer p { max-width: 40ch; margin-top: 16px; font-size: 14px; color: var(--mute); }
.footer__legal { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--mute); }

/* 5. Headings and rules ----------------------------------------------------- */
/* The rule: two hairlines meeting at a diamond. Stands under a heading, or alone. */
.rule { position: relative; display: block; width: min(180px, 60%); height: 9px; margin-inline: auto; border: 0;
  background: linear-gradient(90deg, transparent, var(--gold)) left center / calc(50% - 11px) 1px no-repeat, linear-gradient(270deg, transparent, var(--gold)) right center / calc(50% - 11px) 1px no-repeat; }
.rule::before { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; translate: -50% -50%; rotate: 45deg; background: var(--gold-hi); box-shadow: 0 0 10px rgb(var(--c-gold-hi) / .6); }
.rule--start { margin-inline: 0; }

/* Page heading: every inner page opens with one. */
.page-head { position: relative; padding-block: clamp(44px, 7vw, 92px) clamp(26px, 4vw, 48px); text-align: center; }
.page-head .wrap { display: grid; justify-items: center; }
.page-head__title { font: 500 var(--step-4)/1.02 var(--font-display); letter-spacing: 0; animation: rise var(--dur-3) var(--ease) both; }
.page-head__title::after, .heading h2::after { content: ""; display: block; width: 180px; max-width: 60%; height: 9px; margin: clamp(16px, 2vw, 22px) 0 0;
  background: linear-gradient(90deg, transparent, var(--gold)) left center / calc(50% - 11px) 1px no-repeat, linear-gradient(270deg, transparent, var(--gold)) right center / calc(50% - 11px) 1px no-repeat, var(--orn-diamond) center / 9px 9px no-repeat; }
.page-head .page-head__title::after, .heading h2::after { margin-inline: auto; }
.page-head__lede { max-width: 58ch; margin: 18px 0 0; font-size: 1.06rem; line-height: 1.55; color: var(--soft); animation: fade-up var(--dur-3) var(--ease) .12s both; }
.eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0 0 16px; font: var(--label); letter-spacing: .28em; text-transform: uppercase; color: var(--gold); }
.page-head .eyebrow { justify-content: center; }

/* Section heading, centred (home, landing sections). */
.heading { max-width: 660px; margin: 0 auto clamp(32px, 5vw, 60px); text-align: center; }
.heading h2 { font: 500 var(--step-3)/1.05 var(--font-display); }
.heading p { margin: 16px 0 0; font-size: 1.06rem; color: var(--soft); }

/* Section heading with an action on the right (listing pages). */
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 40px; align-items: end; margin-bottom: clamp(24px, 3.4vw, 44px); padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.section-head h2 { font: 500 var(--step-2)/1.05 var(--font-display); }
.section-head p { grid-column: 1; margin: 0; max-width: 56ch; color: var(--mute); }
.section-head .eyebrow { grid-column: 1 / -1; margin-bottom: -6px; }
.section-head__action { grid-column: 2; grid-row: 1 / span 3; align-self: end; justify-self: end; }

/* 6. Buttons and links -------------------------------------------------------
   Primary is struck gold; there is one per view. Ghost is the second choice.
   Sizes: --sm 36px, default 46px, --lg 56px. */
.btn { position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 46px; padding: 0 26px; border: 1px solid #f6e5b3; background: var(--gold-face); color: var(--on-accent); font: 700 .78rem/1 var(--font-label); letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; text-decoration: none; cursor: pointer;
  outline: 1px solid rgb(40 28 6 / .3); outline-offset: -5px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .55), inset 0 -12px 16px -10px rgb(96 64 12 / .7), 0 12px 28px -16px rgb(var(--c-gold) / .95);
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2), filter var(--dur-1); }
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(105deg, transparent 32%, rgb(255 255 255 / .6) 50%, transparent 68%); translate: -130% 0; transition: translate var(--dur-4) var(--ease); }
.btn:hover { color: var(--on-accent); transform: translateY(-2px); box-shadow: inset 0 1px 0 rgb(255 255 255 / .55), inset 0 -12px 16px -10px rgb(96 64 12 / .7), 0 18px 36px -14px rgb(var(--c-gold) / 1); }
.btn:hover::before { translate: 130% 0; }
.btn:active { transform: translateY(0); filter: brightness(.94); }
.btn:focus-visible { outline: 2px solid var(--teal-hi); outline-offset: 3px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .42; cursor: not-allowed; transform: none; filter: saturate(.4); box-shadow: none; }
.btn .icon { width: 1.25em; height: 1.25em; }
.btn--ghost { border-color: var(--line-2); background: rgb(var(--c-ground) / .55); color: var(--gold-hi); outline-color: rgb(var(--c-gold) / .14); box-shadow: none; }
.btn--ghost::before { background: linear-gradient(105deg, transparent 32%, rgb(var(--c-gold-hi) / .16) 50%, transparent 68%); }
.btn--ghost:hover { color: var(--gold-hi); border-color: var(--gold); background: rgb(var(--c-gold) / .1); box-shadow: 0 14px 30px -18px rgb(var(--c-gold) / .7); }
.btn--steel { border-color: #eef0f4; background: linear-gradient(180deg, #f1f3f6 0%, #c3c8d1 42%, #8d939e 100%); color: #14161a; box-shadow: inset 0 1px 0 #fff, 0 12px 28px -16px rgb(var(--c-silver) / .9); }
.btn--steel:hover { color: #14161a; box-shadow: inset 0 1px 0 #fff, 0 18px 36px -14px rgb(var(--c-silver) / 1); }
.btn--danger { border-color: var(--oxblood-hi); background: linear-gradient(180deg, #c05a4f 0%, #8a2f2c 60%, #6a2220 100%); color: #fff3ee; outline-color: rgb(0 0 0 / .25); box-shadow: inset 0 1px 0 rgb(255 255 255 / .25), 0 12px 28px -16px rgb(var(--c-oxblood) / 1); }
.btn--danger:hover { color: #fff3ee; box-shadow: inset 0 1px 0 rgb(255 255 255 / .25), 0 18px 36px -14px rgb(var(--c-oxblood) / 1); }
.btn--sm { height: 36px; padding: 0 16px; font-size: .7rem; outline-offset: -4px; }
.btn--lg { height: 56px; padding: 0 34px; font-size: .86rem; outline-offset: -6px; }
.btn--block { width: 100%; }
.btn[aria-busy="true"] { pointer-events: none; filter: saturate(.6); }
.btn[aria-busy="true"]::after { content: ""; width: 15px; height: 15px; border: 2px solid rgb(26 20 8 / .3); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; }

.link { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: var(--accent-2); text-decoration: underline; text-decoration-color: rgb(var(--c-accent-2) / .4); text-underline-offset: 3px; transition: color var(--dur-1), text-decoration-color var(--dur-1); }
.link:hover { color: var(--ink); text-decoration-color: currentColor; }
/* "See all" links: a label with an arrow that steps forward. */
.more { display: inline-flex; align-items: center; gap: 7px; padding-block: 9px; margin-block: -9px; font: var(--label); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: var(--gold); transition: color var(--dur-1); }
.more:hover { color: var(--gold-hi); }
.more .icon { transition: translate var(--dur-2) var(--ease); }
.more:hover .icon { translate: 4px 0; }

/* 7. Icon buttons ---------------------------------------------------------- */
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line-2); background: rgb(var(--c-surface) / .7); color: var(--soft); cursor: pointer; text-decoration: none; transition: border-color var(--dur-1), color var(--dur-1), background var(--dur-1); }
.icon-btn:hover { border-color: var(--gold); color: var(--gold-hi); background: rgb(var(--c-gold) / .08); }

/* 8. Panels, arch, niche, vellum -------------------------------------------- */
/* Panel: dressed stone with an inner hairline. spotlight.js feeds --mx/--my. */
.panel { position: relative; isolation: isolate; min-width: 0; padding: clamp(18px, 2.2vw, 28px); background: var(--stone); border: 1px solid var(--line); outline: 1px solid rgb(var(--c-line) / .07); outline-offset: -6px; box-shadow: var(--lift-1); }
.panel::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity var(--dur-3); background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgb(var(--c-teal) / .12), transparent 62%); }
.panel:hover::before { opacity: 1; }
.panel--glass { background: var(--stone); }
.panel--accent { background: var(--stone-lit); border-color: rgb(var(--c-teal) / .4); }
.panel--flush { padding: 0; }
.panel__title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 18px; font: var(--label); letter-spacing: var(--label-track); text-transform: uppercase; color: var(--gold); }
/* The padding and matching negative margin give a small link a finger-sized target without moving it. */
.panel__title a { display: inline-flex; align-items: center; gap: 5px; padding-block: 9px; margin-block: -9px; font: 500 12.5px var(--font-body); letter-spacing: 0; text-transform: none; text-decoration: none; color: var(--mute); transition: color var(--dur-1); }
.panel__title a:hover { color: var(--gold-hi); }
.chamfer { clip-path: none; }
/* Gold corner brackets, for the one panel on a page that matters most. */
.corners { position: relative; }
.corners::after { content: ""; position: absolute; inset: -1px; pointer-events: none; --b: var(--gold) 0 0;
  background: linear-gradient(var(--b)) 0 0 / 18px 1px, linear-gradient(var(--b)) 0 0 / 1px 18px, linear-gradient(var(--b)) 100% 0 / 18px 1px, linear-gradient(var(--b)) 100% 0 / 1px 18px,
    linear-gradient(var(--b)) 0 100% / 18px 1px, linear-gradient(var(--b)) 0 100% / 1px 18px, linear-gradient(var(--b)) 100% 100% / 18px 1px, linear-gradient(var(--b)) 100% 100% / 1px 18px;
  background-repeat: no-repeat; }

/* Arch: a pointed arch that holds its proportions at any width (see tokens).
   The shape is a mask, so anything inside is cut to it; the outline is drawn
   on top in --arch-line. Leave room at the top: the point takes ~62% of the width. */
.arch { --arch-line: var(--line-2); position: relative; isolation: isolate; background: var(--stone); border-bottom: 1px solid var(--arch-line);
  -webkit-mask: var(--arch-mask) top center / 100% auto no-repeat; mask: var(--arch-mask) top center / 100% auto no-repeat; }
.arch::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: var(--arch-line); transition: background var(--dur-2);
  -webkit-mask: var(--arch-outline) top center / 100% auto no-repeat; mask: var(--arch-outline) top center / 100% auto no-repeat; }
.arch--double::before { content: ""; position: absolute; inset: 7px 7px 0; z-index: 2; pointer-events: none; background: rgb(var(--c-line) / .14);
  -webkit-mask: var(--arch-outline) top center / 100% auto no-repeat; mask: var(--arch-outline) top center / 100% auto no-repeat; }
.arch--lit { background: var(--stone-lit); }
.panel--arch { padding-top: clamp(64px, 26%, 120px); text-align: center; border: 0; outline: 0; box-shadow: none; }
.panel--arch .panel__title { justify-content: center; }

/* Niche: a small arch that holds an icon or a numeral. */
.niche { position: relative; display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 44px; padding-top: 8px; border-bottom: 1px solid var(--line-2); color: var(--gold); font: 600 1.05rem/1 var(--font-display); }
.niche::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--line-2); -webkit-mask: var(--arch-outline) top center / 100% auto no-repeat; mask: var(--arch-outline) top center / 100% auto no-repeat; transition: background var(--dur-2); }
.niche .icon { width: 17px; height: 17px; }
.niche--lg { width: 58px; height: 68px; padding-top: 14px; font-size: 1.5rem; }
:is(a, button):hover > .niche::before { background: var(--gold); }

/* Vellum: where the site is read rather than used (news, lore, notes). */
.vellum { position: relative; padding: clamp(26px, 4vw, 56px); color: var(--vellum-ink);
  background: var(--tex-vellum), radial-gradient(120% 90% at 50% 40%, var(--vellum) 40%, var(--vellum-2) 100%);
  box-shadow: inset 0 0 70px rgb(90 62 24 / .4), 0 30px 70px -30px #000; }
.vellum::before { content: ""; position: absolute; inset: 10px; pointer-events: none; border: 1px solid rgb(90 62 24 / .35); }
.vellum > * { position: relative; }
.vellum__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid rgb(90 62 24 / .4); }
.vellum__head :is(h1, h2) { font: 700 clamp(26px, 2.8vw, 38px)/1 var(--font-label); letter-spacing: .06em; text-transform: uppercase; color: var(--vellum-ink); }
.vellum .more { color: var(--vellum-mute); }
.vellum .more:hover { color: var(--vellum-ink); }
.vellum .prose { color: var(--vellum-soft); font: 500 1.22rem/1.6 var(--font-display); }
.vellum .prose :is(h2, h3, strong) { color: var(--vellum-ink); }
.vellum .prose a { color: var(--vellum-rubric); }
.vellum .prose blockquote { border-left-color: var(--vellum-rubric); color: var(--vellum-soft); }
.vellum .prose li::marker { color: var(--vellum-rubric); }
.vellum .prose code { background: rgb(90 62 24 / .14); }
.article-head { padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid rgb(90 62 24 / .4); }
.article-head h1 { font: 700 clamp(2rem, 4.4vw, 3.25rem)/1.05 var(--font-display); color: var(--vellum-ink); }
.article-more { margin: 40px 0 0; padding-top: 18px; border-top: 1px solid rgb(90 62 24 / .4); font: var(--label); letter-spacing: var(--label-track); text-transform: uppercase; color: var(--vellum-mute); }
/* An entry on vellum: date line, title, a paragraph. The lead one opens with an initial. */
.entry { display: block; padding: 20px 0; border-top: 1px solid rgb(90 62 24 / .22); color: inherit; text-decoration: none; }
.entry:first-of-type { border-top: 0; }
.entry:hover { color: inherit; }
.entry__meta { margin: 0 0 6px; font: var(--label); letter-spacing: var(--label-track); text-transform: uppercase; color: var(--vellum-mute); }
.entry h3 { font-size: 1.55rem; font-weight: 700; color: var(--vellum-ink); transition: color var(--dur-1); }
a.entry:hover h3 { color: var(--vellum-rubric); }
.entry__body { margin: 8px 0 0; font: 500 1.15rem/1.55 var(--font-display); color: var(--vellum-soft); }
.entry--lead h3 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.entry--lead .entry__body { font-size: 1.28rem; }
.entry--lead .entry__body::first-letter { float: left; margin: .06em .1em 0 0; font: 700 3.1em/.82 var(--font-label); color: var(--vellum-rubric); }

/* 9. Stats (ledger) and rows ------------------------------------------------ */
/* A row of figures: label above, numeral below, hairlines between. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 0; border-block: 1px solid var(--line); background: linear-gradient(90deg, transparent, rgb(var(--c-surface-2) / .75) 18%, rgb(var(--c-surface-2) / .75) 82%, transparent); }
.stat { min-width: 0; padding: 16px 18px; border-left: 1px solid var(--line); text-align: center; }
.stat:first-child { border-left: 0; }
.stat dt, .stat__label { white-space: nowrap; font: var(--label); letter-spacing: var(--label-track); text-transform: uppercase; color: var(--mute); }
.stat dd, .stat__value { margin: 8px 0 0; font: 600 clamp(1.5rem, 2.3vw, 2rem)/1 var(--font-display); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; color: var(--ink); }
.stat small { margin-left: 2px; font: 600 .55em var(--font-display); color: var(--gold); }
.stats--boxed { border: 1px solid var(--line); background: var(--stone); }
.stats--start .stat { text-align: left; }

/* Rows: a lead (niche or rank), a name with a note, a value at the end. */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.rows > li:first-child { border-top: 0; padding-top: 0; }
.rows > li:last-child { padding-bottom: 0; }
.rows__pos { width: 38px; flex-shrink: 0; text-align: center; font: 600 1.6rem/1 var(--font-display); color: var(--bronze); }
.rows > li:first-child .rows__pos { color: var(--gold-hi); }
.rows__main { display: grid; flex: 1; min-width: 0; }
.rows__main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 1.2rem/1.2 var(--font-display); color: var(--ink); }
.rows__main a { padding-block: 6px; margin-block: -6px; color: inherit; text-decoration: none; }
.rows__main a:hover b { color: var(--gold-hi); }
.rows__main small { font-size: 12.5px; color: var(--mute); }
.rows__end { white-space: nowrap; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--soft); }
.rows__end small { color: var(--mute); }
.rows__end--up { color: var(--ok); }

/* 10. Badges, chips, faction marks ------------------------------------------ */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid currentColor; font: 600 .66rem/1 var(--font-label); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; color: var(--mute); }
.badge--ok { color: var(--ok); } .badge--warn { color: var(--warn); } .badge--bad { color: var(--bad); } .badge--gold { color: var(--gold); }
.badge--ion { color: var(--on-accent); background: var(--gold); border-color: var(--gold); }
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* Chip: a live state, with a pulse while it is true. */
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 11px; border: 1px solid currentColor; background: rgb(var(--c-ground) / .6); font: 600 .68rem/1 var(--font-label); letter-spacing: .16em; text-transform: uppercase; color: var(--ok); }
.chip i { position: relative; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.chip--live i::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid currentColor; animation: ping 1.8s var(--ease) infinite; }
.chip--down { color: var(--bad); }
.faction { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.faction::before { content: ""; width: 7px; height: 7px; rotate: 45deg; background: currentColor; box-shadow: 0 0 8px currentColor; }
.faction--light { color: var(--aol); } .faction--fury { color: var(--uof); }
.rank { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px; border: 1px solid rgb(var(--c-gold) / .45); background: rgb(var(--c-gold) / .08); font: 600 12px/1 var(--font-body); font-variant-numeric: tabular-nums; color: var(--gold); }
.rank--0 { color: var(--faint); border-color: var(--line); background: none; }
.class-icon { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line-2); border-radius: 50%; background: var(--surface-2); font: 700 11px var(--font-label); color: var(--soft); }

/* 11. Alerts and toasts ----------------------------------------------------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border: 1px solid var(--line-2); border-left: 3px solid var(--gold); background: var(--surface); font-size: 14.5px; }
.alert .icon { margin-top: 2px; color: var(--gold); }
.alert--success { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok) 7%, var(--surface)); }
.alert--success .icon { color: var(--ok); }
.alert--error { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, var(--surface)); }
.alert--error .icon { color: var(--bad); }
.alert--info .icon { color: var(--accent-2); }
.flash-stack { position: fixed; z-index: var(--z-toast); right: max(16px, env(safe-area-inset-right)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 10px; width: min(420px, calc(100vw - 32px)); }
.flash-stack .alert { box-shadow: var(--lift-3); animation: toast-in var(--dur-3) var(--ease) both; }
.flash-stack .alert.is-leaving { animation: toast-out var(--dur-2) var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px) } }

/* 12. Forms ----------------------------------------------------------------- */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field__label { display: flex; justify-content: space-between; gap: 12px; font: var(--label); letter-spacing: var(--label-track); text-transform: uppercase; color: var(--mute); }
.field__hint { margin: 0; font-size: 12.5px; color: var(--mute); }
.field__error { margin: 0; display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--bad); }
.input, .select, .textarea { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 0; background-color: var(--well); color: var(--ink); font-size: 16px; box-shadow: inset 0 2px 6px rgb(0 0 0 / .6); transition: border-color var(--dur-1), box-shadow var(--dur-1); }
.textarea { min-height: 140px; padding: 12px 14px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23c8a45a' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: inset 0 2px 6px rgb(0 0 0 / .6), 0 0 0 3px rgb(var(--c-gold) / .22); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--bad); }
.input:disabled, .select:disabled, .textarea:disabled { opacity: .5; cursor: not-allowed; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 46px; }
.input-wrap__btn { position: absolute; right: 4px; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: none; cursor: pointer; color: var(--mute); }
.input-wrap__btn:hover { color: var(--gold-hi); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--soft); cursor: pointer; }
.check input { flex-shrink: 0; width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--gold); }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.meter i { height: 3px; background: var(--surface-3); transition: background var(--dur-2); }
.meter[data-score="1"] i:nth-child(-n+1) { background: var(--bad); }
.meter[data-score="2"] i:nth-child(-n+2) { background: var(--warn); }
.meter[data-score="3"] i:nth-child(-n+3) { background: var(--gold); }
.meter[data-score="4"] i { background: var(--ok); }

/* 13. Tabs and filters ------------------------------------------------------ */
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; border-bottom: 1px solid var(--line); }
.seg > * { position: relative; padding: 13px 18px; border: 0; background: none; cursor: pointer; font: var(--label); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; text-decoration: none; color: var(--mute); transition: color var(--dur-1); }
.seg > *::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: -1px; height: 2px; background: var(--gold); transform: scaleX(0); transition: transform var(--dur-2) var(--ease); }
.seg > *:hover { color: var(--gold-hi); }
.seg > :is([aria-current="page"], [aria-pressed="true"], [aria-selected="true"]) { color: var(--gold-hi); }
.seg > :is([aria-current="page"], [aria-pressed="true"], [aria-selected="true"])::after { transform: scaleX(1); }
/* A bar of filter controls above a listing. */
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 20px; padding: 14px; border: 1px solid var(--line); background: rgb(var(--c-surface) / .7); }
.filters > .field { flex: 1 1 170px; }
.filters > .field--grow { flex: 3 1 260px; }
.filters > .input { flex: 3 1 220px; width: auto; }
.filters > .select { flex: 1 1 160px; width: auto; }
.filters > :is(.btn, .link) { flex: none; }

/* 14. Tables and pagination ------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--stone); box-shadow: var(--lift-1); }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { padding: 13px 16px; border-bottom: 1px solid var(--line-2); background: rgb(0 0 0 / .32); font: var(--label); letter-spacing: .16em; text-transform: uppercase; text-align: left; white-space: nowrap; color: var(--gold); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--dur-1); }
.table tbody tr:hover { background: rgb(var(--c-gold) / .06); }
.table .num, .table th.num { text-align: right; }
.table .muted { color: var(--mute); font-size: 13px; }
.table a { text-decoration: none; transition: color var(--dur-1); }
.table a:hover { color: var(--gold-hi); }
.table--dense td { padding: 8px 12px; } .table--dense th { padding: 9px 12px; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 28px; }
.pager a, .pager span { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border: 1px solid var(--line); text-decoration: none; font: 600 1.1rem/1 var(--font-display); font-variant-numeric: lining-nums; color: var(--soft); transition: border-color var(--dur-1), color var(--dur-1), background var(--dur-1); }
.pager a:hover { border-color: var(--gold); color: var(--gold-hi); background: rgb(var(--c-gold) / .08); }
.pager [aria-current="page"] { border-color: #f6e5b3; background: var(--gold-face); color: var(--on-accent); }
.pager .gap { border: 0; }

/* 15. Dialog and command palette -------------------------------------------- */
dialog { color: var(--ink); }
.dialog { width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-2); background: linear-gradient(180deg, rgb(var(--c-surface-2)), rgb(var(--c-surface))); box-shadow: var(--lift-3); outline: 1px solid rgb(var(--c-line) / .08); outline-offset: -7px; }
.dialog[open] { animation: dialog-in var(--dur-3) var(--ease); }
.dialog::backdrop { background: rgb(0 0 0 / .7); backdrop-filter: blur(5px); animation: fade var(--dur-2); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(18px) scale(.98) } }
.dialog__body { padding: clamp(22px, 3vw, 32px); }
.dialog__title { margin-bottom: 10px; font: 600 var(--step-2)/1.1 var(--font-display); }
.dialog__actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: rgb(0 0 0 / .22); }
.palette { margin-top: 12vh; width: min(640px, calc(100vw - 32px)); }
.palette__input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); color: var(--gold); }
.palette__input input { flex: 1; min-width: 0; height: 58px; border: 0; background: transparent; outline: none; font-size: 17px; color: var(--ink); }
.palette__list { list-style: none; margin: 0; padding: 8px; max-height: min(440px, 60vh); overflow-y: auto; }
.palette__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; font-size: 15px; }
.palette__item small { margin-left: auto; font: var(--label); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.palette__item[aria-selected="true"] { background: rgb(var(--c-gold) / .1); box-shadow: inset 2px 0 0 var(--gold); }
.palette__empty { padding: 18px 12px; font-size: 14px; color: var(--mute); }
.palette__foot { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--mute); }

/* 16. Countdown and bars ---------------------------------------------------- */
.countdown { display: flex; justify-content: center; gap: clamp(10px, 1.6vw, 22px); }
.countdown > div { min-width: 2.2ch; text-align: center; }
.countdown b { display: block; font: 500 clamp(2.4rem, 4.4vw, 4rem)/1 var(--font-display); font-variant-numeric: lining-nums tabular-nums; color: var(--gold-hi); }
.countdown span { font: var(--label); letter-spacing: .2em; text-transform: uppercase; color: var(--mute); }
.countdown--sm b { font-size: clamp(1.5rem, 2.4vw, 2.1rem); }
.bar { height: 4px; overflow: hidden; background: var(--surface-3); }
.bar > i { display: block; height: 100%; width: var(--value, 0%); background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); transition: width var(--dur-4) var(--ease); }
.bar--split { display: flex; height: 6px; }
.bar--split > i:first-child { background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); }
.bar--split > i:last-child { background: linear-gradient(90deg, var(--oxblood-hi), var(--oxblood)); }

/* 17. Loading states -------------------------------------------------------- */
.spinner { display: inline-block; width: 22px; height: 22px; border: 2px solid var(--line-2); border-top-color: var(--gold-hi); border-radius: 50%; animation: spin .8s linear infinite; }
/* Skeleton: stands in for text or a block while live data arrives. Size it with width/height. */
.skeleton { display: block; height: 1em; background: linear-gradient(100deg, var(--surface-2) 30%, rgb(var(--c-gold) / .16) 50%, var(--surface-2) 70%) 0 0 / 300% 100%; animation: shimmer 1.6s linear infinite; color: transparent; }
@keyframes shimmer { from { background-position: 100% 0 } to { background-position: 0 0 } }

/* 18. Empty state ------------------------------------------------------------
   An empty niche: the icon stands in an arch, with a line saying what will be here. */
.empty { position: relative; display: grid; justify-items: center; gap: 10px; padding: 40px 20px 44px; text-align: center; color: var(--mute); }
.empty::before { content: ""; position: absolute; left: 50%; top: 28px; width: 78px; height: 92px; translate: -50% 0; background: var(--line-2); border-bottom: 1px solid var(--line-2); -webkit-mask: var(--arch-outline) top center / 100% auto no-repeat; mask: var(--arch-outline) top center / 100% auto no-repeat; }
.empty::after { content: ""; position: absolute; left: 50%; top: 20px; width: 150px; height: 120px; translate: -50% 0; z-index: -1; background: radial-gradient(closest-side, rgb(var(--c-gold) / .2), transparent); }
.empty .icon { position: relative; width: 30px; height: 30px; margin: 30px 0 34px; color: var(--gold); }
.empty h3 { font: 600 var(--step-1)/1.2 var(--font-display); color: var(--ink); }
.empty p { max-width: 44ch; margin: 0; }

/* 19. Responsive ------------------------------------------------------------ */
@media (max-width: 1180px) {
  :root { --header-h: 96px; }
  .masthead__bar { grid-template-columns: auto 1fr; height: 62px; }
  .hud.is-scrolled .masthead__bar { height: 56px; }
  .mainnav { display: none; }
  .icon-btn.masthead__burger { display: inline-grid; }
  .masthead__brand { padding: 0; margin-block: 0; }
  .masthead__brand .logo { width: 116px; }
}
@media (max-width: 920px) {
  .section-head { grid-template-columns: minmax(0, 1fr); }
  .section-head__action { grid-column: 1; grid-row: auto; justify-self: start; }
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .masthead__strip > .wrap { gap: 12px; }
  .masthead__link--gold { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .table th, .table td { padding: 10px 12px; }
  .dialog__actions { flex-direction: column-reverse; }
  .dialog__actions .btn { width: 100%; }
}

/* 20. Disclosure -------------------------------------------------------------
   A question that opens to its answer (<details class="faq">). No script. */
.faq__group { margin-bottom: 8px; font: var(--label); letter-spacing: var(--label-track); text-transform: uppercase; color: var(--gold); }
.faq { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 2px; cursor: pointer; list-style: none; font: 600 var(--step-1)/1.25 var(--font-display); color: var(--ink); transition: color var(--dur-1); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex-shrink: 0; width: 9px; height: 9px; margin-right: 6px; border-right: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold); rotate: 45deg; translate: 0 -3px; transition: rotate var(--dur-2) var(--ease), translate var(--dur-2) var(--ease); }
.faq summary:hover { color: var(--gold-hi); }
.faq[open] summary::after { rotate: -135deg; translate: 0 3px; }
.faq > .prose { padding: 0 2px 20px; max-width: 68ch; }
.faq > .prose > :last-child { margin-bottom: 0; }
