/* =========================================================
   LARCHIK LIBRARY — STAGE 2A
   Public UI redesign
   ========================================================= */

:root {
  --bg: #0f1317;
  --bg-raised: #141a1f;
  --surface: #171e24;
  --surface-2: #1c242b;
  --surface-3: #222c34;

  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .15);

  --text: #edf1f3;
  --text-soft: #c7d0d6;
  --muted: #8f9da7;

  --accent: #baa27d;
  --accent-light: #d4c09f;
  --accent-soft: rgba(186, 162, 125, .12);
  --accent-line: rgba(186, 162, 125, .30);

  --danger-soft: rgba(210, 110, 98, .12);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow:
    0 18px 45px rgba(0, 0, 0, .18);

  --content: 1240px;
  --reading: 790px;

  --font:
    "Segoe UI Variable Text",
    "Segoe UI Variable",
    "Inter",
    "Noto Sans",
    "Segoe UI",
    Arial,
    sans-serif;
}

/* =========================================================
   STAGE 7B - campaign access and author-friendly editor
   ========================================================= */

.campaign-access-badge {
  width: fit-content;
  min-height: 27px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
}

.campaign-access-badge > span {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-size: .62rem;
}

.campaign-access-allowed {
  border-color: rgba(102, 178, 134, .34);
  background: rgba(67, 128, 93, .13);
  color: #a9d9ba;
}

.campaign-access-allowed > span {
  background: rgba(102, 178, 134, .18);
}

.campaign-access-approval {
  border-color: rgba(210, 157, 82, .42);
  background: rgba(161, 108, 42, .14);
  color: #e6bd80;
}

.campaign-access-approval > span {
  background: rgba(210, 157, 82, .18);
}

.campaign-access-strip {
  border-bottom: 1px solid var(--line);
  background: #151b1f;
}

.campaign-access-strip-allowed {
  background: linear-gradient(90deg, rgba(50, 105, 73, .22), rgba(15, 20, 24, .92) 55%);
}

.campaign-access-strip-approval {
  background: linear-gradient(90deg, rgba(145, 91, 34, .24), rgba(15, 20, 24, .92) 55%);
}

.campaign-access-strip-inner {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-soft);
  font-size: .78rem;
}

.campaign-access-strip-inner > a {
  margin-left: auto;
  color: var(--accent-light);
  font-weight: 650;
  text-decoration: none;
}

.source-access-section {
  margin-top: 54px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

.source-access-section.source-access-allowed {
  border-color: rgba(102, 178, 134, .24);
  background: linear-gradient(145deg, rgba(67, 128, 93, .08), var(--surface) 36%);
}

.source-access-section.source-access-approval {
  border-color: rgba(210, 157, 82, .28);
  background: linear-gradient(145deg, rgba(161, 108, 42, .09), var(--surface) 36%);
}

.source-access-section .section-head {
  margin-bottom: 22px;
}

.source-access-section .section-head p:not(.eyebrow) {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--muted);
}

.source-access-count {
  min-width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-soft);
  font-weight: 700;
}

.campaign-source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.campaign-source-card {
  min-width: 0;
  padding: 13px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(8, 11, 14, .34);
  text-decoration: none;
}

.campaign-source-card:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
}

.campaign-source-code {
  width: 44px;
  height: 52px;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  border: 1px solid;
  border-radius: 8px;
  color: var(--accent-light);
  font-size: .72rem;
  font-weight: 760;
}

.campaign-source-card strong,
.campaign-source-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-source-card strong {
  color: var(--text);
  font-size: .84rem;
}

.campaign-source-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: .68rem;
}

.campaign-source-card .campaign-access-badge {
  grid-column: 2;
  margin-top: 6px;
}

.creation-step-grid-global {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.creation-principle-clear .principle-mark {
  border-color: rgba(102, 178, 134, .38);
  background: rgba(67, 128, 93, .16);
  color: #a9d9ba;
}

.source-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.source-card-heading h2 {
  margin: 0;
}

/* Author cabinet */

.manage-shell {
  grid-template-columns: 270px minmax(0, 1fr);
  background: #0f1418;
}

.manage-sidebar {
  padding: 22px 16px 36px;
  border-color: rgba(255, 255, 255, .07);
  background: linear-gradient(180deg, #151b20, #11161a);
  overflow-y: auto;
}

.manage-home {
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font: inherit;
}

.manage-home > span:first-child {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  color: var(--accent-light);
  font-size: 1rem;
}

.manage-home strong,
.manage-home small {
  display: block;
}

.manage-home strong {
  color: var(--text);
  font-size: .9rem;
}

.manage-home small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .65rem;
}

.manage-sidebar nav {
  display: block;
}

.manage-nav-group {
  margin-top: 20px;
  display: grid;
  gap: 3px;
}

.manage-nav-group > small {
  padding: 0 10px 6px;
  color: #c4a878;
  font-size: .62rem;
  font-weight: 760;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.manage-sidebar .manage-nav-group a {
  padding: 8px 10px;
  color: #aab5bc;
  font-size: .76rem;
}

.manage-main {
  width: 100%;
  max-width: 1500px;
  padding: 30px clamp(22px, 3vw, 48px) 90px;
}

.manage-dashboard-hero {
  min-height: 170px;
  padding: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: radial-gradient(circle at 86% 16%, rgba(186, 162, 125, .16), transparent 34%), var(--surface);
}

.manage-dashboard-hero h1 {
  font-size: clamp(2rem, 3.3vw, 3.25rem);
}

.manage-dashboard-hero p:not(.eyebrow) {
  max-width: 650px;
}

.manage-primary-actions {
  margin: 18px 0 42px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.manage-primary-actions > a {
  min-width: 0;
  padding: 17px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 3px 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
}

.manage-primary-actions > a:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

.manage-primary-actions > a > span {
  width: 38px;
  height: 38px;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-light);
  font-weight: 760;
}

.manage-primary-actions strong,
.manage-primary-actions small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-primary-actions strong {
  color: var(--text);
  font-size: .82rem;
}

.manage-primary-actions small {
  color: var(--muted);
  font-size: .65rem;
}

.manage-group {
  margin-top: 34px;
}

.manage-group-head {
  margin-bottom: 13px;
}

.manage-group-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.manage-group-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .75rem;
}

.manage-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.manage-stat {
  min-width: 0;
}

.editor-welcome {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid rgba(102, 178, 134, .25);
  border-radius: 12px;
  background: rgba(67, 128, 93, .1);
}

.editor-welcome > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: rgba(102, 178, 134, .14);
  color: #a9d9ba;
}

.editor-welcome strong,
.editor-welcome p {
  display: block;
  margin: 0;
}

.editor-welcome strong {
  font-size: .84rem;
}

.editor-welcome p {
  margin-top: 3px;
  color: #9eaaa9;
  font-size: .72rem;
}

.editor-section {
  overflow: visible;
}

.editor-section .form-panel-head,
.form-panel-head {
  padding: 17px 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.editor-section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 20px;
}

.editor-section-grid .editor-field-description,
.editor-section-grid .editor-field-higher_levels,
.editor-section-grid .editor-field-traits,
.editor-section-grid .editor-field-actions,
.editor-section-grid .editor-field-bonus_actions,
.editor-section-grid .editor-field-reactions,
.editor-section-grid .editor-field-legendary_actions,
.editor-section-grid .editor-field-starting_equipment {
  grid-column: 1 / -1;
}

.editor-field > span {
  color: #b9c2c8 !important;
  font-size: .72rem !important;
  font-weight: 680 !important;
}

.editor-field > small {
  color: var(--muted);
  font-size: .65rem;
  line-height: 1.45;
}

.required-mark {
  margin-left: 3px;
  color: #d7a968;
}

.rich-editor-source {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

.rich-editor {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #12181d;
}

.rich-editor:focus-within {
  border-color: rgba(186, 162, 125, .58);
  box-shadow: 0 0 0 3px rgba(186, 162, 125, .08);
}

.rich-editor-toolbar {
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  background: #192027;
}

.rich-editor-toolbar button {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 6px;
  background: rgba(255, 255, 255, .025);
  color: #c5ced3;
  font-size: .66rem;
  font-weight: 650;
  cursor: pointer;
}

.rich-editor-toolbar button:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--text);
}

.rich-editor-surface {
  min-height: 230px;
  max-height: 680px;
  padding: 22px;
  overflow: auto;
  outline: 0;
  color: #d8e0e4;
  font-size: .91rem;
  line-height: 1.72;
}

.rich-editor-surface:empty::before {
  content: "Начни писать здесь...";
  color: #66737c;
}

.rich-editor-surface h2,
.rich-editor-surface h3,
.rich-editor-surface h4 {
  margin: 1.15em 0 .5em;
  color: #f0f3f5;
}

.rich-editor-surface p {
  margin: .65em 0;
}

.rich-editor-surface blockquote {
  margin: 1em 0;
  padding: 12px 16px;
  border-left: 3px solid #b89d74;
  background: rgba(186, 162, 125, .08);
  color: #c8d0d5;
}

.rich-editor-surface table {
  width: 100%;
  margin: 12px 0;
}

.rich-editor-surface th,
.rich-editor-surface td {
  padding: 9px;
  border: 1px solid var(--line-strong);
  vertical-align: top;
}

.rich-editor-surface th {
  background: rgba(186, 162, 125, .1);
  color: #e7d6b9;
  text-align: left;
}

.rich-editor-status {
  padding: 6px 10px;
  border-top: 1px solid var(--line);
  color: #6f7d86;
  font-size: .6rem;
  text-align: right;
}

.repeater-card .rich-editor-surface {
  min-height: 170px;
}

.repeater-card.is-new {
  border-color: rgba(102, 178, 134, .3);
  animation: editor-card-in .28s ease-out both;
}

.repeater-remove {
  margin-top: 10px;
  padding: 6px 9px;
  border: 0;
  background: transparent;
  color: #cf928a;
  font-size: .68rem;
  cursor: pointer;
}

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

.editor-bottom-actions > span {
  color: var(--muted);
  font-size: .7rem;
}

.editor-bottom-actions .editor-actions {
  margin: 0;
}

