/* =====================================================================
   AZEROTHIAN CHRONICLE — design system
   Tokens transcribed from INSPIRATION/DESIGN.md. No CSS framework.
   ===================================================================== */

:root {
  /* --- accent: ONE variable drives every coloured thing on the page.
         The public layout overrides it per character with the class colour
         from Settings → Class colours; the admin keeps the site default. --- */
  --accent: #fcb977;
  --accent-ink: #0b0f18;           /* text on a filled accent button */

  /* --- ground: cool blue-black, so a warm accent reads warm-on-cool --- */
  --surface-base: #0b0f18;
  --surface: #0e1320;
  --surface-elevated: #111827;
  --surface-container-lowest: #080b12;
  --surface-container-low: #10161f;
  --surface-container: #151c2b;
  --surface-container-high: #1c2536;
  --surface-container-highest: #243043;
  --surface-bright: #2b3850;

  --on-surface: #e9e6df;
  --on-surface-variant: #c9c6be;
  --outline: #8e8b83;
  --outline-variant: #3a4052;

  /* --- semantic accents: all aliases of --accent, so old class names keep working --- */
  --primary: var(--accent);
  --primary-container: var(--accent);
  --on-primary: var(--accent-ink);
  --secondary: var(--accent);
  --brass: var(--accent);
  --gold-bright: var(--accent);
  --tertiary: #e2b5ff;
  --epic-purple: #a335ee;
  --uncommon-green: #5ab88a;
  --legendary-orange: #ff8000;
  --rare-blue: #4a8be0;
  --faction-alliance: #4a8be0;
  --faction-horde: #c8412e;
  --error: #ffb4ab;

  /* --- parchment (kept for the admin) --- */
  --surface-parchment: #efe3cb;
  --surface-parchment-subtle: #e4d3b2;
  --parchment-text: #3a2e20;
  --parchment-muted: #7a6a52;

  /* --- strokes & glass --- */
  --border-hairline: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.10);
  --border-brass: color-mix(in srgb, var(--accent) 35%, transparent);
  --veil-1: rgba(255, 255, 255, 0.035);
  --veil-2: rgba(255, 255, 255, 0.05);
  --glass: rgba(255, 255, 255, 0.05);
  --glass-strong: rgba(11, 15, 24, 0.55);
  --card-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --complete-green: #5ab88a;
  --incomplete: rgba(255, 255, 255, 0.20);

  /* --- type --- */
  --font-display: 'Cinzel', 'Times New Roman', serif;
  --font-body: 'Source Sans 3', -apple-system, 'Segoe UI', system-ui, sans-serif;

  /* --- rhythm (4px base) --- */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.875rem;
  --space-lg: 1.25rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --gutter: 1rem;
  --gutter-desktop: 1.5rem;

  --radius-sm: 3px;
  --radius: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 9999px;

  --surface-card: #121826;
  --surface-card-hover: #172033;

  --shell: 1160px;
  --shell-wide: 1328px;
  --nav-h: 64px;
  --strip-h: 36px;
  --header-h: calc(var(--nav-h) + var(--strip-h));
  --ribbon-h: 0px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html { scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  background: var(--surface-base);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 20px;
  min-height: 100vh;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: #ffffff; }

button { font-family: inherit; cursor: pointer; }

img { max-width: 100%; display: block; }

/* ---------- typography scale ---------- */
.t-display     { font-family: var(--font-display); font-size: 56px; line-height: 60px; letter-spacing: .015em; font-weight: 700; }
.t-headline-lg { font-family: var(--font-display); font-size: 38px; line-height: 44px; letter-spacing: .015em; font-weight: 700; text-wrap: balance; }
.t-headline-md { font-family: var(--font-display); font-size: 22px; line-height: 28px; letter-spacing: .04em; font-weight: 600; }
.t-headline-sm { font-family: var(--font-display); font-size: 18px; line-height: 24px; letter-spacing: .03em; font-weight: 600; }
.t-title       { font-size: 16px; line-height: 22px; font-weight: 600; }
.t-body-lg     { font-size: 16px; line-height: 24px; }
.t-body        { font-size: 14px; line-height: 20px; }
.t-body-sm     { font-size: 13px; line-height: 18px; }
.t-label       { font-size: 12px; line-height: 16px; letter-spacing: .18em; font-weight: 600; text-transform: uppercase; }
.t-micro       { font-size: 11px; line-height: 14px; letter-spacing: .14em; font-weight: 600; text-transform: uppercase; }

@media (max-width: 767px) {
  .t-display     { font-size: 32px; line-height: 36px; letter-spacing: .01em; }
  .t-headline-lg { font-size: 26px; line-height: 32px; letter-spacing: .01em; }
}

.muted { color: var(--outline); }
.variant { color: var(--on-surface-variant); }
.tabular { font-variant-numeric: tabular-nums; }
.gold { color: var(--primary); }

/* ---------- boot splash ---------- */
.boot {
  position: fixed; inset: 0; display: grid; place-content: center; justify-items: center;
  gap: var(--space-sm); background: var(--surface-base); text-align: center;
}
.boot__crest { font-size: 28px; color: var(--primary); text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent); }
.boot__title { font-family: var(--font-display); font-size: 26px; letter-spacing: .18em; color: var(--primary); }
.boot__sub { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--outline); }
.boot__track { width: 180px; height: 3px; border-radius: var(--radius-sm); background: rgba(255,255,255,.08); overflow: hidden; }
.boot__track span { display: block; height: 100%; width: 40%; border-radius: var(--radius-sm);
  background: var(--accent); animation: boot-slide 1.1s ease-in-out infinite; }
