/* ============================================================================
   ForgeWeaver — "Cartographer" theme (ultra-modern, dark).
   Ink-on-night-vellum: deep charcoal-navy grounds, antique brass + verdigris
   ley-line accents, engraved serif display, topographic textures.
   ========================================================================== */

:root {
  /* Grounds */
  --ink-900: #080b11;
  --ink-850: #0a0e14;
  --ink-800: #0d131c;
  --ink-750: #111925;
  --ink-700: #16202e;
  --panel: rgba(18, 26, 38, 0.66);
  --panel-solid: #121a26;
  --line: rgba(200, 173, 110, 0.14);
  --line-strong: rgba(200, 173, 110, 0.30);

  /* Ink & parchment text */
  --parch: #ece4d2;
  --parch-dim: #c8c0ac;
  --muted: #8b97a6;
  --muted-2: #6b7686;

  /* Accents */
  --gold: #d8b673;
  --gold-bright: #eecb86;
  --gold-deep: #a9843f;
  --ley: #58c9c0;          /* verdigris ley-line */
  --ley-dim: #3a8f89;
  --danger: #d98a6a;

  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1180px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.75);
  --glow-gold: 0 0 0 1px rgba(216, 182, 115, 0.18), 0 18px 50px -18px rgba(216, 182, 115, 0.22);

  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --display: "Cinzel", "Spectral", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--parch-dim);
  background: var(--ink-850);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Topographic / graticule background layer */
.topo-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(88, 201, 192, 0.10), transparent 60%),
    radial-gradient(1000px 620px at 8% 4%, rgba(216, 182, 115, 0.09), transparent 55%),
    linear-gradient(180deg, var(--ink-850) 0%, var(--ink-900) 100%);
}
.topo-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(200, 173, 110, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 173, 110, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  opacity: 0.5;
}
.topo-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='700' height='700'%3E%3Cg fill='none' stroke='%23c8ad6e' stroke-opacity='0.05' stroke-width='1'%3E%3Cpath d='M0 350 Q175 250 350 350 T700 350'/%3E%3Cpath d='M0 400 Q175 300 350 400 T700 400'/%3E%3Cpath d='M0 300 Q175 200 350 300 T700 300'/%3E%3Cpath d='M0 250 Q175 160 350 250 T700 250'/%3E%3Cpath d='M0 450 Q175 360 350 450 T700 450'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 700px 700px;
  opacity: 0.6;
}

/* ---- Layout helpers ------------------------------------------------------ */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
main { min-height: 60vh; }
section { position: relative; }

.eyebrow {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.72rem;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }

h1, h2, h3, h4 { color: var(--parch); font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0; }
p { margin: 0 0 1rem; }
a { color: var(--gold-bright); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--gold); }

/* ---- Buttons ------------------------------------------------------------- */
.muted { color: var(--muted); }
.btn {
  --_bg: transparent;
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--sans); font-weight: 600; font-size: 0.94rem;
  padding: 0.72em 1.25em; border-radius: 999px; border: 1px solid var(--line-strong);
  color: var(--parch); background: var(--_bg); cursor: pointer;
  transition: transform .16s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--gold {
  border-color: transparent; color: #23180a;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep));
  box-shadow: var(--glow-gold);
}
.btn--gold:hover { color: #23180a; box-shadow: 0 0 0 1px rgba(238,203,134,.4), 0 22px 50px -14px rgba(216,182,115,.5); }
.btn--ghost { background: rgba(236, 228, 210, 0.02); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-bright); }
.btn--ley { border-color: var(--ley-dim); color: var(--ley); background: rgba(88,201,192,.06); }
.btn--ley:hover { border-color: var(--ley); box-shadow: 0 0 0 1px rgba(88,201,192,.25), 0 18px 40px -16px rgba(88,201,192,.4); }
.btn--quiet { border-color: transparent; color: var(--muted); background: transparent; padding-inline: .6em; }
.btn--quiet:hover { color: var(--parch); }
.btn--lg { font-size: 1.02rem; padding: 0.92em 1.6em; }
.btn--block { width: 100%; justify-content: center; }
form.button_to { display: inline; }

/* ---- Nav ----------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  background: linear-gradient(180deg, rgba(8, 11, 17, 0.86), rgba(8, 11, 17, 0.55));
  border-bottom: 1px solid var(--line);
}
.nav.is-scrolled { background: linear-gradient(180deg, rgba(8, 11, 17, 0.94), rgba(8, 11, 17, 0.82)); box-shadow: 0 10px 30px -20px rgba(0,0,0,.9); border-bottom-color: var(--line-strong); }
.nav__inner {
  max-width: var(--maxw); margin-inline: auto; padding: 0.85rem 24px;
  display: flex; align-items: center; gap: 1.5rem;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--parch); }
.brand__mark { width: 30px; height: 30px; color: var(--gold); display: inline-flex; }
.brand__mark .compass { width: 100%; height: 100%; }
.brand__word { font-family: var(--display); font-weight: 700; letter-spacing: .06em; font-size: 1.12rem; }
.brand__word-accent { color: var(--gold); }
.nav__links { display: flex; gap: 1.4rem; margin-left: 1rem; }
.nav__links a { color: var(--muted); font-size: 0.92rem; font-weight: 500; }
.nav__links a:hover { color: var(--parch); }
.nav__actions { display: flex; align-items: center; gap: .6rem; margin-left: auto; }

/* ---- Flash --------------------------------------------------------------- */
.flash-wrap { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 60; width: min(560px, 92vw); display: grid; gap: .5rem; }
.flash {
  padding: .8rem 1.1rem; border-radius: var(--radius-sm); font-size: .92rem;
  backdrop-filter: blur(10px); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  animation: flashIn .4s ease both;
}
.flash--notice { background: rgba(88,201,192,.12); border-color: rgba(88,201,192,.4); color: #d7f5f1; }
.flash--alert { background: rgba(217,138,106,.12); border-color: rgba(217,138,106,.45); color: #f6ddcf; }
@keyframes flashIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---- Hero ---------------------------------------------------------------- */
.hero { position: relative; padding: clamp(4rem, 12vh, 9rem) 0 clamp(3rem, 7vh, 6rem); overflow: hidden; }
.hero__inner { max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; position: relative; z-index: 2; }
.hero__grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 3rem; align-items: center; }
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem); letter-spacing: -0.015em; margin: 1.2rem 0 1.1rem;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--gold-bright) 10%, var(--ley) 120%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__lede { font-family: var(--serif); font-size: clamp(1.08rem, 1.7vw, 1.32rem); color: var(--parch-dim); max-width: 34ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.hero__meta { display: flex; gap: 1.8rem; margin-top: 2.4rem; flex-wrap: wrap; }
.hero__meta .stat { display: grid; }
.hero__meta .stat b { font-family: var(--display); color: var(--gold); font-size: 1.35rem; }
.hero__meta .stat span { color: var(--muted); font-size: .82rem; letter-spacing: .04em; }

/* Hero art — a glowing charted realm */
.hero__art { position: relative; aspect-ratio: 1; }
.hero__art .ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--line); }
.hero__art .ring--2 { inset: 12%; border-color: var(--line-strong); }
.hero__art .ring--3 { inset: 26%; }
.hero__art .disc {
  position: absolute; inset: 30%; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(88,201,192,.28), transparent 60%), radial-gradient(circle at 65% 70%, rgba(216,182,115,.22), transparent 55%), rgba(13,19,28,.7);
  box-shadow: inset 0 0 60px rgba(0,0,0,.6), 0 30px 80px -30px rgba(88,201,192,.5);
  border: 1px solid var(--line-strong);
}
.hero__art .compass { position: absolute; inset: 34%; color: var(--gold); opacity: .9; filter: drop-shadow(0 6px 20px rgba(216,182,115,.4)); animation: slowspin 90s linear infinite; }
.hero__art .spark { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--ley); box-shadow: 0 0 12px 2px rgba(88,201,192,.7); }
@keyframes slowspin { to { transform: rotate(360deg); } }
.floaty { animation: floaty 7s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---- Section scaffolding ------------------------------------------------- */
.section { padding: clamp(3.5rem, 9vh, 7rem) 0; }
.section__head { max-width: 62ch; margin-bottom: 2.6rem; }
.section__head h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); margin: .8rem 0 .8rem; }
.section__head p { color: var(--muted); font-size: 1.05rem; }
.divider-ley { height: 1px; border: 0; background: linear-gradient(90deg, transparent, var(--line-strong) 20%, var(--ley-dim) 50%, var(--line-strong) 80%, transparent); margin: 0; }

