/* Persephone RP. Shares the launcher's palette and type: gold, crimson and arcane teal on near-black violet;
   Cinzel for headings, Cormorant Garamond for lore, Inter for the interface. No framework, no build step. */

@font-face { font-family: "Cinzel"; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(../fonts/cinzel-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cinzel"; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(../fonts/cinzel-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cinzel Decorative"; font-style: normal; font-display: swap; font-weight: 700;
  src: url(../fonts/cinzel-decorative-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fonts/inter-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fonts/inter-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fonts/inter-cyrillic-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-display: swap; font-weight: 500;
  src: url(../fonts/cormorant-garamond-latin-500-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-display: swap; font-weight: 500;
  src: url(../fonts/cormorant-garamond-latin-ext-500-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-display: swap; font-weight: 500;
  src: url(../fonts/cormorant-garamond-cyrillic-500-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-display: swap; font-weight: 500;
  src: url(../fonts/cormorant-garamond-latin-500-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-display: swap; font-weight: 500;
  src: url(../fonts/cormorant-garamond-latin-ext-500-italic.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-display: swap; font-weight: 500;
  src: url(../fonts/cormorant-garamond-cyrillic-500-italic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-display: swap; font-weight: 600;
  src: url(../fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-display: swap; font-weight: 600;
  src: url(../fonts/cormorant-garamond-latin-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-display: swap; font-weight: 600;
  src: url(../fonts/cormorant-garamond-cyrillic-600-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url(../fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2-variations"); }

:root {
  --bg: #07060b;
  --bg-2: #0d0a14;
  --bg-3: #140f1d;
  --ink: #efe8db;
  --ink-dim: #b9b0c3;
  --ink-faint: #918aa2;
  --gold: #d8b46a;
  --gold-bright: #f5dc9f;
  --gold-deep: #8a6a2c;
  --crimson: #c3243f;
  --crimson-bright: #ff6b82;
  --crimson-deep: #5c0c1d;
  --arcane: #6fe3d6;
  --arcane-deep: #1d6f69;
  --violet: #a593ff;
  --violet-deep: #3b2c7a;
  --ok: #7be3a1;
  --warn: #f1c25b;
  --err: #ff7d8f;

  --arcana: var(--violet);
  --occulta: var(--crimson-bright);
  --artifice: var(--arcane);

  --line: rgba(216, 180, 106, .16);
  --line-strong: rgba(216, 180, 106, .32);
  --line-soft: rgba(239, 232, 219, .07);
  --glass: rgba(20, 14, 28, .62);
  --glass-solid: rgba(22, 16, 31, .97);
  --glass-highlight: rgba(255, 240, 220, .06);
  --shadow: 0 30px 80px -24px rgba(0, 0, 0, .8);
  --shadow-sm: 0 12px 30px -16px rgba(0, 0, 0, .8);

  --radius: 16px;
  --radius-sm: 10px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --title-gold: #e8c983;
  --title-shadow: 0 3px 0 rgba(0, 0, 0, .55);
  --glow-gold: 0 0 18px rgba(216, 180, 106, .45);
  --glow-crimson: 0 0 20px rgba(255, 90, 116, .5);
  --glow-violet: 0 0 18px rgba(165, 147, 255, .45);

  --font-display: "Cinzel Decorative", "Cinzel", Georgia, serif;
  --font-heading: "Cinzel", Georgia, "Times New Roman", serif;
  --font-lore: "Cormorant Garamond", Georgia, serif;
  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("../img/runes-faint.svg") right -18vmax bottom -18vmax / 62vmax 62vmax no-repeat, var(--bg);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

body > * { position: relative; z-index: 1; }

::selection { background: rgba(195, 36, 63, .55); color: #fff; }

a { color: var(--gold-bright); text-decoration-color: rgba(245, 220, 159, .35); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: #fff3d6; text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--arcane); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: .03em;
  line-height: 1.15;
  margin: 0 0 .6em;
  color: #f7efdf;
  overflow-wrap: break-word;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); }
h3 { font-size: 1.12rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .875rem; }
.dim { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }
.mono { font-family: var(--font-mono); font-size: .88em; }
.nowrap { white-space: nowrap; }
.lore { font-family: var(--font-lore); font-style: italic; font-weight: 500; }
[hidden] { display: none !important; }
:where(svg) { width: 1.1em; height: 1.1em; flex: none; }
fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
legend { padding: 0; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap;
}

.skip {
  position: absolute; left: 1rem; top: -3rem; z-index: 20;
  background: var(--gold); color: #1b1208; padding: .55rem 1rem; border-radius: 8px; font-weight: 600;
}
.skip:focus { top: 1rem; }

.wrap { width: min(1200px, 100% - 2rem); margin-inline: auto; }
.wrap.narrow { width: min(520px, 100% - 2rem); }
.wrap.mid { width: min(880px, 100% - 2rem); }

.eyebrow {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  font-family: var(--font-heading); font-weight: 600; font-size: .74rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 .7rem;
}
.eyebrow .chip { letter-spacing: .06em; }

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

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(9, 7, 14, .84);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar .bar { display: flex; align-items: center; gap: 1.5rem; min-height: 4.25rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--ink); flex: none; }
.brand img { width: 38px; height: 38px; }
.brand .word { display: grid; line-height: 1.05; }
.brand .word b { font-family: var(--font-heading); font-weight: 700; font-size: 1.12rem; letter-spacing: .2em; color: #f7efdf; }
.brand .word small { font-family: var(--font-heading); font-weight: 600; font-size: .6rem; letter-spacing: .34em; color: var(--gold); margin-top: .2rem; }
.brand:hover .word b { color: var(--gold-bright); }

.nav { display: flex; align-items: center; gap: .3rem; margin-left: auto; }
.nav a {
  position: relative; font-family: var(--font-heading); font-weight: 600; font-size: .8rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-dim); text-decoration: none; padding: .55rem .8rem; border-radius: 8px;
  transition: color .2s ease, background .2s ease;
}
.nav a:hover { color: var(--gold-bright); background: rgba(216, 180, 106, .06); }
.nav a[aria-current="page"] { color: var(--gold-bright); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: .8rem; right: .8rem; bottom: .15rem; height: 2px; border-radius: 2px;
  background: var(--gold);
}
.nav .count { font-family: var(--font-ui); font-weight: 700; font-size: .68rem; letter-spacing: 0; margin-left: .35rem;
  background: var(--crimson); color: #fff; border-radius: 99px; padding: .05rem .4rem; vertical-align: .1em; }
.nav-cta.btn { margin-left: .4rem; }

.account { display: flex; align-items: center; gap: .55rem; padding-left: 1rem; margin-left: .4rem; border-left: 1px solid var(--line); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-family: var(--font-heading); font-weight: 700; font-size: .95rem; color: #fff3f0;
  background: var(--crimson);
  box-shadow: 0 0 0 1px rgba(245, 220, 159, .45);
}
.account .who { display: grid; line-height: 1.15; }
.account .who b { font-weight: 600; font-size: .9rem; color: var(--ink); max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .who small { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.account .who small.gm { color: var(--arcane); }
.account form { margin: 0; display: flex; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; cursor: pointer;
  color: var(--ink-dim); background: transparent; border: 1px solid transparent;
}
.icon-btn:hover { color: var(--gold-bright); border-color: var(--line); background: rgba(216, 180, 106, .06); }
.icon-btn svg { width: 20px; height: 20px; }

.menu { display: none; margin-left: auto; position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; cursor: pointer; color: var(--gold-bright); background: rgba(255, 255, 255, .03); }
.menu > summary svg { width: 22px; height: 22px; }
.menu[open] > summary { border-color: var(--line-strong); background: rgba(216, 180, 106, .08); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + .6rem); width: min(19rem, calc(100vw - 2rem));
  background: #17111f; border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 0 0 100vmax rgba(5, 4, 9, .55), var(--shadow); padding: .6rem; display: grid; gap: .15rem;
}
.menu-panel a { display: flex; align-items: center; justify-content: space-between; padding: .8rem .9rem; border-radius: 10px; text-decoration: none;
  font-family: var(--font-heading); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; font-size: .85rem; color: var(--ink); }
.menu-panel a:hover, .menu-panel a[aria-current="page"] { background: rgba(216, 180, 106, .08); color: var(--gold-bright); }
.menu-panel a[aria-current="page"] { box-shadow: inset 2px 0 0 var(--gold); }
.menu-panel .count { font-family: var(--font-ui); font-size: .72rem; background: var(--crimson); color: #fff; border-radius: 99px; padding: .05rem .45rem; letter-spacing: 0; }
.menu-panel .menu-account { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem .5rem; margin-top: .3rem; border-top: 1px solid var(--line); }
.menu-panel .menu-account .who { flex: 1; display: grid; line-height: 1.2; min-width: 0; }
.menu-panel .menu-account .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-panel .menu-account small { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.menu-panel .menu-account small.gm { color: var(--arcane); }
.menu-panel form { margin: 0; }

/* Flash ------------------------------------------------------------------- */

.flashes { margin-top: 1.25rem; display: grid; gap: .6rem; }
.flash {
  display: flex; gap: .75rem; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem;
  background: var(--glass-solid); box-shadow: var(--shadow-sm); font-size: .95rem;
}
.flash::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-top: .5rem; flex: none; background: var(--gold); }
.flash p { margin: 0; }
.flash.ok { border-color: rgba(123, 227, 161, .35); }
.flash.ok::before { background: var(--ok); color: var(--ok); }
.flash.error { border-color: rgba(255, 107, 127, .45); }
.flash.error::before { background: var(--err); color: var(--err); }

main { flex: 1; padding-block: clamp(1.75rem, 4vw, 3rem) 4.5rem; }
main:focus { outline: none; }

/* Panels ------------------------------------------------------------------ */

.panel {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.15rem, 2.6vw, 1.9rem);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}
.panel.ornate { border-color: var(--line-strong); }
.panel.ornate::after {
  content: ""; position: absolute; inset: 7px; border-radius: 11px; pointer-events: none;
  border: 1px solid rgba(216, 180, 106, .1);
}
.panel + .panel { margin-top: 1.25rem; }
.panel h2:first-child, .panel h3:first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }

.divider {
  position: relative; height: 1px; border: 0; margin: 2.5rem 0;
  background: var(--line-strong);
  overflow: visible;
}
.divider::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; transform: translate(-50%, -50%) rotate(45deg);
  background: var(--bg); border: 1px solid var(--gold);
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 2rem; }
.page-head > div { min-width: 0; flex: 1 1 32rem; }
.page-head h1 { margin: 0; }
.page-head p.lead, .page-head > div > p:not(.eyebrow) {
  margin: .6rem 0 0; color: var(--ink-dim); max-width: 60ch;
  font-family: var(--font-lore); font-style: italic; font-weight: 500; font-size: 1.32rem; line-height: 1.4;
}
.page-head .actions { flex: none; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.section-head h2 { margin: 0; display: flex; align-items: center; gap: .7rem; }
.section-head h2 .count-badge { font-family: var(--font-ui); font-size: .78rem; font-weight: 600; letter-spacing: .04em; color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: 99px; padding: .1rem .55rem; }
.section-head p { margin: 0; color: var(--ink-faint); font-size: .92rem; }

/* Buttons and forms ------------------------------------------------------- */

.btn {
  --b: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 44px; padding: .55rem 1.2rem; border-radius: 10px; border: 1px solid var(--b);
  font-family: var(--font-heading); font-weight: 700; font-size: .84rem; letter-spacing: .1em; text-transform: uppercase;
  background: rgba(255, 255, 255, .035); color: var(--ink); cursor: pointer; text-decoration: none; line-height: 1.1; text-align: center;
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}
.btn:hover { --b: var(--line-strong); color: #fff6df; background: rgba(216, 180, 106, .08); }
.btn:active:not([disabled]) { transform: translateY(1px) scale(.99); }
.btn:not([disabled]):is(:hover, :focus-visible) { box-shadow: 0 0 14px rgba(216, 180, 106, .22); }
.btn.primary {
  --b: transparent;
  color: #1b1208;
  background: var(--gold);
  box-shadow: 0 0 0 1px rgba(255, 230, 170, .35) inset;
}
.btn.primary:not([disabled]):is(:hover, :focus-visible) { color: #120c03; background: var(--gold-bright); box-shadow: 0 0 0 1px rgba(255, 240, 200, .6) inset, var(--glow-gold); }
.btn.crimson {
  --b: transparent;
  color: #fff3f0;
  background: var(--crimson);
  box-shadow: 0 0 0 1px rgba(255, 160, 170, .3) inset;
}
.btn.crimson:not([disabled]):is(:hover, :focus-visible) { color: #fff; background: #d22d4a; box-shadow: 0 0 0 1px rgba(255, 190, 200, .55) inset, var(--glow-crimson); }
.btn.danger { --b: transparent; background: #63182a; box-shadow: 0 0 0 1px rgba(255, 125, 143, .35) inset; color: #ffd5da; }
.btn.danger:not([disabled]):is(:hover, :focus-visible) { color: #fff; background: #7a2232; box-shadow: 0 0 0 1px rgba(255, 190, 200, .55) inset, var(--glow-crimson); }
.btn.arcane { --b: rgba(165, 147, 255, .45); background: rgba(68, 52, 140, .58); color: #ece7ff; }
.btn.arcane:not([disabled]):is(:hover, :focus-visible) { --b: rgba(165, 147, 255, .8); background: rgba(88, 70, 176, .72); box-shadow: var(--glow-violet); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: .35rem .8rem; font-size: .72rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg { width: 1.1em; height: 1.1em; }
.btn.back svg { transform: scaleX(-1); }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }
.actions.center { justify-content: center; }

.field { display: grid; gap: .45rem; margin-bottom: 1.25rem; }
.field > label, .label {
  font-family: var(--font-ui); font-size: .76rem; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim);
}
.hint, .field .hint { font-size: .86rem; color: var(--ink-faint); line-height: 1.5; }
input[type="text"], input[type="password"], input[type="number"], input[type="search"], textarea, select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: rgba(5, 4, 9, .6); border: 1px solid rgba(216, 180, 106, .2); border-radius: 10px; padding: .75rem .95rem;
  min-height: 48px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input::placeholder, textarea::placeholder { color: #7d7590; }
input:hover, textarea:hover { border-color: rgba(216, 180, 106, .32); }
textarea { min-height: 13rem; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: rgba(111, 227, 214, .6); box-shadow: 0 0 0 4px rgba(111, 227, 214, .12); background: rgba(5, 4, 9, .8);
}
input[aria-invalid="true"] { border-color: var(--err); }
input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgba(255, 107, 127, .15); }
.field-note { font-size: .88rem; min-height: 1.4em; }
.field-note.ok { color: var(--ok); }
.field-note.bad { color: var(--err); }

.error-box, .notice-box {
  position: relative; border-radius: 12px; padding: .95rem 1.1rem .95rem 1.25rem; margin-bottom: 1.25rem;
  border: 1px solid; overflow: hidden;
}
.error-box::before, .notice-box::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.error-box { color: var(--ink); border-color: rgba(255, 107, 127, .4); background: rgba(66, 11, 24, .5); }
.error-box::before { background: var(--err); }
.error-box h3 { font-family: var(--font-ui); font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #ffb6c0; margin-bottom: .45rem; }
.error-box ul { margin: 0; padding-left: 1.15rem; }
.error-box li + li { margin-top: .2rem; }
.error-box p:last-child { margin-bottom: 0; }
.notice-box { color: var(--ink); border-color: rgba(241, 194, 91, .35); background: rgba(58, 42, 14, .45); }
.notice-box::before { background: var(--warn); }
.notice-box strong { color: var(--gold-bright); }
.notice-box > p { margin: .4rem 0 0; }
.notice-box.calm { border-color: rgba(111, 227, 214, .3); background: rgba(15, 52, 51, .45); }
.notice-box.calm::before { background: var(--arcane); }
.notice-box.calm strong { color: var(--arcane); }

/* Status chips ------------------------------------------------------------ */

.chip {
  display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-ui); font-size: .7rem; font-weight: 650;
  letter-spacing: .08em; text-transform: uppercase; padding: .26rem .65rem; border-radius: 999px; line-height: 1.3;
  border: 1px solid rgba(239, 232, 219, .14); color: var(--ink-dim); background: rgba(7, 6, 11, .55); white-space: nowrap;
  vertical-align: middle;
}
.chip::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.chip.s-draft { color: #c9c0d8; }
.chip.s-pending { color: var(--warn); border-color: rgba(241, 194, 91, .4); background: rgba(80, 58, 18, .35); }
.chip.s-changes_requested { color: #ffae7a; border-color: rgba(255, 174, 122, .4); background: rgba(90, 42, 16, .35); }
.chip.s-approved { color: var(--arcane); border-color: rgba(111, 227, 214, .4); background: rgba(16, 60, 58, .35); }
.chip.s-imported { color: var(--ok); border-color: rgba(123, 227, 161, .4); background: rgba(18, 64, 38, .35); }
.chip.s-rejected, .chip.s-failed { color: var(--err); border-color: rgba(255, 107, 127, .42); background: rgba(92, 12, 29, .4); }
.chip.plain::before { display: none; }
.chip.cost-pos { color: var(--gold-bright); border-color: rgba(216, 180, 106, .35); }
.chip.cost-neg { color: var(--ok); border-color: rgba(123, 227, 161, .35); }

/* Landing ----------------------------------------------------------------- */

.hero {
  position: relative; isolation: isolate; overflow: hidden;
  margin-top: calc(-1 * clamp(1.75rem, 4vw, 3rem));
  min-height: min(88vh, 860px);
  display: flex; align-items: center;
  padding-block: clamp(3rem, 8vw, 6rem);
}
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 30%; filter: saturate(1) contrast(1.08) brightness(.95);
  animation: kenburns 46s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.14) translate3d(-1.5%, -1%, 0); } }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(7, 6, 11, .5) 0%, rgba(7, 6, 11, 0) 30%, rgba(7, 6, 11, .2) 60%, var(--bg) 100%),
    linear-gradient(90deg, rgba(7, 6, 11, .88) 0%, rgba(7, 6, 11, .45) 48%, rgba(7, 6, 11, .1) 100%);
}
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 2rem; align-items: center; }
.hero .wrap > div:first-child { container-type: inline-size; }
.hero-title {
  margin: .2rem 0 .1em;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.4rem, 12.4cqi, 6.4rem); line-height: 1; letter-spacing: .02em;
  color: var(--title-gold); text-shadow: var(--title-shadow);
  text-wrap: nowrap;
}
.hero .tagline { font-family: var(--font-lore); font-style: italic; font-weight: 500; font-size: clamp(1.35rem, 2.4vw, 1.75rem); line-height: 1.3;
  color: rgba(239, 232, 219, .9); text-shadow: 0 2px 12px rgba(0, 0, 0, .8); margin: .4rem 0 1.1rem; max-width: 30ch; }
.hero .lede { font-size: 1.05rem; color: var(--ink-dim); max-width: 50ch; margin-bottom: 1.8rem; text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.hero .actions .btn { min-height: 50px; padding-inline: 1.5rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.8rem; }
.hero-meta span { display: inline-flex; align-items: center; gap: .5rem; height: 34px; padding: 0 .9rem; border-radius: 999px; font-size: .8rem;
  background: rgba(10, 8, 16, .6); border: 1px solid var(--line); color: var(--ink-dim); backdrop-filter: blur(10px); }
.hero-meta b { color: var(--ink); font-weight: 600; }
.hero-meta .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--crimson-bright); }

.sigil-art { position: relative; aspect-ratio: 1; width: min(100%, 440px); justify-self: center; }
.sigil-art .ring { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .85; animation: turn 120s linear infinite; }
.sigil-art .fruit { position: absolute; inset: 33% 33%; width: 34%; height: 34%; }
@keyframes turn { to { transform: rotate(360deg); } }

.landing-section { padding-block: clamp(3rem, 7vw, 5rem) 0; }
.landing-section > .wrap > header { text-align: center; max-width: 46rem; margin: 0 auto 2.2rem; }
.landing-section > .wrap > header .eyebrow { justify-content: center; }
.landing-section > .wrap > header p:not(.eyebrow) { font-family: var(--font-lore); font-style: italic; font-size: 1.25rem; color: var(--ink-dim); margin: 0; }
.landing-section h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin-bottom: .4rem; }

.triad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.current {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 1.8rem 1.6rem 1.6rem;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  background: color-mix(in srgb, var(--accent) 5%, rgba(20, 14, 28, .62));
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow);
  transition: transform .3s var(--ease-out), border-color .3s ease;
}
.current:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.current .glyph { width: 3.4rem; height: 3.4rem; display: grid; place-items: center; border-radius: 50%; margin-bottom: 1.1rem;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent); }
.current .glyph svg { width: 1.7rem; height: 1.7rem; }
.current h3 { font-size: 1.5rem; color: var(--accent); letter-spacing: .08em; margin-bottom: .2rem; }
.current .motto { font-family: var(--font-lore); font-style: italic; font-size: 1.12rem; color: var(--ink); margin: 0 0 .7rem; }
.current p:last-child { color: var(--ink-dim); margin: 0; font-size: .95rem; }
.arcana { --accent: var(--arcana); }
.occulta { --accent: var(--occulta); }
.artifice { --accent: var(--artifice); }

.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; padding: 0; margin: 0; list-style: none; position: relative; }
.steps::before { content: ""; position: absolute; top: 1.6rem; left: 12%; right: 12%; height: 1px; background: var(--line-strong); }
.steps li { counter-increment: step; text-align: center; position: relative; padding: 0 .4rem; }
.steps li::before {
  content: counter(step, upper-roman); display: grid; place-items: center; width: 3.2rem; height: 3.2rem; margin: 0 auto 1rem;
  border-radius: 50%; font-family: var(--font-heading); font-weight: 700; color: var(--gold-bright); font-size: 1rem;
  background: #1c1426; border: 1px solid var(--line-strong);
  box-shadow: 0 0 0 5px var(--bg);
  position: relative;
}
.steps strong { display: block; font-family: var(--font-heading); font-weight: 600; letter-spacing: .06em; font-size: 1.02rem; margin-bottom: .35rem; color: #f7efdf; }
.steps span { color: var(--ink-dim); font-size: .93rem; display: block; max-width: 26ch; margin-inline: auto; }

.news { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 1.25rem; }
.news article {
  position: relative; border-radius: var(--radius); padding: 1.4rem 1.5rem; border: 1px solid var(--line);
  background: var(--glass); box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-sm);
}
.news article::before { content: ""; position: absolute; left: 1.5rem; width: 3rem; top: -1px; height: 2px; background: var(--crimson); }
.news time { font-family: var(--font-heading); font-weight: 600; font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.news h3 { margin: .45rem 0 .5rem; font-size: 1.2rem; }
.news h3 a { color: #f7efdf; text-decoration: none; }
.news h3 a:hover { color: var(--gold-bright); }
.news p { margin: 0; color: var(--ink-dim); font-size: .95rem; }

.call {
  margin-top: clamp(3rem, 7vw, 5rem); text-align: center; padding: clamp(2rem, 5vw, 3.2rem) 1.5rem; border-radius: 20px; position: relative; overflow: hidden;
  border: 1px solid var(--line-strong);
  background: rgba(44, 14, 27, .6);
}
.call h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); }
.call p { font-family: var(--font-lore); font-style: italic; font-size: 1.25rem; color: var(--ink-dim); max-width: 40ch; margin: 0 auto 1.5rem; }

/* Cards: characters and applications --------------------------------------- */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 1.25rem; }
.card {
  display: flex; flex-direction: column; gap: .8rem; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.35rem; background: var(--glass);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-sm); position: relative; overflow: hidden;
  transition: border-color .25s ease, transform .3s var(--ease-out);
}
.card::before {
  content: ""; position: absolute; inset: 0 auto auto 1.35rem; width: 3rem; height: 2px;
  background: var(--accent, transparent);
}
.card:hover { border-color: var(--line-strong); }
.card.living { --accent: var(--ok); }
.card.retired { opacity: .72; }
.card.retired .crest { filter: grayscale(1); }
.card-top { display: flex; gap: 1rem; align-items: center; }
.card-top > div { min-width: 0; }
.card h3 { margin: 0; font-size: 1.28rem; line-height: 1.2; }
.card h3 a { color: #f7efdf; text-decoration: none; }
.card h3 a:hover { color: var(--gold-bright); }
.card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.card .foot a, .card .foot form, .card .foot button { position: relative; z-index: 1; }
.card .meta { display: flex; flex-wrap: wrap; gap: .4rem .7rem; align-items: center; color: var(--ink-faint); font-size: .86rem; margin-top: .3rem; }
.card .race { font-family: var(--font-lore); font-style: italic; font-size: 1.05rem; color: var(--ink-dim); }
.card .foot { margin-top: auto; display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; padding-top: .3rem; }
.card .foot .when { margin-left: auto; font-size: .8rem; color: var(--ink-faint); }
.card p.comment { margin: 0; padding: .65rem .85rem; border-left: 2px solid #ffae7a; border-radius: 0 8px 8px 0; background: rgba(255, 174, 122, .07);
  font-family: var(--font-lore); font-style: italic; font-size: 1.05rem; line-height: 1.4; }
.card p.failure { border-left-color: var(--err); background: rgba(255, 107, 127, .07); white-space: pre-line; font-family: var(--font-ui); font-style: normal; font-size: .9rem; }
.card .perk-names { margin: 0; font-size: .9rem; color: var(--ink-dim); }
.card.single { max-width: 760px; }
.card.single h2 { margin: 0; font-size: 1.6rem; line-height: 1.2; }
.card.single h2 a { color: #f7efdf; text-decoration: none; }
.card.single h2 a:hover { color: var(--gold-bright); }
.card.single h2 a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.card.single .story { margin: 0; white-space: pre-line; font-family: var(--font-lore); font-weight: 500; font-size: 1.1rem; line-height: 1.55; color: var(--ink-dim); max-width: 68ch; }
.one-rule { margin: 1rem 0 0; max-width: 760px; }
.earlier { margin-top: 2.2rem; max-width: 760px; }
.earlier .small-head { margin: 0 0 .7rem; font-size: 1.05rem; }
.earlier ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.earlier li { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; }
.earlier .when { color: var(--ink-faint); font-size: .8rem; }

.crest {
  flex: none; width: 3.4rem; height: 3.4rem; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; color: var(--gold-bright);
  background: #24152a;
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 0 0 4px rgba(7, 6, 11, .7), inset 0 0 0 5px rgba(216, 180, 106, .25);
}
.crest.lg { width: 4.6rem; height: 4.6rem; font-size: 2rem; }

.statline { display: flex; flex-wrap: wrap; gap: .35rem; }
.statline > span { font-family: var(--font-mono); font-size: .74rem; font-weight: 500; padding: .2rem .5rem; border-radius: 6px;
  background: rgba(7, 6, 11, .6); border: 1px solid var(--line-soft); color: var(--ink-dim); }
.statline > span.stat-arcana { color: var(--arcana); }
.statline > span.stat-occulta { color: var(--occulta); }
.statline > span.stat-artifice { color: var(--artifice); }
.statline .base { color: var(--ink-faint); }
.card:has(.tip-host) { overflow: visible; }

.empty {
  display: grid; justify-items: center; gap: .6rem; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: clamp(2rem, 5vw, 3rem) 1.5rem;
  background: rgba(13, 10, 20, .55);
  color: var(--ink-dim);
}
.empty .glyph { width: 3.2rem; height: 3.2rem; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--gold); margin-bottom: .3rem; }
.empty .glyph svg { width: 1.5rem; height: 1.5rem; }
.empty strong { font-family: var(--font-heading); font-weight: 600; font-size: 1.15rem; color: var(--ink); letter-spacing: .04em; }
.empty p { margin: 0; max-width: 46ch; }
.empty .btn { margin-top: .6rem; }

/* Application form ---------------------------------------------------------- */

.composer { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.75rem; align-items: start; }
.composer-main > section { margin-bottom: 1.5rem; scroll-margin-top: 5.5rem; }
.section-title { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line-soft); }
.section-title .num {
  display: grid; place-items: center; width: 2.7rem; height: 2.7rem; border-radius: 50%; flex: none;
  font-family: var(--font-heading); font-weight: 700; font-size: 1rem; color: var(--gold-bright);
  border: 1px solid var(--line-strong); background: #1c1426;
}
.section-title h2 { margin: 0; }
.section-title p { margin: .15rem 0 0; color: var(--ink-faint); font-size: .9rem; }
.section-intro { color: var(--ink-dim); font-size: .95rem; margin-bottom: 1.25rem; }
.cost-scale { display: inline-flex; flex-wrap: wrap; gap: .3rem; vertical-align: middle; }
.cost-scale span { font-family: var(--font-mono); font-size: .74rem; padding: .1rem .4rem; border-radius: 5px; border: 1px solid var(--line-soft); color: var(--ink-dim); background: rgba(7, 6, 11, .5); }
.cost-scale span b { color: var(--gold-bright); font-weight: 600; }

.ledger { position: sticky; top: 5.6rem; display: grid; gap: 1rem; }
.ledger .panel { padding: 1.35rem 1.4rem; }
.meter-label { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-ui); font-weight: 650; font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-dim); }
.meter-label .mono { letter-spacing: 0; color: var(--ink-faint); }
.points { display: flex; align-items: baseline; gap: .5rem; margin: .35rem 0 .7rem; }
.points #remaining {
  font-family: var(--font-heading); font-weight: 700; font-size: 3.4rem; line-height: 1;
  color: var(--title-gold); text-shadow: var(--title-shadow);
  font-variant-numeric: lining-nums tabular-nums;
}
.points small { font-size: .9rem; color: var(--ink-faint); }
.points.over #remaining { color: var(--err); }
.meter { height: 8px; border-radius: 99px; background: rgba(5, 4, 9, .8); border: 1px solid var(--line-soft); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--gold); transition: width .35s var(--ease-out); }
.meter.over i { background: var(--err); }
.meter.refund i { background: var(--arcane); }
.meter.refund.over i { background: var(--err); }
#spent-text { margin: .45rem 0 1.1rem; }
.ledger hr.rule { border: 0; height: 1px; margin: 1.15rem 0; background: var(--line); }
.chosen { list-style: none; margin: .55rem 0 0; padding: 0; display: grid; gap: .35rem; font-size: .9rem; }
.chosen li { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.chosen li span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chosen li .c { font-family: var(--font-mono); font-size: .78rem; color: var(--gold-bright); flex: none; }
.chosen li .c.neg { color: var(--ok); }
.chosen .none { color: var(--ink-faint); font-style: italic; font-family: var(--font-lore); font-size: 1rem; }
.ledger ul.problems { list-style: none; margin: .55rem 0 0; padding: 0; font-size: .9rem; display: grid; gap: .45rem; color: #ffc6ce; }
.ledger ul.problems li { display: flex; gap: .55rem; align-items: flex-start; line-height: 1.4; }
.ledger ul.problems li::before { content: "!"; flex: none; display: grid; place-items: center; width: 1.15rem; height: 1.15rem; margin-top: .05rem; border-radius: 50%;
  font: 700 .7rem/1 var(--font-ui); color: #fff; background: var(--crimson); }
.ledger ul.problems:focus { outline: 2px solid var(--err); outline-offset: 4px; border-radius: 6px; }
.all-good { color: var(--ok); font-size: .95rem; font-weight: 600; display: flex; align-items: center; gap: .45rem; margin: .55rem 0 0; }
.all-good svg { width: 1.15rem; height: 1.15rem; }
.ledger .actions { display: grid; grid-template-columns: 1fr; gap: .6rem; margin-top: 1.2rem; }
.ledger .actions .btn { width: 100%; }
.ledger .actions .btn.primary { order: -1; min-height: 50px; }
.ledger .note { margin: .8rem 0 0; font-size: .82rem; color: var(--ink-faint); line-height: 1.5; }
.ledger-nav { display: grid; gap: .1rem; margin: 0; padding: 0; list-style: none; counter-reset: sec; }
.ledger-nav a { display: flex; align-items: center; gap: .7rem; padding: .45rem .6rem; border-radius: 8px; text-decoration: none; color: var(--ink-dim); font-size: .9rem; }
.ledger-nav a:hover { background: rgba(216, 180, 106, .07); color: var(--gold-bright); }
.ledger-nav a span { font-family: var(--font-heading); font-weight: 700; color: var(--gold); width: 1.6rem; text-align: center; font-size: .8rem; }

.races { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: .85rem; }
.race-option { position: relative; }
.race-option input { position: absolute; opacity: 0; inset: 0; pointer-events: none; }
.race-option label {
  position: relative; display: grid; gap: .4rem; align-content: start; height: 100%; cursor: pointer; padding: 1.05rem 1.1rem; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(9, 7, 14, .6);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s var(--ease-out);
}
.race-option label:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.race-option label::after {
  content: ""; position: absolute; top: .85rem; right: .85rem; width: 1.2rem; height: 1.2rem; border-radius: 50%;
  border: 1px solid var(--line-strong); background: rgba(5, 4, 9, .7);
}
.race-option input:checked + label {
  border-color: var(--gold); background: rgba(46, 36, 26, .72);
  box-shadow: 0 0 0 1px rgba(216, 180, 106, .35) inset;
}
.race-option input:checked + label::after {
  border-color: var(--gold); background: var(--gold-bright);
  box-shadow: inset 0 0 0 3.5px #1a1320;
}
.race-option input:focus-visible + label { outline: 2px solid var(--arcane); outline-offset: 2px; }
.race-option strong { font-family: var(--font-heading); font-weight: 700; font-size: 1.08rem; letter-spacing: .06em; padding-right: 1.6rem; }
.race-option .desc { font-family: var(--font-lore); font-size: 1.05rem; color: var(--ink-dim); line-height: 1.35; }
.mods { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .2rem; }
.mod { font-family: var(--font-ui); font-weight: 600; font-size: .72rem; padding: .14rem .45rem; border-radius: 5px; border: 1px solid var(--line-soft); background: rgba(5, 4, 9, .5); }
.mod.up { color: var(--ok); border-color: rgba(123, 227, 161, .25); }
.mod.down { color: var(--err); border-color: rgba(255, 107, 127, .25); }
.mod.perk { color: var(--gold-bright); border-color: rgba(216, 180, 106, .25); }

.height-field { margin: 1.4rem 0 0; }
.height-control { display: flex; align-items: center; gap: 1.1rem; }
.height-control output {
  font-family: var(--font-heading); font-weight: 700; font-size: 1.5rem; color: var(--gold-bright);
  min-width: 4.5ch; text-align: right; font-variant-numeric: tabular-nums;
}
.height-track { flex: 1; min-width: 0; }
.height-control input[type="range"] {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 44px; margin: 0; padding: 0;
  background: transparent; border: 0; cursor: pointer;
}
.height-control input[type="range"]:focus { background: transparent; box-shadow: none; }
.height-control input[type="range"]:focus-visible { outline: 2px solid var(--arcane); outline-offset: 2px; border-radius: 6px; }
.height-control input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px; border: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(216, 180, 106, .12), rgba(216, 180, 106, .5));
}
.height-control input[type="range"]::-moz-range-track {
  height: 6px; border-radius: 3px; border: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(216, 180, 106, .12), rgba(216, 180, 106, .5));
}
.height-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%;
  background: var(--gold-bright); border: 3px solid #1a1320; box-shadow: 0 0 0 1px var(--gold), 0 2px 8px rgba(0, 0, 0, .5);
}
.height-control input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold-bright); border: 3px solid #1a1320; box-shadow: 0 0 0 1px var(--gold), 0 2px 8px rgba(0, 0, 0, .5);
}
.height-ends {
  display: flex; justify-content: space-between; margin-top: -.45rem;
  font-size: .8rem; color: var(--ink-faint); font-variant-numeric: tabular-nums;
}
.meta-line .height, .card .height { font-size: .9rem; color: var(--ink-dim); }