@keyframes editor-card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1120px) {
  .campaign-source-grid,
  .creation-step-grid-global {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manage-primary-actions,
  .manage-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .manage-shell {
    grid-template-columns: 1fr;
  }

  .manage-sidebar {
    position: static;
    height: auto;
    overflow: visible;
  }

  .manage-sidebar nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .manage-nav-group {
    margin-top: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  .editor-section-grid {
    grid-template-columns: 1fr;
  }

  .editor-section-grid .editor-field {
    grid-column: 1;
  }
}

@media (max-width: 640px) {
  .campaign-access-strip-inner {
    padding: 9px 0;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .campaign-access-strip-inner > span:not(.campaign-access-badge) {
    width: calc(100% - 130px);
  }

  .campaign-access-strip-inner > a {
    width: 100%;
    margin-left: 0;
  }

  .campaign-source-grid,
  .creation-step-grid-global,
  .manage-primary-actions,
  .manage-card-grid,
  .manage-sidebar nav {
    grid-template-columns: 1fr;
  }

  .source-access-section {
    margin-top: 34px;
    padding: 18px;
  }

  .source-card-heading {
    display: block;
  }

  .source-card-heading .campaign-access-badge {
    margin-top: 8px;
  }

  .manage-main {
    padding: 18px 12px 70px;
  }

  .manage-dashboard-hero {
    padding: 20px;
  }

  .sticky-actions {
    position: static;
  }

  .rich-editor-toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .rich-editor-toolbar button {
    flex: 0 0 auto;
  }

  .rich-editor-surface {
    min-height: 200px;
    padding: 16px;
  }

  .editor-bottom-actions {
    align-items: stretch;
    flex-direction: column;
  }
}


/* RESET / TYPOGRAPHY */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(
      circle at 50% -10%,
      rgba(126, 143, 154, .08),
      transparent 34rem
    ),
    var(--bg);

  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.62;
  font-weight: 430;
  letter-spacing: -.006em;

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.container {
  width: min(
    calc(100% - 48px),
    var(--content)
  );

  margin-inline: auto;
}

.main {
  min-height: 70vh;
  padding: 0 0 72px;
}

.page-container {
  padding-top: 30px;
}

h1,
h2,
h3,
h4 {
  margin-top: 0;
  color: var(--text);
  line-height: 1.14;
  letter-spacing: -.035em;
}

h1 {
  font-size: clamp(2.25rem, 4vw, 4.4rem);
  font-weight: 740;
}

h2 {
  font-size: clamp(1.55rem, 2.3vw, 2.35rem);
  font-weight: 700;
}

h3 {
  font-size: 1.16rem;
  font-weight: 680;
}

p {
  margin-top: 0;
}

.lead {
  max-width: 700px;
  color: var(--text-soft);
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-light);
  font-size: .73rem;
  font-weight: 720;
  letter-spacing: .13em;
  line-height: 1.2;
  text-transform: uppercase;
}

.original {
  color: var(--muted);
  font-size: 1rem;
}

.prose,
.wiki-content {
  max-width: var(--reading);
  color: var(--text-soft);
  font-size: 1.02rem;
  line-height: 1.82;
}

.prose p,
.wiki-content p {
  margin: 0 0 1.2em;
}

.prose h2,
.prose h3,
.wiki-content h2,
.wiki-content h3 {
  margin-top: 2em;
  margin-bottom: .7em;
}

.prose-narrow {
  max-width: 700px;
}


/* HEADER */

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;

  border-bottom: 1px solid var(--line);
  background: rgba(15, 19, 23, .90);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(
    calc(100% - 40px),
    1360px
  );

  min-height: 72px;
  margin-inline: auto;

  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 11px;

  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;

  display: grid;
  place-items: center;

  border: 1px solid var(--accent-line);
  border-radius: 10px;

  background:
    linear-gradient(
      145deg,
      rgba(186, 162, 125, .19),
      rgba(186, 162, 125, .04)
    );

  color: var(--accent-light);
  font-size: 1rem;
  font-weight: 780;
}

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

.brand-copy strong {
  font-size: 1.02rem;
  letter-spacing: -.025em;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .025em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 3px;
}

.main-nav > a,
.nav-dropdown > summary {
  min-height: 38px;
  padding: 8px 10px;

  display: inline-flex;
  align-items: center;

  border-radius: 8px;

  color: var(--text-soft);
  font-size: .88rem;
  font-weight: 560;
  text-decoration: none;

  cursor: pointer;
}

.main-nav > a:hover,
.nav-dropdown > summary:hover {
  background: rgba(255,255,255,.055);
  color: var(--text);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown > summary {
  list-style: none;
}

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

.nav-dropdown > summary::after {
  content: "⌄";
  margin-left: 6px;
  color: var(--muted);
}

.nav-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;

  min-width: 240px;
  padding: 10px;

  border: 1px solid var(--line-strong);
  border-radius: var(--radius);

  background: #171d22;
  box-shadow: var(--shadow);
}

.nav-menu-wide {
  width: min(560px, 86vw);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.nav-menu-group {
  padding: 7px;
}

.nav-menu-group small {
  display: block;
  padding: 0 8px 8px;

  color: var(--muted);
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.nav-menu-group a {
  display: block;
  padding: 8px;

  border-radius: 7px;

  color: var(--text-soft);
  font-size: .86rem;
  text-decoration: none;
}

.nav-menu-group a:hover {
  background: rgba(255,255,255,.055);
  color: var(--text);
}

.header-search {
  flex: 1 1 220px;
  max-width: 340px;
  min-width: 150px;

  height: 38px;
  padding: 0 11px;

  display: flex;
  align-items: center;
  gap: 8px;

  border: 1px solid var(--line);
  border-radius: 9px;

  background: rgba(255,255,255,.035);
}

.header-search > span {
  color: var(--muted);
  font-size: 1.1rem;
}

.header-search input {
  min-width: 0;
  flex: 1;

  border: 0;
  outline: 0;
  background: none;

  color: var(--text);
  font-size: .88rem;
}

.header-search input::placeholder {
  color: #6f7d86;
}

.header-search kbd {
  color: var(--muted);
  font-family: var(--font);
  font-size: .67rem;
}

.account-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-name {
  max-width: 105px;
  overflow: hidden;
  color: var(--muted);
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-link,
.text-button,
.header-login {
  border: 0;
  background: none;

  color: var(--text-soft);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;

  cursor: pointer;
}

.icon-link {
  width: 34px;
  height: 34px;

  display: grid;
  place-items: center;

  border: 1px solid var(--line);
  border-radius: 8px;
}

.icon-link:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.header-login {
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.mobile-menu {
  display: none;
}


/* CONTEXT TOOL */

.context-tools {
  border-bottom: 1px solid var(--line);
  background: rgba(186, 162, 125, .045);
}

.context-tools-inner {
  min-height: 42px;

  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;

  color: var(--muted);
  font-size: .78rem;
}

.context-tools a {
  color: var(--accent-light);
  font-weight: 620;
  text-decoration: none;
}


/* BUTTONS */

.primary-button,
.ghost-button,
.card-button {
  min-height: 42px;
  padding: 10px 16px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  border-radius: 9px;

  font-size: .86rem;
  font-weight: 650;
  line-height: 1.1;
  text-decoration: none;

  cursor: pointer;
}

.primary-button {
  border: 1px solid #c3aa84;
  background: #b49a72;
  color: #11161a;
}

.primary-button:hover {
  background: #c2aa84;
}

.ghost-button {
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.025);
  color: var(--text-soft);
}

.ghost-button:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--text);
}

.card-button {
  padding-inline: 0;
  justify-content: space-between;
  color: var(--accent-light);
}


/* BREADCRUMBS */

.breadcrumbs {
  min-height: 34px;
  margin-bottom: 26px;

  display: flex;
  align-items: center;
  gap: 8px;

  color: var(--muted);
  font-size: .76rem;
}

.breadcrumbs a {
  color: var(--text-soft);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--accent-light);
}


/* HOME HERO */

.home-container {
  padding-top: 34px;
}

.home-hero-v2 {
  min-height: 460px;
  padding: clamp(36px, 6vw, 76px);

  display: grid;
  grid-template-columns:
    minmax(0, 1.3fr)
    minmax(280px, .7fr);

  align-items: center;
  gap: clamp(40px, 7vw, 92px);

  border: 1px solid var(--line);
  border-radius: var(--radius-xl);

  background:
    radial-gradient(
      circle at 15% 20%,
      rgba(186,162,125,.13),
      transparent 34%
    ),
    linear-gradient(
      145deg,
      rgba(255,255,255,.035),
      rgba(255,255,255,.012)
    );

  overflow: hidden;
}

.home-hero-copy h1 {
  max-width: 820px;
  margin-bottom: 22px;
}

.home-hero-copy h1 span {
  display: block;
  color: #b7c1c8;
}

.hero-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-search-card {
  padding: 24px;

  border: 1px solid var(--line);
  border-radius: var(--radius-lg);

  background: rgba(9,12,15,.46);
  box-shadow: 0 22px 60px rgba(0,0,0,.20);
}

.hero-search-label {
  display: block;
  margin-bottom: 10px;

  color: var(--muted);
  font-size: .75rem;
  font-weight: 650;
}

.hero-search-card form {
  height: 54px;
  padding: 0 16px;

  display: flex;
  align-items: center;
  gap: 10px;

  border: 1px solid var(--line-strong);
  border-radius: 10px;

  background: rgba(255,255,255,.055);
}

.hero-search-card input {
  width: 100%;

  border: 0;
  outline: 0;
  background: none;

  color: var(--text);
}

.hero-search-links {
  margin-top: 16px;

  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.hero-search-links a {
  color: var(--muted);
  font-size: .76rem;
  text-decoration: none;
}

.hero-search-links a:hover {
  color: var(--accent-light);
}


/* PORTALS */

.home-portals {
  margin-top: 24px;

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.portal-card {
  position: relative;
  min-height: 190px;
  padding: 24px;

  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 16px;

  border: 1px solid var(--line);
  border-radius: var(--radius-lg);

  background: var(--surface);

  text-decoration: none;

  transition:
    transform .16s ease,
    border-color .16s ease,
    background .16s ease;
}

.portal-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line);
  background: var(--surface-2);
}

.portal-icon {
  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  border: 1px solid var(--accent-line);
  border-radius: 11px;

  background: var(--accent-soft);
  color: var(--accent-light);

  font-size: 1.15rem;
}

.portal-card small {
  color: var(--muted);
  font-size: .69rem;
  font-weight: 670;
  text-transform: uppercase;
  letter-spacing: .09em;
}

.portal-card h2 {
  margin: 7px 0 10px;
  font-size: 1.25rem;
}

.portal-card p {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.6;
}

.portal-arrow {
  color: var(--accent-light);
}


/* SECTIONS */

.home-section,
.home-lower {
  margin-top: 72px;
}

.section-head {
  margin-bottom: 22px;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-head h2,
.section-head h3 {
  margin: 0;
}

.section-head > a {
  color: var(--muted);
  font-size: .82rem;
  text-decoration: none;
}

.section-head > a:hover {
  color: var(--accent-light);
}

.content-block {
  margin-top: 52px;
}


/* SYSTEM CARDS */

.system-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.system-card-grid-large {
  gap: 20px;
}

.system-card {
  min-height: 270px;
  padding: 25px;

  display: flex;
  flex-direction: column;
  gap: 22px;

  border: 1px solid var(--line);
  border-radius: var(--radius-lg);

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,.035),
      rgba(255,255,255,.012)
    );

  transition:
    border-color .16s ease,
    transform .16s ease;
}

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

.system-card-large {
  min-height: 350px;
  padding: 30px;
}

.system-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.system-monogram {
  width: 48px;
  height: 48px;

  display: grid;
  place-items: center;

  border: 1px solid var(--accent-line);
  border-radius: 12px;

  background: var(--accent-soft);
  color: var(--accent-light);

  font-size: .92rem;
  font-weight: 760;
}

.system-monogram.large {
  width: 60px;
  height: 60px;
  font-size: 1.05rem;
}

.system-card small {
  color: var(--muted);
}

.system-card h2,
.system-card h3 {
  margin: 6px 0 10px;
}

.system-card p {
  color: var(--muted);
}

.system-card footer {
  margin-top: auto;
  padding-top: 16px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  border-top: 1px solid var(--line);

  color: var(--muted);
  font-size: .78rem;
}

.system-card footer a {
  color: var(--accent-light);
  text-decoration: none;
}

.system-publisher {
  color: var(--muted);
  font-size: .78rem;
}

.soft-pill {
  width: fit-content;
  padding: 5px 8px;

  display: inline-flex;
  align-items: center;

  border: 1px solid var(--line);
  border-radius: 999px;

  background: rgba(255,255,255,.035);

  color: var(--text-soft);
  font-size: .69rem;
  font-weight: 620;
  line-height: 1;
}


/* WORLD CARDS */

.world-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.world-card {
  min-height: 270px;
  display: grid;
  grid-template-columns: 170px 1fr;

  border: 1px solid var(--line);
  border-radius: var(--radius-lg);

  background: var(--surface);
  overflow: hidden;

  transition:
    transform .16s ease,
    border-color .16s ease;
}

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

.world-card-large {
  min-height: 330px;
  grid-template-columns: 220px 1fr;
}

.world-card-cover {
  min-height: 100%;

  display: grid;
  place-items: center;

  background:
    radial-gradient(
      circle at 50% 35%,
      rgba(186,162,125,.18),
      transparent 40%
    ),
    #11171c;

  background-size: cover;
  background-position: center;

  text-decoration: none;
}

.world-card-cover span {
  width: 72px;
  height: 72px;

  display: grid;
  place-items: center;

  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;

  background: rgba(10,13,16,.52);
  backdrop-filter: blur(9px);

  color: var(--accent-light);
  font-size: 1.6rem;
  font-weight: 730;
}

.world-card-body {
  padding: 26px;
  display: flex;
  flex-direction: column;
}

.world-card-body > small {
  color: var(--muted);
  font-size: .69rem;
  font-weight: 680;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.world-card h2,
.world-card h3 {
  margin: 7px 0 12px;
}

.world-card h2 a,
.world-card h3 a {
  text-decoration: none;
}

.world-card p {
  color: var(--muted);
  line-height: 1.65;
}

.world-meta {
  margin-top: auto;
  padding-top: 16px;

  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;

  border-top: 1px solid var(--line);

  color: var(--muted);
  font-size: .76rem;
}

.world-card-system {
  min-height: 24px;
  margin-bottom: 12px;

  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}


/* D&D CATEGORY CARDS */

.category-grid.image-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.category-card.image-card {
  position: relative;
  min-height: 185px;
  padding: 20px;

  display: flex;
  flex-direction: column;
  justify-content: flex-end;

  border: 1px solid var(--line);
  border-radius: var(--radius-lg);

  background:
    linear-gradient(
      180deg,
      rgba(8,11,13,.10) 10%,
      rgba(8,11,13,.92) 92%
    ),
    var(--card-image),
    var(--surface);

  background-size: cover;
  background-position: center;

  overflow: hidden;
  text-decoration: none;

  transition:
    transform .16s ease,
    border-color .16s ease;
}

.category-card.image-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line);
}

.category-card h3 {
  margin: 7px 0 3px;
  font-size: 1.12rem;
}

.category-count {
  width: fit-content;
  min-width: 29px;
  padding: 5px 8px;

  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;

  background: rgba(10,13,16,.48);

  color: var(--text-soft);
  font-size: .68rem;
}

.category-open {
  color: var(--muted);
  font-size: .72rem;
}


/* HOME LOWER */

.home-lower {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
}

.panel {
  padding: 25px;

  border: 1px solid var(--line);
  border-radius: var(--radius-lg);

  background: var(--surface);
}

.panel-head {
  margin-bottom: 15px;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
}

.panel-head h3 {
  margin: 0;
}

.panel-head > a {
  color: var(--muted);
  font-size: .76rem;
  text-decoration: none;
}


/* COMMON ROWS */

.material-row,
.library-row,
.compact-row,
.article-row {
  min-height: 68px;

  display: flex;
  align-items: center;
  gap: 14px;

  border-top: 1px solid var(--line);

  text-decoration: none;

  transition:
    background .14s ease,
    padding .14s ease;
}

.material-row:first-of-type,
.library-row:first-child,
.compact-row:first-child,
.article-row:first-child {
  border-top: 0;
}

.material-row:hover,
.library-row:hover,
.compact-row:hover,
.article-row:hover {
  background: rgba(255,255,255,.025);
}

.material-badge,
.row-icon,
.article-type-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;

  display: grid;
  place-items: center;

  border: 1px solid var(--line);
  border-radius: 9px;

  background: rgba(255,255,255,.035);

  color: var(--accent-light);
  font-size: .78rem;
  font-weight: 700;
}

.material-copy,
.library-row-copy,
.row-main,
.article-row-copy {
  min-width: 0;
  flex: 1;

  display: flex;
  flex-direction: column;
}