/* ---- Cards / panels ------------------------------------------------------ */
.grid { display: grid; gap: 1.2rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.6rem; backdrop-filter: blur(6px);
  transition: transform .2s ease, border-color .25s ease, box-shadow .3s ease;
  position: relative; overflow: hidden;
}
.card::after { content: ""; position: absolute; inset: 0; background: radial-gradient(400px 200px at 100% 0, rgba(88,201,192,.08), transparent 70%); opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.card:hover::after { opacity: 1; }
.card__icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; color: var(--gold); background: rgba(216,182,115,.10); border: 1px solid var(--line-strong); margin-bottom: 1rem; font-size: 1.2rem; }
.card h3 { font-size: 1.24rem; margin-bottom: .5rem; }
.card p { color: var(--muted); font-size: .96rem; margin: 0; }
.card--ley .card__icon { color: var(--ley); background: rgba(88,201,192,.10); }

/* World feature split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; }
.feature-list { display: grid; gap: 1.1rem; margin-top: 1.4rem; }
.feature-list .fl { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
.feature-list .fl .dot { width: 34px; height: 34px; border-radius: 9px; background: rgba(216,182,115,.1); border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--gold); }
.feature-list .fl h4 { font-family: var(--sans); font-size: 1rem; color: var(--parch); margin-bottom: .2rem; }
.feature-list .fl p { color: var(--muted); font-size: .93rem; margin: 0; }

.plaque {
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 2rem;
  background: linear-gradient(160deg, rgba(18,26,38,.85), rgba(10,14,20,.85));
  box-shadow: var(--shadow); position: relative;
}
.plaque__quote { font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--parch); line-height: 1.5; }
.plaque__by { margin-top: 1rem; color: var(--gold); font-family: var(--display); letter-spacing: .12em; font-size: .78rem; text-transform: uppercase; }

/* Roadmap */
.roadmap { display: grid; gap: 0; counter-reset: step; border-left: 1px solid var(--line-strong); margin-left: 8px; }
.roadmap .step { position: relative; padding: 0 0 1.6rem 2rem; }
.roadmap .step::before { counter-increment: step; content: counter(step); position: absolute; left: -17px; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ink-750); border: 1px solid var(--line-strong); color: var(--gold); font-family: var(--display); font-size: .82rem; }
.roadmap .step.is-now::before { background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep)); color: #23180a; box-shadow: 0 0 0 4px rgba(216,182,115,.14); }
.roadmap .step h4 { font-family: var(--sans); font-size: 1.02rem; margin-bottom: .2rem; color: var(--parch); }
.roadmap .step p { color: var(--muted); font-size: .93rem; margin: 0; }
.roadmap .step .tag { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ley); margin-left: .5rem; }

/* CTA band */
.cta-band { text-align: center; padding: clamp(3rem, 8vh, 6rem) 0; }
.cta-band h2 { font-size: clamp(2rem, 4vw, 3.2rem); margin-bottom: 1rem; }
.cta-band p { color: var(--muted); max-width: 52ch; margin: 0 auto 2rem; font-size: 1.08rem; }

/* ---- Forms / auth -------------------------------------------------------- */
.auth { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 4rem 24px; }
.auth__card { width: min(460px, 100%); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 18px; padding: 2.4rem; backdrop-filter: blur(10px); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.auth__card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), var(--ley), transparent); pointer-events: none; }
.auth__head { text-align: center; margin-bottom: 1.8rem; }
.auth__head .brand__mark { width: 44px; height: 44px; margin: 0 auto .8rem; color: var(--gold); }
.auth__head h1 { font-size: 1.8rem; }
.auth__head p { color: var(--muted); font-size: .95rem; margin-top: .4rem; }

.field { display: grid; gap: .4rem; margin-bottom: 1.1rem; }
.field label { font-size: .82rem; font-weight: 600; letter-spacing: .04em; color: var(--parch-dim); text-transform: uppercase; }
.field input, .field textarea, .field select {
  width: 100%; font-family: var(--sans); font-size: 1rem; color: var(--parch);
  background: rgba(8, 11, 17, 0.6); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: .8rem .95rem; transition: border-color .2s ease, box-shadow .2s ease; outline: none;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216,182,115,.14); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field .hint { color: var(--muted-2); font-size: .78rem; }
.auth__alt { text-align: center; margin-top: 1.4rem; color: var(--muted); font-size: .92rem; }

