/* Agents & Dragons — the worn-package design system (redesign 2026-10-31).
 *
 * One physical package: a faded, much-handled game box (the cover), its
 * rulebooks (aged paper, woodcut ink art, 1977 stat blocks), its
 * character sheets (red-and-black print on cream, hand-ruled boxes),
 * and the table itself. Classic type throughout: Cinzel / Cinzel
 * Decorative for display, IM Fell English for text — self-hosted, OFL.
 * Print grain lies over everything at low opacity; the art stays rich,
 * the package carries the aging. */

/* ------------------------------- fonts -------------------------------- */

@font-face {
  font-family: "Cinzel";
  src: url("/assets/fonts/Cinzel.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Cinzel Decorative";
  src: url("/assets/fonts/CinzelDecorative-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Cinzel Decorative";
  src: url("/assets/fonts/CinzelDecorative-900.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: "IM Fell English";
  src: url("/assets/fonts/IMFellEnglish-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IM Fell English";
  src: url("/assets/fonts/IMFellEnglish-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ------------------------------ palette ------------------------------- */

:root {
  --ink: #2b2118;
  --ink-soft: #4a3826;
  --paper: #ece0c0;
  --paper-hi: #f6ecd2;
  --paper-deep: #e0cf9f;
  --paper-card: #e9dbb4;
  --box-red: #a83a34;        /* the faded box red (palette COVER_RED) */
  --box-red-deep: #752723;   /* its deep shade (COVER_RED_DEEP) */
  --box-red-dark: #57120e;
  --gold: #c9932b;
  --gold-bright: #e8c85a;
  --ivory: #f3e5c3;
  --dim: #7a6a52;
  --slate: #232c44;          /* the table's dark inset, desaturated */
  --slate-deep: #161c2e;
  --river: #4a7d99;
  --leaf: #4d7d33;
  --blood: #a83a34;
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='240' height='240' filter='url(%23n)' opacity='0.6'/></svg>");
}

* { box-sizing: border-box; }

html { background: #120c07; }

body {
  margin: 0;
  color: var(--ivory);
  background:
    radial-gradient(1100px 480px at 50% -60px, rgba(201, 147, 43, 0.13) 0%, rgba(0,0,0,0) 62%),
    radial-gradient(900px 700px at 50% 115%, rgba(117, 39, 35, 0.20) 0%, rgba(0,0,0,0) 60%),
    #171009;
  font-family: "IM Fell English", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.55;
}

/* The print grain: one coherent overlay across every page. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background-image: var(--noise); background-size: 240px 240px;
  opacity: 0.05; mix-blend-mode: overlay;
}

main { max-width: 1060px; margin: 0 auto; padding: 0 16px 52px; }

a { color: #8c2f2b; }
a:hover { color: var(--box-red-dark); }
.window a, .book a { color: #8c2f2b; }

.mono { font-family: ui-monospace, "Courier New", monospace; font-size: 0.92em; }
.sprite { image-rendering: pixelated; vertical-align: middle; }
.sprite.ink { image-rendering: pixelated; }

h1, h2, h3 { font-family: "Cinzel", Georgia, serif; }

/* ------------------------------ site head ------------------------------ */

.site-head {
  display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center;
  justify-content: space-between;
  max-width: 1060px; margin: 0 auto; padding: 13px 18px 11px;
  background: linear-gradient(180deg, var(--box-red) 0%, var(--box-red-deep) 92%);
  border-bottom: 4px double var(--gold);
  border-radius: 0 0 5px 5px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.45);
  position: relative; overflow: hidden;
}
.site-head::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--noise); opacity: 0.07; mix-blend-mode: overlay;
}
.brand {
  display: inline-flex; align-items: center; gap: 11px;
  color: var(--ivory); text-decoration: none;
  font-family: "Cinzel Decorative", Georgia, serif; font-weight: 700;
  letter-spacing: 2.5px; font-size: 19px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
}
.brand:hover { color: var(--gold-bright); }
.brand .brand-bell, .brand svg {
  background: radial-gradient(circle, #8c2f2b 58%, var(--gold) 60%, var(--gold) 66%, transparent 68%);
  border-radius: 50%; padding: 3px;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 17px; position: relative; z-index: 1; }
.site-nav a {
  color: #e6d3a3; text-decoration: none; font-size: 13.5px;
  font-family: "Cinzel", Georgia, serif; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px;
}
.site-nav a:hover { color: var(--gold-bright); }

/* ------------------------------- footer -------------------------------- */

.site-foot {
  max-width: 1060px; margin: 0 auto; padding: 26px 16px 44px;
  color: #b7a888; font-size: 14.5px; text-align: center;
}
.site-foot .foot-sigil { margin-bottom: 10px; }
.site-foot .foot-sigil svg {
  background: radial-gradient(circle, var(--box-red-deep) 58%, var(--gold) 61%, var(--gold) 66%, transparent 69%);
  border-radius: 50%; padding: 5px;
}
.site-foot .attribution { max-width: 780px; margin: 10px auto; font-style: italic; }
.site-foot .foot-links a { color: #cbb37f; }
.site-foot .foot-links a:hover { color: var(--gold-bright); }

/* --------------------------- parchment windows -------------------------- */
/* The package's paper: forms, panels, and pages pulled from the box.
   Aged cream, hand-ruled double borders, a whisper of grain inside. */

.window {
  position: relative;
  background: linear-gradient(180deg, var(--paper-hi) 0%, var(--paper) 55%, var(--paper-deep) 130%);
  color: var(--ink);
  border: 2px solid var(--ink-soft);
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 1px rgba(246, 236, 210, 0.9),
    inset 0 0 0 4px rgba(122, 90, 50, 0.20),
    inset 0 0 42px rgba(122, 90, 50, 0.14),
    0 7px 20px rgba(0,0,0,0.42);
  padding: 18px 22px;
  margin: 18px 0;
}
.window::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--noise); opacity: 0.05; mix-blend-mode: multiply;
  border-radius: inherit;
}
.win-title {
  margin: 0 0 10px; font-size: 18px; letter-spacing: 2.2px; font-weight: 700;
  text-transform: uppercase; color: var(--box-red-deep);
  border-bottom: 3px double rgba(117, 39, 35, 0.55); padding-bottom: 7px;
}
.window p { margin: 8px 0; }
.window hr { border: none; border-top: 1px solid rgba(74, 56, 38, 0.4); margin: 14px 0; }
.panel-intro { font-size: 18px; }

.btn {
  display: inline-block; cursor: pointer;
  background: linear-gradient(180deg, #efd9a0, #dec27f);
  color: var(--ink);
  border: 1.5px solid #6d5320; border-radius: 3px;
  box-shadow: 0 2px 0 #6d5320, 0 4px 9px rgba(0,0,0,0.25);
  padding: 8px 17px; font-size: 14.5px; letter-spacing: 1.2px;
  font-family: "Cinzel", Georgia, serif; font-weight: 700;
  text-transform: uppercase; text-decoration: none;
}
.btn:hover { background: linear-gradient(180deg, #f7e3ac, #e8cc8a); color: var(--ink); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #6d5320; }
.btn:disabled { opacity: 0.45; cursor: wait; }
.btn.gold { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); border-color: #7a5a16; }
.btn.gold:hover { background: linear-gradient(180deg, #f2d67c, #d9a83e); }
.btn.big { font-size: 16.5px; padding: 11px 22px; }

input[type="text"], input[type="password"], textarea, select {
  background: #fbf3dc; color: var(--ink);
  border: 1.5px solid #8a6d3b; border-radius: 2px;
  box-shadow: inset 0 1px 4px rgba(74, 56, 38, 0.18);
  padding: 8px 10px; font-size: 16.5px; width: 100%;
  font-family: "IM Fell English", Georgia, serif;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 0; }
label { display: block; margin: 11px 0 4px; font-size: 14.5px; color: var(--ink-soft); font-family: "Cinzel", Georgia, serif; letter-spacing: 0.4px; }
label.check { font-family: "IM Fell English", Georgia, serif; letter-spacing: 0; font-size: 15px; }
label.check input { width: auto; margin-right: 7px; }
.err { color: var(--blood); }
.ok-note { color: var(--leaf); }
.statusline { font-size: 15px; color: var(--dim); font-style: italic; }
.statusline b { color: var(--ink); }

.page-title {
  font-family: "Cinzel Decorative", Georgia, serif; font-weight: 700;
  font-size: clamp(30px, 5vw, 44px); letter-spacing: 1.5px;
  color: var(--gold-bright); text-align: center;
  margin: 22px 0 6px; text-shadow: 0 2px 0 rgba(0,0,0,0.55);
}

/* ------------------------------ sign-in -------------------------------- */

.auth-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.auth-box {
  border: 1.5px solid rgba(74, 56, 38, 0.65); border-radius: 2px;
  background: rgba(251, 243, 220, 0.5);
  box-shadow: inset 0 0 0 1px rgba(246, 236, 210, 0.7), inset 0 0 22px rgba(122, 90, 50, 0.10);
  padding: 6px 16px 14px;
}
.auth-box h3 {
  color: var(--box-red-deep); letter-spacing: 1.6px; font-size: 16px;
  text-transform: uppercase; margin: 12px 0 2px;
}
.agent-door {
  margin-top: 16px; border-top: 3px double rgba(117, 39, 35, 0.5); padding-top: 10px;
}
.agent-door summary {
  cursor: pointer; font-family: "Cinzel", Georgia, serif; font-weight: 700;
  letter-spacing: 1.2px; font-size: 14.5px; color: var(--ink-soft);
}
.agent-door summary:hover { color: var(--box-red-deep); }
.agent-door p { font-size: 15.5px; }

/* -------------------------------- cover --------------------------------- */
/* The box top: faded dusty red, outlined ivory masthead, the art
   window in a worn wooden frame. Aging is in the package — grain,
   vignette, softened contrast — never in the painting itself. */

body.cover { background: #241016; }
body.cover main { max-width: 940px; }
.cover-frame {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(246, 236, 210, 0.10) 0%, rgba(0,0,0,0) 55%),
    radial-gradient(130% 100% at 50% 115%, rgba(0,0,0,0.30) 0%, rgba(0,0,0,0) 55%),
    linear-gradient(180deg, var(--box-red) 0%, #9c332e 55%, var(--box-red-deep) 125%);
  border: 3px solid var(--box-red-dark);
  outline: 1px solid rgba(201, 147, 43, 0.35); outline-offset: 5px;
  border-radius: 4px; padding: 30px 30px 34px; margin-top: 22px;
  text-align: center; color: var(--ivory);
  box-shadow:
    inset 0 0 60px rgba(60, 8, 6, 0.35),
    inset 0 2px 0 rgba(246, 236, 210, 0.14),
    0 14px 48px rgba(0,0,0,0.6);
  transition: transform 0.5s ease, opacity 0.5s ease, filter 0.5s ease;
}
.cover-frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--noise); opacity: 0.09; mix-blend-mode: overlay;
}
body.cover-arriving .cover-frame { opacity: 0; transform: translateY(16px); }
body.lid-lifting .cover-frame {
  transform: perspective(1150px) rotateX(11deg) translateY(-14px) scale(0.99);
  opacity: 0.3; filter: brightness(1.12);
}
.cover-topline {
  color: var(--gold-bright); font-family: "Cinzel", Georgia, serif; font-weight: 700;
  letter-spacing: 4px; font-size: clamp(13px, 2.4vw, 19px); margin: 0;
  border-bottom: 1px solid rgba(243, 229, 195, 0.65); padding-bottom: 10px;
  text-shadow: 0 1px 0 rgba(60, 8, 6, 0.6);
}
.cover-title {
  font-family: "Cinzel Decorative", Georgia, serif; font-weight: 900;
  font-size: clamp(44px, 9.5vw, 92px); line-height: 1.02; margin: 14px 0 6px;
  letter-spacing: 3px; color: var(--ivory);
  text-shadow:
    1.5px 0 0 var(--box-red-dark), -1.5px 0 0 var(--box-red-dark),
    0 1.5px 0 var(--box-red-dark), 0 -1.5px 0 var(--box-red-dark),
    1.5px 1.5px 0 var(--box-red-dark), -1.5px -1.5px 0 var(--box-red-dark),
    1.5px -1.5px 0 var(--box-red-dark), -1.5px 1.5px 0 var(--box-red-dark),
    0 5px 0 rgba(60, 8, 6, 0.45), 0 14px 28px rgba(0,0,0,0.4);
}
.cover-title .mh-line { display: block; }
.cover-title .amp {
  color: var(--gold-bright); font-size: 0.82em; vertical-align: -0.04em;
  text-shadow:
    1.5px 0 0 var(--box-red-dark), -1.5px 0 0 var(--box-red-dark),
    0 1.5px 0 var(--box-red-dark), 0 -1.5px 0 var(--box-red-dark),
    0 5px 0 rgba(60, 8, 6, 0.45);
}
.cover-subtitle, .cover-bottom {
  font-family: "Cinzel", Georgia, serif; font-weight: 400; letter-spacing: 4.5px;
  font-size: clamp(12px, 2.2vw, 18px); color: var(--ivory);
  border-top: 4px double rgba(243, 229, 195, 0.8);
  border-bottom: 4px double rgba(243, 229, 195, 0.8);
  padding: 7px 4px; margin: 10px 6px 0;
}
.cover-art {
  /* Hero pass (2026-10-31): the painting is the page's centerpiece —
     a touch wider than the landscape it replaced. */
  position: relative; margin: 20px auto 8px; max-width: 820px;
  border: 9px solid #2b1a0c; border-radius: 3px;
  outline: 1.5px solid var(--gold); outline-offset: -14px;
  box-shadow: 0 0 0 1.5px #120a04, inset 0 0 0 2px rgba(0,0,0,0.6), 0 8px 26px rgba(0,0,0,0.45);
  overflow: hidden; line-height: 0;
  background: #17130e;
}
.cover-art .cover-scene { width: 100%; height: auto; display: block; }
.cover-art .art-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(115% 100% at 50% 42%, rgba(0,0,0,0) 62%, rgba(20, 8, 4, 0.34) 100%),
    linear-gradient(180deg, rgba(246, 236, 210, 0.05) 0%, rgba(0,0,0,0) 22%);
  box-shadow: inset 0 0 34px rgba(10, 4, 2, 0.5);
}
.cover-art .art-shade::after {
  content: ""; position: absolute; inset: 0;
  background-image: var(--noise); opacity: 0.06; mix-blend-mode: overlay;
}
.cover-art .ember {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: radial-gradient(circle, #ffd98a 0%, #e8862d 55%, rgba(232, 134, 45, 0) 74%);
  opacity: 0; pointer-events: none; animation: ember-rise 8s linear infinite;
}
@keyframes ember-rise {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: 0.95; }
  55% { opacity: 0.75; }
  100% { transform: translate(16px, -180px); opacity: 0; }
}
.cover-menu {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 13px; max-width: 880px; margin: 20px auto 0; text-align: left;
}
.cover-menu a {
  display: block; text-decoration: none; color: var(--ink);
  background: linear-gradient(180deg, var(--paper-hi), var(--paper-deep));
  border: 1.5px solid var(--ink-soft); border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(246,236,210,0.8), 0 4px 12px rgba(0,0,0,0.35);
  padding: 13px 16px 12px;
}
.cover-menu a b {
  display: block; font-size: 17.5px; letter-spacing: 1.8px; color: var(--box-red-deep);
  font-family: "Cinzel", Georgia, serif; font-weight: 700;
}
.cover-menu a b::before { content: "◆ "; color: var(--gold); font-size: 11px; vertical-align: 2px; }
.cover-menu a span { font-size: 15px; color: var(--ink-soft); }
.cover-menu a:hover { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold-bright), 0 5px 14px rgba(0,0,0,0.4); }
.cover-menu a:hover b { color: var(--blood); }
.cover-books { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.book-link {
  display: flex; gap: 14px; align-items: center; text-decoration: none;
  color: var(--ivory); border: 1.5px solid rgba(201, 147, 43, 0.75); border-radius: 3px;
  box-shadow: inset 0 0 0 3px rgba(0,0,0,0.28), inset 0 0 26px rgba(0,0,0,0.35), 0 5px 14px rgba(0,0,0,0.4);
  padding: 13px 18px 13px 15px; max-width: 345px; text-align: left;
}
.book-link.cloth-a { background: linear-gradient(160deg, #33505c 0%, #22343f 70%); }
.book-link.cloth-b { background: linear-gradient(160deg, #6d2a26 0%, #471a17 70%); }
.book-link:hover { filter: brightness(1.13); }
.book-link .book-medallion {
  flex: none; background: radial-gradient(circle, rgba(246,236,210,0.16) 55%, rgba(201,147,43,0.85) 58%, rgba(201,147,43,0.85) 63%, transparent 66%);
  border-radius: 50%; padding: 7px; line-height: 0;
}
.book-link b { font-family: "Cinzel Decorative", Georgia, serif; font-weight: 700; letter-spacing: 1.2px; display: block; font-size: 16.5px; color: var(--ivory); }
.book-link span { font-size: 14px; color: #d9c491; }
.cover-bottom { margin-top: 18px; }
.cover-smallprint {
  max-width: 620px; margin: 13px auto 0; font-style: italic;
  font-size: 14.5px; color: rgba(243, 229, 195, 0.85); line-height: 1.5;
}
.cover-sigil { margin-top: 14px; }
.cover-sigil svg {
  background: radial-gradient(circle, rgba(0,0,0,0.22) 55%, rgba(201,147,43,0.9) 58%, rgba(201,147,43,0.9) 63%, transparent 66%);
  border-radius: 50%; padding: 5px;
}
.cover-explainer { max-width: 880px; margin: 24px auto 0; text-align: left; }
.cover-explainer .window p:first-of-type::first-letter {
  font-family: "Cinzel Decorative", Georgia, serif; font-weight: 700;
  font-size: 44px; line-height: 0.85; float: left; padding: 5px 8px 0 0;
  color: var(--box-red-deep);
}

/* ------------------------------ game screen ----------------------------- */
/* The stage is a dark viewport cut into the parchment chronicle — the
   window you look through at the table. */

.stage {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 0;
  border: 2.5px solid #120a04; border-radius: 3px; overflow: hidden;
  background: #060607;
  box-shadow: inset 0 0 0 1.5px rgba(201, 147, 43, 0.5), 0 4px 14px rgba(0,0,0,0.3);
}
.stage-enemies {
  position: relative; min-height: 300px; padding: 18px 12px;
  background:
    linear-gradient(180deg, rgba(58, 111, 138, 0.30), rgba(6,6,7,0) 55%),
    radial-gradient(400px 160px at 50% 100%, rgba(87,166,57,0.13), rgba(0,0,0,0) 70%),
    #0a0f1e;
  display: flex; align-items: flex-end; justify-content: center; gap: 14px;
  border-right: 2.5px solid #120a04;
}
.stage-party {
  display: flex; flex-direction: column; justify-content: flex-end;
  gap: 8px; padding: 14px 10px; background: #0d1322; color: var(--ivory);
}
.enemy { text-align: center; }
.enemy .ename { font-family: "Cinzel", Georgia, serif; font-size: 13px; letter-spacing: 0.6px; color: var(--ivory); }
.enemy .ehp { font-size: 13px; font-style: italic; color: var(--gold-bright); }
.enemy.dead { opacity: 0.28; filter: grayscale(1); }
.party-member { display: flex; align-items: center; gap: 10px; }
.party-member .pinfo { font-size: 14px; }
.hpbar {
  height: 9px; background: #2a0f0c; border: 1.5px solid rgba(20, 12, 6, 0.85);
  border-radius: 2px; overflow: hidden; min-width: 90px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}
.hpbar > div { height: 100%; background: linear-gradient(90deg, #b03a30, #7d9b3a); }
.battle-bottom { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; margin-top: 12px; }
.enemy-name-panel, .command-panel {
  background: linear-gradient(180deg, var(--slate) 0%, var(--slate-deep) 100%);
  border: 2px solid #120a04; border-radius: 3px; padding: 12px 16px;
  box-shadow: inset 0 0 0 1.5px rgba(201, 147, 43, 0.45);
  color: var(--ivory);
  font-family: "IM Fell English", Georgia, serif;
}
.command-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.command-panel button {
  background: none; border: none; color: var(--ivory); text-align: left;
  font-family: "Cinzel", Georgia, serif; font-weight: 700;
  font-size: 15.5px; letter-spacing: 1.2px; cursor: pointer; padding: 4px 4px;
  text-transform: uppercase;
}
.command-panel button:hover, .command-panel button:focus { color: var(--gold-bright); }
.command-panel button::before { content: "▸ "; color: transparent; }
.command-panel button:hover::before { color: var(--gold-bright); }

.feed { max-height: 460px; overflow-y: auto; padding-right: 4px; }
.feed .scene-block { margin-bottom: 16px; }
.feed .scene-title {
  color: var(--box-red-deep); font-family: "Cinzel", Georgia, serif; font-weight: 700;
  letter-spacing: 1.6px; text-transform: uppercase; font-size: 15px; margin: 0 0 4px;
}
.feed .narration { margin: 4px 0; font-size: 17.5px; }
.feed .opening { color: var(--ink-soft); font-style: italic; margin: 4px 0; }
.feed .action-line { margin: 3px 0; font-size: 15.5px; }
.feed .action-line b { color: var(--box-red-dark); }
.feed .defaulted { color: var(--dim); font-size: 14px; font-style: italic; }

table.rolls { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rolls th, table.rolls td { border-bottom: 1px solid rgba(74, 56, 38, 0.35); padding: 4px 6px; text-align: left; }
table.rolls th { color: var(--box-red-deep); font-family: "Cinzel", Georgia, serif; font-size: 12.5px; letter-spacing: 1px; text-transform: uppercase; }
.roll-ok { color: var(--leaf); }
.roll-bad { color: var(--blood); }

/* --------------------------- character sheets --------------------------- */
/* Vintage character sheets: aged cream paper, red display lettering,
   hand-ruled boxes, checkbox squares. The sheet is a physical
   artifact from the box, filled in by hand. */

.sheet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 13px; }
.sheet-card {
  position: relative;
  background: linear-gradient(180deg, #f2e7c8 0%, var(--paper-card) 70%, #dfcd9c 130%);
  border: 1.5px solid var(--ink-soft); border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(246,236,210,0.75), inset 0 0 26px rgba(122,90,50,0.13), 0 4px 11px rgba(0,0,0,0.28);
  padding: 12px 15px 13px; color: var(--ink);
}
.sheet-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--noise); opacity: 0.05; mix-blend-mode: multiply;
}
.sheet-card h3 {
  margin: 0 0 1px; font-size: 17.5px; color: var(--box-red-deep);
  font-family: "Cinzel Decorative", Georgia, serif; font-weight: 700; letter-spacing: 0.6px;
}
.sheet-card .sub { color: var(--ink-soft); font-size: 14px; font-style: italic; margin-bottom: 8px; }
.sheet-card dl {
  display: grid; grid-template-columns: auto 1fr; gap: 3px 11px;
  font-size: 15px; margin: 7px 0 2px;
}
.sheet-card dt {
  color: var(--box-red-deep); font-family: "Cinzel", Georgia, serif; font-weight: 700;
  font-size: 11.5px; letter-spacing: 1.1px; text-transform: uppercase; padding-top: 3px;
  border-bottom: 1px solid rgba(74, 56, 38, 0.28);
}
.sheet-card dd { margin: 0; font-style: italic; border-bottom: 1px solid rgba(74, 56, 38, 0.28); padding-bottom: 1px; }
.slotbox {
  display: inline-block; width: 11px; height: 11px; margin: 0 1.5px;
  border: 1.5px solid var(--ink-soft); border-radius: 1px;
  background: rgba(251, 243, 220, 0.6); vertical-align: -1px;
}
.slotbox.used { background: var(--ink-soft); box-shadow: inset 0 0 0 1.5px var(--paper-card); }
.slotnum { font-style: normal; font-size: 13px; color: var(--ink-soft); }
.tag {
  display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 2px;
  border: 1.5px solid var(--box-red-deep); color: var(--box-red-deep); margin-left: 7px;
  font-family: "Cinzel", Georgia, serif; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; vertical-align: 2px; font-style: normal;
}
.tag.house { border-color: var(--river); color: var(--river); }

/* Full character screen (flow build contract): the sheet as a working
   screen — ability boxes down the left like the printed form, ruled
   panels, equipment slots you can handle. */
.charsheet {
  background: linear-gradient(180deg, #f2e7c8 0%, var(--paper-card) 70%, #dfcd9c 130%);
  border: 2px solid var(--ink-soft); border-radius: 3px; color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(246,236,210,0.8), inset 0 0 30px rgba(122,90,50,0.13), 0 7px 20px rgba(0,0,0,0.4);
  padding: 20px 22px; position: relative;
}
.charsheet .cs-name {
  font-family: "Cinzel Decorative", Georgia, serif; font-weight: 700;
  color: var(--box-red-deep); font-size: clamp(24px, 4vw, 34px); margin: 0;
  border-bottom: 3px double rgba(117, 39, 35, 0.55); padding-bottom: 6px;
}
.charsheet .cs-sub { font-style: italic; color: var(--ink-soft); margin: 4px 0 12px; }
.charsheet .cs-cols { display: grid; grid-template-columns: 118px 1fr 1fr; gap: 14px; }
.charsheet .cs-ability {
  border: 1.5px solid var(--ink-soft); border-radius: 2px; text-align: center;
  padding: 6px 4px 8px; margin-bottom: 9px; background: rgba(251,243,220,0.5);
  box-shadow: inset 0 0 0 1px rgba(246,236,210,0.7);
}
.charsheet .cs-ability b {
  display: block; font-family: "Cinzel", Georgia, serif; font-size: 11.5px;
  letter-spacing: 1.4px; color: var(--box-red-deep);
}
.charsheet .cs-ability .cs-score { font-size: 27px; line-height: 1.1; }
.charsheet .cs-ability .cs-mod { font-style: italic; font-size: 14px; color: var(--ink-soft); }
.charsheet .cs-box {
  border: 1.5px solid rgba(74, 56, 38, 0.7); border-radius: 2px;
  padding: 10px 13px; margin-bottom: 12px; background: rgba(251,243,220,0.35);
}
.charsheet .cs-box h3, .charsheet .cs-box h4 {
  margin: 0 0 6px; color: var(--box-red-deep); letter-spacing: 1.6px;
  font-size: 14.5px; text-transform: uppercase;
}
.equip-slot {
  display: flex; gap: 10px; align-items: baseline; padding: 5px 2px;
  border-bottom: 1px solid rgba(74, 56, 38, 0.3);
}
.equip-slot .slot-label {
  flex: none; width: 92px; font-family: "Cinzel", Georgia, serif; font-weight: 700;
  font-size: 11px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--box-red-deep);
}
.equip-slot .slot-item { font-style: italic; }
.equip-slot .slot-empty { color: var(--dim); font-style: italic; }

/* Level-up screen (flow build contract): the sheet, celebrated. */
.levelup {
  border: 2.5px solid var(--gold); border-radius: 3px;
  background: linear-gradient(180deg, var(--paper-hi), var(--paper-deep));
  box-shadow: inset 0 0 0 2px rgba(122, 90, 50, 0.3), inset 0 0 46px rgba(201, 147, 43, 0.18), 0 9px 26px rgba(0,0,0,0.45);
  color: var(--ink); padding: 22px 24px; text-align: center;
}
.levelup h2, .levelup .levelup-title {
  font-family: "Cinzel Decorative", Georgia, serif; font-weight: 900;
  color: var(--box-red-deep); letter-spacing: 2px; margin: 0 0 6px;
  font-size: clamp(26px, 4.5vw, 38px);
}
.levelup-card {
  border: 1.5px solid var(--ink-soft); border-radius: 2px; text-align: left;
  background: rgba(251,243,220,0.55); padding: 12px 15px; cursor: pointer; color: var(--ink);
  font: inherit; width: 100%;
}
.levelup-card:hover, .levelup-card.selected { border-color: var(--gold); box-shadow: 0 0 0 1.5px var(--gold-bright); }

/* Map views (flow build contract): the campaign map and dungeon
   interiors as a plate from the box — stone frame, aged tiles. */
.map-panel {
  border: 2.5px solid #120a04; border-radius: 3px; overflow: hidden;
  background: #241a10; box-shadow: inset 0 0 0 1.5px rgba(201,147,43,0.5), 0 5px 16px rgba(0,0,0,0.35);
}
.map-panel .map-name {
  font-family: "Cinzel", Georgia, serif; font-weight: 700; letter-spacing: 2px;
  color: var(--gold-bright); text-transform: uppercase; font-size: 15px;
  padding: 9px 14px; border-bottom: 1.5px solid rgba(201,147,43,0.4);
  background: linear-gradient(180deg, #2e2013, #241a10);
}
.map-grid { display: grid; gap: 2px; padding: 10px; background: #1a120a; }
.map-cell {
  aspect-ratio: 1; border: 1px solid rgba(20, 12, 6, 0.55); border-radius: 1px;
  background: linear-gradient(160deg, #d9c491, #c8ad72);
  box-shadow: inset 0 0 8px rgba(122, 90, 50, 0.25);
  display: flex; align-items: center; justify-content: center; line-height: 0;
}
.map-cell.unseen { background: #4a3a28; box-shadow: inset 0 0 12px rgba(0,0,0,0.6); }
.map-cell.water { background: linear-gradient(160deg, #4d7186, #33505c); }
.map-cell.woods { background: linear-gradient(160deg, #5d7a3d, #425c2a); }
.map-cell.stone { background: linear-gradient(160deg, #9a8d76, #77694f); }
.map-cell.here { outline: 2.5px solid var(--blood); outline-offset: -2.5px; box-shadow: 0 0 12px rgba(232, 200, 90, 0.65), inset 0 0 8px rgba(122,90,50,0.25); }
.map-legend {
  display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 8px 14px 11px;
  font-style: italic; font-size: 14px; color: #d9c491;
  background: linear-gradient(180deg, #241a10, #2e2013);
}

/* -------------------------------- builder ------------------------------- */

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; margin: 10px 0; }
.pick-card {
  background: linear-gradient(180deg, #f2e7c8, var(--paper-card));
  border: 1.5px solid var(--ink-soft); border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(246,236,210,0.7), 0 3px 9px rgba(0,0,0,0.25);
  padding: 12px; text-align: center; cursor: pointer; color: var(--ink);
  font: inherit;
}
.pick-card:hover { border-color: var(--gold); }
.pick-card.selected { border-color: var(--gold); background: linear-gradient(180deg, #f7e9bd, #ecd28e); box-shadow: 0 0 0 1.5px var(--gold-bright), 0 3px 9px rgba(0,0,0,0.25); }
.pick-card h3 { margin: 6px 0 2px; font-size: 16px; color: var(--box-red-deep); letter-spacing: 0.6px; }
.pick-card p { font-size: 13.5px; color: var(--ink-soft); margin: 2px 0; }
.stepnav { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.stepnav .btn.current { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: var(--ink); }
.ability-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(122px, 1fr)); gap: 10px; }
.ability-cell {
  background: rgba(251,243,220,0.5); border: 1.5px solid var(--ink-soft); border-radius: 2px;
  padding: 10px; text-align: center; color: var(--ink);
}
.ability-cell .score { font-size: 27px; }
.ability-cell .mod { color: var(--box-red-deep); font-style: italic; }
.ability-cell button { width: 34px; margin: 2px; }
.check-list { columns: 2; column-gap: 26px; }
.check-list label { display: block; margin: 4px 0; color: var(--ink); font-size: 15.5px; font-family: "IM Fell English", Georgia, serif; letter-spacing: 0; }
.check-list input { width: auto; margin-right: 8px; }

/* --------------------------------- books -------------------------------- */
/* The rulebooks out of the box: aged paper, cloth covers in faded
   red and slate, woodcut ink art, two voices of type — Cinzel
   Decorative for chapter heads, IM Fell for the text — and stat
   blocks set as the 1977 manual set them: ruled, capped, dense. */

.book {
  background: linear-gradient(180deg, #f0e4c2 0%, var(--paper) 60%, var(--paper-deep) 135%);
  color: var(--ink); border-radius: 3px;
  border: 2px solid var(--ink-soft);
  box-shadow: inset 0 0 0 1px rgba(246,236,210,0.85), inset 0 0 52px rgba(122,90,50,0.15), 0 9px 30px rgba(0,0,0,0.5);
  padding: 36px 42px; margin: 20px 0; position: relative;
}
.book::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--noise); opacity: 0.05; mix-blend-mode: multiply;
}
.book a { color: #8c2f2b; }
.book-cover { text-align: center; margin-bottom: 10px; }
.book-cover .cover-art { display: flex; gap: 16px; justify-content: center; align-items: flex-end; margin-bottom: 12px; }
.book-cover .cover-kicker {
  font-family: "Cinzel", Georgia, serif; letter-spacing: 4px; font-size: 14px;
  color: var(--box-red-deep); text-transform: uppercase; margin: 0;
}
.book-cover h1, .bookish-title {
  font-family: "Cinzel Decorative", Georgia, serif; font-weight: 900;
  font-size: clamp(34px, 6vw, 52px); color: var(--box-red-deep);
  letter-spacing: 1.5px; margin: 4px 0 8px; text-shadow: none;
  border-bottom: 4px double rgba(117, 39, 35, 0.6); padding-bottom: 12px;
}
.book-cover .cover-sub { max-width: 620px; margin: 0 auto; font-style: italic; font-size: 16.5px; color: var(--ink-soft); }
.chapter-nav { margin: 16px auto 4px; max-width: 640px; text-align: left; }
.chapter-nav ol { columns: 2; column-gap: 34px; margin: 0; padding-left: 22px; }
.chapter-nav li { margin: 3px 0; break-inside: avoid; }
.book h2 {
  font-family: "Cinzel Decorative", Georgia, serif; font-weight: 700;
  color: var(--box-red-deep); font-size: clamp(23px, 3.6vw, 30px); letter-spacing: 1px;
  margin: 34px 0 10px; border-bottom: 3px double rgba(117, 39, 35, 0.55); padding-bottom: 5px;
}
.book h3 { color: var(--ink); margin: 20px 0 6px; font-size: 19.5px; letter-spacing: 0.5px; }
.book p, .book li { font-size: 16.5px; }
.book-chapter > p:first-of-type::first-letter {
  font-family: "Cinzel Decorative", Georgia, serif; font-weight: 700;
  font-size: 40px; line-height: 0.85; float: left; padding: 4px 8px 0 0; color: var(--box-red-deep);
}
.data-table, .book table.data-table {
  border-collapse: collapse; margin: 12px 0; font-size: 15px; width: 100%;
}
.data-table th, .data-table td {
  border-top: 1.5px solid rgba(74, 56, 38, 0.55); border-bottom: 1px solid rgba(74, 56, 38, 0.3);
  padding: 4px 9px; text-align: left;
}
.data-table th {
  font-family: "Cinzel", Georgia, serif; font-size: 12.5px; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--box-red-deep);
  border-bottom: 2.5px solid rgba(117, 39, 35, 0.65);
}
.book-card, .race-card, .class-entry, .condition-card, .background-card,
.feat-card, .equipment-entry, .item-entry, .spell-entry, .corpus-entry,
.pack-entry, .book-entry {
  border: 1.5px solid rgba(74, 56, 38, 0.7); border-radius: 2px;
  background: rgba(251, 243, 220, 0.42);
  box-shadow: inset 0 0 0 1px rgba(246,236,210,0.65), inset 0 0 22px rgba(122,90,50,0.09);
  padding: 14px 17px; margin: 14px 0;
}
.book-entry .entry-art, .class-entry .entry-art { text-align: center; margin-bottom: 6px; }
.card-art { text-align: center; margin-bottom: 4px; }
.monster-name { font-style: italic; color: var(--ink-soft); margin-top: -4px; }
.redaction-note {
  border: 1.5px solid var(--blood); color: var(--box-red-deep); border-radius: 2px;
  padding: 8px 12px; transform: rotate(-0.4deg);
  font-family: "Cinzel", Georgia, serif; font-size: 13.5px; letter-spacing: 0.4px;
}
.book-colophon { border-top: 3px double rgba(117, 39, 35, 0.55); margin-top: 30px; padding-top: 12px; font-size: 15px; }
.bestiary-index { columns: 2; column-gap: 34px; font-size: 15.5px; }
.bestiary-index li { break-inside: avoid; margin: 2.5px 0; }
.book-table-text {
  font-size: 14px; line-height: 1.45; background: rgba(122, 90, 50, 0.10);
  border-left: 2.5px solid rgba(117, 39, 35, 0.5); padding: 7px 11px;
}
.spell-level-line, .item-meta { font-style: italic; color: var(--ink-soft); }
.variant-note, .gear-note, .in-game-note { font-style: italic; font-size: 15px; color: var(--ink-soft); }
.example-roll {
  background: linear-gradient(180deg, var(--slate), var(--slate-deep)); color: var(--ivory);
  border: 2px solid #120a04; border-radius: 3px; padding: 12px 16px;
  font-size: 15px; margin: 12px 0; box-shadow: inset 0 0 0 1.5px rgba(201,147,43,0.4);
}
.example-roll .ok { color: #9ccb62; } .example-roll .bad { color: #ff9a8a; }
.redacted { background: var(--ink); color: var(--ink); padding: 0 6px; border-radius: 2px; user-select: none; }
.entry-head { display: flex; gap: 18px; align-items: flex-start; }
.entry-head .sprite { flex: none; }
.book-toc { columns: 2; column-gap: 30px; font-size: 15.5px; }

/* Stat blocks — the 1977 component, shared by the Monster Manual's
   own entries (.statblock) and the corpus bestiary's windowed blocks
   (.vintage-statblock / .vintage-table, corpus-books.ts contract):
   compact ruled tables, all-caps field labels, dense period type. */
.statblock-wrap { margin: 14px 0; }
table.statblock, table.vintage-table {
  border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.4;
  border-top: 3px double var(--box-red-deep); border-bottom: 3px double var(--box-red-deep);
  margin: 0 0 10px;
}
table.statblock th, table.vintage-table th {
  font-family: "Cinzel", Georgia, serif; font-weight: 700; font-size: 11.5px;
  letter-spacing: 1.2px; text-transform: uppercase; color: var(--box-red-deep);
  text-align: left; padding: 3.5px 8px 3.5px 2px; white-space: nowrap;
  border-bottom: 1px solid rgba(74, 56, 38, 0.3); vertical-align: top;
}
table.statblock td, table.vintage-table td {
  padding: 3.5px 10px 3.5px 2px; font-style: italic;
  border-bottom: 1px solid rgba(74, 56, 38, 0.3); vertical-align: top;
}
table.statblock.abilities th, table.statblock.abilities td { text-align: center; font-style: normal; }
table.statblock.abilities td { font-size: 15.5px; }
.window.stat-block { padding-top: 12px; }
.window.stat-block .win-title { font-size: 15.5px; }
.window.vintage-statblock table.vintage-table { margin-bottom: 2px; }

/* Old book-page shell (kept for any surface still using it). */
body.book-page-body { background: #201409; }
.book-page {
  background: linear-gradient(180deg, #f0e4c2, var(--paper) 60%, var(--paper-deep) 135%);
  color: var(--ink); border-radius: 3px; padding: 34px 38px; margin: 18px 0;
  border: 2px solid var(--ink-soft); box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.book-page a { color: #8c2f2b; }
.book-page h1 {
  font-family: "Cinzel Decorative", Georgia, serif; font-weight: 900;
  font-size: 36px; margin: 0 0 6px; letter-spacing: 1px; color: var(--box-red-deep);
  border-bottom: 4px double rgba(117, 39, 35, 0.6); padding-bottom: 10px;
}
.book-page h2 { font-family: "Cinzel Decorative", Georgia, serif; color: var(--box-red-deep); margin: 30px 0 8px; font-size: 25px; border-bottom: 1px solid rgba(74,56,38,0.4); padding-bottom: 4px; }
.book-page h3 { color: var(--ink); margin: 20px 0 6px; font-size: 19px; }
.book-page table { border-collapse: collapse; margin: 10px 0; font-size: 15px; }
.book-page th, .book-page td { border: 1px solid rgba(122, 90, 50, 0.55); padding: 4px 9px; text-align: left; }
.book-page th { background: rgba(122, 90, 50, 0.14); font-family: "Cinzel", Georgia, serif; font-size: 12.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--box-red-deep); }

@media (max-width: 760px) {
  .stage { grid-template-columns: 1fr; }
  .stage-enemies { border-right: none; border-bottom: 2.5px solid #120a04; }
  .battle-bottom { grid-template-columns: 1fr; }
  .auth-cols { grid-template-columns: 1fr; }
  .book { padding: 24px 18px; }
  .book-page { padding: 22px 18px; }
  .check-list { columns: 1; }
  .chapter-nav ol, .bestiary-index, .book-toc { columns: 1; }
  .charsheet .cs-cols { grid-template-columns: 1fr; }
  .cover-frame { padding: 22px 16px 26px; }
  table.statblock th { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .cover-art .ember { display: none; animation: none; }
  .cover-frame { transition: none; }
  body.lid-lifting .cover-frame { transform: none; opacity: 1; filter: none; }
  * { scroll-behavior: auto; }
}

/* ===== Gameplay flow (map-first table, character screen, level-up desk) =====
   Surfaces wear the design system's contract classes (.map-panel,
   .charsheet, .levelup); this section carries only what the contract
   does not: the overlay, the sheet's checkbox marks, the desk's
   controls, and text on the map's dark plate. */

.tag.levelup {
  border-color: var(--box-red);
  color: var(--box-red);
  font-weight: 700;
}

/* --- on the map plate (dark ground) --- */
.map-cell .cell-glyph {
  font-family: "Cinzel", Georgia, serif;
  font-size: 21px;
  line-height: 1;
  color: var(--ink);
}
.map-cell.unseen .cell-glyph { color: #d9c491; }
.map-legend b { color: var(--gold-bright); }
.map-where { margin: 0; padding: 0 14px 4px; color: #e9dbb4; font-style: italic; }
.map-note { margin: 0; padding: 0 14px 12px; color: #b3a37f; font-size: 0.92em; font-style: italic; }
.travel-row {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 2px 14px 13px;
}
.travel-label {
  font-variant: small-caps; letter-spacing: 0.05em; color: #d9c491;
}
.travel-row .statusline { color: #e9dbb4; }
.stage-where {
  margin: 0 0 4px;
  font-family: "Cinzel Decorative", Georgia, serif;
  letter-spacing: 0.08em;
  color: var(--box-red);
  font-variant: small-caps;
}

/* --- the character screen overlay --- */
.char-overlay {
  position: fixed;
  inset: 0;
  background: rgba(24, 16, 8, 0.72);
  overflow-y: auto;
  z-index: 60;
  padding: 24px 12px 48px;
}
.char-sheet-wrap { max-width: 1060px; margin: 0 auto; }
.cs-top { display: flex; justify-content: space-between; align-items: flex-start; }
.cs-levelup-banner {
  margin: 10px 0 0;
  border: 1.5px solid var(--box-red);
  color: var(--box-red-deep);
  padding: 6px 10px;
  font-variant: small-caps;
  letter-spacing: 0.05em;
  background: rgba(168, 58, 52, 0.07);
}
.cs-line { margin: 3px 0; font-size: 0.95rem; }
.cs-text { margin: 4px 0; font-size: 0.95rem; }
.cs-num { display: inline-block; min-width: 2.1em; font-weight: 700; }
.cs-mark {
  display: inline-block;
  width: 10px; height: 10px;
  border: 1.5px solid var(--ink);
  margin-right: 6px;
  vertical-align: -1px;
  background: transparent;
}
.cs-mark.filled { background: var(--ink); }
.cs-mark.star { background: var(--box-red); border-color: var(--box-red); }
.cs-tag {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  font-variant: small-caps;
  border: 1px solid var(--river);
  color: var(--river);
  padding: 0 4px;
  border-radius: 2px;
}
.cs-equip { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cs-mini { padding: 1px 8px; font-size: 0.8rem; }

/* --- the level-up desk's controls --- */
.levelup fieldset.levelup-card { cursor: default; margin: 10px 0; }
.levelup-card legend {
  font-family: "Cinzel", Georgia, serif;
  color: var(--box-red-deep);
  letter-spacing: 0.04em;
  padding: 0 6px;
}
.lu-note { color: var(--ink-soft); font-size: 0.92em; font-style: italic; margin: 6px 0; text-align: left; }
.lu-check { display: inline-block; margin: 2px 12px 2px 0; text-align: left; }
.levelup label { text-align: left; }

/* --- spectator map --- */
.sp-map { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.sp-node {
  border: 1.5px solid var(--ink-soft);
  border-radius: 2px;
  padding: 4px 9px;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.2);
}
.sp-node.visited { background: #d9c391; }
.sp-node.current { background: var(--box-red); color: var(--paper-card); border-color: var(--ink); font-weight: 700; }
.sp-node.hidden { background: #2b2118; color: var(--paper-card); }

/* ===== Maps program (2026-10-31): the painted plates =====
   The tile grid is retired. Every map is now one painted plate from
   the cartography studio (src/web/map-art.ts): parchment country and
   drawn places on the region plate, a stone plan on the interior
   plate. The plate's own marked places are the travel controls. */

.map-art { padding: 10px; background: #14100e; }
.map-art .map-note { padding: 4px 2px; }
.map-svg { display: block; width: 100%; height: auto; }

.map-label {
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-anchor: middle;
  fill: #241a14;
  paint-order: stroke;
  stroke: #f3e5c3;
  stroke-width: 3px;
  stroke-linejoin: round;
}
.map-label.dark { fill: #e8e0cc; stroke: #14100e; }
.map-label.current { fill: #8f1d1d; }
.map-label.dark.current { fill: #f7d774; }

.compass-n {
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  text-anchor: middle;
  fill: #241a14;
}

.target-ring {
  fill: rgba(232, 169, 61, 0.10);
  stroke: #e8a93d;
  stroke-width: 1.4;
  stroke-dasharray: 3.5 2.5;
}
.party-ring {
  fill: none;
  stroke: #f7d774;
  stroke-width: 1.6;
  animation: party-pulse 2.6s ease-in-out infinite;
}
.party-ring.soft { stroke-width: 1; opacity: 0.4; animation: none; }
@keyframes party-pulse {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
  .party-ring { animation: none; }
}

.map-target { cursor: pointer; outline: none; }
.map-target:hover .target-ring,
.map-target:focus .target-ring { stroke: #f7d774; stroke-width: 2.2; }
.map-target:hover .map-label,
.map-target:focus .map-label { fill: #8f1d1d; }
.map-target:hover .map-label.dark,
.map-target:focus .map-label.dark { fill: #f7d774; }

.fog-outline {
  fill: none;
  stroke: #241a14;
  stroke-width: 1;
  stroke-dasharray: 2.5 3;
  opacity: 0.65;
}
.fog-mark {
  font-family: "IM Fell English", Georgia, serif;
  font-style: italic;
  text-anchor: middle;
  fill: #5e3c1a;
}

.map-panel #travel-status { display: block; padding: 0 14px 10px; color: #e9dbb4; }
.map-panel #travel-status:empty { display: none; }