@keyframes boot-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* ---------- layout shell ---------- */
.shell { max-width: var(--shell); margin: 0 auto; padding: 0 var(--gutter); }
.shell--wide { max-width: var(--shell-wide); }
@media (min-width: 768px)  { .shell { padding: 0 var(--space-xl); } }
@media (min-width: 1024px) { .shell { padding: 0 var(--gutter-desktop); } }

.page { padding-top: var(--header-h); }
.section { padding: 36px 0 40px; border-top: 1px solid var(--border-hairline); }
.section:first-of-type, .cine + .section { border-top: 0; }

.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-lg); flex-wrap: wrap; margin-bottom: var(--space-lg); }
.section__lead { display: flex; align-items: baseline; gap: var(--space-md); flex-wrap: wrap; }
.kicker { display: flex; align-items: center; gap: var(--space-sm); color: var(--outline); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.kicker--accent { color: var(--accent); }
.kicker__mark { display: inline-block; width: 28px; height: 2px; background: currentColor; }
.section__title { color: var(--on-surface); margin: 0; font-family: var(--font-display); font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: .02em; }
@media (max-width: 767px) { .section__title { font-size: 22px; line-height: 28px; } }
.section__more { font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.section__more:hover { color: var(--on-surface); }
.section__note { color: var(--outline); max-width: 48ch; margin: 0; }

/* ---------- header: one glass row over the artwork, roster strip beneath ---------- */
.topbar {
  position: fixed; top: var(--ribbon-h); left: 0; right: 0; z-index: 50;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-hairline);
}
.topbar__inner { max-width: var(--shell-wide); margin: 0 auto; padding: 0 var(--gutter);
  height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
@media (min-width: 768px)  { .topbar__inner, .roster-strip__inner { padding: 0 var(--space-xl); } }
@media (min-width: 1024px) { .topbar__inner, .roster-strip__inner { padding: 0 var(--gutter-desktop); } }
.brand__text { display: none; }
@media (min-width: 640px) { .brand__text { display: block; } }

.mainnav { display: flex; align-items: center; gap: 4px; margin-left: var(--space-md); }
@media (max-width: 899px) {
  :root { --navrow-h: 40px; --header-h: calc(var(--nav-h) + var(--navrow-h) + var(--strip-h)); }
  .topbar__inner { flex-wrap: wrap; height: auto; row-gap: 0; }
  .brand, .topbar__right { height: var(--nav-h); }
  .mainnav { order: 10; flex-basis: 100%; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter);
    height: var(--navrow-h); overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--border-hairline);
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent);
            mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent); }
  .mainnav::-webkit-scrollbar { display: none; }
  .mainnav__link { white-space: nowrap; padding: 8px 12px; }
}
.mainnav__link {
  position: relative; padding: 8px 13px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; letter-spacing: .06em;
  color: var(--on-surface-variant); transition: color .15s ease, background .15s ease;
}
.mainnav__link:hover { color: var(--on-surface); background: rgba(255,255,255,.05); }
.mainnav__link.active { color: #ffffff; }

.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand__crest {
  width: 30px; height: 30px; border-radius: var(--radius-full); display: grid; place-items: center;
  border: 1px solid var(--border-brass); background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent); font-size: 14px; object-fit: cover;
}
.brand__name { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: .14em; color: var(--accent); }
.brand__tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .2em; padding: 3px 8px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.brand__sub { display: none; }

.topbar__right { display: flex; align-items: center; gap: var(--space-sm); flex-shrink: 0; }
.ruleset-pill { display: none; align-items: center; padding: 4px 6px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
@media (min-width: 640px) { .ruleset-pill { display: flex; } }
.ruleset-pill__name { color: var(--on-surface-variant); }

.twitch {
  display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: var(--radius-full);
  background: rgba(145,70,255,.18); border: 1px solid rgba(145,70,255,.45); color: #fff; transition: background .18s ease;
}
.twitch:hover { background: rgba(145,70,255,.3); color: #fff; }
.twitch__dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: #a855f7; animation: pulse 1.6s ease-out infinite; }
.twitch__label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(168,85,247,.6); } 70% { box-shadow: 0 0 0 6px rgba(168,85,247,0); } 100% { box-shadow: 0 0 0 0 rgba(168,85,247,0); } }
.pulse { width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--accent); }

.icon-btn {
  width: 30px; height: 30px; border-radius: var(--radius-full); display: grid; place-items: center;
  border: 1px solid var(--border-hairline); color: var(--on-surface-variant);
  transition: all .18s ease; text-decoration: none; font-size: 13px;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.roster-strip { height: var(--strip-h); border-top: 1px solid var(--border-hairline); background: rgba(11,15,24,.35); }
.roster-strip__inner {
  max-width: var(--shell-wide); margin: 0 auto; padding: 0 var(--gutter); height: 100%;
  display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent);
          mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent);
}
.roster-strip__inner::-webkit-scrollbar { display: none; }
.roster-strip__label { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--outline); margin-right: 4px; flex-shrink: 0; }
.roster__chip {
  display: flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-full);
  border: 1px solid transparent; color: var(--on-surface-variant); font-size: 12px; transition: all .18s ease; white-space: nowrap;
}
.roster__chip:hover { background: rgba(255,255,255,.06); color: var(--on-surface); }
.roster__chip--active { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.roster__lvl { font-size: 10px; color: var(--outline); }
.roster__chip--active .roster__lvl { color: var(--accent); opacity: .8; }

/* ---------- cards ---------- */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-highlight), 0 6px 20px rgba(0,0,0,.28);
  position: relative;
  overflow: hidden;
}
.card__body { position: relative; padding: var(--space-lg); }
@media (min-width: 768px) { .card__body { padding: var(--space-xl); } }