/* OAuth provider buttons */
.oauth { margin-top: 1.4rem; }
.oauth__sep { display: flex; align-items: center; gap: 1rem; color: var(--muted-2); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 1rem; }
.oauth__sep::before, .oauth__sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.oauth__btns { display: grid; gap: .6rem; }
.btn--oauth { width: 100%; justify-content: center; background: rgba(236,228,210,.03); border-color: var(--line-strong); color: var(--parch); font-weight: 500; }
.btn--oauth:hover { border-color: var(--gold); color: var(--parch); background: rgba(236,228,210,.06); }
.oauth__icon { display: inline-flex; }
.oauth--discord:hover { border-color: #5865F2; box-shadow: 0 0 0 1px rgba(88,101,242,.3); }
.oauth--google_oauth2:hover { border-color: #4285F4; box-shadow: 0 0 0 1px rgba(66,133,244,.3); }
.oauth--steam:hover { border-color: #66c0f4; box-shadow: 0 0 0 1px rgba(102,192,244,.3); }
.oauth .button_to { display: block; width: 100%; margin: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.errors { background: rgba(217,138,106,.1); border: 1px solid rgba(217,138,106,.4); color: #f6ddcf; border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1.2rem; font-size: .9rem; }
.errors ul { margin: .3rem 0 0; padding-left: 1.1rem; }

/* Contact layout */
.contact { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 3rem; align-items: start; }
.contact__aside .chip { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .75rem; border: 1px solid var(--line-strong); border-radius: 999px; font-size: .8rem; color: var(--parch-dim); margin: 0 .4rem .5rem 0; }

/* Dashboard */
.dash { padding: clamp(2.5rem, 7vh, 5rem) 0; }
.dash__hello { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: .4rem; }
.dash__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 2rem; }
.pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--gold); }

/* ---- Account connections ------------------------------------------------- */
.connections { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.connection { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(8,11,17,.35); }
.connection__icon { width: 28px; height: 28px; display: inline-flex; align-items: center; }
.connection__meta { display: grid; gap: .1rem; }
.connection__meta strong { color: var(--parch); }
.connection__action { display: flex; align-items: center; gap: .6rem; }
.provider-groups { display: grid; gap: 1.1rem; }
.provider-group { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; background: rgba(8,11,17,.3); }
.provider-group__head { display: flex; align-items: center; gap: .7rem; }
.provider-group__head strong { color: var(--parch); }
.provider-group__add { margin-left: auto; }
.provider-group__none { margin: .7rem 0 0; font-size: .9rem; }
.connection--sub { grid-template-columns: auto 1fr auto; background: transparent; border-color: var(--line); margin-top: .7rem; padding: .7rem .9rem; }

/* ---- Footer -------------------------------------------------------------- */
.footer { margin-top: 2rem; border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(8,11,17,0), rgba(8,11,17,.6)); position: relative; }
.footer::before { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong) 25%, var(--ley-dim) 50%, var(--line-strong) 75%, transparent); pointer-events: none; }
.footer__inner {
  max-width: var(--maxw); margin-inline: auto; padding: 3rem 24px 2rem;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2.5rem;
}
.footer__brand { display: flex; align-items: flex-start; gap: .8rem; }
.footer__brand .brand__mark { width: 34px; height: 34px; color: var(--gold); flex: none; }
.footer__brand .brand__word { font-family: var(--display); font-weight: 700; letter-spacing: .06em; font-size: 1.1rem; color: var(--parch); }
.footer__tag { color: var(--muted); font-size: .92rem; margin: .35rem 0 0; font-family: var(--serif); font-style: italic; }
.footer__col { display: flex; flex-direction: column; gap: .7rem; }
.footer__col h4 { font-family: var(--display); text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; color: var(--gold); margin-bottom: .3rem; font-weight: 600; }
.footer__col a { color: var(--muted); font-size: .94rem; width: fit-content; }
.footer__col a:hover { color: var(--parch); }
.footer__base {
  max-width: var(--maxw); margin-inline: auto; padding: 1.2rem 24px 2.4rem;
  border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--muted-2); font-size: .84rem;
}
.footer__note { font-family: var(--serif); font-style: italic; }
@media (max-width: 720px) {
  .footer__inner { grid-template-columns: 1fr 1fr; gap: 1.8rem; }
  .footer__brand { grid-column: 1 / -1; }
  .footer__base { flex-direction: column; }
}

/* ---- Admin --------------------------------------------------------------- */
.admin__head { border-bottom: 1px solid var(--line); padding: 2rem 0 0; background: linear-gradient(180deg, rgba(88,201,192,.04), transparent); }
.admin__title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: .5rem 0 1rem; }
.admin__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.admin__nav { display: flex; gap: .3rem; flex-wrap: wrap; }
.admin__tab { color: var(--muted); font-weight: 600; font-size: .92rem; padding: .55rem .9rem; border-radius: 8px 8px 0 0; border-bottom: 2px solid transparent; }
.admin__tab:hover { color: var(--parch); }
.admin__tab.is-active { color: var(--gold-bright); border-bottom-color: var(--gold); background: rgba(216,182,115,.06); }
.admin__body { padding: 2rem 0 4rem; }
.admin__toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.admin__toolbar p { max-width: 60ch; margin: 0; }
.admin__search { display: flex; gap: .6rem; align-items: center; }
.admin__search input { flex: 1; max-width: 420px; background: rgba(8,11,17,.6); border: 1px solid var(--line-strong); border-radius: 10px; color: var(--parch); padding: .7rem .9rem; }
.admin__user-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.admin__meta { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.admin__meta div { display: grid; gap: .1rem; }
.admin__meta .muted { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; }

.admin-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.admin-table th { text-align: left; font-family: var(--sans); font-weight: 600; color: var(--muted-2); text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line-strong); }
.admin-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr.is-off { opacity: .55; }
.admin-table .muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .8rem; }

.badge { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .04em; padding: .2rem .6rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--parch-dim); }
.badge--admin { color: #23180a; background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep)); border-color: transparent; }
.badge--moderator { color: var(--ley); border-color: var(--ley-dim); background: rgba(88,201,192,.08); }
.badge--gm { color: var(--gold-bright); border-color: var(--gold-deep); }
.badge--adventurer { color: var(--muted); }
.badge--ok { color: var(--ley); border-color: var(--ley-dim); }
.badge--muted { color: var(--muted-2); }
.badge--bad { color: var(--danger); border-color: rgba(217,138,106,.45); }
.chip--sm { font-size: .7rem; padding: .12rem .5rem; margin: 0 .2rem .2rem 0; }
.btn--sm { padding: .42em .8em; font-size: .84rem; }

.toggle { cursor: pointer; font: inherit; font-size: .78rem; font-weight: 600; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(139,151,166,.08); color: var(--muted); }
.toggle--on { color: var(--ley); border-color: var(--ley-dim); background: rgba(88,201,192,.12); }
.toggle:hover { border-color: var(--parch-dim); }

.role-picker { display: grid; gap: .7rem; margin-top: 1rem; }
.role-option { display: grid; grid-template-columns: auto 1fr; gap: .8rem; align-items: start; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.role-option:hover { border-color: var(--line-strong); }
.role-option.is-current { border-color: var(--gold-deep); background: rgba(216,182,115,.05); }
.role-option input { margin-top: .3rem; accent-color: var(--gold); }
.role-option__name { font-weight: 600; color: var(--parch); }
.role-option__perms { display: block; font-weight: 400; font-size: .74rem; color: var(--ley); margin-top: .15rem; }
.role-option p { color: var(--muted); font-size: .9rem; margin: .2rem 0 0; }
.check { display: flex; align-items: center; gap: .5rem; color: var(--parch-dim); }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }

/* ---- Reveal-on-scroll ---------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 940px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { max-width: 340px; margin: 0 auto; }
  .grid--3 { grid-template-columns: 1fr 1fr; }
  .split, .contact { grid-template-columns: 1fr; }
  .nav__links { display: none; }
}
@media (max-width: 620px) {
  .grid--3, .grid--2, .dash__grid, .form-row { grid-template-columns: 1fr; }
  .nav__actions .btn--ghost { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================================
   The signed-in app shell (UX.md) â€” top bar + collapsible dock + main.
   Modes (play / gm / admin) only change the accent, set on <body data-mode>.
   ========================================================================== */

.app {
  --accent: var(--gold);
  --accent-bright: var(--gold-bright);
  --tbar-h: 58px;
  --dock-w: 60px;
  --dock-w-pinned: 208px;
  min-height: 100vh;
}
.app[data-mode="gm"]    { --accent: var(--ley); --accent-bright: #7de0d7; }
.app[data-mode="admin"] { --accent: #b79bd8; --accent-bright: #cdb6ea; }

/* ---- Top bar ------------------------------------------------------------- */
.tbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--tbar-h);
  display: flex; align-items: center; gap: 1rem;
  padding-inline: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 20, 0.82);
  backdrop-filter: blur(14px);
}
.tbar__brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--parch); }
.tbar__brand .brand__mark { width: 26px; height: 26px; color: var(--accent); display: inline-flex; }
.tbar__brand .compass { width: 26px; height: 26px; }
.tbar__word { font-family: var(--display); font-size: 1rem; letter-spacing: .04em; }
.tbar__word .brand__word-accent { color: var(--accent-bright); }