.stat-table { width: 100%; border-collapse: collapse; }
.stat-table thead th { text-align: center; font-family: var(--font-ui); font-size: .7rem; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); padding: 0 .4rem .55rem; }
.stat-table thead th:first-child { text-align: left; padding-left: 0; }
.stat-table tbody th { text-align: left; font-weight: 400; }
.stat-table td, .stat-table tbody th { padding: .8rem .4rem; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.stat-table tbody th { padding-left: 0; }
.stat-table tr.group td { border-top: 0; padding: 1.3rem 0 .45rem; font-family: var(--font-heading); font-weight: 700; font-size: .74rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.stat-table tr.group:first-child td { padding-top: .2rem; }
.stat-table tr[data-stat]:hover { background: rgba(216, 180, 106, .03); }
.stat-name { font-family: var(--font-heading); letter-spacing: .05em; font-weight: 700; color: #f4ead6; }
.stat-name label { cursor: pointer; font-size: 1.02rem; }
.stat-name small { display: block; font-family: var(--font-ui); font-weight: 400; letter-spacing: 0; color: var(--ink-faint); font-size: .84rem; line-height: 1.4; margin-top: .15rem; max-width: 46ch; }
.stat-arcana .stat-name, .stat-arcana.stat-name { color: var(--arcana); }
.stat-occulta .stat-name, .stat-occulta.stat-name { color: var(--occulta); }
.stat-artifice .stat-name, .stat-artifice.stat-name { color: var(--artifice); }
.stat-table .w-step { width: 1%; }
.stat-table .w-num { width: 4.2rem; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: rgba(5, 4, 9, .65); }
.stepper button { width: 2.6rem; height: 2.75rem; border: 0; background: transparent; color: var(--gold-bright); font-size: 1.2rem; cursor: pointer; font-family: var(--font-ui); font-weight: 500; transition: background .15s ease; }
.stepper button:hover:not([disabled]) { background: rgba(216, 180, 106, .14); }
.stepper button:active:not([disabled]) { background: rgba(216, 180, 106, .24); }
.stepper button[disabled] { color: var(--ink-faint); cursor: not-allowed; opacity: .4; }
.stepper input { width: 3rem; min-height: 0; height: 2.75rem; border: 0; border-inline: 1px solid var(--line); border-radius: 0; text-align: center; padding: 0;
  font-family: var(--font-mono); font-weight: 600; font-size: 1.02rem; background: transparent; -moz-appearance: textfield; appearance: textfield; }
.stepper input:focus { box-shadow: inset 0 0 0 2px rgba(111, 227, 214, .55); }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pips { display: flex; gap: 3px; justify-content: center; margin-top: .45rem; }
.pips i { width: 9px; height: 5px; border-radius: 2px; background: rgba(239, 232, 219, .1); transition: background .2s ease; }
.pips i.zero { width: 2px; background: rgba(239, 232, 219, .35); }
.pips i.on { background: var(--gold); }
.pips i.on.steep { background: var(--crimson-bright); }
.pips i.on.neg { background: var(--ok); }
.num-cell { font-family: var(--font-mono); text-align: center; white-space: nowrap; color: var(--ink-faint); }
.num-cell.final { font-family: var(--font-heading); font-weight: 700; font-size: 1.35rem; color: var(--gold-bright); font-variant-numeric: lining-nums; }
.num-cell .pos { color: var(--ok); font-weight: 600; }
.num-cell .neg { color: var(--err); font-weight: 600; }

.perk-group { margin-bottom: 1.75rem; }
.perk-group:last-child { margin-bottom: 0; }
.perk-group > h3 { display: flex; align-items: center; gap: .6rem; font-size: .82rem; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--cat, var(--gold)); margin-bottom: .9rem; }
.perk-group > h3::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--cat, var(--gold)) 25%, transparent); }
.perk-group > h3 svg { width: 1.25rem; height: 1.25rem; }
.perk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: .85rem; }
.perk { position: relative; }
.perk input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.perk label, .perk .perk-card {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: .25rem .85rem; height: 100%; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.05rem; background: rgba(9, 7, 14, .6);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s var(--ease-out);
}
.perk label:hover { border-color: color-mix(in srgb, var(--cat, var(--gold)) 50%, transparent); transform: translateY(-1px); }
.perk .icon {
  position: relative; grid-row: span 2; width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--cat, var(--gold)) 40%, transparent); color: var(--cat, var(--gold));
  background: color-mix(in srgb, var(--cat, var(--gold)) 10%, rgba(5, 4, 9, .8));
  transition: background .2s ease, color .2s ease;
}
.perk .icon svg { width: 1.3rem; height: 1.3rem; }
.perk .title { font-family: var(--font-heading); letter-spacing: .04em; font-weight: 700; align-self: center; line-height: 1.25; color: #f4ead6; }
.perk .cost { align-self: start; padding-top: .1rem; }
.perk .body { grid-column: 2 / -1; font-size: .9rem; color: var(--ink-dim); line-height: 1.5; }
.perk .body p { margin: 0 0 .4rem; }
.perk .effects { display: flex; flex-wrap: wrap; gap: .3rem; margin: .35rem 0; }
.perk .effects span { font-family: var(--font-ui); font-weight: 600; font-size: .72rem; color: var(--arcane); border: 1px solid rgba(111, 227, 214, .25); background: rgba(16, 60, 58, .25); border-radius: 5px; padding: .1rem .45rem; }
.perk ul.reqs { list-style: none; margin: .45rem 0 0; padding: 0; font-size: .84rem; display: grid; gap: .15rem; }
.perk ul.reqs li { display: flex; gap: .45rem; align-items: baseline; color: var(--ink-faint); }
.perk ul.reqs li::before { content: "◇"; color: var(--ink-faint); font-size: .8em; }
.perk ul.reqs li.met { color: var(--ok); }
.perk ul.reqs li.met::before { content: "◆"; color: var(--ok); }
.perk ul.reqs li.unmet { color: #ffa3b0; }
.perk ul.reqs li.unmet::before { content: "◇"; color: var(--err); }
.perk .when { grid-column: 2 / -1; margin: 0; font-size: .7rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.perk .group-tag { font-size: .75rem; color: var(--ink-faint); margin: .45rem 0 0; display: flex; gap: .35rem; align-items: center; }
.perk input:checked + label {
  border-color: var(--cat, var(--gold));
  background: color-mix(in srgb, var(--cat, var(--gold)) 10%, rgba(9, 7, 14, .78));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cat, var(--gold)) 45%, transparent) inset;
}
.perk input:checked + label .icon { background: var(--cat, var(--gold)); color: #120c08; border-color: transparent; }
.perk input:checked + label .icon::after {
  content: ""; position: absolute; right: -4px; bottom: -4px; width: 1.05rem; height: 1.05rem; border-radius: 50%;
  background: var(--ok) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23052010' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12.5l4.5 4.5L19 7.5'/></svg>") center / 70% no-repeat;
  box-shadow: 0 0 0 2px var(--bg);
}
.perk input:focus-visible + label { outline: 2px solid var(--arcane); outline-offset: 2px; }
.perk.blocked label { background: rgba(9, 7, 14, .4); border-style: dashed; }
.perk.blocked .title { color: var(--ink-dim); }
.perk.blocked .icon { filter: grayscale(.85); opacity: .7; }
.perk.blocked input:checked + label { border-color: var(--err); border-style: solid; box-shadow: 0 0 0 1px rgba(255, 107, 127, .4) inset; }
.perk.blocked input:checked + label .icon { background: var(--err); filter: none; opacity: 1; }
.perk.blocked input:checked + label .icon::after { background-color: var(--err); background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'><path d='M12 6v8M12 18v.5'/></svg>"); }
.perk.granted label { cursor: default; border-style: dashed; border-color: rgba(216, 180, 106, .35); }
.perk.granted label:hover { transform: none; }
.perk.granted .cost::before { content: "From your race"; font-size: .68rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin-right: .4rem; }
.perk.granted .cost .chip { display: none; }

.cat-origin { --cat: #d9b98a; }
.cat-physical { --cat: #f0a066; }
.cat-magic { --cat: var(--violet); }
.cat-social { --cat: #ecd27a; }
.cat-patron { --cat: #c67cf0; }
.cat-corruption { --cat: var(--crimson-bright); }
.cat-narrative { --cat: #a9c3d8; }
.cat-flaw { --cat: var(--ok); }
.cat-unknown { --cat: var(--ink-faint); }

.counter { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-faint); text-align: right; }
.counter.over { color: var(--err); }
textarea.story-input { font-family: var(--font-lore); font-size: 1.2rem; line-height: 1.55; font-weight: 500; }

.mobile-points { display: none; }

/* Application view -------------------------------------------------------- */

.sheet-head { display: flex; gap: 1.25rem; align-items: center; }
.sheet-head .meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin-top: .55rem; }
.sheet-head .race { font-family: var(--font-lore); font-style: italic; font-size: 1.2rem; color: var(--ink-dim); }
.sheet { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.75rem; align-items: start; }
.sheet aside { display: grid; gap: 1.25rem; }
.sheet aside .panel + .panel { margin-top: 0; }
.sheet .story { white-space: pre-line; font-family: var(--font-lore); font-weight: 500; font-size: 1.24rem; line-height: 1.6; color: #ece4d6; margin: 0; max-width: 68ch; }
.sheet .story::first-letter { font-family: var(--font-display); font-size: 3.3em; float: left; line-height: .85; padding: .06em .06em 0 0; color: var(--title-gold); }
.notice-box .story, .error-box .story { white-space: pre-line; }
.panel h2 { font-size: 1.35rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0; }
.kv dt { font-size: .74rem; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); padding-top: .15rem; }
.kv dd { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 136px), 1fr)); gap: .7rem; }
.stat-tile { --pad-bottom: .8rem; border: 1px solid var(--line-soft); border-radius: 12px; padding: .75rem .9rem var(--pad-bottom);
  background: linear-gradient(var(--tone, transparent), var(--tone, transparent)) .9rem 0 / 1.6rem 2px no-repeat, rgba(5, 4, 9, .5); overflow: hidden; }
.stat-tile .n { font-family: var(--font-heading); font-size: 1.75rem; font-weight: 700; color: var(--gold-bright); line-height: 1.1; margin: .2rem 0 .1rem; font-variant-numeric: lining-nums; }
.stat-tile .l { font-size: .72rem; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--tone-text, var(--ink-dim)); }
.stat-tile .x { font-size: .76rem; color: var(--ink-faint); }
.stat-tile.zero .n { color: var(--ink-faint); }
.stat-tile.stat-arcana { --tone: var(--arcana); --tone-text: var(--arcana); }
.stat-tile.stat-occulta { --tone: var(--occulta); --tone-text: var(--occulta); }
.stat-tile.stat-artifice { --tone: var(--artifice); --tone-text: var(--artifice); }
.perk-list { display: grid; gap: .75rem; padding: 0; margin: 0; list-style: none; }
.perk-list li { display: flex; gap: .85rem; align-items: flex-start; }
.perk-list .pi { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; color: var(--cat, var(--gold));
  border: 1px solid color-mix(in srgb, var(--cat, var(--gold)) 40%, transparent); background: rgba(5, 4, 9, .6); }
.perk-list .pi svg { width: 1.15rem; height: 1.15rem; }
.perk-list strong { font-family: var(--font-heading); font-weight: 700; letter-spacing: .03em; }
.perk-list .muted { color: var(--ink-faint); font-size: .88rem; }
.subhead { font-family: var(--font-ui); font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 .7rem; }
.perk-list + .subhead { margin-top: 1.4rem; }
.review textarea { min-height: 7.5rem; }
.review .all-good { margin-bottom: 1rem; }
.review .actions { display: grid; grid-template-columns: 1fr; gap: .55rem; }
.review .actions .btn { width: 100%; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.1rem; display: grid; gap: .85rem; font-size: .92rem; position: relative; }
.timeline::before { content: ""; position: absolute; left: .3rem; top: .5rem; bottom: .5rem; width: 1px; background: var(--line-strong); }
.timeline li { position: relative; display: grid; gap: .05rem; color: var(--ink); }
.timeline li::before { content: ""; position: absolute; left: -1.08rem; top: .45rem; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid var(--gold); }
.timeline li:last-child::before { background: var(--gold); }
.timeline time { font-size: .8rem; color: var(--ink-faint); }

/* GM queue ---------------------------------------------------------------- */

.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.4rem; padding: .35rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(9, 7, 14, .55); width: fit-content; max-width: 100%; }
.tabs a { text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; font-family: var(--font-heading); font-weight: 600; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); padding: .55rem .9rem; border-radius: 10px; }
.tabs a:hover { color: var(--gold-bright); background: rgba(216, 180, 106, .06); }
.tabs a[aria-current="page"] { color: #1b1208; background: var(--gold); }
.tabs a .count { font-family: var(--font-ui); font-weight: 700; font-size: .72rem; letter-spacing: 0; min-width: 1.4rem; text-align: center; padding: .05rem .35rem; border-radius: 99px; background: rgba(239, 232, 219, .08); color: var(--ink-dim); }
.tabs a[aria-current="page"] .count { background: rgba(27, 18, 8, .2); color: #1b1208; }
.table-wrap { overflow-x: auto; }
.panel.table-wrap { padding: .4rem 0; }
table.queue { width: 100%; border-collapse: collapse; }
table.queue th { text-align: left; font-size: .7rem; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); padding: .8rem 1.2rem; border-bottom: 1px solid var(--line); }
table.queue td { padding: 1rem 1.2rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.queue tr:last-child td { border-bottom: 0; }
table.queue tbody tr { transition: background .15s ease; }
table.queue tbody tr:hover td { background: rgba(216, 180, 106, .04); }
table.queue .who-cell { display: flex; align-items: center; gap: .85rem; }
table.queue .crest { width: 2.6rem; height: 2.6rem; font-size: 1.05rem; }
table.queue td a.name { font-family: var(--font-heading); font-weight: 700; letter-spacing: .04em; text-decoration: none; color: #f7efdf; font-size: 1.05rem; }
table.queue td a.name:hover { color: var(--gold-bright); }
table.queue td .sub { font-size: .8rem; color: var(--ink-faint); }

/* Catalog ----------------------------------------------------------------- */

.toc { position: sticky; top: 4.35rem; z-index: 5; display: flex; gap: .4rem; margin: 0 0 2rem; padding: .45rem; border-radius: 14px;
  background: rgba(9, 7, 14, .82); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  width: fit-content; max-width: 100%; overflow-x: auto; }
.toc a { flex: none; text-decoration: none; display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .95rem; border-radius: 10px;
  font-family: var(--font-heading); font-weight: 600; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); }
.toc a:hover { color: var(--gold-bright); background: rgba(216, 180, 106, .07); }
.toc a .n { font-family: var(--font-ui); font-size: .72rem; letter-spacing: 0; color: var(--ink-faint); }
.catalog-section { scroll-margin-top: 8.5rem; margin-bottom: 3.5rem; }
.catalog-section > h2 { display: flex; align-items: center; gap: .8rem; }
.catalog-section > h2::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.catalog-section .section-intro { margin-top: -.2rem; }
.race-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 1.1rem; }
.race-cards .card .desc { font-family: var(--font-lore); font-size: 1.08rem; color: var(--ink-dim); line-height: 1.4; margin: 0; }
.skill-table { width: 100%; border-collapse: collapse; }
.skill-table td, .skill-table th { padding: .8rem 1.1rem; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.skill-table tbody tr:last-child > * { border-bottom: 0; }
.skill-table thead th { font-size: .7rem; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); border-bottom-color: var(--line); }
.skill-table tbody tr:hover > * { background: rgba(216, 180, 106, .03); }
.skill-table tbody th { font-family: var(--font-heading); font-weight: 700; letter-spacing: .04em; color: #f4ead6; white-space: nowrap; }
.catalog-perks .perk label { cursor: default; }
.show-sm { display: none; }
.skill-table .stat-name small, .skill-table th small { display: none; }
.badge-gm { color: var(--crimson-bright); border-color: rgba(255, 107, 130, .5); }

/* Auth -------------------------------------------------------------------- */

.auth-page main, main.auth-main { padding-block: 0; display: flex; }
.auth { flex: 1; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: calc(100vh - 4.3rem); }
.auth-art { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: flex-end; padding: clamp(2rem, 5vw, 4rem); border-right: 1px solid var(--line); }
.auth-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; filter: saturate(.8) brightness(.8) contrast(1.1); }
.auth-art::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(7, 6, 11, .05) 30%, rgba(7, 6, 11, .88)); }
.auth-art blockquote { margin: 0; max-width: 30rem; }
.auth-art blockquote p { font-family: var(--font-lore); font-style: italic; font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.3; color: #f2ead9; text-shadow: 0 2px 14px rgba(0, 0, 0, .8); margin-bottom: .8rem; }
.auth-art blockquote footer { font-family: var(--font-heading); font-size: .74rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: clamp(2rem, 5vw, 4rem) 1rem; }
.auth-form .inner { width: min(420px, 100%); }
.auth-form .sigil { display: block; width: 64px; height: 64px; margin: 0 0 1.4rem; }
.auth-form h1 { font-size: clamp(2rem, 3.6vw, 2.6rem); margin-bottom: .3rem; }
.auth-form .sub { color: var(--ink-dim); font-family: var(--font-lore); font-style: italic; font-size: 1.2rem; line-height: 1.4; margin-bottom: 1.8rem; }
.auth-form .btn[type="submit"] { width: 100%; min-height: 50px; margin-top: .5rem; }
.auth-form .alt { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line-soft); color: var(--ink-dim); font-size: .95rem; }
.auth-form .error-box p { margin: 0; }