.pillar {
  background: var(--glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: background .18s ease, border-color .18s ease;
}
.pillar:hover { background: rgba(255,255,255,.07); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

/* ---------- badges & pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.14); background: transparent;
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #d9d6cd;
}
.badge--primary   { border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.badge--uncommon  { border-color: rgba(90,184,138,.5); color: var(--uncommon-green); background: rgba(90,184,138,.12); }
.badge--rare      { border-color: rgba(74,139,224,.5); color: #8fb8ee; background: rgba(74,139,224,.12); }
.badge--epic      { border-color: rgba(163,53,238,.45); color: #d7b3ff; background: rgba(163,53,238,.12); }
.badge--legendary { border-color: rgba(255,128,0,.45); color: #ffb98a; background: rgba(255,128,0,.12); }
.badge--ghost     { background: transparent; }

.level-plate {
  display: inline-flex; align-items: center; gap: var(--space-sm); padding: 6px 14px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 8%, transparent); border: 1px solid var(--border-brass);
}
.level-plate__level { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--accent); letter-spacing: .06em; }
.level-plate__era { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--outline); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm);
  padding: 12px 22px; border-radius: var(--radius); border: 1px solid transparent;
  font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  transition: all .18s ease; text-decoration: none; cursor: pointer;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { filter: brightness(1.1); color: var(--accent-ink); }
.btn--ghost { background: transparent; border-color: rgba(255,255,255,.22); color: #ffffff; }
.btn--ghost:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.4); color: #ffffff; }
.btn--danger { background: transparent; border-color: rgba(255,180,171,.4); color: var(--error); }
.btn--danger:hover { background: rgba(255,180,171,.12); }
.btn--sm { padding: 7px 12px; font-size: 11px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- progress ---------- */
.meter { display: grid; gap: 6px; }
.meter__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.meter__value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.meter__track { height: 6px; border-radius: var(--radius-sm); background: rgba(255,255,255,.08); overflow: hidden; }
.meter__bar { height: 100%; border-radius: var(--radius-sm); background: var(--accent); transition: width .6s ease; }
.meter__bar--epic { background: var(--epic-purple); }
.meter__bar--rare { background: var(--rare-blue); }
.meter__bar--uncommon { background: var(--uncommon-green); }

/* ---------- cinematic hero: the art band the header floats over ---------- */
.cine {
  position: relative; overflow: hidden; color: var(--on-surface);
  margin-top: calc(-1 * (var(--header-h) + var(--ribbon-h)));
  padding-top: calc(var(--header-h) + var(--ribbon-h));
  min-height: 640px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.cine__art { position: absolute; inset: 0; overflow: hidden; background: var(--surface-container-low); }
.cine__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 20%); }
.cine__art--portrait img { filter: blur(6px) saturate(1.1); transform: scale(1.06); }
.cine__grade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,34,64,.55), rgba(11,15,24,.25) 60%); mix-blend-mode: multiply; }
.cine__glow  { position: absolute; inset: 0; background: radial-gradient(60% 70% at 78% 30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 65%); mix-blend-mode: screen; }
.cine__scrim { position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(11,15,24,.9) 0%, rgba(11,15,24,.7) 34%, rgba(11,15,24,.15) 62%, rgba(11,15,24,0) 100%); }
.cine__fade  { position: absolute; left: 0; right: 0; bottom: 0; height: 320px; background: linear-gradient(180deg, rgba(11,15,24,0), var(--surface-base) 94%); }
.cine__grain { position: absolute; inset: 0; opacity: .07; mix-blend-mode: overlay; pointer-events: none; }
.cine__empty { position: absolute; inset: 0;
  background: radial-gradient(900px 520px at 78% 30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 62%),
              radial-gradient(1000px 600px at 50% 0%, rgba(24,38,64,.9), transparent 70%),
              linear-gradient(180deg, #0e1524 0%, var(--surface-base) 100%); }

.cine__inner { position: relative; display: grid; gap: var(--space-xl); align-items: end;
  padding-top: 120px; padding-bottom: var(--space-2xl); grid-template-columns: 1fr; }
@media (min-width: 1000px) { .cine__inner { grid-template-columns: minmax(0, 1fr) 420px; gap: 60px; padding-top: 160px; } }

.cine__copy { display: flex; flex-direction: column; gap: 18px; }
.cine__eyebrow { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.cine__eyebrow::before { content: ''; display: inline-block; width: 28px; height: 2px; background: var(--accent); }
.cine__name { margin: 0; font-family: var(--font-display); font-weight: 700; color: #ffffff; text-wrap: balance;
  font-size: clamp(48px, 8.2vw, 118px); line-height: .92; letter-spacing: .01em; }
.cine__tags { display: flex; gap: 10px; flex-wrap: wrap; }
.cine__stand { margin: 6px 0 0; max-width: 560px; font-size: 19px; line-height: 1.5; color: var(--on-surface-variant); }
@media (max-width: 767px) { .cine__stand { font-size: 16px; } }
.cine__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.cine__roster { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--outline); margin-top: 4px; }
.cine__roster a { color: var(--accent); font-weight: 600; }
.cine__roster a:hover { color: #ffffff; }

.cine__stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.lockup { padding: 16px; border-radius: var(--radius-md); background: var(--glass); border: 1px solid var(--border-card);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); min-width: 0; }
.lockup__tag { font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); display: flex; justify-content: space-between; gap: 6px; }
.lockup__value { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: #ffffff; margin-top: 6px; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.lockup__caption { font-size: 11px; color: var(--outline); margin-top: 2px; }

.faction-dot { width: 7px; height: 7px; border-radius: var(--radius-full); flex-shrink: 0; background: var(--outline-variant); }
.faction-dot--alliance { background: var(--faction-alliance); }
.faction-dot--horde    { background: var(--faction-horde); }

/* legacy metric block, still used on atlas entry pages */
.metrics { display: grid; gap: var(--space-md); margin-top: var(--space-lg); grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (min-width: 900px) { .metrics { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.metric__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-sm); }
.metric__icon { font-size: 14px; }
.metric__tag { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.metric__value { font-size: 17px; font-weight: 600; color: var(--on-surface); font-variant-numeric: tabular-nums; }
.metric__caption { font-size: 11px; color: var(--outline); margin-top: 2px; }

/* portrait card, kept for the admin preview */
.portrait { position: relative; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border-card);
  background: var(--surface-container-lowest); aspect-ratio: 3 / 4; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait__fallback { width: 100%; height: 100%; display: grid; place-items: center; color: var(--outline-variant);
  font-family: var(--font-display); font-size: 40px; background: var(--surface-container-low); }
.backdrop-preview { position: relative; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border-card);
  background: var(--surface-container-lowest); aspect-ratio: 16 / 7; }
.backdrop-preview img { width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 20%); }

/* ---------- chapters ---------- */
.chapters { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.chapter { display: flex; flex-direction: column; gap: var(--space-sm); }
.chapter__head { display: flex; align-items: center; justify-content: space-between; }
.chapter__no { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--primary-container); }
.chapter__title { font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: .02em; color: var(--on-surface); }
.chapter__text { font-size: 13px; line-height: 18px; color: var(--on-surface-variant); flex: 1; }
.chapter__status { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm);
  margin-top: var(--space-sm); padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--surface-container-lowest); border: 1px solid var(--border-hairline); }