.tbar__mode {
  font-family: var(--display); font-size: .66rem; text-transform: uppercase; letter-spacing: .22em;
  color: var(--accent); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: .25rem .7rem;
}

/* The world you are looking at: same pill as the mode label, but it opens. */
.tbar__world {
  align-items: center; gap: .4rem; font-size: .84rem; color: var(--parch-dim);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: .25rem .8rem;
}
.tbar__world span { font-family: var(--display); color: var(--parch); }
.tbar__world:hover, .menu[open] .tbar__world { border-color: var(--accent); color: var(--parch); }

.tbar__tools { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.tbar__search {
  display: inline-flex; align-items: center; gap: .6rem;
  min-width: 260px; padding: .45rem .7rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(18, 26, 38, 0.5); color: var(--muted-2);
  font-family: var(--sans); font-size: .86rem; position: relative;
}
.tbar__search:focus-within { border-color: var(--ley); }
.tbar__search input {
  flex: 1; min-width: 0; border: 0; background: none; padding: 0;
  color: var(--parch); font: inherit; outline: none;
}
.tbar__search input::-webkit-search-cancel-button { filter: invert(0.6); }
.tbar__search kbd {
  margin-left: auto; font-family: var(--sans); font-size: .68rem;
  border: 1px solid var(--line); border-radius: 5px; padding: .05rem .35rem; color: var(--muted-2);
}
.tbar__results {
  position: absolute; z-index: 30; top: calc(100% + .4rem); left: 0; right: 0;
  list-style: none; margin: 0; padding: .3rem; max-height: 60vh; overflow-y: auto;
  background: var(--ink-800); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
}
.tbar__results[hidden] { display: none; }
.tbar__results a {
  display: flex; justify-content: space-between; gap: .8rem; align-items: baseline;
  padding: .4rem .6rem; border-radius: 7px; color: var(--parch); text-decoration: none;
}
.tbar__results a:hover, .tbar__results a:focus-visible { background: rgba(255, 255, 255, .06); }
.tbar__results .muted { font-size: .75rem; }
.tbar__icon {
  width: 34px; height: 34px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: rgba(18, 26, 38, 0.5); color: var(--muted-2);
  font-size: .9rem; cursor: not-allowed;
}
.tbar__bell { position: relative; cursor: pointer; }
.menu[open] .tbar__bell { border-color: var(--accent); color: var(--parch); }
.tbar__badge {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px;
  display: grid; place-items: center; padding: 0 .2rem;
  border-radius: 999px; background: var(--accent-bright); color: var(--ink-900);
  font-family: var(--sans); font-size: .62rem; font-weight: 700;
}

/* ---- Avatar menu (native details element) -------------------------------- */
.menu { position: relative; }
.menu__trigger { list-style: none; cursor: pointer; display: inline-flex; }
.menu__trigger::-webkit-details-marker { display: none; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); font-size: .9rem; color: var(--ink-900);
  background: linear-gradient(140deg, var(--accent-bright), var(--accent));
  border: 1px solid var(--line-strong);
}
.menu[open] .avatar { box-shadow: var(--glow-gold); }
.menu__panel {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: 258px; padding: .55rem;
  background: var(--panel-solid); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: grid; gap: .35rem;
}
.menu__head { padding: .5rem .6rem .6rem; display: grid; gap: .2rem; border-bottom: 1px solid var(--line); }
.menu__head strong { color: var(--parch); font-family: var(--serif); }
.menu__handle { color: var(--muted); font-size: .82rem; }
.menu__head .pill { justify-self: start; margin-top: .3rem; color: var(--accent); }
.menu__group { display: grid; gap: .12rem; padding-top: .25rem; border-top: 1px solid var(--line); }
.menu__group:first-of-type { border-top: 0; }
.menu__item, .menu__item button {
  display: block; width: 100%; text-align: left;
  padding: .5rem .6rem; border-radius: var(--radius-sm);
  color: var(--parch-dim); font: inherit; font-size: .9rem;
  background: none; border: 0; cursor: pointer;
}
.menu__item:hover { background: rgba(216, 182, 115, .08); color: var(--parch); }
.menu__item--quiet, .menu__item--quiet button { color: var(--muted); }
.menu__panel--wide { width: 320px; max-height: 70vh; overflow-y: auto; }
/* A menu hanging off the left half of the bar opens leftward, not off-screen. */
.menu__panel--left { right: auto; left: 0; width: 296px; }
.menu__item .menu__handle { display: block; font-size: .78rem; line-height: 1.3; }
.menu__notice { line-height: 1.35; text-decoration: none; }
.menu__none { padding: .6rem; color: var(--muted); font-size: .86rem; }
.menu__label {
  padding: .45rem .6rem .15rem; font-family: var(--display);
  font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted-2);
}
.menu__modes { display: flex; flex-wrap: wrap; gap: .3rem; padding: .3rem .35rem .45rem; }
.menu__modes .menu__label { flex: 1 0 100%; }
.menu__mode {
  padding: .35rem .75rem; border-radius: 999px; font-size: .84rem;
  border: 1px solid var(--line); color: var(--parch-dim);
}
.menu__mode:hover { border-color: var(--line-strong); color: var(--parch); }
.menu__mode.is-active { border-color: var(--accent); color: var(--accent-bright); background: rgba(216, 182, 115, .08); }

/* ---- Body + dock --------------------------------------------------------- */
.app__body { display: flex; align-items: stretch; min-height: calc(100vh - var(--tbar-h)); }
.app__main { flex: 1; min-width: 0; }

.dock {
  position: sticky; top: var(--tbar-h); align-self: flex-start;
  height: calc(100vh - var(--tbar-h));
  width: var(--dock-w);
  display: flex; flex-direction: column; gap: .2rem;
  padding: .6rem .5rem;
  border-right: 1px solid var(--line);
  background: rgba(13, 19, 28, 0.5);
  transition: width .18s ease;
  overflow: hidden;
}
.dock:hover, .dock.is-pinned { width: var(--dock-w-pinned); }
.dock__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.dock__item {
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem .6rem; border-radius: var(--radius-sm);
  color: var(--parch-dim); font-size: .9rem; white-space: nowrap;
}
.dock__glyph { width: 22px; flex: none; text-align: center; font-size: 1.02rem; color: var(--accent); }
.dock__label { opacity: 0; transition: opacity .16s ease; }
.dock:hover .dock__label, .dock.is-pinned .dock__label { opacity: 1; }
.dock__item:hover { background: rgba(216, 182, 115, .08); color: var(--parch); }
.dock__item.is-active { background: rgba(216, 182, 115, .12); color: var(--parch); box-shadow: inset 2px 0 0 var(--accent); }
/* An anchor on the zone above it, not a zone of its own: a hairline hanging off
   the parent, a smaller glyph and quieter text. Reads as one place with ways in
   when the dock is open, and as nothing at all when it is shut. */