.material-copy strong,
.library-row-copy strong,
.row-main strong {
  color: var(--text);
  font-size: .88rem;
}

.material-copy small,
.library-row-copy small,
.row-main small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .75rem;
}

.material-source {
  max-width: 160px;
  color: var(--muted);
  font-size: .72rem;
  text-align: right;
}

.library-row {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 8px;
}

.library-row:first-child {
  border-top: 1px solid var(--line);
  margin-top: 0;
}

.library-row:hover {
  border-color: var(--accent-line);
}

.library-row-arrow,
.article-row-arrow {
  color: var(--muted);
}

.source-mini {
  display: flex;
  flex-direction: column;
}

.source-mini > a {
  padding: 12px 0;

  display: flex;
  align-items: center;
  gap: 12px;

  border-top: 1px solid var(--line);

  text-decoration: none;
}

.source-mini > a:first-child {
  border-top: 0;
}

.source-mini strong {
  display: block;
  font-size: .84rem;
}

.source-mini small {
  display: block;
  margin-top: 3px;

  color: var(--muted);
  font-size: .72rem;
}

.book-spine {
  min-width: 42px;
  height: 46px;
  padding: 5px;

  display: grid;
  place-items: center;

  border-left: 3px solid var(--accent);
  border-radius: 5px;

  background: rgba(255,255,255,.04);

  color: var(--text-soft);
  font-size: .62rem;
  font-weight: 720;
  text-align: center;
}


/* PAGE HEADING */

.page-heading {
  margin-bottom: 34px;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.page-heading-spacious {
  padding: 22px 0 30px;
}

.page-heading h1 {
  margin-bottom: 14px;
}

.page-heading p:last-child {
  margin-bottom: 0;
}


/* ENTITY HERO */

.entity-hero {
  position: relative;

  min-height: 270px;
  margin-bottom: 36px;
  padding: clamp(28px, 5vw, 50px);

  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 30px;

  border: 1px solid var(--line);
  border-radius: var(--radius-xl);

  background:
    radial-gradient(
      circle at 10% 20%,
      var(--accent-soft),
      transparent 36%
    ),
    var(--surface);

  overflow: hidden;
}

.entity-symbol {
  width: 112px;
  height: 112px;

  display: grid;
  place-items: center;

  border: 1px solid var(--accent-line);
  border-radius: 28px;

  background: rgba(186,162,125,.08);

  color: var(--accent-light);
  font-size: 1.7rem;
  font-weight: 760;
}

.entity-hero-copy {
  max-width: 780px;
}

.entity-hero-copy h1 {
  margin: 10px 0 10px;
}

.entity-subtitle {
  color: var(--muted);
}

.entity-edit-button {
  align-self: start;
}

.source-cover-large {
  width: 112px;
  height: 150px;

  border-left-width: 5px;
  border-radius: 8px;

  font-size: .84rem;
}

.source-cover-image {
  display: block;
  box-sizing: border-box;
  border: 1px solid var(--line);
  object-fit: cover;
  object-position: center;
}


/* META */

.hero-meta,
.article-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 12px;

  color: var(--muted);
  font-size: .74rem;
}

.hero-meta a {
  color: var(--text-soft);
  text-decoration: none;
}


/* REFERENCE GRID */

.reference-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.reference-grid > a {
  min-height: 108px;
  padding: 18px;

  display: grid;
  grid-template-columns: 40px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 3px 12px;

  border: 1px solid var(--line);
  border-radius: var(--radius);

  background: var(--surface);

  text-decoration: none;
}

.reference-grid > a:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
}

.reference-grid > a > span {
  width: 40px;
  height: 40px;

  grid-row: 1 / 3;

  display: grid;
  place-items: center;

  border: 1px solid var(--line);
  border-radius: 9px;

  color: var(--accent-light);
  font-weight: 700;
}

.reference-grid strong {
  font-size: .91rem;
}

.reference-grid small {
  color: var(--muted);
  font-size: .72rem;
}


/* FILTERS */

.filter-panel,
.form-panel {
  margin-bottom: 24px;
  padding: 22px;

  border: 1px solid var(--line);
  border-radius: var(--radius-lg);

  background: var(--surface);
}

.filter-grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.filter-panel label,
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.filter-panel label > span,
.form-grid label > span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 620;
}

.form-control {
  width: 100%;
  min-height: 43px;
  padding: 9px 11px;

  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;

  background: rgba(8,11,14,.38);
  color: var(--text);
}

.form-control:focus {
  border-color: var(--accent-line);
  box-shadow:
    0 0 0 3px rgba(186,162,125,.08);
}

.filter-actions,
.editor-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}


/* ARTICLE LIST */

.article-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.article-row {
  min-height: 96px;
  padding: 16px;

  border: 1px solid var(--line);
  border-radius: var(--radius);

  background: var(--surface);
}

.article-row:first-child {
  border-top: 1px solid var(--line);
}

.article-row:hover {
  padding-left: 19px;
  border-color: var(--accent-line);
}

.article-type-icon {
  width: 46px;
  height: 46px;
  border-radius: 11px;
}

.article-row-copy > strong {
  margin-top: 5px;
  color: var(--text);
  font-size: .98rem;
}

.article-row-copy > small {
  margin-top: 4px;
  color: var(--muted);
  font-size: .76rem;
}

.article-row-meta {
  font-size: .69rem;
}


/* ARTICLE / CONTENT */

.content-section,
.article-content-section {
  margin-top: 28px;
  margin-bottom: 26px;
  padding: clamp(22px, 3vw, 34px);

  border: 1px solid var(--line);
  border-radius: var(--radius-lg);

  background: var(--surface);
}

.article-content-section .wiki-content {
  margin-top: 22px;
}

.article-page .form-panel {
  margin-top: 18px;
}

.section-heading-inline {
  margin-bottom: 22px;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading-inline h2 {
  margin: 0;
}


/* EXISTING DETAIL PAGES */

.detail-layout,
.class-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 26px;
  align-items: start;
}

.material-hero,
.class-hero {
  margin-bottom: 26px;
  padding: 30px;

  border: 1px solid var(--line);
  border-radius: var(--radius-xl);

  background:
    radial-gradient(
      circle at 10% 20%,
      var(--accent-soft),
      transparent 36%
    ),
    var(--surface);
}

.material-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 24px;
}

.material-hero > div:first-child {
  width: 110px;
  height: 110px;

  display: grid;
  place-items: center;

  border: 1px solid var(--line);
  border-radius: 24px;

  overflow: hidden;
}

.material-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-glyph {
  color: var(--accent-light);
  font-size: 1.7rem;
}

.class-hero {
  min-height: 300px;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  overflow: hidden;
}

.class-art {
  min-height: 240px;
  border-radius: var(--radius-lg);
  background-position: center;
  background-size: cover;
}

.class-tabs {
  position: sticky;
  z-index: 20;
  top: 73px;

  margin-bottom: 22px;
  padding: 7px;

  display: flex;
  gap: 3px;

  border: 1px solid var(--line);
  border-radius: 11px;

  background: rgba(18,24,29,.92);
  backdrop-filter: blur(15px);
}

.class-tabs a {
  padding: 8px 10px;

  border-radius: 7px;

  color: var(--muted);
  font-size: .76rem;
  font-weight: 600;
  text-decoration: none;
}

.class-tabs a:hover {
  background: rgba(255,255,255,.05);
  color: var(--text);
}

.detail-aside,
.class-aside {
  position: sticky;
  top: 132px;
}

.source-card,
.toc,
.rule-panel,
.callout,
.subclass-preview {
  margin-bottom: 14px;
  padding: 18px;

  border: 1px solid var(--line);
  border-radius: var(--radius);

  background: var(--surface);
}