/* Error ------------------------------------------------------------------- */

.error-page { text-align: center; padding-block: clamp(2rem, 8vw, 5rem); }
.error-page .code-wrap { position: relative; width: min(320px, 70vw); aspect-ratio: 1; margin: 0 auto 1.25rem; display: grid; place-items: center; }
.error-page .code-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .45; animation: turn 160s linear infinite; }
.error-page .code { position: relative; font-family: var(--font-display); font-weight: 700; font-size: clamp(3.6rem, 13vw, 6rem); line-height: 1;
  color: var(--title-gold); text-shadow: var(--title-shadow); }
.error-page p.dim { font-family: var(--font-lore); font-style: italic; font-size: 1.25rem; }

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

.site-foot { border-top: 1px solid var(--line); padding-block: 2.2rem 2rem; color: var(--ink-faint); font-size: .86rem; background: rgba(7, 6, 11, .6); }
.site-foot .cols { display: flex; gap: 1.5rem 3rem; justify-content: space-between; flex-wrap: wrap; align-items: flex-start; }
.site-foot .brandline { display: flex; gap: .8rem; align-items: center; }
.site-foot .brandline img { width: 30px; height: 30px; opacity: .9; }
.site-foot .brandline b { display: block; font-family: var(--font-heading); letter-spacing: .2em; color: var(--ink-dim); font-size: .9rem; }
.site-foot nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.site-foot nav a { color: var(--ink-dim); text-decoration: none; font-family: var(--font-heading); font-weight: 600; font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; }
.site-foot nav a:hover { color: var(--gold-bright); }
.site-foot .credits { margin: 1.4rem 0 0; font-size: .76rem; color: #7d7590; }
.site-foot .credits a { color: inherit; }
.site-foot .rune { font-family: var(--font-mono); letter-spacing: .4em; color: var(--gold-deep); }

/* Character pages ---------------------------------------------------------- */

.accent-crimson { --tint: #ff7d8f; }
.accent-ember { --tint: #f0a066; }
.accent-gold { --tint: #d8b46a; }
.accent-moss { --tint: #a3d98a; }
.accent-teal { --tint: #6fe3d6; }
.accent-frost { --tint: #93c5f2; }
.accent-violet { --tint: #a593ff; }
.accent-orchid { --tint: #e394dc; }

.portrait { display: block; background: var(--bg-3); border: 1px solid color-mix(in srgb, var(--tint, var(--gold)) 55%, transparent); }
.portrait.thumb, .crest.thumb { width: 3.4rem; height: 3.4rem; border-radius: 50%; flex: none; object-fit: cover; }
.portrait.lg { width: 8rem; height: auto; max-height: 11rem; object-fit: contain; border-radius: 12px; padding: 3px; }
.portrait.xl { width: 100%; height: auto; max-height: 20rem; object-fit: contain; border-radius: 14px; padding: 4px; }
.crest.xl { width: 7rem; height: 7rem; font-size: 3rem; }
.profile .crest, .char-card .crest { border-color: color-mix(in srgb, var(--tint, var(--gold)) 55%, transparent); }

.profile-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.25rem 2rem; align-items: end; margin-bottom: 1.75rem; }
.profile-portrait { width: clamp(8rem, 17vw, 13rem); display: grid; justify-items: start; }
.profile-id { min-width: 0; }
.profile-id h1 { margin: 0 0 .5rem; }
.profile-id .eyebrow a, .page-head .eyebrow a { color: inherit; text-decoration: none; }
.profile-id .eyebrow a:hover, .page-head .eyebrow a:hover { color: var(--gold-bright); text-decoration: underline; }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; }
.meta-line .race { font-family: var(--font-lore); font-style: italic; font-size: 1.2rem; color: var(--ink-dim); }
.played-by { margin: .55rem 0 0; color: var(--ink-dim); }
.played-by b { color: var(--ink); font-weight: 600; }
.since { margin: .15rem 0 0; font-size: .85rem; color: var(--ink-faint); }
.profile-actions form { margin: 0; }
.profile-head.compact { grid-template-columns: auto minmax(0, 1fr); align-items: center; margin-bottom: 1.5rem; }
.profile-head.compact .profile-portrait { width: auto; }
.profile-head.compact h2 { margin: 0 0 .3rem; }

.page-toc { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; padding: .7rem 0; margin-bottom: 2.25rem; border-block: 1px solid var(--line-soft); font-size: .9rem; }
.page-toc a { color: var(--ink-dim); text-decoration: none; }
.page-toc a:hover { color: var(--tint, var(--gold-bright)); text-decoration: underline; }

.profile-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2.5rem; align-items: start; }
.prose-block { scroll-margin-top: 5.5rem; }
.prose-block + .prose-block { margin-top: 3rem; }
.rule-head { position: relative; font-size: 1.45rem; padding-bottom: .65rem; margin-bottom: 1.3rem; }
.rule-head::after { content: ""; position: absolute; left: 0; bottom: 0; width: 3rem; height: 2px; border-radius: 2px; background: var(--tint, var(--gold)); }
.rule-head.marked::before { content: "\25C6"; display: inline-block; margin-right: .6rem; font-size: .55em; vertical-align: .25em; color: var(--tint, var(--gold)); }
.prose { max-width: 68ch; font-family: var(--font-lore); font-weight: 500; font-size: 1.25rem; line-height: 1.68; color: #ebe3d5; overflow-wrap: break-word; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table { margin: 0 0 1em; }
.prose > :last-child { margin-bottom: 0; }
.prose strong { font-weight: 600; color: #f7efdf; }
.prose h3, .prose h4, .prose h5 { font-family: var(--font-heading); font-weight: 600; letter-spacing: .04em; color: #f4ead6; margin: 1.7em 0 .55em; line-height: 1.25; }
.prose h3 { font-size: 1.12rem; }
.prose h4 { font-size: .98rem; color: var(--ink-dim); }
.prose h5 { font-size: .84rem; letter-spacing: .08em; color: var(--ink-faint); }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .3em; }
.prose li::marker { color: var(--tint, var(--gold)); }
.prose blockquote { padding: .1em 0 .1em 1.1em; border-left: 2px solid color-mix(in srgb, var(--tint, var(--gold)) 60%, transparent); color: var(--ink-dim); font-style: italic; }
.prose a { color: var(--tint, var(--gold-bright)); text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.prose a:hover { text-decoration-color: currentColor; }
.prose s { color: var(--ink-faint); text-decoration-color: color-mix(in srgb, currentColor 70%, transparent); }
.prose code { font-family: var(--font-mono); font-size: .76em; font-weight: 450; padding: .08em .35em; border-radius: 5px; border: 1px solid var(--line-soft); background: rgba(216, 180, 106, .07); color: #f1e6cf; overflow-wrap: break-word; }
.prose pre { max-width: 100%; overflow-x: auto; padding: .85rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid var(--line-soft); background: rgba(7, 6, 11, .55); font-size: .86rem; font-weight: 400; line-height: 1.6; }
.prose pre code { font-size: inherit; padding: 0; border: 0; border-radius: 0; background: none; overflow-wrap: normal; white-space: pre; }
.prose hr { height: auto; margin: 1.4em 0; border: 0; text-align: center; color: color-mix(in srgb, var(--tint, var(--gold)) 80%, transparent); overflow: visible; }
.prose hr::before { content: "\00B7 \00B7 \00B7"; letter-spacing: .8em; padding-left: .8em; font-size: 1.6rem; line-height: 1; }
.prose table { display: block; width: max-content; max-width: 100%; overflow-x: auto; border-collapse: collapse; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(7, 6, 11, .35); font-size: 1.08rem; line-height: 1.45; }
.prose th, .prose td { padding: .5em .9em; text-align: left; min-width: 6.5em; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.prose th + th, .prose td + td { border-left: 1px solid var(--line-soft); }
.prose th { font-family: var(--font-heading); font-size: .8rem; font-weight: 600; letter-spacing: .06em; color: #f4ead6; border-bottom-color: var(--line); white-space: nowrap; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose .align-left { text-align: left; }
.prose .align-center { text-align: center; }
.prose .align-right { text-align: right; }
.prose .task-list-item { position: relative; list-style: none; }
.prose .task-list-item input { appearance: none; width: .8em; height: .8em; position: absolute; left: -1.3em; top: .56em; margin: 0; border: 1px solid color-mix(in srgb, var(--tint, var(--gold)) 70%, transparent); border-radius: 3px; background: rgba(7, 6, 11, .5); }
.prose .task-list-item input:checked { background: var(--tint, var(--gold)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6l4.6-5' fill='none' stroke='%2307060b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
.prose .footnote-ref { font-size: .62em; line-height: 0; }
.prose .footnote-ref a { padding: 0 .12em; text-decoration: none; font-family: var(--font-ui); font-weight: 600; }
.prose .footnotes-sep { display: none; }
.prose .footnotes { margin-top: 2em; padding-top: .9em; border-top: 1px solid var(--line-soft); font-size: 1.02rem; line-height: 1.55; color: var(--ink-dim); }
.prose .footnotes-list { margin: 0; }
.prose .footnote-item p { margin: 0 0 .4em; }
.prose .footnote-backref { text-decoration: none; font-family: var(--font-ui); font-size: .8em; }
.prose .footnote-item, .prose .footnote-ref a { scroll-margin-top: 5.5rem; }
.prose .footnote-item:target, .prose .footnote-ref a:target { background: rgba(216, 180, 106, .08); border-radius: 4px; }

.profile-side .panel h2 { margin-bottom: 1rem; }
.stat-grid.compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 112px), 1fr)); gap: .5rem; }
.stat-grid.compact .stat-tile { --pad-bottom: .6rem; padding: .55rem .65rem var(--pad-bottom); }
.stat-grid.compact .stat-tile .l { font-size: .64rem; letter-spacing: .1em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-grid.compact .stat-tile .n { font-size: 1.35rem; margin: .15rem 0 0; }
.perks-head { margin-top: 1.5rem; }
.profile-side .perk-list .muted { font-size: .86rem; line-height: 1.45; margin-top: .15rem; }
.perk-list .perk-tags { font-size: .68rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-top: .2rem; }
.perk-list .perk-tags span + span::before { content: " · "; }
.perk-list .perk-tags .secret { color: var(--err); }
.perk-list .effects { font-size: .8rem; font-weight: 600; color: var(--arcane); margin-top: .25rem; }

.gm-logs { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--line-soft); scroll-margin-top: 5.5rem; }
.gm-logs > .rule-head { margin-bottom: .4rem; }
.gm-logs > .rule-head::after { background: var(--crimson-bright); }
.gm-logs > p { margin: 0 0 1.4rem; }
.gm-logs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.gm-logs-grid .panel { margin: 0; scroll-margin-top: 5.5rem; }
.gm-logs-grid h3 { font-size: 1.15rem; margin-bottom: .9rem; }
.log-list { list-style: none; margin: 0 0 .8rem; padding: 0; }
.log-list li { padding: .6rem 0 .6rem .9rem; border-left: 2px solid var(--line); }
.log-list li + li { border-top: 1px solid var(--line-soft); }
.log-list li.rising { border-left-color: var(--crimson-bright); }
.log-list li.falling { border-left-color: var(--ok); }
.log-list .what { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; }
.log-list .what b { font-weight: 650; color: var(--ink); }
.log-list li.rising .what b { color: var(--crimson-bright); }
.log-list li.falling .what b { color: var(--ok); }
.log-list .what a { font-weight: 600; }
.log-list .sub { font-size: .82rem; color: var(--ink-faint); margin-top: .15rem; overflow-wrap: anywhere; }

.credits-section + .credits-section { margin-top: 2.75rem; }
.credit-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 1rem; }
.credit-list li { padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(7, 6, 11, .35); scroll-margin-top: 5.5rem; }
.credit-list h3 { font-size: 1.15rem; margin: 0 0 .2rem; }
.credit-list h3 a { text-decoration: none; }
.credit-list h3 a:hover { text-decoration: underline; }
.credit-list p { margin: .35rem 0 0; }
.credit-list .by { font-size: .88rem; color: var(--ink-dim); margin-top: 0; }
.credit-list .by b { color: var(--ink); font-weight: 600; }
.credit-list .licence { font-size: .82rem; color: var(--ink-faint); }
.credits-page .disclaimer { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line-soft); }

.guide-page .toc { flex-wrap: wrap; }
.guide-section { scroll-margin-top: 8rem; max-width: 52rem; }
.guide-section + .guide-section { margin-top: 2.75rem; }
.guide-section h3 { font-size: 1.15rem; margin: 1.6rem 0 .5rem; }
.guide-section ul, .guide-section ol { padding-left: 1.4em; }
.guide-section li + li { margin-top: .4em; }
.guide-section li::marker { color: var(--gold); }
.guide-section code, .guide-faq code { font-family: var(--font-mono); font-size: .8em; padding: .08em .35em; border-radius: 5px; border: 1px solid var(--line-soft);
  background: rgba(216, 180, 106, .07); color: #f1e6cf; overflow-wrap: anywhere; }
.guide-section pre { max-width: 100%; overflow-x: auto; padding: .85rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid var(--line-soft);
  background: rgba(7, 6, 11, .55); font-size: .84rem; line-height: 1.6; }
.guide-section pre code { font-size: inherit; padding: 0; border: 0; background: none; overflow-wrap: normal; white-space: pre; }
.guide-section kbd { font-family: var(--font-mono); font-size: .82em; padding: .05em .45em; border-radius: 5px; border: 1px solid var(--line); border-bottom-width: 2px; background: rgba(7, 6, 11, .6); }
.guide-table { width: 100%; border-collapse: collapse; margin: .8rem 0 1rem; font-size: .95rem; }
.guide-table th, .guide-table td { text-align: left; vertical-align: top; padding: .5rem .75rem; border-bottom: 1px solid var(--line-soft); }
.guide-table th { font-weight: 600; color: var(--ink-dim); font-size: .85rem; }
.guide-table td:first-child { white-space: nowrap; }
.guide-figure { margin: 1.2rem 0; }
.guide-figure img { display: block; max-width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); image-rendering: pixelated; }
.guide-figure figcaption { margin-top: .5rem; font-size: .86rem; color: var(--ink-dim); }
.guide-faq { margin: 0; }
.guide-faq dt { font-weight: 600; margin-top: 1rem; }
.guide-faq dd { margin: .25rem 0 0; color: var(--ink-dim); }

.fight-facts .facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .9rem 2rem; }
.fight-facts .facts dt { font-size: .7rem; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.fight-facts .facts dd { margin: .15rem 0 0; overflow-wrap: anywhere; }
.fight-facts .facts .place { grid-column: 1 / -1; }
.table-title { font-size: 1.25rem; padding: .9rem 1.2rem .3rem; margin: 0; }
table.fighters span.name { font-family: var(--font-heading); font-weight: 700; letter-spacing: .04em; color: var(--ink-dim); font-size: 1.05rem; }
.fight-log .round-head { font-size: .78rem; font-weight: 650; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin: 1.4rem 0 .4rem; }
.log-lines { margin: 0; padding-left: 2.6rem; font-size: .93rem; line-height: 1.5; }
.log-lines li { padding: .22rem 0; }
.log-lines li::marker { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-faint); }
.log-lines .roll { margin-left: .5rem; font-size: .76rem; color: var(--ink-faint); white-space: nowrap; }
.log-lines li.k-round, .log-lines li.k-turn_start { color: var(--ink-dim); }
.log-lines li.k-encounter_start, .log-lines li.k-encounter_end { color: var(--gold-bright); font-weight: 600; }
.log-lines li.k-damage .msg, .log-lines li.k-fire .msg, .log-lines li.k-effect .msg { color: #ffb0a8; }
.log-lines li.k-heal .msg { color: var(--ok); }
.log-lines li.k-leave .msg { color: var(--crimson-bright); }
.log-lines li.hit .roll { color: var(--ok); }
.log-lines li.miss .roll { color: var(--err); }

/* Stat breakdowns: a modified stat shows where its value comes from on hover or focus, across its whole row. */
.tips { position: relative; }
.tip-host { cursor: help; }
.tip-host:focus-visible { outline: 2px solid var(--arcane); outline-offset: 2px; }
.tip {
  display: none; position: absolute; left: 0; right: 0; z-index: 6; margin-top: .4rem; padding: .6rem .8rem .65rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #16101f; box-shadow: var(--shadow-sm);
  font: 450 .82rem/1.4 var(--font-ui); letter-spacing: 0; text-transform: none; text-align: left; white-space: normal; color: var(--ink-dim); cursor: default;
}
.stat-tile > .tip { margin-top: calc(var(--pad-bottom) + 1px + .4rem); }
.statline > span > .tip { margin-top: calc(.2rem + 1px + .4rem); }
.tip-host:hover > .tip, .tip-host:focus > .tip { display: grid; gap: .2rem; }
.tip-host.tip-closed > .tip { display: none; }
.tip-head { font-weight: 650; color: var(--ink); margin-bottom: .1rem; }
.tip-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.tip-row b { font-family: var(--font-mono); font-weight: 600; color: var(--ink); white-space: nowrap; }
.tip-row.up b { color: var(--ok); }
.tip-row.down b { color: var(--err); }
.tip-row.note { font-size: .76rem; color: var(--ink-faint); }
.tip-row.unknown > span { font-style: italic; }
.tip-row.total { border-top: 1px solid var(--line-soft); padding-top: .3rem; margin-top: .1rem; color: var(--ink); }
.tip-row.total b { color: var(--gold-bright); }

.directory-tools { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; justify-content: space-between; margin-bottom: 1.75rem; }
.directory-tools .tabs { margin: 0; }
.search { display: flex; gap: .5rem; flex: 1 1 22rem; max-width: 36rem; margin: 0; }
.search input { flex: 1; min-width: 0; }
.result-line { color: var(--ink-dim); margin: -.5rem 0 1.25rem; }
.char-cards { list-style: none; margin: 0; padding: 0; }
.char-card { --accent: var(--tint, var(--gold-deep)); }
.char-card .played-by { margin: .3rem 0 0; font-size: .86rem; color: var(--ink-faint); }
.group-head { font-size: 1.1rem; letter-spacing: .08em; margin: 2.25rem 0 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
section:first-of-type > .group-head { margin-top: 0; }

.card .read-more { margin: 0; }
.card .read-more a { position: relative; z-index: 1; font-weight: 600; }

.empty.locked h1 { font-size: 1.4rem; margin: 0; }
.empty.locked .actions { margin-top: .6rem; }

.page-editor { align-items: stretch; }
.page-editor .ledger { position: static; display: flex; flex-direction: column; gap: 1.25rem; }
.page-editor .ledger .panel + .panel { margin-top: 0; }
.page-editor .ledger .panel:last-child { position: sticky; top: 5.6rem; }
.page-editor .ledger .actions { display: grid; grid-template-columns: 1fr; gap: .6rem; margin: 0; }
.page-editor .panel h2 { font-size: 1.25rem; }
.page-editor textarea.story-input { min-height: 28rem; }
.field-foot { display: flex; justify-content: space-between; gap: .5rem 1rem; align-items: baseline; flex-wrap: wrap; }
.field-foot .hint { margin: 0; flex: 1 1 18rem; }
.md-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .4rem 1rem; }
.md-tabs { display: inline-flex; gap: .2rem; margin-left: auto; padding: .2rem; border: 1px solid var(--line); border-radius: 10px; background: rgba(9, 7, 14, .55); }
.md-tab {
  min-height: 34px; padding: .35rem .85rem; border: 0; border-radius: 7px; background: transparent; cursor: pointer;
  font-family: var(--font-heading); font-weight: 600; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim);
}
.md-tab:hover { color: var(--gold-bright); background: rgba(216, 180, 106, .06); }
.md-tab[aria-selected="true"] { color: #1b1208; background: var(--gold); }
.md-tab:focus-visible { outline-offset: 2px; }
.md-preview { min-height: 9rem; padding: .9rem 1.1rem; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(5, 4, 9, .35); overflow-x: auto; }
.md-preview:focus-visible { outline-offset: 2px; border-radius: 10px; }
.md-preview[aria-busy="true"] .prose { opacity: .5; }
.md-status { margin: 0 0 .6rem; font-size: .86rem; line-height: 1.5; color: var(--ink-faint); }
.md-status:empty { display: none; }
.md-status.error { color: var(--err); }
.md-status .btn { margin-left: .4rem; vertical-align: middle; }
.section-list { display: grid; gap: 1rem; margin: 1rem 0; }
.section-edit { border: 1px solid var(--line-soft); border-radius: 12px; padding: .4rem 1.1rem 1rem; margin: 0; background: rgba(5, 4, 9, .35); }
.section-edit legend { font-family: var(--font-heading); font-weight: 700; font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); padding: 0 .4rem; }
.section-edit .field { margin-bottom: .9rem; }
.section-edit textarea { min-height: 9rem; font-family: var(--font-lore); font-size: 1.12rem; font-weight: 500; }
.section-controls { display: flex; flex-wrap: wrap; gap: .5rem; }
.portrait-preview { margin-bottom: 1.1rem; }
.portrait-preview .portrait.xl { max-height: 16rem; width: auto; max-width: 100%; }
input[type="file"] { width: 100%; font: inherit; font-size: .9rem; color: var(--ink-dim); }
input[type="file"]::file-selector-button {
  font-family: var(--font-heading); font-weight: 700; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  margin-right: .8rem; padding: .5rem .85rem; min-height: 36px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .035); color: var(--ink); cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: rgba(216, 180, 106, .08); color: #fff6df; }
.check { display: flex; gap: .55rem; align-items: center; cursor: pointer; }
.check input, .swatch-option input { accent-color: var(--gold); width: 1.05rem; height: 1.05rem; margin: 0; }
.accent-picker { margin: 0; }
.accent-picker legend { margin-bottom: .8rem; }
.swatches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.swatch-option { display: flex; align-items: center; gap: .55rem; padding: .5rem .65rem; min-height: 44px; border: 1px solid var(--line-soft); border-radius: 10px; cursor: pointer; font-size: .92rem; }
.swatch-option:hover { border-color: var(--line-strong); }
.swatch-option:has(input:checked) { border-color: var(--tint); background: rgba(255, 255, 255, .03); }
.swatch { width: 1rem; height: 1rem; border-radius: 50%; background: var(--tint); flex: none; }

.diff-panel { margin-bottom: 2.5rem; }
.diff { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-lore); font-weight: 500; font-size: 1.12rem; line-height: 1.6; color: var(--ink-dim); max-width: 80ch; margin-top: 1rem; }
.diff ins { text-decoration: none; color: #d2f7de; background: rgba(123, 227, 161, .14); border-bottom: 1px solid rgba(123, 227, 161, .55); }
.diff del { color: #ffd0d6; background: rgba(255, 107, 127, .13); text-decoration-color: rgba(255, 125, 143, .75); }
.diff ins::before, .diff ins::after, .diff del::before, .diff del::after { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(100%); white-space: nowrap; }
.diff ins::before { content: " [added: "; }
.diff del::before { content: " [removed: "; }
.diff ins::after, .diff del::after { content: "] "; }
.diff .gap { display: block; margin: .9rem 0; padding: .3rem 0; text-align: center; font-family: var(--font-ui); font-size: .78rem; letter-spacing: .08em; color: var(--ink-faint); border-block: 1px dashed var(--line-soft); }
.diff-count.ins { color: var(--ok); }
.diff-count.del { color: var(--err); }
.diff-panel .also { margin: 1rem 0 0; color: var(--ink-dim); }
.version-view { max-width: 880px; }

/* Launcher download ------------------------------------------------------- */

.download { display: grid; gap: 1.25rem; }
.download-head { display: flex; gap: 1rem; align-items: center; }
.download-head .glyph { flex: none; width: 3.4rem; height: 3.4rem; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line-strong); background: #1c1426; color: var(--gold-bright); }
.download-head .glyph svg { width: 1.6rem; height: 1.6rem; }
.download-head h2 { margin: 0 0 .2rem; }
.download-head p { margin: 0; color: var(--ink-dim); }
.download-btn { justify-self: start; min-height: 52px; padding-inline: 1.6rem; font-size: .9rem; }
.download .facts { margin: 0; display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: .9rem 2.4rem;
  padding-top: 1.1rem; border-top: 1px solid var(--line-soft); }
.download .facts > div { min-width: 0; }
.download .facts dt { font-size: .7rem; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.download .facts dd { margin: .15rem 0 0; overflow-wrap: anywhere; }
.download .facts .hash-row { grid-column: 1 / -1; }
.download .facts .hash-row dd { display: flex; gap: .7rem; align-items: flex-start; }
.download .hash { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: .8rem; line-height: 1.55; color: var(--ink-dim); word-break: break-all;
  padding: .5rem .7rem; border-radius: 8px; background: rgba(5, 4, 9, .6); border: 1px solid var(--line-soft); }
.download .hint { margin: 0; }
.download .hint code { font-family: var(--font-mono); font-size: .85em; color: var(--ink); overflow-wrap: anywhere; }
.smartscreen { margin: 1.25rem 0 0; }
.smartscreen p { margin: 0; }
.smartscreen p + p { margin-top: .6rem; }
.smartscreen b { color: var(--ink); font-weight: 650; }
.install-steps { counter-reset: step; list-style: none; padding: 0; margin: 2.2rem 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.install-steps li { counter-increment: step; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .25rem .9rem; align-content: start; }
.install-steps li::before {
  content: counter(step, upper-roman); grid-row: span 2; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  font-family: var(--font-heading); font-weight: 700; color: var(--gold-bright); font-size: .9rem; background: #1c1426; border: 1px solid var(--line-strong);
}
.install-steps strong { font-family: var(--font-heading); font-weight: 600; letter-spacing: .06em; color: #f7efdf; align-self: center; }
.install-steps span { color: var(--ink-dim); font-size: .93rem; }
.coming-soon h2 { margin: 0; font-size: 1.4rem; }
.coming-soon .actions { margin-top: .6rem; }
.platform-note { margin: 1.5rem 0 0; font-size: .88rem; text-align: center; }

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

@media (max-width: 1080px) {
  .account .who { display: none; }
  .nav a { padding-inline: .6rem; letter-spacing: .1em; }
}

@media (max-width: 980px) {
  .composer, .sheet, .profile-body, .gm-logs-grid { grid-template-columns: minmax(0, 1fr); }
  .page-editor .ledger .panel:last-child { position: static; }
  .ledger, .sheet aside { position: static; }
  .ledger-nav-panel { display: none; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2rem; }
  .steps::before { display: none; }
  .triad { grid-template-columns: minmax(0, 1fr); }
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .sigil-art { display: none; }
  .hero { min-height: 0; }
  .mobile-points {
    display: flex; justify-content: space-between; align-items: center; gap: .8rem;
    position: sticky; bottom: 0; z-index: 8; margin: 0 -1rem; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
    background: rgba(9, 7, 14, .94); border-top: 1px solid var(--line-strong); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -12px 30px -12px rgba(0, 0, 0, .9);
    grid-column: 1 / -1;
  }
  .mobile-points .mp-points { display: flex; align-items: baseline; gap: .45rem; font-size: .85rem; color: var(--ink-dim); }
  .mobile-points strong { font-family: var(--font-heading); font-weight: 700; font-size: 1.6rem; line-height: 1; color: var(--gold-bright); }
  .mobile-points.over strong { color: var(--err); }
  .mobile-points a { display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; font-size: .85rem; font-weight: 600; color: var(--ink);
    padding: .5rem .85rem; border-radius: 99px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .04); }
  .mobile-points a.bad { color: #ffc6ce; border-color: rgba(255, 107, 127, .45); background: rgba(92, 12, 29, .4); }
  .mobile-points a.good { color: var(--ok); border-color: rgba(123, 227, 161, .4); }
}

@media (max-width: 860px) {
  .nav, .account { display: none; }
  .menu { display: block; }
  .auth { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .auth-art { min-height: 220px; border-right: 0; border-bottom: 1px solid var(--line); padding: 1.5rem 1rem; }
  .auth-art blockquote p { font-size: 1.3rem; }
  .auth-form { padding: 2rem 1rem 1rem; }
  table.queue thead { display: none; }
  table.queue, table.queue tbody, table.queue tr, table.queue td { display: block; width: 100%; }
  table.queue tr { padding: 1rem 1.1rem; border-bottom: 1px solid var(--line-soft); display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; }
  table.queue tr:last-child { border-bottom: 0; }
  table.queue td { padding: 0; border: 0; }
  table.queue td.c-name { grid-column: 1 / -1; }
  table.queue td[data-label]::before { content: attr(data-label); display: block; font-size: .66rem; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
  table.queue tbody tr:hover td { background: none; }
  .install-steps { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  body { font-size: .98rem; }
  .wrap, .wrap.mid, .wrap.narrow { width: calc(100% - 2rem); }
  .page-head { margin-bottom: 1.5rem; }
  .page-head .actions, .page-head > .btn { width: 100%; }
  .page-head > .btn, .page-head .actions .btn { flex: 1 1 auto; }
  .hero { padding-block: 2.5rem 3rem; }
  .hero .actions .btn { flex: 1 1 100%; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .steps li { display: grid; grid-template-columns: auto 1fr; text-align: left; gap: 0 1rem; align-items: start; }
  .steps li::before { margin: 0; grid-row: span 2; width: 2.8rem; height: 2.8rem; }
  .steps span { margin: 0; max-width: none; }
  .stat-table .hide-sm { display: none; }
  .stat-table td, .stat-table tbody th { padding-inline: .2rem; }
  .stat-name small { font-size: .8rem; }
  .stepper button { width: 2.4rem; }
  .stepper input { width: 2.5rem; }
  .stat-table .w-num { width: 3rem; }
  .panel { border-radius: 14px; }
  .composer-main > .panel { padding-inline: 1rem; }
  .section-title { gap: .8rem; }
  .section-title .num { width: 2.3rem; height: 2.3rem; font-size: .85rem; }
  .perk label { grid-template-columns: auto 1fr; }
  .perk .cost { grid-column: 2; grid-row: 2; }
  .perk .body { grid-column: 1 / -1; }
  .perk .icon { grid-row: span 2; }
  .sheet-head .crest { display: none; }
  .tabs { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs a { flex: none; }
  .toc { width: 100%; top: 4.35rem; }
  .skill-table .hide-sm { display: none; }
  .skill-table th small.show-sm { display: block; font-family: var(--font-ui); font-weight: 400; letter-spacing: 0; white-space: normal; color: var(--ink-faint); font-size: .82rem; margin-top: .2rem; }
  .skill-table td, .skill-table th { padding-inline: .8rem; }
  .card .foot .when { margin-left: 0; width: 100%; }
  .site-foot .cols { flex-direction: column; }
  .profile-head { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .profile-portrait { width: min(10rem, 50%); }
  .profile-actions { width: 100%; }
  .profile-actions .btn, .profile-actions form { flex: 1 1 auto; }
  .profile-actions form .btn { width: 100%; }
  .prose { font-size: 1.18rem; line-height: 1.62; }
  .search { flex-basis: 100%; }
  .directory-tools .tabs { width: 100%; }
  .download-btn { justify-self: stretch; }
  .download .facts { grid-template-columns: minmax(0, 1fr); }
  .download .facts .hash-row dd { flex-direction: column; align-items: stretch; }
}