.chapter__status-label { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--outline); }
.chapter__status-value { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chapter--active { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.chapter--active .chapter__title { color: var(--accent); }

/* ---------- gallery ---------- */
.gallery { display: grid; gap: var(--gutter-desktop); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.shot { display: flex; flex-direction: column; text-align: left; padding: 0; background: var(--surface-card);
  border: 1px solid var(--border-card); border-radius: var(--radius-lg); overflow: hidden; color: inherit;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.shot:hover { border-color: var(--border-brass); box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 15%, transparent); transform: translateY(-2px); }
.shot__frame { position: relative; aspect-ratio: 16 / 9; background: var(--surface-container-lowest); overflow: hidden; }
.shot__frame img { width: 100%; height: 100%; object-fit: cover; }
.shot__placeholder { width: 100%; height: 100%;
  background: radial-gradient(120% 90% at 80% 10%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%),
              linear-gradient(160deg, #1b2236, #0e1320); }
.shot__tag-l { position: absolute; top: var(--space-sm); left: var(--space-sm); }
.shot__tag-r { position: absolute; top: var(--space-sm); right: var(--space-sm); }
.shot__body { padding: var(--space-md); display: grid; gap: 6px; }
.shot__title { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--gold-bright); }
.shot__text { font-size: 13px; line-height: 18px; color: var(--on-surface-variant); }
.shot__foot { display: flex; justify-content: space-between; gap: var(--space-sm); padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--border-hairline); font-size: 11px; color: var(--outline); letter-spacing: .06em; }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(5,7,12,.92); display: grid; place-items: center; padding: var(--space-lg); }
.lightbox__panel { max-width: 1000px; width: 100%; background: var(--surface-container-low);
  border: 1px solid var(--border-brass); border-radius: var(--radius-md); overflow: hidden; }
.lightbox__close { position: absolute; top: var(--space-lg); right: var(--space-lg); }
.lightbox__img { width: 100%; max-height: 78vh; object-fit: contain; background: #000; }
.zoomable { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; width: 100%; text-align: left; }
.zoomable img { width: 100%; }

/* ---------- operations bento ---------- */
.bento { display: grid; gap: var(--gutter-desktop); grid-template-columns: 1fr; }
@media (min-width: 860px)  { .bento { grid-template-columns: repeat(2, minmax(320px, 1fr)); } }
@media (min-width: 1160px) { .bento { grid-template-columns: repeat(3, minmax(300px, 1fr)); } }

.op { display: flex; flex-direction: column; }
.op__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--border-hairline); }
.op__title { display: flex; align-items: center; gap: var(--space-sm); font-family: var(--font-display);
  font-size: 17px; font-weight: 600; letter-spacing: .03em; color: var(--on-surface); }
.op__body { padding: var(--space-md) var(--space-lg) var(--space-lg); display: grid; gap: var(--space-sm); flex: 1; align-content: start; }
.op__foot { padding: var(--space-md) var(--space-lg); border-top: 1px solid var(--border-hairline); }

.task { display: flex; align-items: center; gap: var(--space-sm); padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.task:last-child { border-bottom: 0; }
.task--active { padding: 10px; border: 1px solid var(--border-brass); border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.task__box { width: 18px; height: 18px; border-radius: var(--radius); flex-shrink: 0; display: grid; place-items: center;
  border: 1.5px solid rgba(255,255,255,.35); font-size: 11px; color: transparent; background: transparent; }
.task__box--done { background: var(--primary-container); border-color: var(--primary-container); color: var(--surface-base); }
.task__label { flex: 1; font-size: 13px; }
.task__label--done { color: rgba(255,255,255,.6); }
.task__status { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }

.stat-hero { text-align: center; padding: var(--space-lg); border-radius: var(--radius);
  background: var(--surface-container-lowest); border: 1px solid var(--border-hairline); }
.stat-hero__value { font-family: var(--font-display); font-size: 40px; line-height: 44px; font-weight: 700; color: var(--accent); }
.stat-hero__label { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--on-surface-variant); margin-top: var(--space-sm); }
.stat-hero__caption { font-size: 12px; color: var(--outline); margin-top: var(--space-xs); }
.stat-pair { display: grid; gap: var(--space-sm); grid-template-columns: repeat(2, minmax(0,1fr)); }
.stat-pill { text-align: center; padding: var(--space-md) var(--space-sm); border-radius: var(--radius);
  background: var(--veil-2); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); }
.stat-pill__label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--outline); }
.stat-pill__value { font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--on-surface); font-variant-numeric: tabular-nums; }