.toc {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc h3 {
  margin-bottom: 10px;
  font-size: .87rem;
}

.toc a {
  padding: 7px 0;

  border-top: 1px solid var(--line);

  color: var(--muted);
  font-size: .76rem;
  text-decoration: none;
}

.toc a:hover {
  color: var(--accent-light);
}

.attribute-grid {
  margin: 18px 0 26px;

  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.attribute-grid > div {
  min-height: 88px;
  padding: 15px;

  display: flex;
  flex-direction: column;
  justify-content: center;

  border: 1px solid var(--line);
  border-radius: 10px;

  background: rgba(255,255,255,.025);
}

.attribute-grid small {
  color: var(--muted);
  font-size: .68rem;
}

.attribute-grid strong {
  margin-top: 5px;
  font-size: .88rem;
}

.rules-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.rule-list {
  margin: 0;
}

.rule-list > div {
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.rule-list dt {
  color: var(--muted);
  font-size: .69rem;
}

.rule-list dd {
  margin: 4px 0 0;
}

.callout {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;

  border: 1px solid var(--line);
  border-radius: 11px;
}

table {
  border-collapse: collapse;
}

.progression-table {
  width: 100%;
  min-width: 720px;
}

.progression-table th {
  padding: 12px;
  border-bottom: 1px solid var(--line-strong);

  color: var(--muted);
  font-size: .7rem;
  text-align: left;
}

.progression-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);

  font-size: .79rem;
  vertical-align: top;
}

.feature {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

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

.feature-title {
  margin-bottom: 12px;

  display: flex;
  align-items: center;
  gap: 12px;
}

.feature-title h3 {
  margin: 0;
}

.level-tag,
.source-chip {
  width: fit-content;
  padding: 4px 7px;

  border: 1px solid var(--line);
  border-radius: 999px;

  color: var(--muted);
  font-size: .66rem;
}

.subclass-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.subclass-choice {
  padding: 18px;

  border: 1px solid var(--line);
  border-radius: var(--radius);

  background: rgba(255,255,255,.025);
  color: var(--text);

  text-align: left;
  cursor: pointer;
}

.subclass-choice:hover {
  border-color: var(--accent-line);
}


/* WIKI LINKS */

.wiki-link {
  color: #d3b98f;
  font-weight: 620;
  text-decoration: none;
  border-bottom: 1px dotted rgba(211,185,143,.55);
}

.wiki-link:hover {
  border-bottom-style: solid;
}

.wiki-link.unresolved {
  color: var(--muted);
  opacity: .75;
  cursor: help;
}


/* EMPTY STATES */

.empty-state {
  padding: 28px;

  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);

  color: var(--muted);
  text-align: center;
}

.empty-state-large {
  min-height: 220px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-state-large strong {
  margin-bottom: 7px;
  color: var(--text);
}

.empty-state-large p {
  max-width: 470px;
  margin: 0;
}


/* MANAGE COMPONENTS — spacing fixes */

.manage-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.manage-stat {
  min-height: 120px;
  padding: 18px;

  display: flex;
  flex-direction: column;
  gap: 7px;

  border: 1px solid var(--line);
  border-radius: var(--radius);

  background: var(--surface);

  text-decoration: none;
}

.manage-stat span {
  color: var(--accent-light);
  font-size: 1.2rem;
}

.manage-stat strong {
  color: var(--text);
}

.manage-stat small {
  color: var(--muted);
}


/* FOOTER */

.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  min-height: 130px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.footer-inner > div {
  display: flex;
  flex-direction: column;
}

.footer-inner strong {
  font-size: .9rem;
}

.footer-inner span {
  margin-top: 4px;
  color: var(--muted);
  font-size: .72rem;
}

.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-inner a {
  color: var(--muted);
  font-size: .75rem;
  text-decoration: none;
}


/* RESPONSIVE */

@media (max-width: 1120px) {

  .main-nav {
    gap: 0;
  }

  .main-nav > a,
  .nav-dropdown > summary {
    padding-inline: 7px;
    font-size: .82rem;
  }

  .account-name {
    display: none;
  }

  .category-grid.image-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .reference-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


@media (max-width: 900px) {

  .container {
    width: min(
      calc(100% - 32px),
      var(--content)
    );
  }

  .header-inner {
    width: calc(100% - 28px);
    min-height: 64px;
    gap: 12px;
  }

  .main-nav {
    display: none;
  }

  .header-search {
    max-width: none;
  }

  .mobile-menu {
    position: relative;
    display: block;
  }

  .mobile-menu > summary {
    padding: 8px 11px;

    border: 1px solid var(--line);
    border-radius: 8px;

    color: var(--text-soft);
    font-size: .78rem;

    list-style: none;
    cursor: pointer;
  }

  .mobile-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;

    width: 220px;
    padding: 10px;

    display: flex;
    flex-direction: column;

    border: 1px solid var(--line-strong);
    border-radius: 10px;

    background: #171d22;
    box-shadow: var(--shadow);
  }

  .mobile-menu-panel a {
    padding: 9px;

    border-radius: 7px;

    color: var(--text-soft);
    font-size: .84rem;
    text-decoration: none;
  }

  .mobile-menu-panel hr {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--line);
  }

  .home-hero-v2 {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .home-portals,
  .home-lower {
    grid-template-columns: 1fr;
  }

  .system-card-grid,
  .world-card-grid {
    grid-template-columns: 1fr;
  }

  .detail-layout,
  .class-layout {
    grid-template-columns: 1fr;
  }

  .detail-aside,
  .class-aside {
    position: static;
  }

  .filter-grid,
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .entity-hero {
    grid-template-columns: auto 1fr;
  }

  .entity-edit-button {
    grid-column: 1 / -1;
  }

  .class-hero {
    grid-template-columns: 1fr;
  }

  .class-tabs {
    overflow-x: auto;
  }
}


@media (max-width: 640px) {

  body {
    font-size: 15px;
  }

  .container {
    width: min(
      calc(100% - 22px),
      var(--content)
    );
  }

  .header-inner {
    width: calc(100% - 20px);
  }

  .brand-copy small {
    display: none;
  }

  .header-search {
    display: none;
  }

  .account-actions .icon-link {
    display: none;
  }

  .home-container {
    padding-top: 16px;
  }

  .home-hero-v2 {
    padding: 26px 20px;
    border-radius: 18px;
  }

  .home-hero-copy h1 {
    font-size: 2.15rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions > * {
    width: 100%;
  }

  .home-portals {
    margin-top: 12px;
    gap: 10px;
  }

  .portal-card {
    min-height: 0;
    padding: 18px;

    grid-template-columns: auto 1fr;
  }

  .portal-arrow {
    display: none;
  }

  .home-section,
  .home-lower {
    margin-top: 46px;
  }

  .category-grid.image-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .category-card.image-card {
    min-height: 145px;
    padding: 14px;
  }

  .world-card,
  .world-card-large {
    grid-template-columns: 1fr;
  }

  .world-card-cover {
    min-height: 180px;
  }

  .system-card,
  .system-card-large {
    min-height: 0;
    padding: 20px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .entity-hero {
    padding: 22px;
    grid-template-columns: 1fr;
  }

  .entity-symbol {
    width: 70px;
    height: 70px;
    border-radius: 17px;
  }

  .source-cover-large {
    width: 76px;
    height: 100px;
  }

  .reference-grid {
    grid-template-columns: 1fr;
  }

  .filter-grid,
  .form-grid,
  .attribute-grid,
  .rules-columns,
  .subclass-grid {
    grid-template-columns: 1fr;
  }

  .article-row {
    min-height: 84px;
    padding: 13px;
  }

  .article-type-icon {
    width: 40px;
    height: 40px;
  }

  .material-source {
    display: none;
  }

  .context-tools-inner {
    min-height: 52px;
    justify-content: space-between;
  }

  .context-tools-inner > span {
    display: none;
  }

  .footer-inner {
    padding: 28px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-inner nav {
    gap: 10px 16px;
  }

  .class-tabs {
    top: 65px;
  }
}


/* =========================================================
   STAGE 2A.1 — typography / proportions polish
   ========================================================= */


/* Убираем старую serif-типографику из site.css */

body,
button,
input,
select,
textarea,
h1,
h2,
h3,
h4,
h5,
h6,
.brand,
.brand strong,
.page-heading,
.material-hero,
.class-hero,
.source-hero,
.entity-hero,
.portal-card,
.system-card,
.world-card {
    font-family:
        "Segoe UI Variable Text",
        "Segoe UI Variable",
        "Inter",
        "Noto Sans",
        "Segoe UI",
        Arial,
        sans-serif !important;
}


/* Шапка */

.header-inner {
    min-height: 70px;
}

.brand-mark {
    width: 38px;
    height: 38px;
}

.brand-copy strong {
    font-size: 1rem;
    font-weight: 720;
    letter-spacing: -.02em;
}

.brand-copy small {
    margin-top: 4px;
    font-size: .65rem;
}

.main-nav > a,
.nav-dropdown > summary {
    padding-inline: 11px;
    font-size: .86rem;
    font-weight: 600;
}

.header-search {
    max-width: 315px;
}


/* Главный hero */

.home-hero-v2 {
    min-height: 400px;

    padding:
        clamp(38px, 5vw, 62px)
        clamp(38px, 5.5vw, 68px);

    grid-template-columns:
        minmax(0, 1.35fr)
        minmax(330px, .65fr);

    gap: clamp(46px, 7vw, 88px);
}

.home-hero-copy {
    max-width: 720px;
}

.home-hero-copy h1 {
    max-width: 690px;

    margin-bottom: 22px;

    font-size:
        clamp(2.55rem, 3.25vw, 3.55rem);

    font-weight: 735;
    line-height: 1.06;
    letter-spacing: -.045em;
}

.home-hero-copy h1 span {
    display: inline;
    color: #aeb9c1;
}

.home-hero-copy .lead {
    max-width: 660px;

    font-size: 1.04rem;
    line-height: 1.72;
}

.home-hero-copy .eyebrow {
    margin-bottom: 15px;
}


/* Правая поисковая карточка */

.hero-search-card {
    width: 100%;
    max-width: 380px;

    justify-self: end;

    padding: 24px;

    border-color: rgba(255,255,255,.10);

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.035),
            rgba(255,255,255,.012)
        ),
        rgba(8, 11, 14, .54);
}

.hero-search-label {
    margin-bottom: 12px;

    color: #aeb9c1;

    font-size: .72rem;
    font-weight: 650;
}

.hero-search-card form {
    height: 52px;
}

.hero-search-card input {
    font-size: .88rem;
}

.hero-search-links {
    margin-top: 14px;
}


/* Кнопки */

.primary-button {
    border-color: #b89d74;

    background:
        linear-gradient(
            180deg,
            #c0a57a,
            #ae936c
        );

    color: #101418;

    box-shadow:
        inset 0 1px rgba(255,255,255,.16);
}

.primary-button:hover {
    background:
        linear-gradient(
            180deg,
            #ccb085,
            #b99e75
        );
}


/* Карточки основных разделов */

.home-portals {
    margin-top: 18px;
    gap: 14px;
}

.portal-card {
    min-height: 172px;
    padding: 22px;
}

.portal-card h2 {
    margin-top: 6px;

    font-size: 1.13rem;
    font-weight: 680;
    letter-spacing: -.025em;
}

.portal-card p {
    max-width: 300px;

    font-size: .82rem;
    line-height: 1.58;
}

.portal-icon {
    width: 40px;
    height: 40px;
}


/* Общая типографика страниц */

.page-heading h1,
.entity-hero h1,
.material-hero h1,
.class-hero h1,
.source-hero h1 {
    font-family:
        "Segoe UI Variable Text",
        "Segoe UI Variable",
        "Inter",
        "Noto Sans",
        "Segoe UI",
        Arial,
        sans-serif !important;

    font-weight: 730;
    letter-spacing: -.04em;
}

.page-heading h1 {
    font-size:
        clamp(2.15rem, 3.2vw, 3.35rem);
}

.entity-hero h1 {
    font-size:
        clamp(2.1rem, 3.5vw, 3.6rem);
}

.content-section h2,
.content-block h2,
.section-head h2 {
    letter-spacing: -.035em;
}


/* Вертикальный ритм */

.home-section,
.home-lower {
    margin-top: 64px;
}

.page-container {
    padding-top: 28px;
}

.content-block {
    margin-top: 48px;
}

.form-panel + .form-panel,
.content-section + .content-section {
    margin-top: 18px;
}


/* Чуть светлее основной текст */

:root {
    --text: #e9eef1;
    --text-soft: #c3ccd2;
    --muted: #8997a1;
}


/* На широком экране герой не должен становиться огромным */

@media (min-width: 1450px) {
    .home-hero-v2 {
        min-height: 390px;
    }

    .home-hero-copy h1 {
        font-size: 3.45rem;
    }
}


/* Планшеты */

@media (max-width: 1000px) {
    .home-hero-v2 {
        grid-template-columns: 1fr;
    }

    .hero-search-card {
        max-width: 100%;
        justify-self: stretch;
    }
}


/* Телефон */

@media (max-width: 640px) {
    .home-hero-v2 {
        padding: 28px 22px;
    }

    .home-hero-copy h1 {
        font-size: 2.15rem;
        line-height: 1.08;
    }

    .home-hero-copy h1 span {
        display: inline;
    }

    .hero-search-card {
        padding: 18px;
    }

    .portal-card {
        padding: 17px;
    }
}


/* =========================================================
   STAGE 2A.2
   Final typography cleanup
   ========================================================= */

/*
 * Старый site.css задаёт display-serif для части публичных
 * компонентов. Убираем его точечно, не затрагивая админку.
 */

html body .main h1,
html body .main h2,
html body .main h3,
html body .main h4,
html body .home-section h2,
html body .home-lower h3,
html body .panel h3,
html body .category-card h3,
html body .portal-card h2,
html body .system-card h2,
html body .system-card h3,
html body .world-card h2,
html body .world-card h3,
html body .entity-hero h1,
html body .material-hero h1,
html body .class-hero h1,
html body .section-head h2,
html body .section-head h3,
html body .brand-copy strong {
    font-family:
        "Segoe UI Variable Text",
        "Segoe UI Variable",
        "Inter",
        "Noto Sans",
        "Segoe UI",
        Arial,
        sans-serif !important;

    text-shadow: none !important;
}


/* Заголовки */

html body .section-head h2 {
    font-size: clamp(1.7rem, 2.1vw, 2.15rem);
    font-weight: 720;
    line-height: 1.12;
    letter-spacing: -.04em;
}

html body .panel h3,
html body .panel-head h3 {
    font-size: 1.18rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.025em;
}


/* Названия карточек справочника */

html body .category-card.image-card h3 {
    margin: 8px 0 3px;

    color: #f0f3f5;

    font-size: 1rem;
    font-weight: 720;
    line-height: 1.15;
    letter-spacing: -.025em;

    text-shadow: none !important;

    -webkit-text-stroke: 0 !important;
}


/*
 * Старый дизайн добавлял тени некоторым текстовым элементам.
 */

html body .category-card *,
html body .image-card *,
html body .material-row *,
html body .source-mini * {
    text-shadow: none !important;
}


/* Счётчик на карточках */

html body .category-count {
    min-width: 30px;
    min-height: 26px;
    padding: 4px 8px;

    display: inline-grid;
    place-items: center;

    border-color: rgba(255,255,255,.12);

    background: rgba(10, 13, 16, .72);
    backdrop-filter: blur(7px);

    color: #c3ccd2;

    font-size: .68rem;
    font-weight: 650;

    text-shadow: none !important;
}


/* Карточки материалов */

html body .category-card.image-card {
    min-height: 178px;

    border-color: rgba(255,255,255,.085);

    box-shadow:
        inset 0 0 0 1px rgba(0,0,0,.08);

    background:
        linear-gradient(
            180deg,
            rgba(7,10,12,.03) 10%,
            rgba(7,10,12,.25) 45%,
            rgba(7,10,12,.94) 100%
        ),
        var(--card-image),
        var(--surface);

    background-position: center;
    background-size: cover;
}

html body .category-card.image-card:hover {
    border-color: rgba(186,162,125,.34);

    box-shadow:
        0 13px 34px rgba(0,0,0,.16);
}


/* Делаем подпись "Открыть" ненавязчивой */

html body .category-open {
    margin-top: 2px;

    color: #87959e;

    font-size: .67rem;
    font-weight: 550;

    text-shadow: none !important;
}


/* Нижние панели */

html body .home-lower {
    margin-top: 46px;
}

html body .panel {
    padding: 26px;
}

html body .panel-head {
    margin-bottom: 14px;
    padding-bottom: 14px;

    border-bottom: 1px solid rgba(255,255,255,.07);
}


/* Материалы внутри нижних панелей */

html body .material-row {
    min-height: 70px;
}

html body .material-copy strong,
html body .source-mini strong {
    color: #e8edf0;

    font-size: .84rem;
    font-weight: 650;

    text-shadow: none !important;
}


/* Немного меньше огромных разрывов на главной */

html body .home-section {
    margin-top: 56px;
}


/* Eyebrow */

html body .eyebrow {
    color: #c5aa80;

    font-size: .69rem;
    font-weight: 740;
    letter-spacing: .12em;

    text-shadow: none !important;
}


/* Шапка */

html body .brand-copy strong {
    color: #edf1f3;

    font-size: 1rem;
    font-weight: 720;
    letter-spacing: -.025em;
}


/* Мелкая навигация чуть читабельнее */

html body .main-nav > a,
html body .nav-dropdown > summary {
    color: #c3ccd2;

    font-size: .85rem;
    font-weight: 590;
}


/* Телефон */

@media (max-width: 640px) {

    html body .category-card.image-card {
        min-height: 142px;
    }

    html body .category-card.image-card h3 {
        font-size: .9rem;
    }

    html body .home-section {
        margin-top: 42px;
    }

    html body .home-lower {
        margin-top: 38px;
    }
}


/* =========================================================
   STAGE 2A.3 — final homepage polish
   ========================================================= */

/* Полностью убираем старые эффекты с подписей карточек */

html body .category-card.image-card h3,
html body .category-card.image-card h3 *,
html body .image-card h3,
html body .image-card h3 * {
    color: #f1f4f6 !important;

    font-family:
        "Segoe UI Variable Text",
        "Segoe UI Variable",
        "Inter",
        "Noto Sans",
        "Segoe UI",
        Arial,
        sans-serif !important;

    font-weight: 700 !important;

    text-shadow: none !important;
    -webkit-text-stroke: 0 transparent !important;
    filter: none !important;
}


/* Чуть спокойнее затемнение изображения */

html body .category-card.image-card {
    background:
        linear-gradient(
            180deg,
            rgba(7,10,12,.03) 0%,
            rgba(7,10,12,.14) 42%,
            rgba(7,10,12,.88) 100%
        ),
        var(--card-image),
        var(--surface);

    background-position: center;
    background-size: cover;
}


/* Чуть лучше читается нижняя часть главной */

html body .material-copy strong,
html body .source-mini strong {
    font-size: .88rem;
}

html body .material-copy small,
html body .source-mini small {
    font-size: .76rem;
    line-height: 1.45;
}

html body .material-source {
    font-size: .74rem;
}


/* Чуть больше воздуха внутри нижних панелей */

html body .panel {
    border-radius: 16px;
}

html body .home-lower {
    gap: 16px;
}


/* STAGE 2A.5 - system monogram */
html body .system-monogram {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 56px !important;
  min-width: 56px !important;
  height: 56px !important;
  padding: 0 !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  text-align: center !important;
}
/* END STAGE 2A.5 */



/* STAGE 2A.8 - library category cards */
html body .category-grid.image-grid {
  grid-auto-rows: auto !important;
  gap: 18px !important;
}

html body a.category-card.image-card {
  position: relative !important;
  display: block !important;
  box-sizing: border-box !important;
  height: 250px !important;
  min-height: 250px !important;
  aspect-ratio: auto !important;
  overflow: hidden !important;
  border: 1px solid rgba(210,180,120,.16) !important;
  border-radius: 15px !important;
  background-position: center !important;
  background-size: cover !important;
  filter: none !important;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease !important;
}

html body a.category-card.image-card:hover {
  transform: translateY(-3px) !important;
  border-color: rgba(210,180,120,.48) !important;
  box-shadow: 0 14px 30px rgba(0,0,0,.26) !important;
}

html body a.category-card.image-card h3 {
  position: absolute !important;
  inset: auto 0 0 0 !important;
  z-index: 3 !important;
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: 64px !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 62px 0 18px !important;
  border-top: 1px solid rgba(255,255,255,.07) !important;
  background: rgba(13,18,21,.97) !important;
  color: #eef1f2 !important;
  -webkit-text-fill-color: #eef1f2 !important;
  font-family: "Segoe UI Variable Text", "Segoe UI Variable", "Noto Sans", "Segoe UI", sans-serif !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  line-height: 1.18 !important;
  letter-spacing: -0.01em !important;
  text-shadow: none !important;
  -webkit-text-stroke: 0 transparent !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  opacity: .999 !important;
}

html body a.category-card.image-card h3::before,
html body a.category-card.image-card h3::after {
  display: none !important;
  content: none !important;
}

html body a.category-card.image-card .category-count {
  position: absolute !important;
  top: auto !important;
  right: 17px !important;
  bottom: 17px !important;
  left: auto !important;
  z-index: 4 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 30px !important;
  height: 30px !important;
  padding: 0 8px !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 999px !important;
  background: #0b1013 !important;
  color: #aeb7bc !important;
  font-size: .75rem !important;
}

@media (max-width: 640px) {
  html body a.category-card.image-card {
    height: 220px !important;
    min-height: 220px !important;
  }
}
/* END STAGE 2A.8 */

/* STAGE 2A.9 - isolate card image */
html body a.category-card.image-card {
  background-color: #0d1215 !important;
  background-image: none !important;
}

html body a.category-card.image-card::before {
  position: absolute !important;
  inset: 0 0 64px 0 !important;
  z-index: 0 !important;
  display: block !important;
  content: "" !important;
  background-color: #11171a !important;
  background-image: var(--card-image) !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  border-radius: 14px 14px 0 0 !important;
  pointer-events: none !important;
}

html body a.category-card.image-card::after {
  position: absolute !important;
  inset: 0 0 64px 0 !important;
  z-index: 1 !important;
  display: block !important;
  content: "" !important;
  background: linear-gradient(180deg, rgba(5,8,10,.04), rgba(5,8,10,.30)) !important;
  border-radius: 14px 14px 0 0 !important;
  pointer-events: none !important;
}

html body a.category-card.image-card h3 {
  bottom: 0 !important;
  height: 64px !important;
  min-height: 64px !important;
  background: #0d1215 !important;
  border-radius: 0 0 14px 14px !important;
  opacity: 1 !important;
}
/* END STAGE 2A.9 */

/* STAGE 3A - imported species content */
.species-description,
.species-traits {
  overflow-wrap: anywhere;
}

.species-description > :first-child,
.species-traits > :first-child {
  margin-top: 0;
}

.species-description > :last-child,
.species-traits > :last-child {
  margin-bottom: 0;
}

.species-traits-panel {
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.species-traits-panel > h2 {
  margin: 0 0 24px;
  font-size: clamp(1.45rem, 2vw, 1.85rem);
}

.species-traits {
  max-width: var(--reading);
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.76;
}

.species-traits h3,
.species-traits h4 {
  color: var(--text);
}

.species-traits h3 {
  margin: 0 0 14px;
  font-size: 1.24rem;
}

.species-traits h4 {
  margin: 28px 0 8px;
  font-size: 1rem;
}

.species-traits p,
.species-traits ul,
.species-traits ol,
.species-traits blockquote {
  margin: 0 0 18px;
}

.species-traits ul,
.species-traits ol {
  padding-left: 24px;
}

.species-traits li + li {
  margin-top: 7px;
}

.species-traits a,
.species-description a {
  color: var(--accent-light);
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
}

.prose .inline-spell-link,
.class-rules-prose .inline-spell-link {
  color: var(--accent-light);
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose .inline-spell-link:hover,
.class-rules-prose .inline-spell-link:hover {
  color: var(--text);
  text-decoration-color: currentColor;
}

.species-size-details,
.species-darkvision,
.species-innate-spells {
  margin: 0 0 18px;
  padding: 15px 18px;
  border-left: 3px solid var(--accent-line);
  border-radius: 0 10px 10px 0;
  background: rgba(186,162,125,.055);
}

.species-size-details h4,
.species-darkvision h4,
.species-innate-spells h4 {
  margin-top: 0;
}

.species-size-details > :last-child,
.species-darkvision > :last-child,
.species-innate-spells > :last-child {
  margin-bottom: 0;
}

.species-lineages {
  margin-top: 42px;
  padding-top: 30px;
  border-top: 1px solid var(--accent-line);
}

.species-lineages > h2 {
  margin: 0 0 18px;
  font-size: 1.5rem;
}

.species-lineage {
  margin-top: 14px;
  padding: clamp(18px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.025), transparent 55%),
    rgba(8,11,14,.34);
}

.species-lineage > h3 {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.species-traits .table-wrapper,
.species-description .table-wrapper {
  max-width: 100%;
  margin: 22px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.species-traits table,
.species-description table {
  width: 100%;
  min-width: 520px;
}

.species-traits th,
.species-traits td,
.species-description th,
.species-description td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.species-traits th,
.species-description th {
  background: rgba(255,255,255,.035);
  color: var(--text);
  font-size: .78rem;
}

.species-traits blockquote,
.species-description blockquote {
  padding: 14px 18px;
  border-left: 3px solid var(--accent-line);
  color: var(--muted);
}

.dice-roll {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255,255,255,.035);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .detail-layout .material-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .detail-layout .material-hero > div:first-child {
    width: 100%;
    height: clamp(190px, 52vw, 270px);
    box-sizing: border-box;
    border-radius: 16px;
  }

  .detail-layout .detail-aside {
    position: static;
    display: block;
  }
}

@media (max-width: 640px) {
  .detail-layout .material-hero {
    padding: 18px;
    gap: 18px;
  }

  .species-traits-panel {
    margin-top: 26px;
    padding-top: 24px;
  }

  .species-size-details,
  .species-darkvision,
  .species-innate-spells,
  .species-lineage {
    padding: 15px;
  }

  .species-lineages {
    margin-top: 32px;
    padding-top: 24px;
  }
}
/* END STAGE 3A */

/* STAGE 3B - catalog navigation and infinite species scroll */
.nav-menu-wide {
  width: min(542px, calc(100vw - 32px));
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 20px;
  padding: 16px;
}

.nav-menu-wide .nav-menu-group {
  padding: 6px;
}

.nav-menu-wide .nav-menu-group small,
.mobile-menu-primary .nav-menu-group small {
  padding-bottom: 12px;
  color: #8f9ba4;
  font-size: .69rem;
  letter-spacing: .11em;
}

.nav-menu-wide .nav-menu-group a,
.mobile-menu-primary .nav-menu-group a {
  padding-block: 9px;
  font-size: .9rem;
}

.nav-more {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.nav-more > summary {
  min-height: 38px;
  padding: 8px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.025);
  color: var(--text-soft);
  font-size: .82rem;
  font-weight: 620;
  list-style: none;
  cursor: pointer;
}

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

.nav-more > summary::after {
  content: "+";
  color: var(--accent-light);
  font-size: 1rem;
  line-height: 1;
}

.nav-more[open] > summary::after {
  content: "−";
}

.nav-more > summary:hover {
  border-color: var(--line-strong);
  background: rgba(255,255,255,.05);
  color: var(--text);
}

.nav-more-grid {
  margin-top: 8px;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 12px;
}

.nav-more-grid a {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--text-soft);
  font-size: .84rem;
  text-decoration: none;
}

.nav-more-grid a:hover {
  background: rgba(255,255,255,.055);
  color: var(--text);
}

.infinite-scroll-status {
  min-height: 64px;
  margin: -12px 0 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: .78rem;
  text-align: center;
}

.infinite-scroll-spinner {
  width: 16px;
  height: 16px;
  display: none;
  flex: 0 0 auto;
  border: 2px solid rgba(186,162,125,.22);
  border-top-color: var(--accent-light);
  border-radius: 50%;
  animation: infinite-scroll-spin .75s linear infinite;
}

.infinite-scroll-status.is-loading .infinite-scroll-spinner {
  display: block;
}

.infinite-scroll-status.is-complete {
  color: #77838c;
}

.infinite-scroll-status.has-error {
  color: #d5b88b;
}

.infinite-scroll-status button {
  padding: 7px 11px;
  border: 1px solid var(--accent-line);
  border-radius: 7px;
  background: rgba(186,162,125,.08);
  color: var(--accent-light);
  cursor: pointer;
}

@keyframes infinite-scroll-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .mobile-menu-panel {
    width: min(360px, calc(100vw - 28px));
    padding: 14px;
  }

  .mobile-menu-primary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
  }

  .mobile-menu-primary .nav-menu-group {
    min-width: 0;
    padding: 4px;
  }

  .mobile-menu-panel .nav-more-grid a {
    padding: 9px;
  }
}

@media (max-width: 430px) {
  .mobile-menu-panel {
    position: fixed;
    top: 70px;
    right: 14px;
    left: 14px;
    width: auto;
    max-height: calc(100vh - 84px);
    overflow-y: auto;
  }

  .mobile-menu-primary .nav-menu-group a {
    padding-inline: 6px;
    font-size: .83rem;
  }

  .nav-more-grid {
    grid-template-columns: 1fr;
  }

  .infinite-scroll-status {
    margin-bottom: 38px;
    padding-inline: 14px;
  }
}
/* END STAGE 3B */

/* STAGE 3C - direct section navigation and complete system marks */
.header-inner {
  gap: 14px;
}

.main-nav-sections {
  min-width: 0;
  flex: 1 1 auto;
  gap: 3px;
}

html body .main-nav-sections > a,
html body .main-nav-sections > .nav-dropdown > summary {
  min-height: 34px;
  padding: 7px 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: rgba(255,255,255,.018);
  color: #c3ccd2;
  font-size: .72rem;
  font-weight: 620;
  line-height: 1;
  white-space: nowrap;
}

html body .main-nav-sections > a:hover,
html body .main-nav-sections > .nav-dropdown > summary:hover,
html body .main-nav-sections > .nav-dropdown[open] > summary {
  border-color: var(--line);
  background: rgba(255,255,255,.055);
  color: var(--text);
}

.nav-more-dropdown {
  flex: 0 0 auto;
}

.nav-more-dropdown > summary::after {
  margin-left: 5px;
}

.nav-menu-compact {
  right: 0;
  left: auto;
  width: 250px;
}

.nav-menu-compact a {
  padding: 10px;
}

.header-search {
  flex-basis: 170px;
  max-width: 220px;
}

html body .system-monogram,
html body .entity-symbol {
  white-space: nowrap;
}

@media (max-width: 1240px) and (min-width: 1101px) {
  .brand-copy small {
    display: none;
  }

  .main-nav-sections {
    gap: 1px;
  }

  html body .main-nav-sections > a,
  html body .main-nav-sections > .nav-dropdown > summary {
    padding-inline: 5px;
    font-size: .67rem;
  }

  .header-search {
    max-width: 155px;
  }
}

@media (max-width: 1100px) {
  .main-nav {
    display: none;
  }

  .mobile-menu {
    position: relative;
    display: block;
  }
}
/* END STAGE 3C */

/* STAGE 4A - complete spell catalog */
.spell-list {
  margin-bottom: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(20, 26, 31, .58);
}

.spell-list .compact-row {
  min-height: 76px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 42px minmax(190px, 1fr) minmax(120px, .55fr) minmax(140px, .65fr) auto;
  gap: 16px;
}

.spell-list .compact-row:hover {
  padding-inline: 19px 13px;
  background: rgba(255,255,255,.035);
}

.spell-level {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-light);
  font-size: .78rem;
  font-weight: 760;
}

.spell-list .row-meta {
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.35;
}

.spell-list + .infinite-scroll-status {
  margin-top: 4px;
}

.spell-hero .hero-glyph {
  font-size: 2.15rem;
  text-shadow: 0 0 30px rgba(211, 181, 128, .28);
}

.spell-content-section .spell-description {
  max-width: 780px;
}

.spell-imported-content h3,
.spell-imported-content h4,
.spell-imported-content h5 {
  margin: 1.8em 0 .65em;
  color: var(--text);
  line-height: 1.25;
}

.spell-imported-content ul,
.spell-imported-content ol {
  margin: 0 0 1.25em;
  padding-left: 1.35em;
}

.spell-imported-content li + li {
  margin-top: .45em;
}

.spell-imported-content a {
  color: var(--accent-light);
  text-decoration-color: rgba(211, 181, 128, .38);
  text-underline-offset: 3px;
}

.spell-imported-content blockquote {
  margin: 1.4em 0;
  padding: 14px 18px;
  border-left: 3px solid var(--accent-line);
  background: rgba(255,255,255,.025);
  color: var(--muted);
}

.spell-imported-content .table-wrapper {
  max-width: 100%;
  margin: 1.4em 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.spell-imported-content table {
  width: 100%;
  min-width: 520px;
}

.spell-imported-content th,
.spell-imported-content td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.spell-imported-content th {
  background: rgba(255,255,255,.035);
  color: var(--text);
  font-size: .78rem;
}

.spell-imported-affiliations {
  max-width: 780px;
  margin-top: 30px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.022);
}

.spell-imported-affiliations h3 {
  margin: 0 0 13px;
  color: var(--text);
  font-size: .9rem;
}

.spell-imported-affiliations dl {
  margin: 0;
}

.spell-imported-affiliations dl > div {
  padding: 10px 0;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  border-top: 1px solid var(--line);
}

.spell-imported-affiliations dt {
  color: var(--muted);
  font-size: .72rem;
}

.spell-imported-affiliations dd {
  margin: 0;
  color: var(--text-soft);
  font-size: .82rem;
  line-height: 1.55;
}

.spell-higher-levels .spell-imported-content p:last-child {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .spell-list .compact-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .spell-list .row-meta {
    display: none;
  }
}

@media (max-width: 560px) {
  .spell-list .compact-row {
    min-height: 70px;
    padding: 10px 12px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .spell-list .compact-row:hover {
    padding-inline: 12px;
  }

  .spell-level {
    width: 34px;
    height: 34px;
  }

  .spell-list .source-chip {
    max-width: 54px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .spell-imported-affiliations dl > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}
/* END STAGE 4A */


/* =========================================================
   STAGE 7A - Larchiya campaign-first experience
   ========================================================= */

:root {
  --club-green: #6f8a66;
  --club-green-soft: rgba(111, 138, 102, .14);
  --club-gold: #d3b77e;
  --club-ink: #0b1011;
  --club-paper: #ece3ce;
  --club-serif: "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

html body .main-nav-sections > a,
html body .main-nav-sections > .nav-dropdown > summary {
  padding-inline: 9px;
  background: transparent;
  font-size: .76rem;
}

html body .main-nav-sections > a.nav-player-start {
  border-color: rgba(211, 183, 126, .28);
  background: rgba(211, 183, 126, .09);
  color: #ead7ad;
}

html body .main-nav-sections > a.nav-player-start:hover {
  border-color: rgba(211, 183, 126, .48);
  background: rgba(211, 183, 126, .15);
}

.club-nav-menu {
  right: 0;
  left: auto;
  width: min(660px, 86vw);
  background:
    linear-gradient(145deg, rgba(111, 138, 102, .08), transparent 40%),
    #151b1d;
}

.club-home {
  padding-top: 22px;
}

.larchiya-hero {
  --world-cover: none;
  position: relative;
  min-height: 650px;
  padding: clamp(38px, 6vw, 78px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(285px, 360px);
  align-items: end;
  gap: clamp(36px, 7vw, 96px);
  border: 1px solid rgba(236, 227, 206, .14);
  border-radius: 30px;
  background: #11191a;
  box-shadow: 0 32px 90px rgba(0, 0, 0, .33);
  isolation: isolate;
  overflow: hidden;
}

.larchiya-hero::before {
  content: "";
  position: absolute;
  z-index: -3;
  inset: 0;
  background-image: var(--world-cover);
  background-position: center;
  background-size: cover;
  transform: scale(1.015);
  animation: larchiya-reveal 1.1s ease-out both;
}

.larchiya-hero::after {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 9, 9, .94) 0%, rgba(7, 11, 11, .74) 43%, rgba(7, 11, 11, .23) 77%),
    linear-gradient(0deg, rgba(5, 9, 9, .88) 0%, transparent 58%),
    radial-gradient(circle at 78% 22%, transparent 0%, rgba(5, 9, 9, .18) 58%);
}

.larchiya-hero-shade {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 16, 17, .08), rgba(11, 16, 17, .22));
}

@keyframes larchiya-reveal {
  from { opacity: .4; transform: scale(1.06); }
  to { opacity: 1; transform: scale(1.015); }
}

.larchiya-hero-copy {
  max-width: 740px;
  animation: campaign-copy-in .72s .08s ease-out both;
}

@keyframes campaign-copy-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.campaign-kicker {
  margin: 0 0 18px;
  color: #e1ca99;
  font-size: .72rem;
  font-weight: 760;
  letter-spacing: .16em;
  text-transform: uppercase;
}

html body .larchiya-hero h1,
html body .world-hub-hero h1,
html body .campaign-hero h1,
html body .player-start-hero h1 {
  margin: 0;
  font-family: var(--club-serif) !important;
  font-weight: 700;
  letter-spacing: -.055em;
}

html body .larchiya-hero h1 {
  max-width: 760px;
  color: #f3ecdd;
  font-size: clamp(3.4rem, 6.4vw, 6.8rem);
  line-height: .9;
}

.larchiya-hero h1 span {
  display: block;
  color: #dbc38f;
}

.larchiya-lead {
  max-width: 680px;
  margin: 28px 0 0;
  color: rgba(244, 239, 226, .86);
  font-size: clamp(1.04rem, 1.4vw, 1.22rem);
  line-height: 1.72;
}

.campaign-facts {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.campaign-facts > span {
  min-height: 30px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(236, 227, 206, .14);
  border-radius: 999px;
  background: rgba(8, 13, 13, .44);
  color: rgba(244, 239, 226, .78);
  font-size: .73rem;
  backdrop-filter: blur(9px);
}

.campaign-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #91b57f;
  box-shadow: 0 0 0 4px rgba(145, 181, 127, .12);
}

.player-entry-card {
  position: relative;
  padding: 28px;
  border: 1px solid rgba(236, 227, 206, .18);
  border-radius: 20px;
  background:
    linear-gradient(150deg, rgba(236, 227, 206, .11), rgba(236, 227, 206, .035)),
    rgba(8, 13, 13, .68);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .26);
  backdrop-filter: blur(18px);
  animation: campaign-copy-in .72s .22s ease-out both;
}