.dock__item.is-under { padding-top: .3rem; padding-bottom: .3rem; font-size: .84rem; color: var(--muted); }
.dock:hover .dock__item.is-under, .dock.is-pinned .dock__item.is-under { padding-left: 1.1rem; }
.dock:hover .dock__item.is-under .dock__glyph,
.dock.is-pinned .dock__item.is-under .dock__glyph { font-size: .88rem; opacity: .8; }
.dock__item.is-under:hover { color: var(--parch); }
.dock__item.is-soon { color: var(--muted-2); cursor: not-allowed; }
.dock__item.is-soon .dock__glyph { color: var(--muted-2); }
.dock__item.is-soon:hover { background: none; color: var(--muted-2); }
.dock__pin {
  margin-top: auto;
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem .6rem; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--muted); font: inherit; font-size: .9rem; cursor: pointer;
  white-space: nowrap;
}
.dock__pin:hover { background: rgba(216, 182, 115, .08); color: var(--parch); }
.dock.is-pinned .dock__pin { color: var(--accent); }

/* ---- /world placeholder -------------------------------------------------- */
.world__stage { position: relative; min-height: calc(100vh - var(--tbar-h)); display: grid; place-items: center; padding: 2rem 24px; }
.world__fog {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% 45%, transparent 0%, rgba(8, 11, 17, .72) 78%),
    repeating-linear-gradient(115deg, rgba(200, 173, 110, .035) 0 2px, transparent 2px 26px);
}
.world__note { position: relative; max-width: 56ch; text-align: center; display: grid; gap: .9rem; justify-items: center; }
.world__note h1 { font-family: var(--display); font-size: clamp(1.7rem, 4vw, 2.6rem); }
.world__note p { color: var(--muted); margin: 0; }
.world__actions { display: flex; gap: .7rem; flex-wrap: wrap; justify-content: center; }

/* ---- /world map ---------------------------------------------------------- */
.world__stage:has(.world__canvas) { padding: 0; overflow: hidden; }
.world__canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; background: var(--ink-900); }
.world__canvas:active { cursor: grabbing; }
.world__loading { position: absolute; color: var(--muted); font-family: var(--display); letter-spacing: .06em; }
.battlemap { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--ink-900); max-width: 100%; }
.battlemap[data-action] { cursor: crosshair; }
/* The floor is the frame: the ground on the left, the telling down the side. */
.scene { display: grid; grid-template-columns: minmax(260px, 480px) 1fr; gap: 1rem; align-items: start; }
.scene__side { display: grid; gap: 1rem; align-content: start; }
.scene__floor { display: grid; gap: .5rem; justify-items: center; text-align: center; }
.scene__floor > p { margin: 0; }
.scene__footing { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
@media (max-width: 860px) { .scene { grid-template-columns: 1fr; } }

/* What it says it is about to do, and whether you are stood right for it. */
.tell {
  border-left: 2px solid var(--danger); padding: .35rem 0 .35rem .7rem;
  margin: .7rem 0; font-size: .95rem;
}
.tell--ready { border-left-color: var(--gold); }
.tell small { display: block; margin-top: .15rem; }
/* The town is full screen: the stage is the viewport, the countryside runs
   off every edge, and the drawer and panel float over it — nothing scrolls. */
.world__stage:has(.town__canvas) {
  height: calc(100vh - var(--tbar-h)); min-height: 0; padding: 0; overflow: hidden;
}
.town__canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: var(--ink-900); cursor: crosshair; touch-action: none;
}

.world__hud, .world__self, .world__folder {
  z-index: 1; background: rgba(10, 14, 20, .82);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  backdrop-filter: blur(6px); padding: .7rem .9rem;
}
.world__hud { position: absolute; top: 1rem; left: 1rem; display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.world__hud-title { display: block; font-family: var(--display); color: var(--parch); }
.world__readout { margin: 0; min-width: 22ch; color: var(--ley); font-size: .84rem; font-family: ui-monospace, Menlo, monospace; }
/* Bottom-left corner: the character HUD sits over the legend (UX.md). */
.world__corner {
  position: absolute; z-index: 1; bottom: 1rem; left: 1rem; display: flex; flex-direction: column;
  gap: .6rem; align-items: stretch; max-width: min(20rem, calc(100% - 2rem));
}
.world__self { display: grid; gap: .4rem; font-size: .84rem; color: var(--parch-dim); }
.world__self summary { cursor: pointer; color: var(--parch); font-family: var(--display); }
.world__self p { margin: 0; }
.world__self .btn { justify-self: start; }
/* The cliff, folded into the character card: a hairline says "this is about
   later", so it reads as a section and not as a fourth floating box. */
.world__rolling {
  display: grid; gap: .15rem; margin-top: .15rem; padding-top: .45rem;
  border-top: 1px solid var(--line); color: var(--muted);
}
.world__rolling p { font-size: .8rem; }
/* Reference, not play: the colour key folds away and stays folded. */
.world__folder > summary {
  cursor: pointer; font-size: .82rem; color: var(--muted); list-style: none;
}
.world__folder > summary::before { content: "▸ "; }
.world__folder[open] > summary { color: var(--parch-dim); margin-bottom: .5rem; }
.world__folder[open] > summary::before { content: "▾ "; }
/* In the corner column the pack is a row like any other, and its panel rises
   off the top of the column instead of pinning itself to the same corner. */
.world__corner .world__pack { position: static; }
.world__corner .place-panel--pack { left: 0; bottom: calc(100% + .5rem); }
.world__legend { display: grid; gap: .3rem; font-size: .82rem; color: var(--parch-dim); list-style: none; }
.world__legend li { display: flex; align-items: center; gap: .5rem; }
.world__legend .muted { margin-left: auto; }
.world__swatch { width: .8rem; height: .8rem; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .4); }

/* Bottom-right: the pilot's corner — overview chart + zoom. The drawer slides
   over it when open; the map is still underneath. */
.world__pilot {
  position: absolute; z-index: 1; bottom: 1rem; right: 1rem;
  display: flex; flex-direction: column; gap: .5rem; align-items: flex-end;
}
.world__zoom { display: flex; gap: .35rem; }
.world__zoom .btn { min-width: 2rem; }
.world__mini {
  display: block; width: min(176px, 28vw); border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--ink-900); cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
}