.deed { padding: var(--space-md); border-radius: var(--radius); background: var(--veil-2); border: 1px solid var(--border-hairline); }
.deed__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.deed__title { font-size: 14px; font-weight: 600; color: var(--gold-bright); }
.deed__text { font-size: 13px; line-height: 18px; color: var(--on-surface-variant); margin-top: var(--space-xs); }
.deed__check { color: var(--complete-green); }

/* ---------- parchment ---------- */
.parchment {
  background: linear-gradient(170deg, var(--surface-parchment), var(--surface-parchment-subtle));
  color: var(--parchment-text);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 0 #c8b995, 0 8px 24px rgba(0,0,0,.6);
  padding: var(--space-lg);
}
.parchment .muted { color: var(--parchment-muted); }

/* ---------- timeline ---------- */
.timeline { position: relative; padding-left: var(--space-xl); }
.timeline::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: rgba(255,255,255,.14); }
.timeline__item { position: relative; padding-bottom: var(--space-xl); }
.timeline__node { position: absolute; left: calc(var(--space-xl) * -1); top: 4px; width: 9px; height: 9px; border-radius: 50%;
  border: 1px solid var(--border-brass); background: var(--surface-base); margin-left: 0; }
.timeline__item--done .timeline__node { background: var(--primary-container); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 55%, transparent); }
.timeline__date { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--outline); }
.timeline__title { font-size: 16px; font-weight: 600; line-height: 22px; color: var(--on-surface); }
.timeline__text { font-size: 13px; line-height: 18px; color: var(--on-surface-variant); margin-top: var(--space-xs); }

/* ---------- posts ---------- */
.post-list { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.post-card__body { padding: var(--space-lg); display: grid; gap: var(--space-sm); }
.post-card__title { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: #ffffff; }
.post-card__meta { display: flex; gap: var(--space-sm); align-items: center; font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--outline); }
.prose { max-width: 72ch; color: var(--on-surface-variant); font-size: 16px; line-height: 26px; }
.prose h2 { font-family: var(--font-display); font-size: 22px; letter-spacing: .04em; color: var(--on-surface); margin: var(--space-xl) 0 var(--space-sm); }
.prose h3 { font-family: var(--font-display); font-size: 18px; color: var(--gold-bright); margin: var(--space-lg) 0 var(--space-xs); }
.prose p { margin: 0 0 var(--space-md); }
.prose ul { margin: 0 0 var(--space-md); padding-left: var(--space-lg); }
.prose li { margin-bottom: var(--space-xs); }
.prose blockquote { margin: 0 0 var(--space-md); padding-left: var(--space-md); border-left: 2px solid var(--border-brass); color: var(--outline); font-style: italic; }
.prose code { font-size: 14px; background: var(--surface-container); padding: 1px 5px; border-radius: var(--radius-sm); color: var(--secondary); }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--border-hairline); padding: var(--space-xl) 0; margin-top: var(--space-2xl);
  background: var(--surface-container-lowest); }
.site-foot a { color: var(--on-surface-variant); }
.site-foot a:hover { color: var(--accent); }
.site-foot__grid { display: grid; gap: var(--space-xl); grid-template-columns: 1fr; }
@media (min-width: 720px) { .site-foot__grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-foot__col { display: grid; gap: 8px; align-content: start; font-size: 13px; }
.site-foot__head { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--outline); margin-bottom: 4px; }
.site-foot__legal { margin: var(--space-xl) 0 0; padding-top: var(--space-md); border-top: 1px solid var(--border-hairline);
  font-size: 12px; color: var(--outline); }
.site-foot__title { display: flex; align-items: center; gap: var(--space-sm); font-family: var(--font-display);
  font-size: 18px; letter-spacing: .1em; color: var(--accent); }
.site-foot__links { display: grid; gap: var(--space-sm); font-size: 13px; }

/* ---------- forms (shared by admin) ---------- */
.field { display: grid; gap: 6px; }
.field__label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--outline); }
.field__hint { font-size: 12px; color: var(--outline); }
.input, .textarea, .select {
  width: 100%; padding: 9px 12px; border-radius: var(--radius);
  background: var(--surface-container-lowest); border: 1px solid var(--border-hairline);
  color: var(--on-surface); font-family: var(--font-body); font-size: 14px; line-height: 20px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--border-brass); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.textarea { min-height: 110px; resize: vertical; }