.player-entry-card .entry-number {
  position: absolute;
  top: 20px;
  right: 22px;
  color: rgba(236, 227, 206, .22);
  font-family: var(--club-serif);
  font-size: 2.3rem;
}

.player-entry-card h2 {
  max-width: 270px;
  margin: 12px 0 14px;
  color: #f1eadc;
  font-family: var(--club-serif) !important;
  font-size: 1.65rem;
  line-height: 1.16;
}

.player-entry-card > p:not(.eyebrow) {
  color: rgba(244, 239, 226, .68);
  font-size: .88rem;
  line-height: 1.65;
}

.player-entry-card > a {
  margin-top: 22px;
  padding-top: 15px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(236, 227, 206, .13);
  color: #e3cc9c;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
}

.world-ribbon {
  position: relative;
  z-index: 4;
  width: calc(100% - 70px);
  margin: -28px auto 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid rgba(236, 227, 206, .11);
  border-radius: 16px;
  background: rgba(18, 24, 24, .96);
  box-shadow: 0 22px 55px rgba(0, 0, 0, .26);
  overflow: hidden;
}

.world-ribbon a {
  min-height: 86px;
  padding: 17px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid rgba(236, 227, 206, .09);
  text-decoration: none;
  transition: background .18s ease, color .18s ease;
}

