@font-face {
  font-family: "Cinzel";
  src: url("../fonts/cinzel-400.woff2?v=20261201-di1") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("../fonts/cinzel-700.woff2?v=20261201-di1") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/ebgaramond-400.woff2?v=20261201-di1") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/ebgaramond-400i.woff2?v=20261201-di1") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/ebgaramond-600.woff2?v=20261201-di1") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/ebgaramond-700.woff2?v=20261201-di1") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #2a2118;
  --ink-soft: #5c4f40;
  --parchment: #fbf6ec;
  --parchment-deep: #f3e8d4;
  --desk: #e7d8c0;
  --rule: #d7c4a4;
  --rule-strong: #8d7048;
  --oxblood: #6e2b33;
  --oxblood-deep: #521f26;
  --forest: #234237;
  --gold: #9a7436;
  --gold-soft: #e4d2ae;
  --focus: #8d3b3b;
  --serif: "EB Garamond", "Palatino Linotype", Palatino, Georgia, serif;
  --display: "Cinzel", "Palatino Linotype", Palatino, serif;
  --shadow: 0 22px 50px rgba(62, 42, 24, 0.16);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 1.125rem/1.45 var(--serif);
  background-color: var(--desk);
  background-image:
    radial-gradient(ellipse at 18% 0%, rgba(255,248,236,.7), transparent 42%),
    radial-gradient(ellipse at 90% 8%, rgba(154,116,54,.08), transparent 36%),
    linear-gradient(180deg, #f6ead6 0%, #e7d3b4 46%, #dcc6a4 100%);
}
a { color: var(--oxblood-deep); text-underline-offset: .15em; }
.skip { position: absolute; left: 1rem; top: -5rem; z-index: 5; background: var(--oxblood); color: #fff; padding: .5rem .8rem; }
.skip:focus { top: .6rem; }
.site-head, main, .site-foot { width: min(960px, calc(100% - 2rem)); margin-inline: auto; }
.site-head { padding: 2.2rem 0 1.4rem; }
.brand { display: flex; gap: .9rem; align-items: center; }
.mark { width: 52px; height: 52px; flex: none; filter: drop-shadow(0 4px 8px rgba(80,40,24,.12)); }
h1 { margin: 0; font: 700 clamp(1.65rem, 4.5vw, 3.1rem)/1.1 var(--display); letter-spacing: .04em; color: var(--oxblood-deep); }
.subtitle { margin: .2rem 0 0; font: .78rem var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); }
.panel, .sheet { background: var(--parchment); border: 1px solid #e4d3b6; box-shadow: var(--shadow); }
.panel { padding: 1.15rem 1.4rem 1.1rem; margin-bottom: 1.4rem; }
.lead { margin: 0 0 .55rem; font-size: 1.25rem; }
.help summary { width: fit-content; cursor: pointer; color: var(--forest); font-size: 1rem; }
.help summary:hover { color: var(--oxblood); }
.help p { margin: .4rem 0 .8rem; max-width: 42rem; color: var(--ink-soft); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.btn { min-height: 44px; font: .72rem var(--display); letter-spacing: .12em; text-transform: uppercase; border-radius: 2px; padding: .75rem 1rem; cursor: pointer; }
.btn-primary { background: var(--oxblood); color: #f8f1e6; border: 1px solid var(--oxblood-deep); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset; }
.btn-primary:hover { background: var(--oxblood-deep); }
.btn-ghost { background: transparent; color: var(--oxblood-deep); border: 1px solid var(--rule-strong); }
.btn-ghost:hover { background: #fffaf3; border-color: var(--oxblood); }
.btn:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.field-note { margin: .55rem 0 0; font-size: .98rem; color: var(--ink-soft); }
.status { min-height: 1.45em; color: var(--forest); }
.sheet {
  position: relative;
  padding: 1.85rem 1.7rem 1.9rem;
  margin-bottom: 2rem;
  background-color: var(--parchment);
  background-image:
    linear-gradient(180deg, rgba(255, 252, 246, 0.65), transparent 7rem),
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(141, 112, 72, 0.035) 4px);
}
.sheet::before,
.sheet::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.sheet::before {
  inset: 0.55rem;
  border: 1px solid rgba(154, 116, 54, 0.55);
  box-shadow: inset 0 0 0 4px rgba(251, 246, 236, 0.4), inset 0 0 0 5px rgba(154, 116, 54, 0.28);
}
.sheet::after {
  inset: 0.38rem;
  background:
    linear-gradient(var(--gold), var(--gold)) left top / 16px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) left top / 1px 16px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right top / 16px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right top / 1px 16px no-repeat,
    linear-gradient(var(--gold), var(--gold)) left bottom / 16px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) left bottom / 1px 16px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right bottom / 16px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right bottom / 1px 16px no-repeat;
}
.sheet:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.sheet-banner { text-align: center; padding-bottom: 1.15rem; margin-bottom: 1.3rem; border-bottom: 3px double var(--gold); }
.dungeon-title { margin: 0; font: 700 clamp(1.65rem, 4vw, 2.5rem)/1.2 var(--display); text-wrap: balance; overflow-wrap: anywhere; }
.fields { margin: 0; }
.fields > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .9rem; padding-block: .75rem; border-bottom: 1px solid var(--gold-soft); }
.fields > div:first-child { padding-top: 0; }
.fields > div:last-child { border-bottom: 0; padding-bottom: 0; }
.fields dt { color: var(--oxblood-deep); font-weight: 600; }
.fields dd { margin: 0; overflow-wrap: anywhere; }
.site-field { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.site-field label { font: .75rem var(--display); letter-spacing: .1em; }
select { min-height: 44px; min-width: 0; max-width: 100%; color: var(--ink); background: var(--parchment-deep); border: 1px solid var(--rule-strong); border-radius: 2px; padding: .5rem 2rem .5rem .7rem; font: 1.1rem var(--serif); }
select:focus { outline: 2px solid var(--focus); outline-offset: 3px; }
.site-foot { padding: 0 0 2.4rem; color: var(--ink-soft); font-size: 1rem; }
.site-foot p { max-width: 48rem; margin: .2rem 0; }
.noscript { width: min(960px, calc(100% - 2rem)); margin: 1rem auto; padding: .8rem 1rem; background: var(--parchment); }
#manual-copy { margin-top: 1rem; }
#manual-copy label { display: block; font-weight: 600; }
#copy-text { width: 100%; padding: .7rem; background: #fffaf3; color: var(--ink); font: 1rem/1.4 var(--serif); border: 1px solid var(--rule-strong); }
.copy-buffer { position: fixed; top: 0; left: -9999px; }
.map-section { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 3px double var(--gold); min-width: 0; }
.map-section h3 { margin: 0 0 .8rem; color: var(--oxblood-deep); font: 700 1.2rem var(--display); }
.map-figure { margin: 0; }
.dungeon-map { display: block; width: 100%; height: auto; max-height: 650px; border: 1px solid #b4cede; }
.map-figure figcaption { margin: .55rem 0 .8rem; color: var(--ink-soft); font-size: .95rem; text-align: center; }
.map-key { margin: .5rem 0 0; padding-left: 1.7rem; columns: 3 11rem; column-gap: 2rem; font-size: 1.05rem; }
.map-key li { padding: .12rem 0 .12rem .15rem; break-inside: avoid; }
.map-key li::marker { color: var(--oxblood-deep); font-weight: 600; }
.feature-key { color: var(--oxblood-deep); font-weight: 600; }
@media (max-width: 540px) {
  .site-head { padding-top: 1.5rem; }
  .panel { padding: 1rem; }
  .sheet { padding: 1.55rem 1.2rem; }
  .fields > div { grid-template-columns: 1fr; gap: .08rem; }
  .btn { flex-grow: 1; }
  .site-field { flex-basis: 100%; }
  .site-field select { flex: 1; }
  .mark { width: 44px; height: 44px; }
  .brand { gap: .65rem; }
}