.textarea--tall { min-height: 340px; font-size: 15px; line-height: 24px; }
.field-row { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.checkbox { display: flex; align-items: center; gap: var(--space-sm); font-size: 13px; color: var(--on-surface-variant); }

/* ---------- admin shell ---------- */
.admin { display: grid; min-height: 100vh; grid-template-columns: 1fr; background: var(--surface-base); }
@media (min-width: 900px) { .admin { grid-template-columns: 236px 1fr; } }

.admin-side { border-right: 1px solid var(--border-hairline); background: var(--surface-container-lowest);
  padding: var(--space-lg) var(--space-md); display: flex; flex-direction: column; gap: var(--space-lg); }
.admin-side__brand { display: flex; align-items: center; gap: var(--space-sm); }
.admin-nav { display: grid; gap: 2px; }
.admin-nav__link { display: flex; align-items: center; gap: var(--space-sm); padding: 8px 10px; border-radius: var(--radius);
  color: var(--on-surface-variant); font-size: 13px; transition: all .15s ease; }
.admin-nav__link:hover { background: var(--surface-container-low); color: var(--on-surface); }
.admin-nav__link.active { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--primary); box-shadow: inset 2px 0 0 var(--primary-container); }
.admin-nav__group { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--outline-variant);
  padding: var(--space-md) 10px var(--space-xs); }

.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap;
  padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--border-hairline); background: var(--surface-container-lowest); }
.admin-content { padding: var(--space-lg); display: grid; gap: var(--space-lg); align-content: start; }
@media (min-width: 900px) { .admin-content { padding: var(--space-xl); } }

.admin-grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.admin-stat { padding: var(--space-lg); }
.admin-stat__value { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.admin-stat__label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--outline); margin-top: var(--space-xs); }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--outline);
  padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--border-hairline); font-weight: 600; }
.table td { padding: var(--space-md); border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.table__actions { display: flex; gap: var(--space-xs); justify-content: flex-end; }
.table-wrap { overflow-x: auto; }

.editor-grid { display: grid; gap: var(--space-lg); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1100px) { .editor-grid { grid-template-columns: minmax(0,1fr) 320px; } }

.toast { position: fixed; right: var(--space-lg); bottom: var(--space-lg); z-index: 200;
  padding: var(--space-md) var(--space-lg); border-radius: var(--radius);
  background: var(--surface-container-high); border: 1px solid var(--border-brass); color: var(--on-surface);
  box-shadow: 0 8px 28px rgba(0,0,0,.6); font-size: 13px; animation: toast-in .2s ease; }
.toast--error { border-color: rgba(255,180,171,.5); color: var(--error); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--space-lg); }
.login-card { width: 100%; max-width: 380px; }

.banner { padding: var(--space-md) var(--space-lg); border-radius: var(--radius); font-size: 13px;
  background: color-mix(in srgb, var(--accent) 8%, transparent); border: 1px solid var(--border-brass); color: var(--on-surface-variant); }