.world-ribbon a:last-child {
  border-right: 0;
}

.world-ribbon a:hover {
  background: rgba(111, 138, 102, .12);
}

.world-ribbon small {
  color: #7f8e88;
  font-size: .64rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.world-ribbon strong {
  margin-top: 4px;
  color: #e5dfd2;
  font-family: var(--club-serif);
  font-size: 1.02rem;
}

.club-section {
  margin-top: clamp(76px, 9vw, 120px);
}

.section-intro {
  max-width: 690px;
}

.section-intro h2,
.club-section-head h2,
.toolkit-copy h2,
.creation-route .section-intro h2,
.after-character h2 {
  font-family: var(--club-serif) !important;
  font-size: clamp(2rem, 3.2vw, 3.25rem);
  line-height: 1.04;
}

.section-intro > p:last-child,
.toolkit-copy > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.75;
}

.campaign-orientation {
  display: grid;
  grid-template-columns: minmax(260px, .65fr) minmax(0, 1.35fr);
  gap: clamp(42px, 7vw, 96px);
  align-items: start;
}

.orientation-track {
  border-top: 1px solid var(--line-strong);
}

.orientation-track a {
  padding: 25px 4px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: padding .18s ease, background .18s ease;
}

.orientation-track a:hover {
  padding-inline: 14px;
  background: linear-gradient(90deg, var(--club-green-soft), transparent);
}

.orientation-track > a > span {
  color: #8ea184;
  font-family: var(--club-serif);
  font-size: 1.35rem;
}

.orientation-track small {
  color: var(--club-gold);
  font-size: .66rem;
  font-weight: 730;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.orientation-track h3 {
  margin: 5px 0 7px;
  font-family: var(--club-serif) !important;
  font-size: 1.3rem;
}

.orientation-track p {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
}

.club-section-head {
  align-items: end;
  margin-bottom: 28px;
}

.world-index-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.world-index-grid > a {
  min-height: 265px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .018), transparent);
  text-decoration: none;
  transition: background .2s ease;
}

.world-index-grid > a:last-child {
  border-right: 0;
}

.world-index-grid > a:hover {
  background: linear-gradient(180deg, rgba(111, 138, 102, .13), rgba(111, 138, 102, .025));
}

.world-index-number {
  color: rgba(211, 183, 126, .46);
  font-family: var(--club-serif);
  font-size: 1.1rem;
}

.world-index-grid h3 {
  margin: 32px 0 10px;
  font-family: var(--club-serif) !important;
  font-size: 1.55rem;
}

.world-index-grid p {
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.62;
}

.world-index-grid footer {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #83918b;
  font-size: .72rem;
}

.world-index-grid footer b {
  color: var(--club-gold);
}

.lore-latest {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.lore-latest > p {
  grid-column: 1 / -1;
}

.lore-latest a,
.lore-card-grid a {
  padding: 20px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .018);
  text-decoration: none;
}

.lore-latest small,
.lore-card-grid small {
  color: var(--club-gold);
  font-size: .65rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.lore-latest strong,
.lore-card-grid strong {
  margin: 7px 0;
  font-family: var(--club-serif);
  font-size: 1.1rem;
}

.lore-latest span,
.lore-card-grid span {
  color: var(--muted);
  font-size: .79rem;
}

.player-toolkit-section {
  padding: clamp(32px, 5vw, 64px);
  display: grid;
  grid-template-columns: minmax(250px, .72fr) minmax(0, 1.28fr);
  gap: clamp(40px, 8vw, 110px);
  border: 1px solid rgba(211, 183, 126, .16);
  border-radius: 24px;
  background:
    radial-gradient(circle at 8% 10%, rgba(211, 183, 126, .08), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, .025), transparent),
    #141a1d;
}

.toolkit-copy {
  align-self: center;
}

.toolkit-copy .primary-button {
  margin-top: 18px;
}

.text-link {
  margin-left: 16px;
  color: var(--club-gold);
  font-size: .82rem;
  text-decoration: none;
}

.toolkit-directory {
  border-top: 1px solid var(--line-strong);
}

.toolkit-directory a {
  min-height: 72px;
  padding: 13px 4px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.toolkit-directory a > span {
  color: #728078;
  font-family: var(--club-serif);
}

.toolkit-directory strong,
.toolkit-directory small {
  display: block;
}

.toolkit-directory strong {
  font-family: var(--club-serif);
  font-size: 1rem;
}

.toolkit-directory small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .72rem;
}

.toolkit-directory b {
  color: var(--club-gold);
  font-size: .74rem;
  font-weight: 650;
}


/* Player start */

.player-start-page {
  max-width: 1180px;
}

.player-start-hero {
  padding: clamp(34px, 6vw, 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: clamp(36px, 7vw, 88px);
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(120deg, rgba(111, 138, 102, .16), transparent 48%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .012) 0 1px, transparent 1px 16px),
    #151c1e;
}

html body .player-start-hero h1 {
  max-width: 760px;
  font-size: clamp(2.7rem, 5.5vw, 5.5rem);
  line-height: .98;
}

.player-start-hero .lead {
  max-width: 720px;
  margin: 24px 0 0;
}

.player-start-hero aside {
  padding: 22px;
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--club-green);
  background: rgba(8, 12, 13, .3);
}

.player-start-hero aside small {
  color: var(--muted);
  font-size: .68rem;
  text-transform: uppercase;
}

.player-start-hero aside strong {
  margin-top: 8px;
  font-family: var(--club-serif);
  font-size: 1.35rem;
}

.player-start-hero aside span {
  margin-top: 5px;
  color: var(--text-soft);
  font-size: .76rem;
}

.player-start-hero aside a {
  margin-top: 22px;
  color: var(--club-gold);
  font-size: .78rem;
  text-decoration: none;
}

.creation-principle {
  margin-top: 24px;
  padding: 28px;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 22px;
  align-items: center;
  border: 1px solid rgba(211, 183, 126, .19);
  border-radius: 16px;
  background: rgba(211, 183, 126, .055);
}