/* A bake's progress, one thin line under its status. */
.bakebar {
  margin-top: .35rem; height: 4px; width: 9rem; max-width: 100%;
  border-radius: 999px; background: rgba(200, 173, 110, .18); overflow: hidden;
}
.bakebar span { display: block; height: 100%; background: var(--gold, #c8ad6e); border-radius: 999px; }

/* ---- Contextual drawer (UX.md) ------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem;
  border: 1px solid var(--line-strong); border-radius: 999px; background: none;
  font: inherit; font-size: .8rem; color: var(--parch-dim); cursor: default;
}
button.chip { cursor: pointer; }
button.chip:hover, button.chip:focus-visible { color: var(--parch); border-color: var(--ley); }
.drawer {
  position: absolute; z-index: 2; top: 1rem; right: 1rem; bottom: 1rem; width: min(22rem, calc(100% - 2rem));
  overflow-y: auto; display: flex; flex-direction: column; gap: 1rem;
  background: rgba(10, 14, 20, .92); border: 1px solid var(--line);
  border-radius: var(--radius-sm); backdrop-filter: blur(6px); padding: 1rem 1.1rem;
}
.drawer[hidden] { display: none; }
/* The drawer folds to a slim tab (GAMEPLAN D11): everything but the fold
   button goes, and the strip stays clickable at the map's edge. */
.drawer__fold {
  align-self: flex-start; margin: -.3rem 0 -.6rem;
  border: 1px solid var(--line-strong); border-radius: 6px; background: rgba(10, 14, 20, .8);
  color: var(--parch-dim); font: inherit; font-size: .8rem; line-height: 1;
  padding: .45rem .5rem; cursor: pointer;
}
.drawer__fold:hover, .drawer__fold:focus-visible { color: var(--parch); border-color: var(--ley); }
.drawer--folded { width: 2.6rem; min-width: 0; padding: .5rem .35rem; overflow: hidden; }
.drawer--folded > :not(.drawer__fold) { display: none; }
.drawer--folded .drawer__fold { margin: 0; }
/* The waking letter (REFORGE pillar 5); the cliff lives in the character card. */
.world__letter { z-index: 24; }
/* The stake dial (REFORGE pillar 1): three ways to work one verb. */
.place-panel__stakes { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.place-panel__footing { font-size: .82rem; border-left: 2px solid var(--line-strong); padding-left: .5rem; }
.place-panel__deal { margin: 0 0 -.3rem; font-size: .85rem; }
/* Names at the cursor (GAMEPLAN D12): a tip riding the pointer, never catching it. */
.town__tip {
  position: fixed; top: 0; left: 0; z-index: 40; pointer-events: none;
  background: rgba(10, 14, 20, .92); border: 1px solid var(--line-strong);
  border-radius: 6px; padding: .3rem .55rem; font-size: .8rem; color: var(--parch);
  white-space: nowrap;
}
.drawer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; }
.drawer__title { margin: .15rem 0 0; font-family: var(--display); font-size: 1.25rem; color: var(--parch); }
.drawer__facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem .9rem; margin: 0; font-size: .88rem; }
.drawer__facts dt { color: var(--muted); }
.drawer__facts dd { margin: 0; color: var(--parch-dim); text-align: right; }
.drawer__section { display: grid; gap: .5rem; }
/* hidden means hidden: author display rules must never resurrect it. */
[hidden] { display: none !important; }

/* The place panel: walking up to a door in a town opens its counter here. */
.place-panel {
  position: absolute; left: 1rem; top: 5.2rem; z-index: 30;
  width: min(400px, calc(100vw - 2rem)); max-height: min(65vh, 560px); overflow-y: auto;
  padding: .9rem 1rem; display: grid; gap: .6rem;
  background: rgba(13, 17, 23, .95); border: 1px solid rgba(233, 209, 158, .25);
  border-radius: 10px; box-shadow: 0 14px 34px rgba(4, 6, 10, .6);
}
.place-panel__head { display: flex; justify-content: space-between; align-items: start; gap: .6rem; }
.place-panel__close {
  background: none; border: 0; color: var(--muted, #9aa3ad); font-size: 1.3rem;
  line-height: 1; cursor: pointer; padding: 0 .2rem;
}
.place-panel__close:hover { color: #e9d19e; }
.place-panel__counter { display: grid; gap: .5rem; }

/* The guide: one whispered line, bottom-centre, hushable. */
.guide {
  position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%);
  z-index: 22; display: flex; align-items: center; gap: .4rem;
  padding: .45rem .5rem .45rem .9rem; border-radius: 999px;
  background: rgba(13, 17, 23, .88); border: 1px solid var(--line-strong);
  max-width: min(640px, 92vw);
}
.guide__word { font-size: .85rem; color: var(--parch-dim); }
.guide__hush {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font-size: 1rem; line-height: 1; padding: 0 .35rem;
}
.guide__hush:hover { color: var(--parch); }

/* The pips: body, heart and purse, always in view. */
.vitals { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.vital {
  font-size: .78rem; font-weight: 600; padding: .18em .6em; border-radius: 999px;
  background: rgba(13, 17, 23, .8); border: 1px solid var(--line); color: var(--parch-dim);
}
.vital--good { border-color: rgba(88, 201, 192, .45); color: #bfe9e4; }
.vital--warn { border-color: rgba(216, 182, 115, .55); color: #ecd9ae; }
.vital--bad { border-color: rgba(217, 138, 106, .6); color: #f2c8b4; }
.world__vitals-dock { position: absolute; top: 1rem; right: 1rem; z-index: 21; }

/* The map's invitation: centred over the world, until dismissed. */
.world__invite {
  left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%);
  width: min(440px, 92vw); max-height: min(84vh, 640px); z-index: 40;
}

/* The pack: a flap in the corner, its panel rising from it. */
.world__pack { position: absolute; left: 1rem; bottom: 1rem; z-index: 31; }
.place-panel--pack { top: auto; bottom: 3.6rem; max-height: min(60vh, 520px); }

/* Openable tasks inside a counter: crafting and trade fold away until asked. */
.place-panel__task summary {
  cursor: pointer; color: var(--gold); font-weight: 600; font-size: .92rem;
  padding: .25rem 0; list-style: none;
}
.place-panel__task summary::before { content: "▸ "; }
.place-panel__task[open] summary::before { content: "▾ "; }
.place-panel__task > *:not(summary) { margin-top: .4rem; }

/* The order menu: right-click on the chart names what can be done there. */
.orders {
  position: fixed; z-index: 60; min-width: 200px; margin: 0; padding: .3rem; list-style: none;
  background: var(--ink-800, #141a22); border: 1px solid rgba(233, 209, 158, .25);
  border-radius: 8px; box-shadow: 0 10px 28px rgba(4, 6, 10, .55);
}
.orders button {
  display: block; width: 100%; padding: .5rem .7rem; text-align: left;
  background: none; border: 0; border-radius: 6px; color: var(--parchment, #e8e2d2);
  font: inherit; cursor: pointer;
}
.orders button:hover { background: rgba(233, 209, 158, .12); color: #e9d19e; }
/* Walking to a door lights its counter, then the light settles. */
.drawer__section--lit { animation: section-lit 1.6s ease-out; border-radius: 6px; }
@keyframes section-lit {
  0% { background: rgba(233, 209, 158, .16); box-shadow: 0 0 0 1px rgba(233, 209, 158, .35); }
  100% { background: transparent; box-shadow: none; }
}
.drawer__chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.drawer__list { list-style: none; display: grid; gap: .3rem; margin: 0; padding: 0; font-size: .88rem; color: var(--parch-dim); }
.drawer__list li, .drawer__row {
  width: 100%; display: flex; justify-content: space-between; gap: .8rem; align-items: baseline;
}
.drawer__row {
  padding: .2rem 0; border: 0; background: none; font: inherit; text-align: left;
  color: var(--parch-dim);
}
button.drawer__row { cursor: pointer; }
button.drawer__row:hover, button.drawer__row:focus-visible { color: var(--parch); }
.drawer__list .muted { font-size: .8rem; white-space: nowrap; }
.drawer__note { margin: auto 0 0; font-size: .82rem; }

/* The day's face: chalked up this morning, gone at the next world-dawn. */
.drawer__section--chalk { border-left: 2px solid rgba(233, 209, 158, .35); padding-left: .6rem; }
.chalk { justify-content: flex-start; align-items: flex-start; color: var(--parch); }
.chalk__mark { flex: 0 0 1.1rem; color: var(--gold); opacity: .8; }
.drawer__list .chalk__worth { display: block; white-space: normal; margin-top: .1rem; }

/* ---- Chronicle ----------------------------------------------------------- */
.chronicle { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .6rem; max-width: 70ch; }
.chronicle__entry {
  border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .02); padding: .7rem .9rem;
}
.chronicle__entry p { margin: .2rem 0 0; color: var(--parch-dim); }
.chronicle__entry time { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.chronicle__entry--2 { border-left-color: var(--ley); }
.chronicle__entry--3 { border-left-color: var(--gold); }

/* The character sheet: five numbers, until there are hundreds. */
.sheet { list-style: none; margin: .9rem 0; padding: 0; display: grid; gap: .35rem; }
.sheet li {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px dotted var(--line); padding-bottom: .25rem;
}
.sheet span { color: var(--muted); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }
.sheet strong { color: var(--gold-bright); font-size: 1.05rem; }

/* Table talk (TABLE.md I.1). A said line is prose and not a stat, so it is the
   one thing in a `.sheet` that keeps its own case — the uppercase span above is
   for labels, and a person's words are not a label. */
.talk { margin-top: .7rem; }
.talk__lines { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .3rem;
  max-height: 15rem; overflow-y: auto; }
.talk__lines li { font-size: .9rem; color: var(--parch-dim); line-height: 1.45; }
.talk__who { color: var(--gold-bright); font-weight: 600; margin-right: .4rem;
  font-size: .9rem; letter-spacing: 0; text-transform: none; }
.talk__quiet { color: var(--muted-2); font-style: italic; }
.talk__deed { color: var(--muted-2); font-style: italic; font-size: .86rem; }
/* The report glyph on a line of player prose: present, and no louder. */
.talk__tell {
  background: none; border: 0; color: var(--muted-2); cursor: pointer;
  font-size: .78rem; padding: 0 .25rem; opacity: .55;
}
.talk__tell:hover { opacity: 1; color: var(--danger); }
.talk__line { color: var(--parch-dim); font-size: .92rem; letter-spacing: 0;
  text-transform: none; line-height: 1.45; }
.talk__line em { font-style: normal; font-size: .82rem; }
.talk__say { display: flex; gap: .5rem; align-items: center; }
.talk__say input[type="text"] {
  flex: 1 1 auto; min-width: 0; font-family: var(--sans); font-size: .92rem; color: var(--parch);
  background: rgba(8, 11, 17, 0.6); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: .5rem .7rem; outline: none; transition: border-color .2s ease, box-shadow .2s ease;
}
.talk__say input[type="text"]:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216,182,115,.14); }
.talk__say input[type="text"]::placeholder { color: var(--muted-2); }

/* The read-aloud (TABLE.md IV.2) and the verb bar under it. A scene opens with
   somebody saying where you are, and every action after it is a sentence with
   the dice in small print underneath — not a stat with a number on it. */
.frame {
  max-width: 68ch; margin: .6rem 0 1rem; padding-left: 1rem;
  border-left: 2px solid var(--gold-deep);
  color: var(--parch); font-size: 1.02rem; line-height: 1.65;
}
.doing { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; }
.doing__act {
  flex-direction: column; align-items: flex-start; gap: .15rem;
  white-space: normal; text-align: left; padding: .55em .95em; line-height: 1.3;
}
.doing__act small { font-size: .74rem; opacity: .72; font-weight: 500; }

/* Where you take it (the stances): a round is read the tabletop way — where
   you stand, then what you do. Radios, so it works with nothing but HTML. */
.stances {
  border: 1px solid var(--line-strong); border-radius: 10px;
  padding: .6rem .8rem; margin-top: .8rem; display: grid; gap: .35rem;
}
.stances legend {
  font-size: .74rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted-2); padding: 0 .35rem;
}
.stances__stand { display: flex; gap: .5rem; align-items: baseline; cursor: pointer;
  font-size: .92rem; line-height: 1.35; }
.stances__stand small { display: block; font-size: .78rem; }
.stances__stand:has(input:checked) span { color: var(--gold-bright); }

/* The fork: a blow that got through hangs until its taker says how it lands. */
.fork {
  border: 1px solid var(--gold-deep); border-radius: 10px;
  padding: .7rem .9rem; margin-top: .8rem;
}

/* The huddle: one open question per company, everybody's answer on it. */
.huddle {
  border: 1px solid var(--line-strong); border-radius: 10px;
  padding: .7rem .9rem; margin: .6rem 0;
}

/* The doll (EMBODY Part I): a body in cartographer ink with the slots ruled
   either side of it. Slots are buttons, not drop targets — no drag, no canvas. */
.card--body { grid-column: 1 / -1; }
.doll {
  display: grid; grid-template-columns: 1fr minmax(140px, 200px) 1fr;
  gap: .8rem; align-items: center; margin: 1rem 0;
}
.doll__col { display: grid; gap: .5rem; align-content: center; }
.doll__fig { width: 100%; height: auto; color: var(--line-strong); }
.doll__place { fill: var(--line-strong); }
.doll__place--hurt { fill: var(--danger); stroke: var(--danger); stroke-opacity: .35; stroke-width: 5; }
.doll__plate { fill: none; stroke: var(--gold-deep); stroke-opacity: .5; }
.doll__rack {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .5rem; margin: .4rem 0 1rem;
}
.slot {
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  padding: .45rem .6rem; display: grid; gap: .1rem; min-height: 3.2rem;
  align-content: center;
}
.slot--full { border-style: solid; border-color: var(--line-strong); background: var(--panel); }
.slot--broken { border-color: var(--danger); }
.slot__name { color: var(--muted-2); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }
.slot__thing { color: var(--parch); font-size: .9rem; line-height: 1.3; }
.slot__reads, .slot__empty { color: var(--muted); font-size: .78rem; }
.slot__empty { font-style: italic; }
.slot form { margin-top: .3rem; }

@media (max-width: 860px) {
  .doll { grid-template-columns: 1fr 1fr; }
  .doll__fig { grid-row: 1; grid-column: 1 / -1; max-width: 180px; margin: 0 auto; }
}

/* The star chart is a scene, not a card: the sky takes the whole screen the way
   the world map does and every other thing on the page floats over it. The
   canvas is the sky you fly through; the SVG under it is the same chart flat,
   and the one you get with no JS. Only one of them is ever shown. */
.starlab {
  position: relative; height: calc(100vh - var(--tbar-h)); overflow: hidden;
  background: var(--ink-900);
}
.starlab__sky {
  position: absolute; inset: 0; overflow: hidden;
  background: radial-gradient(circle at 50% 38%, rgba(88,110,160,.10), transparent 62%),
              var(--ink-900);
  box-shadow: inset 0 0 140px rgba(0,0,0,.7);
}
.starlab__canvas {
  display: none; position: absolute; inset: 0; width: 100%; height: 100%;
  cursor: grab; touch-action: none;
}
.is-live .starlab__canvas { display: block; }
.is-live .starlab__flat { display: none; }
.is-turning .starlab__canvas { cursor: grabbing; }
.starlab__flat { position: absolute; inset: 0; display: grid; place-items: center; padding: .6rem; overflow: auto; }
.starlab__flat .stars { max-width: min(100%, 640px); margin: 0; }
.starlab__tools {
  position: absolute; top: 1rem; right: 1rem; z-index: 2;
  display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end;
}
.starlab__hint {
  position: absolute; right: 1rem; bottom: 1rem; margin: 0; z-index: 1;
  font-size: .74rem; letter-spacing: .06em; color: var(--muted-2); pointer-events: none;
}
/* Everything else on the page is a pane of smoked glass over the sky. */
.starlab__head, .starlab__panel, .starlab__fold {
  background: rgba(10, 14, 20, .86); border: 1px solid var(--line);
  border-radius: var(--radius-sm); backdrop-filter: blur(6px);
}
.starlab__head {
  position: absolute; z-index: 1; top: 1rem; left: 1rem; padding: .6rem .9rem;
  max-width: min(28rem, calc(100% - 12rem));
}
.starlab__head h1 { font-family: var(--display); font-size: clamp(1.1rem, 2.2vw, 1.6rem); margin: .1rem 0 .2rem; }
.starlab__head p { margin: 0; color: var(--muted); font-size: .8rem; }
.starlab__panel {
  position: absolute; z-index: 1; right: 1rem; top: 4.3rem; padding: .9rem;
  width: min(23rem, calc(100% - 2rem)); max-height: calc(100% - 6.4rem); overflow: auto;
}
.starlab__corner {
  position: absolute; z-index: 1; bottom: 1rem; left: 1rem;
  display: flex; flex-direction: column; gap: .5rem; align-items: stretch;
  width: min(34rem, calc(100% - 26rem));
}
.starlab__corner .btn { align-self: start; }
.starlab__fold { padding: .45rem .8rem; }
.starlab__fold > summary { cursor: pointer; color: var(--parch); font-family: var(--display); font-size: .92rem; }
.starlab__fold[open] { max-height: 44vh; overflow: auto; }
.starlab__fold .sheet { margin: .5rem 0 .2rem; }
.starinfo h3 { margin: .2rem 0 .35rem; font-family: var(--display); }
.starinfo .sheet { margin: .6rem 0; }
.starinfo__acts { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .7rem; }
.starkey { list-style: none; margin: .8rem 0 0; padding: 0; font-size: .8rem; color: var(--muted); }
.starkey li { display: flex; gap: .5rem; align-items: baseline; padding: .18rem 0; }
.starkey b { color: var(--gold); font-weight: 400; width: 1.1rem; text-align: center; }
.sheet li.is-picked { background: rgba(216,182,115,.08); box-shadow: inset 2px 0 0 var(--gold); }
.sheet li[data-at] { cursor: pointer; }
/* Too narrow to float anything: the sky becomes the first row and the panes
   fall underneath it in reading order. */
@media (max-width: 980px) {
  .starlab { height: auto; overflow: visible; display: grid; gap: .8rem; padding: .8rem 16px 1.6rem; }
  .starlab__sky {
    position: relative; inset: auto; height: 60vh;
    border: 1px solid var(--line); border-radius: var(--radius);
  }
  .starlab__head, .starlab__panel, .starlab__corner {
    position: static; width: auto; max-height: none; max-width: none;
  }
}
.stars a { cursor: pointer; }
.stars a:focus-visible .stars__node { stroke: var(--gold-bright); stroke-width: 3; }
.stars { display: block; width: 100%; max-width: 520px; margin: .6rem auto 1rem; height: auto; }
.stars__root { fill: var(--gold-deep); }
.stars__arm { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.stars__arm.is-lit { stroke: var(--gold); stroke-dasharray: none; }
.stars__arm--bleed { stroke: var(--ley-dim); stroke-dasharray: 6 5; }
/* Colour is the arm here too — the hue comes off the same chart the sky reads. */
.stars__node { fill: var(--panel-solid); stroke: hsl(var(--hue, 41) 30% 46%); stroke-width: 1.5; }
.stars__node--turn { stroke-dasharray: 3 3; }
.stars__node--door { stroke-width: 2.5; }
.stars__node--bearing { stroke: var(--ley-dim); }
.stars__node--working { stroke-dasharray: 2 2 8 2; stroke-width: 2; }
.stars__node.is-near { stroke: hsl(var(--hue, 41) 70% 62%); stroke-dasharray: none; }
.stars__node.is-lit { fill: hsl(var(--hue, 41) 80% 62%); stroke: hsl(var(--hue, 41) 92% 82%); }
.stars__node--bearing.is-lit { fill: var(--ley); stroke: var(--ley); }
.stars text { text-anchor: middle; fill: var(--muted); font-family: var(--sans); }
.stars__root-name { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; fill: var(--gold-deep); }
.stars__label { font-size: 10px; fill: var(--parch-dim); }
.stars__label--dark { font-style: italic; opacity: .6; }

/* The arc board: a thread, its beats, and the two things a GM can do to it. */
.arc { border-top: 1px dotted var(--line); padding: .7rem 0; }
.arc > span { display: block; font-size: .85rem; }
.arc__beats { margin: .4rem 0 .5rem; padding-left: 1.1rem; display: grid; gap: .2rem; }
.arc__beats li { font-size: .92rem; }
.arc__beats li span { margin-left: .4rem; font-size: .8rem; }
.arc__beat--done { color: var(--muted); text-decoration: line-through; }
.arc__acts { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ---- Shell responsive ---------------------------------------------------- */
@media (max-width: 860px) {
  .tbar__search, .tbar__mode { display: none; }
  .app__body { flex-direction: column; }
  .dock {
    position: sticky; top: auto; bottom: 0; order: 2;
    flex-direction: row; width: 100%; height: auto;
    border-right: 0; border-top: 1px solid var(--line);
    overflow-x: auto;
  }
  .dock:hover, .dock.is-pinned { width: 100%; }
  .dock__list { grid-auto-flow: column; }
  .dock__label, .dock__pin { display: none; }
  .app__main { order: 1; }
}