/* ---------- environment marking ---------- */
/* A Test site must never be mistaken for the live one at a glance. */
.env-ribbon {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: 30px; display: flex; align-items: center; justify-content: center;
  gap: var(--space-sm); padding: 0 var(--gutter);
  background: linear-gradient(90deg, rgba(255,128,0,.18), color-mix(in srgb, var(--accent) 18%, transparent));
  border-bottom: 1px solid rgba(255,128,0,.35);
  font-size: 12px; letter-spacing: .06em; color: var(--gold-bright);
  text-align: center;
}
.env-ribbon a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.env-ribbon__dot {
  width: 7px; height: 7px; border-radius: var(--radius-full);
  background: var(--legendary-orange); flex-shrink: 0;
}
.site--ribbon { --ribbon-h: 30px; }
.env-ribbon--offline { background: linear-gradient(90deg, rgba(200,65,46,.35), rgba(200,65,46,.18)); border-bottom-color: rgba(200,65,46,.6); color: #ffd6d0; }
.env-ribbon--offline .env-ribbon__dot { background: var(--faction-horde); }
.env-ribbon--offline a { color: #ffffff; }

/* ---------- offline holding page ---------- */
.offline { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: var(--space-xl); padding: var(--space-xl) var(--gutter);
  background: radial-gradient(900px 520px at 78% 30%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%),
              radial-gradient(1000px 600px at 50% 0%, rgba(24,38,64,.9), transparent 70%), var(--surface-base); }
.offline__card { text-align: center; max-width: 560px; display: grid; gap: var(--space-md); justify-items: center; }
.offline__crest { font-size: 28px; color: var(--accent); }
.offline__brand { font-family: var(--font-display); font-size: 14px; letter-spacing: .3em; text-transform: uppercase; color: var(--outline); }
.offline__title { margin: 0; font-family: var(--font-display); font-size: clamp(36px, 7vw, 64px); line-height: 1; color: #ffffff; }
.offline__text { margin: 0; font-size: 18px; line-height: 1.5; color: var(--on-surface-variant); }
.offline__link { color: var(--accent); font-weight: 600; }
.offline__admin { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--outline); }
.offline__admin:hover { color: var(--on-surface); }

.availability--off { border-color: rgba(200,65,46,.45); }

.schedule__when { display: grid; gap: 4px; }
.schedule__date { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--accent); }
input[type="datetime-local"].input { color-scheme: dark; min-width: 240px; }

/* ---------- on/off switch ---------- */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch--disabled { opacity: .5; cursor: not-allowed; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__label { font-size: 13px; font-weight: 600; color: var(--on-surface); }
.switch__track { position: relative; width: 52px; height: 28px; border-radius: 999px; background: rgba(200,65,46,.55);
  border: 1px solid rgba(255,255,255,.14); transition: background .2s ease; }
.switch__knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.5); transition: transform .2s ease; }
.switch input:checked + .switch__track { background: var(--complete-green); }
.switch input:checked + .switch__track .switch__knob { transform: translateX(24px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch__state { font-size: 11px; font-weight: 700; letter-spacing: .16em; color: var(--outline); width: 3ch; }
.page--offset { padding-top: calc(var(--header-h) + var(--ribbon-h)); }
@media (max-width: 600px) { .env-ribbon { font-size: 11px; } }

.env-chip {
  display: inline-flex; align-items: center; gap: var(--space-sm);
  padding: 5px 10px; border-radius: var(--radius);
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  border: 1px solid currentColor; align-self: flex-start;
}
.env-chip--test { color: var(--legendary-orange); background: rgba(255,128,0,.08); }
.env-chip--prod { color: var(--complete-green); background: rgba(90,184,138,.08); }
.env-chip__dot { width: 7px; height: 7px; border-radius: var(--radius-full); background: currentColor; }

.admin-nav__link--promote { color: var(--gold-bright); }
.admin-nav__link--promote:hover { color: var(--primary); }

/* ---------- promote flow ---------- */
.env-flow {
  display: flex; align-items: stretch; gap: var(--space-md); flex-wrap: wrap;
}
.env-flow__node {
  flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px;
  padding: var(--space-md) var(--space-lg); border-radius: var(--radius-md);
  background: var(--veil-1); border: 1px solid var(--border-hairline);
}
.env-flow__node--test { border-color: rgba(255,128,0,.35); }
.env-flow__node--prod { border-color: rgba(90,184,138,.35); }
.env-flow__name {
  font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: .04em;
}
.env-flow__node--test .env-flow__name { color: var(--legendary-orange); }
.env-flow__node--prod .env-flow__name { color: var(--complete-green); }
.env-flow__arrow {
  align-self: center; font-size: 22px; color: var(--primary-container); flex-shrink: 0;
}

.confirm {
  padding: var(--space-md) var(--space-lg); border-radius: var(--radius);
  background: rgba(255,128,0,.07); border: 1px solid rgba(255,128,0,.40);
  display: grid; gap: var(--space-sm);
}
.confirm__title { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--gold-bright); }
.confirm__text { margin: 0; font-size: 13px; line-height: 18px; color: var(--on-surface-variant); }

.schema-steps { margin: var(--space-sm) 0 0; padding-left: 18px; font-size: 12px; color: var(--on-surface-variant); display: grid; gap: 2px; }

/* ---------- media library ---------- */
.media-grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.media-grid--picker { padding: var(--space-md); max-height: 62vh; overflow: auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.media-card { display: flex; flex-direction: column; min-width: 0; }
.media-card--pick { padding: 0; border: 1px solid var(--border-card); border-radius: var(--radius-md); background: var(--surface-card); color: inherit; text-align: left; cursor: pointer; overflow: hidden; transition: border-color .15s ease, transform .15s ease; }
.media-card--pick:hover { border-color: var(--accent); transform: translateY(-1px); }
.media-card--pick .media-card__name, .media-card--pick .media-card__meta { padding: 0 10px; }
.media-card--pick .media-card__meta { padding-bottom: 8px; }
.media-card__frame { position: relative; aspect-ratio: 16 / 10; background: var(--surface-container-lowest); overflow: hidden; display: grid; place-items: center; }
.media-card__frame a { display: block; width: 100%; height: 100%; }
.media-card__frame img { width: 100%; height: 100%; object-fit: cover; }
.media-card__missing { font-size: 11px; color: var(--outline); padding: var(--space-sm); text-align: center; }
.media-card__badge { position: absolute; top: 6px; left: 6px; }
.media-card__body { padding: var(--space-md); display: grid; gap: 6px; align-content: start; }
.media-card__name { font-size: 13px; font-weight: 600; color: var(--on-surface); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 8px; }
.media-card__meta { font-size: 11px; color: var(--outline); }
.picker { max-width: 1100px; }
.picker__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--border-hairline); }
.picker__search { max-width: 260px; }

/* ---------- class colour table ---------- */
.color-row { display: grid; gap: var(--space-sm); align-items: center; grid-template-columns: 40px minmax(120px, 1fr) 110px auto auto; }
@media (max-width: 767px) { .color-row { grid-template-columns: 40px 1fr 100px; } .color-row__sample { display: none; } }
.color-row__pick { width: 40px; height: 38px; padding: 2px; border-radius: var(--radius); border: 1px solid var(--border-hairline); background: var(--surface-container-lowest); cursor: pointer; }
.color-row__hex { font-variant-numeric: tabular-nums; }
.color-row__sample { display: flex; align-items: center; gap: var(--space-md); padding: 0 var(--space-sm); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); }

/* ---------- image upload ---------- */
.image-field { display: flex; gap: var(--space-sm); align-items: stretch; }
.image-field .input { flex: 1; min-width: 0; }
.image-field__pick { position: relative; overflow: hidden; flex-shrink: 0; cursor: pointer; }
.image-field__pick.is-busy { opacity: .5; cursor: not-allowed; }
/* The real input sits invisibly over the styled label so the button is the hit target. */
.image-field__input {
  position: absolute; inset: 0; opacity: 0; cursor: inherit;
  font-size: 0; width: 100%; height: 100%;
}
.image-field__preview {
  display: flex; align-items: flex-start; gap: var(--space-sm); margin-top: var(--space-sm);
}
.image-field__preview img {
  max-height: 140px; border-radius: var(--radius);
  border: 1px solid var(--border-hairline); background: var(--surface-container-lowest);
}
.image-field__missing {
  padding: var(--space-md); border-radius: var(--radius); font-size: 12px;
  color: var(--error); border: 1px dashed rgba(255,180,171,.4);
}
.image-field .input[readonly] { color: var(--outline); font-style: italic; }
.image-field__preview a { display: block; }
.image-field__preview img { cursor: zoom-in; }