.principle-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(211, 183, 126, .3);
  border-radius: 50%;
  color: var(--club-gold);
  font-family: var(--club-serif);
  font-size: 1.3rem;
}

.creation-principle h2 {
  margin: 0 0 6px;
  font-family: var(--club-serif) !important;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.creation-principle p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: .86rem;
}

.creation-principle > span {
  max-width: 210px;
  color: #d9c89f;
  font-size: .72rem;
  text-align: right;
}

.creation-route {
  margin-top: 86px;
}

.creation-source {
  margin-top: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: #151b1e;
  overflow: hidden;
}

.creation-source-campaign {
  border-color: rgba(111, 138, 102, .34);
}

.creation-source > header {
  padding: 28px 30px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(111, 138, 102, .09), transparent 45%);
}

.creation-source > header h2 {
  margin: 9px 0 4px;
  font-family: var(--club-serif) !important;
  font-size: 1.7rem;
}

.creation-source > header p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
}

.creation-source > header > a {
  color: var(--club-gold);
  font-size: .78rem;
  text-decoration: none;
  white-space: nowrap;
}

.availability-badge {
  padding: 5px 8px;
  border: 1px solid rgba(126, 165, 109, .28);
  border-radius: 999px;
  background: rgba(126, 165, 109, .09);
  color: #aaca9a;
  font-size: .64rem;
  font-weight: 730;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.creation-step-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.creation-step-grid a {
  min-height: 112px;
  padding: 22px 26px;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background .18s ease;
}

.creation-step-grid a:nth-child(even) {
  border-right: 0;
}

.creation-step-grid a:hover {
  background: var(--club-green-soft);
}

.creation-step-grid a > span {
  color: #718078;
  font-family: var(--club-serif);
}

.creation-step-grid strong,
.creation-step-grid small {
  display: block;
}

.creation-step-grid strong {
  font-family: var(--club-serif);
  font-size: 1.08rem;
}

.creation-step-grid small {
  margin-top: 4px;
  color: var(--muted);
  font-size: .74rem;
}

.creation-step-grid b {
  color: var(--club-gold);
  font-size: .75rem;
}

.after-character {
  margin-top: 86px;
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .025), transparent), #141a1d;
}

.after-character ol {
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  list-style: none;
  border-top: 1px solid var(--line-strong);
}

.after-character li {
  min-height: 90px;
  padding: 20px 20px 20px 0;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: start;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  font-size: .86rem;
}

.after-character li:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.after-character li:nth-child(even) {
  padding-left: 20px;
}

.after-character li span {
  color: var(--club-gold);
  font-family: var(--club-serif);
}

.after-character-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}


/* World and campaign hubs */

.world-hub-hero,
.campaign-hero {
  --world-cover: none;
  position: relative;
  min-height: 520px;
  padding: clamp(38px, 6vw, 72px);
  display: flex;
  align-items: end;
  border: 1px solid rgba(236, 227, 206, .13);
  border-radius: 26px;
  background-image: var(--world-cover);
  background-position: center;
  background-size: cover;
  isolation: isolate;
  overflow: hidden;
}

.world-hub-hero::after,
.campaign-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 9, 9, .94), rgba(5, 9, 9, .64) 54%, rgba(5, 9, 9, .16)),
    linear-gradient(0deg, rgba(5, 9, 9, .86), transparent 62%);
}

.world-hub-copy,
.campaign-hero-copy {
  max-width: 760px;
}

html body .world-hub-hero h1,
html body .campaign-hero h1 {
  color: #f2ebdd;
  font-size: clamp(3.4rem, 6vw, 6.2rem);
  line-height: .92;
}

.world-hub-copy > p:not(.campaign-kicker),
.campaign-hero-copy > p:not(.campaign-kicker) {
  max-width: 680px;
  margin-top: 24px;
  color: rgba(244, 239, 226, .8);
  font-size: 1.04rem;
  line-height: 1.7;
}

.world-detail-ribbon {
  width: calc(100% - 100px);
  grid-template-columns: repeat(4, 1fr);
}

.world-hub-layout,
.campaign-briefing {
  margin-top: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr);
  gap: clamp(36px, 7vw, 84px);
}

.world-story-panel h2,
.campaign-briefing h2,
.world-empty-lore h2 {
  font-family: var(--club-serif) !important;
  font-size: clamp(2rem, 3vw, 3rem);
}

.world-story-panel > p:not(.eyebrow),
.campaign-briefing-main > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.8;
}

.world-campaign-panel,
.campaign-checklist {
  padding-left: 28px;
  border-left: 1px solid var(--line-strong);
}

.world-campaign-panel > a {
  padding: 24px 0;
  display: block;
  border-top: 1px solid var(--line);
  text-decoration: none;
}

.world-campaign-panel h3 {
  margin: 16px 0 8px;
  font-family: var(--club-serif) !important;
  font-size: 1.45rem;
}

.world-campaign-panel p {
  color: var(--muted);
  font-size: .82rem;
}

.world-campaign-panel small {
  color: var(--club-gold);
}

.world-archive-group + .world-archive-group {
  margin-top: 38px;
}

.world-archive-group > h3 {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.lore-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.world-empty-lore,
.campaign-empty-state {
  margin-top: 74px;
  padding: clamp(30px, 5vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: linear-gradient(90deg, rgba(111, 138, 102, .08), transparent 62%);
}

.world-empty-lore > div {
  max-width: 720px;
}

.world-empty-lore p:last-child,
.campaign-empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

.campaign-briefing {
  margin-top: 64px;
}

.campaign-checklist ol {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.campaign-checklist li {
  padding: 13px 0;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  font-size: .82rem;
}

.campaign-checklist li span {
  color: var(--club-gold);
  font-family: var(--club-serif);
}

.campaign-checklist > a {
  margin-top: 22px;
  display: inline-block;
  color: var(--club-gold);
  font-size: .8rem;
  text-decoration: none;
}

.campaign-empty-state {
  margin-top: 0;
  display: block;
}


@media (max-width: 1100px) {
  .larchiya-hero {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .world-index-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .world-index-grid > a:nth-child(2) {
    border-right: 0;
  }

  .world-index-grid > a:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 900px) {
  .larchiya-hero {
    min-height: 720px;
    grid-template-columns: 1fr;
    align-content: end;
  }

  .player-entry-card {
    max-width: 520px;
  }

  .campaign-orientation,
  .player-toolkit-section,
  .player-start-hero,
  .world-hub-layout,
  .campaign-briefing {
    grid-template-columns: 1fr;
  }

  .world-ribbon {
    width: calc(100% - 36px);
  }

  .world-ribbon a {
    padding-inline: 14px;
  }

  .player-start-hero aside,
  .world-campaign-panel,
  .campaign-checklist {
    padding-top: 22px;
    padding-left: 0;
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }

  .creation-principle {
    grid-template-columns: 46px 1fr;
  }

  .creation-principle > span {
    grid-column: 2;
    max-width: none;
    text-align: left;
  }

  .lore-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .club-home {
    width: min(calc(100% - 24px), var(--content));
    padding-top: 12px;
  }

  .larchiya-hero {
    min-height: 690px;
    padding: 28px 22px 42px;
    border-radius: 20px;
    background-position: 63% center;
  }

  .larchiya-hero::after {
    background:
      linear-gradient(0deg, rgba(5, 9, 9, .96) 0%, rgba(5, 9, 9, .73) 58%, rgba(5, 9, 9, .22)),
      linear-gradient(90deg, rgba(5, 9, 9, .72), transparent);
  }

  html body .larchiya-hero h1 {
    font-size: clamp(3rem, 15vw, 4.6rem);
  }

  .larchiya-lead {
    margin-top: 20px;
    font-size: .93rem;
  }

  .player-entry-card {
    padding: 22px;
  }

  .world-ribbon,
  .world-detail-ribbon {
    width: calc(100% - 24px);
    grid-template-columns: repeat(2, 1fr);
  }

  .world-ribbon a {
    min-height: 70px;
    border-bottom: 1px solid rgba(236, 227, 206, .09);
  }

  .world-ribbon a:nth-child(even) {
    border-right: 0;
  }

  .world-ribbon a:last-child {
    grid-column: 1 / -1;
  }

  .campaign-orientation,
  .club-section {
    margin-top: 64px;
  }

  .world-index-grid,
  .creation-step-grid,
  .after-character ol,
  .lore-card-grid,
  .lore-latest {
    grid-template-columns: 1fr;
  }

  .world-index-grid > a {
    min-height: 205px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .player-toolkit-section {
    padding: 28px 20px;
  }

  .text-link {
    margin: 14px 0 0;
    display: block;
  }

  .player-start-page,
  .world-hub-page,
  .campaign-page {
    width: min(calc(100% - 24px), var(--content));
  }

  .player-start-hero,
  .world-hub-hero,
  .campaign-hero {
    padding: 32px 22px;
    border-radius: 18px;
  }

  html body .player-start-hero h1,
  html body .world-hub-hero h1,
  html body .campaign-hero h1 {
    font-size: 3rem;
  }

  .creation-principle {
    padding: 22px;
    grid-template-columns: 1fr;
  }

  .creation-principle > span {
    grid-column: 1;
  }

  .creation-source > header {
    padding: 24px 20px;
    align-items: start;
    flex-direction: column;
  }

  .creation-step-grid a {
    border-right: 0;
  }

  .after-character li,
  .after-character li:nth-child(even) {
    padding-inline: 0;
    border-right: 0;
  }

  .world-empty-lore {
    align-items: start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .larchiya-hero::before,
  .larchiya-hero-copy,
  .player-entry-card {
    animation: none;
  }
}

/* END STAGE 7A */

/* STAGE 7B priority overrides */
.manage-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid.editor-section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.creation-step-grid.creation-step-grid-global {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1120px) {
  .manage-card-grid,
  .creation-step-grid.creation-step-grid-global {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .form-grid.editor-section-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .manage-card-grid,
  .creation-step-grid.creation-step-grid-global {
    grid-template-columns: 1fr;
  }
}

/* END STAGE 7B */

/* STAGE 4B - spell catalog search */
.spell-catalog-toolbar {
  padding: 14px;
  display: grid;
  align-items: stretch;
  gap: 12px;
}

.spell-search-control {
  position: relative;
  min-width: 0;
}

.spell-search-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  z-index: 1;
  width: 19px;
  height: 19px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}

.catalog-toolbar .spell-search-input {
  width: 100%;
  min-height: 50px;
  padding: 11px 48px 11px 45px;
  border-color: var(--line-strong);
  border-radius: 11px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent),
    #11171c;
  color: var(--text);
  font-size: .96rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
  outline: none;
}

.catalog-toolbar .spell-search-input::placeholder {
  color: var(--muted);
}

.catalog-toolbar .spell-search-input::-webkit-search-cancel-button {
  appearance: none;
}

.spell-search-control:focus-within .spell-search-input {
  border-color: var(--accent-line);
  box-shadow:
    0 0 0 3px rgba(186, 162, 125, .08),
    inset 0 1px 0 rgba(255,255,255,.035);
}

.spell-search-control:focus-within .spell-search-icon {
  stroke: var(--accent-light);
}

.spell-search-clear {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.spell-search-clear:hover,
.spell-search-clear:focus-visible {
  background: rgba(255,255,255,.055);
  color: var(--text);
  outline: none;
}

.spell-search-clear[hidden] {
  display: none;
}

.spell-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.spell-filter-grid label {
  min-width: 0;
}

.spell-filter-grid select {
  width: 100%;
}

@media (max-width: 820px) {
  .spell-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .spell-catalog-toolbar {
    padding: 11px;
    gap: 10px;
  }

  .catalog-toolbar .spell-search-input {
    min-height: 48px;
    font-size: .92rem;
  }

  .spell-filter-grid {
    grid-template-columns: 1fr;
  }
}
/* END STAGE 4B */

/* STAGE 5C - readable class rules and level timeline */
.class-detail-page {
  --class-reading: 72ch;
}

.class-detail-page #overview,
.class-detail-page #progression,
.class-detail-page #features,
.class-detail-page #subclasses {
  scroll-margin-top: 132px;
}

.class-detail-page .content-section {
  padding: clamp(24px, 3vw, 38px);
  border-color: rgba(255, 255, 255, .09);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .018), transparent 42%),
    #151c22;
}

.class-detail-page .class-content {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.class-detail-page .content-section {
  min-width: 0;
  max-width: 100%;
  margin-bottom: 0;
}

.class-detail-page .table-wrap,
.class-detail-page .features-section,
.class-detail-page .feature-timeline,
.class-detail-page .feature-level-group,
.class-detail-page .feature-level-content,
.class-detail-page .feature {
  min-width: 0;
  max-width: 100%;
}

.class-detail-page .class-tabs {
  scrollbar-width: none;
}

.class-detail-page .class-tabs::-webkit-scrollbar {
  display: none;
}

.class-introduction {
  max-width: var(--class-reading);
  margin: 6px 0 30px;
  padding: 0 0 26px;
  border-bottom: 1px solid var(--line);
}

.overview-panels {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(360px, 1.2fr);
  gap: 14px;
}

.overview-panels.single-panel {
  grid-template-columns: minmax(0, 720px);
}

.class-detail-page .rule-panel {
  margin: 0;
  padding: 22px;
  border-color: rgba(255, 255, 255, .095);
  background: rgba(8, 12, 15, .24);
}

.class-detail-page .rule-panel > h3 {
  margin: 0 0 17px;
  font-size: 1.24rem;
}

.class-detail-page .rule-list > div {
  padding: 13px 0;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
}

.class-detail-page .rule-list dt {
  font-size: .76rem;
}

.class-detail-page .rule-list dd {
  margin: 0;
  color: var(--text);
  font-size: .9rem;
  line-height: 1.5;
}

.quick-start-panel {
  display: grid;
  align-content: start;
  gap: 0;
}

.quick-start-block {
  padding: 17px 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 13px;
  border-top: 1px solid var(--line);
}

.quick-start-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-light);
  font-size: .78rem;
  font-weight: 750;
}

.quick-start-block h4 {
  margin: 3px 0 9px;
  color: var(--text);
  font-family: var(--font);
  font-size: .88rem;
}

.quick-start-block .class-rules-prose {
  font-size: .86rem;
}

.equipment-callout {
  margin: 14px 0 0;
  padding: 22px;
}

.callout-heading {
  margin-bottom: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.callout-heading > span {
  color: var(--accent-light);
}

.callout-heading h3 {
  margin: 0;
  font-size: 1.18rem;
}

.class-rules-prose,
.class-rules-prose .ttg-class-content {
  max-width: var(--class-reading);
  color: #c8d0d5;
  font-family: var(--font) !important;
  font-size: 1rem;
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.class-rules-prose p,
.class-rules-prose ul,
.class-rules-prose ol,
.class-rules-prose blockquote,
.class-rules-prose .table-wrapper {
  margin: 0 0 1.05em;
}

.class-rules-prose .table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 11px;
  background: rgba(9, 13, 16, .28);
  scrollbar-color: var(--line-strong) transparent;
}

.class-rules-prose .table-wrapper > table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  color: #c8d0d5;
  font-family: var(--font);
  font-size: .82rem;
  line-height: 1.45;
  overflow-wrap: normal;
}

.class-rules-prose .table-wrapper th,
.class-rules-prose .table-wrapper td {
  padding: 11px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .075);
  vertical-align: top;
  text-align: left;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.class-rules-prose .table-wrapper th {
  background: rgba(255, 255, 255, .045);
  color: #aeb9c0;
  font-size: .7rem;
  font-weight: 720;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.class-rules-prose .table-wrapper tr:last-child td {
  border-bottom: 0;
}

.class-rules-prose .table-wrapper th:last-child:not(:first-child),
.class-rules-prose .table-wrapper td:last-child:not(:first-child) {
  width: 112px;
  min-width: 112px;
}

.class-rules-prose .table-wrapper td a {
  overflow-wrap: break-word;
}

.class-rules-prose ul,
.class-rules-prose ol {
  padding-left: 1.35rem;
}

.class-rules-prose li {
  padding-left: .2rem;
}

.class-rules-prose li + li {
  margin-top: .48rem;
}

.class-rules-prose strong {
  color: #f0d09c;
  font-weight: 720;
}

.class-rules-prose em {
  color: #aebbc4;
}

.class-rules-prose a {
  color: #d9bc8c;
  text-decoration-color: rgba(217, 188, 140, .48);
  text-underline-offset: 3px;
}

.class-rules-prose a:hover {
  color: #f0d09c;
  text-decoration-color: currentColor;
}

.class-rules-prose h3,
.class-rules-prose h4 {
  color: var(--text);
  font-family: var(--font);
  line-height: 1.3;
}

.class-rules-prose h3 {
  margin: 1.8em 0 .75em;
  font-size: 1.15rem;
}

.class-rules-prose h4 {
  margin: 1.5em 0 .65em;
  font-size: 1rem;
}

.class-rules-prose .ttg-class-content > p:has(> strong:first-child) {
  padding: 12px 15px;
  border-left: 3px solid rgba(208, 170, 111, .62);
  border-radius: 0 9px 9px 0;
  background: rgba(208, 170, 111, .055);
}

.class-feature-options {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.class-feature-option,
.class-feature-scaling,
.feature-prerequisite {
  margin-top: 12px;
  padding: 15px 17px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: rgba(255, 255, 255, .024);
}

.class-feature-option > :last-child,
.class-feature-scaling > :last-child,
.feature-prerequisite > :last-child {
  margin-bottom: 0;
}

.progression-section .section-heading-inline {
  align-items: end;
}

.class-detail-page .subclass-picker select {
  min-width: min(300px, 72vw);
  min-height: 42px;
  font-size: .86rem;
}

.class-detail-page .subclass-preview {
  margin: 18px 0;
  padding: 15px 17px;
}

.class-detail-page .subclass-preview b {
  font-size: .88rem;
}

.class-detail-page .subclass-preview p {
  margin: 3px 0 0;
  font-size: .78rem;
  line-height: 1.5;
}

.class-detail-page .progression-table td {
  font-size: .8rem;
  line-height: 1.48;
}

.class-detail-page .feature-cell {
  min-width: 270px;
}

.class-detail-page .feature-cell a {
  color: #c7d0d6;
  text-decoration: none;
}

.class-detail-page .feature-cell a:hover {
  color: var(--accent-light);
}

.features-heading {
  margin-bottom: 28px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.active-subclass-label {
  max-width: 330px;
  padding: 7px 11px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-light);
  font-size: .72rem;
  line-height: 1.3;
}

.active-subclass-label[hidden] {
  display: none;
}

.feature-timeline {
  position: relative;
  display: grid;
  gap: 4px;
}

.feature-timeline::before {
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 23px;
  width: 1px;
  content: "";
  background: linear-gradient(180deg, var(--accent-line), var(--line) 85%, transparent);
}

.feature-level-group {
  position: relative;
  padding: 0 0 24px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 18px;
}

.feature-level-group.is-empty:not(.has-subclass-features) {
  display: none;
}

.feature-level-header {
  display: contents;
}

.feature-level-number {
  position: relative;
  z-index: 2;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: #11171c;
  color: var(--text);
  font-size: .9rem;
  font-weight: 760;
  box-shadow: 0 0 0 5px #151c22;
}

.feature-level-header > div {
  display: none;
}

.feature-level-content {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.subclass-feature-slot {
  display: grid;
  gap: 12px;
}

.class-detail-page .feature {
  margin: 0;
  padding: clamp(20px, 2.4vw, 28px);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 13px;
  background: rgba(255, 255, 255, .025);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .018);
}

.class-detail-page .feature.subclass-feature {
  border-color: rgba(205, 168, 109, .32);
  background:
    linear-gradient(135deg, rgba(205, 168, 109, .075), transparent 48%),
    rgba(255, 255, 255, .022);
}

.class-detail-page .feature-title {
  margin-bottom: 20px;
  align-items: start;
  justify-content: space-between;
}

.class-detail-page .feature-title h3 {
  margin: 5px 0 0;
  font-size: clamp(1.2rem, 2vw, 1.48rem);
  line-height: 1.25;
}

.feature-origin {
  color: var(--muted);
  font-size: .65rem;
  font-weight: 720;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.subclass-feature .feature-origin {
  color: var(--accent-light);
}

.class-detail-page .level-tag {
  flex: 0 0 auto;
  margin-top: 1px;
  white-space: nowrap;
}

.section-intro {
  max-width: 660px;
  margin: -8px 0 22px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.55;
}

.class-detail-page .subclass-choice {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.class-detail-page .subclass-choice:hover {
  transform: translateY(-2px);
}

.class-detail-page .subclass-choice.selected {
  border-color: rgba(205, 168, 109, .5);
  background: rgba(205, 168, 109, .075);
}

.class-detail-page .subclass-choice h3 {
  margin: 14px 0 0;
  font-size: 1.08rem;
}

.class-detail-page .subclass-choice p {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: .82rem;
  line-height: 1.58;
}

.class-detail-page .subclass-choice small {
  margin-top: auto;
  padding-top: 16px;
  color: var(--accent-light);
  font-weight: 650;
}

@media (max-width: 900px) {
  .class-detail-page .class-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .overview-panels {
    grid-template-columns: 1fr;
  }

  .features-heading {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .class-detail-page .content-section {
    padding: 21px 17px;
  }

  .class-detail-page .rule-list > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .section-heading-inline {
    align-items: stretch;
    flex-direction: column;
  }

  .class-detail-page .subclass-picker select {
    width: 100%;
    min-width: 0;
  }

  .feature-timeline::before {
    left: 18px;
  }

  .feature-level-group {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
  }

  .feature-level-number {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    box-shadow: 0 0 0 4px #151c22;
  }

  .class-detail-page .feature {
    padding: 18px 15px;
  }

  .class-detail-page .feature-title {
    align-items: start;
    flex-direction: column;
    gap: 9px;
  }

  .class-detail-page .level-tag {
    white-space: normal;
  }

  .class-rules-prose,
  .class-rules-prose .ttg-class-content {
    font-size: .94rem;
    line-height: 1.67;
  }
}
/* END STAGE 5C */

/* STAGE 6A - TTG backgrounds and feats */

.background-card .material-cover:not([style]) {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 24%, rgba(207, 173, 112, .2), transparent 28%),
    linear-gradient(145deg, #263139, #13191e 62%, #101519);
}

.background-card .material-cover:not([style])::before {
  position: absolute;
  width: 74%;
  aspect-ratio: 1;
  content: "";
  border: 1px solid rgba(207, 173, 112, .16);
  border-radius: 38% 62% 48% 52%;
  transform: rotate(28deg);
}

.background-card-mark {
  position: relative;
  color: var(--accent-light);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.2rem;
  text-shadow: 0 0 28px rgba(207, 173, 112, .34);
}

.background-prose,
.feat-prose {
  color: var(--text-soft);
  font-size: .98rem;
  line-height: 1.72;
}

.background-imported-content > :first-child,
.feat-imported-content > :first-child,
.background-equipment-content > :first-child {
  margin-top: 0;
}

.background-imported-content > :last-child,
.feat-imported-content > :last-child,
.background-equipment-content > :last-child {
  margin-bottom: 0;
}

.background-prose h3,
.background-prose h4,
.feat-prose h3,
.feat-prose h4 {
  margin: 1.65em 0 .65em;
  color: var(--text);
  line-height: 1.25;
}

.background-prose ul,
.background-prose ol,
.feat-prose ul,
.feat-prose ol,
.background-equipment ul,
.background-equipment ol {
  padding-left: 1.35rem;
}

.background-prose li,
.feat-prose li,
.background-equipment li {
  margin: .55rem 0;
}

.background-equipment {
  margin-top: 24px;
}

.background-equipment > div,
.background-equipment-content {
  min-width: 0;
}

.feat-category-note {
  margin-bottom: 22px;
  padding: 13px 15px;
  border-left: 3px solid var(--accent-light);
  border-radius: 0 8px 8px 0;
  background: var(--accent-soft);
  color: var(--text-soft);
}

.feat-related-backgrounds {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.feat-related-backgrounds h3 {
  margin-top: 0;
}

.background-prose .table-wrapper,
.feat-prose .table-wrapper,
.background-equipment .table-wrapper {
  max-width: 100%;
  margin: 20px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.background-prose table,
.feat-prose table,
.background-equipment table {
  width: 100%;
  min-width: 560px;
}

.background-prose th,
.background-prose td,
.feat-prose th,
.feat-prose td,
.background-equipment th,
.background-equipment td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.feat-list {
  margin-bottom: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(20, 26, 31, .58);
}

.feat-list .compact-row {
  min-height: 76px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 42px minmax(190px, 1fr) minmax(120px, .45fr) minmax(180px, .7fr) auto;
  gap: 16px;
}

.feat-list .compact-row:hover {
  padding-inline: 19px 13px;
  background: rgba(255, 255, 255, .035);
}

.feat-list .row-meta {
  min-width: 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.35;
}

.feat-list + .infinite-scroll-status,
.background-grid + .infinite-scroll-status {
  margin-top: 4px;
}

@media (max-width: 900px) {
  .feat-list .compact-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .feat-list .row-meta {
    display: none;
  }
}

@media (max-width: 560px) {
  .feat-list .compact-row {
    min-height: 70px;
    padding: 10px 12px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .feat-list .compact-row:hover {
    padding-inline: 12px;
  }

  .background-prose,
  .feat-prose {
    font-size: .94rem;
    line-height: 1.66;
  }
}

/* END STAGE 6A */

/* STAGE 7C - long-form contribution editor */
.contribution-editor-panel > p {
  max-width: 760px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.55;
}

.contribution-form-grid {
  align-items: start;
}

.contribution-form-grid .contribution-field-summary {
  grid-column: span 2;
}

.contribution-editor-panel .contribution-field-main {
  margin-top: 24px;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.contribution-field-main > span {
  color: var(--text) !important;
  font-size: .88rem !important;
  font-weight: 720 !important;
}

.contribution-field-short_description textarea {
  min-height: 132px;
  resize: vertical;
}

.contribution-field-main .rich-editor {
  border-radius: 13px;
  box-shadow: 0 14px 42px rgba(0, 0, 0, .16);
}

.contribution-field-main .rich-editor-toolbar {
  padding: 10px 12px;
}

.contribution-field-main .rich-editor-toolbar button {
  min-height: 34px;
  padding-inline: 11px;
  font-size: .7rem;
}

.contribution-field-main .rich-editor-surface {
  height: clamp(480px, 58vh, 760px);
  min-height: 480px;
  max-height: 760px;
  padding: 28px 32px;
  font-size: 1rem;
  line-height: 1.76;
}

.contribution-field-main .rich-editor-status {
  padding: 8px 12px;
}

@media (max-width: 1100px) {
  .contribution-form-grid .contribution-field-summary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .contribution-field-main .rich-editor-surface {
    height: 55vh;
    min-height: 360px;
    padding: 20px;
  }
}

/* END STAGE 7C */