/* ---------- atlas: art tiles with a gradient overlay ---------- */
.atlas-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.tile {
  position: relative; display: block; height: 230px; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface-card); color: inherit; text-decoration: none;
  border: 1px solid var(--border-card);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tile-accent, var(--accent)) 50%, transparent);
  box-shadow: 0 12px 30px rgba(0,0,0,.45); color: inherit; }
.tile__art { position: absolute; inset: 0; }
.tile__art img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.tile:hover .tile__art img { transform: scale(1.04); }
.tile__ph { width: 100%; height: 100%; display: grid; place-items: center;
  background: radial-gradient(120% 90% at 80% 10%, color-mix(in srgb, var(--tile-accent, var(--accent)) 40%, transparent), transparent 60%),
              linear-gradient(160deg, #1b2236, #0e1320); }
.tile__glyph { font-size: 44px; line-height: 1; color: var(--tile-accent, var(--accent)); opacity: .7; margin-top: -40px; }
.tile__veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,15,24,0) 35%, rgba(11,15,24,.94)); }
.tile__kind { position: absolute; left: 16px; top: 14px; right: 16px; display: flex; justify-content: space-between; gap: 8px;
  font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--tile-accent, var(--accent)); }
.tile__when { color: var(--on-surface-variant); font-weight: 600; letter-spacing: .1em; }
.tile__foot { position: absolute; left: 16px; right: 16px; bottom: 16px; }
.tile__name { font-family: var(--font-display); font-size: 20px; line-height: 24px; font-weight: 700; color: #ffffff; }
.tile__meta { font-size: 12px; color: var(--on-surface-variant); margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile__meta strong { color: #ffffff; font-weight: 700; }

/* ---------- breadcrumbs ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: var(--space-md);
  font-size: 12px; letter-spacing: .04em; color: var(--outline); }
.crumbs a { color: var(--on-surface-variant); }
.crumbs a:hover { color: var(--primary); }
.crumbs__sep { color: var(--outline-variant); }
.crumbs__here { color: var(--on-surface); font-weight: 600; }

/* ---------- ownership: filters and empty states ---------- */
.owner-filter {
  display: flex; gap: var(--space-sm); flex-wrap: wrap; margin-bottom: var(--space-lg);
}
.owner-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius);
  background: var(--surface-container-low); border: 1px solid var(--border-hairline);
  color: var(--on-surface-variant); font-size: 13px; transition: all .18s ease;
}
.owner-chip:hover { border-color: var(--border-brass); color: var(--on-surface); }
.owner-chip--on {
  background: var(--surface-container-highest); border-color: var(--border-brass);
  color: var(--primary); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 16%, transparent);
}
.owner-chip__lvl {
  font-size: 10px; color: var(--outline); background: var(--surface-container-lowest);
  padding: 1px 5px; border-radius: var(--radius-sm); font-variant-numeric: tabular-nums;
}
.owner-chip--on .owner-chip__lvl { color: var(--gold-bright); background: var(--surface-container-low); }

.empty {
  display: grid; gap: var(--space-xs); justify-items: center; text-align: center;
  padding: var(--space-2xl) var(--space-lg); border-radius: var(--radius-md);
  border: 1px dashed var(--outline-variant); background: var(--veil-1);
}
.empty__glyph { font-size: 22px; color: var(--outline-variant); }
.empty__title { font-family: var(--font-display); font-size: 17px; letter-spacing: .03em; color: var(--on-surface-variant); }
.empty__text { margin: 0; font-size: 13px; color: var(--outline); max-width: 46ch; }

/* ---------- faction ---------- */
.badge--faction { border-color: currentColor; background: transparent; }
.badge--faction-alliance { color: var(--faction-alliance); background: rgba(74,139,224,.10); }
.badge--faction-horde    { color: var(--faction-horde);    background: rgba(200,65,46,.10); }
.faction-dot { width: 6px; height: 6px; border-radius: var(--radius-full); flex-shrink: 0; background: var(--outline-variant); }
.faction-dot--alliance { background: var(--faction-alliance); }
.faction-dot--horde    { background: var(--faction-horde); }

/* ---------- helpers ---------- */
.row { display: flex; align-items: center; gap: var(--space-sm); }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.stack { display: grid; gap: var(--space-md); }
.stack--sm { gap: var(--space-sm); }
.stack--lg { gap: var(--space-lg); }
.grow { flex: 1; }
.right { text-align: right; }
.center { text-align: center; }
.hide-sm { display: none; }
@media (min-width: 768px) { .hide-sm { display: initial; } }
.drag-handle { cursor: grab; color: var(--outline-variant); }

#blazor-error-ui {
  background: var(--surface-container-high); color: var(--error); bottom: 0; left: 0; right: 0;
  box-shadow: 0 -1px 2px rgba(0,0,0,.4); display: none; padding: 0.8rem 1.2rem 0.8rem 1.6rem; position: fixed; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 1rem; top: .8rem; }
