@font-face {
  font-family: "Cinzel";
  src: url("../fonts/cinzel-400.woff2?v=20261202-mi1") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("../fonts/cinzel-700.woff2?v=20261202-mi1") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/ebgaramond-400.woff2?v=20261202-mi1") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/ebgaramond-400i.woff2?v=20261202-mi1") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/ebgaramond-600.woff2?v=20261202-mi1") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/ebgaramond-700.woff2?v=20261202-mi1") 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; }

.option-field { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.option-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; }
.actions { align-items: center; }
.option-field { flex-direction: column; align-items: flex-start; gap: .25rem; }
.actions .btn { align-self: flex-end; }
.sheet { padding: 1.8rem 2rem 1.65rem; }
.sheet-banner { position: relative; display: flex; align-items: center; gap: 1.15rem; padding: .35rem 0 1.25rem; margin-bottom: 1.1rem; border-bottom: 3px double var(--gold); }
.category-emblem { width: 58px; height: 58px; flex: none; color: var(--oxblood); }
.banner-copy { min-width: 0; flex: 1; }
.card-eyebrow { margin: 0 0 .3rem; color: var(--ink-soft); font: .62rem var(--display); letter-spacing: .17em; text-transform: uppercase; }
.item-title { margin: 0; color: var(--oxblood-deep); font: 700 clamp(1.4rem, 3.4vw, 2rem)/1.2 var(--display); overflow-wrap: anywhere; text-wrap: balance; }
.card-meta { margin: .45rem 0 0; color: var(--ink-soft); font-style: italic; }
.tier-badge { align-self: flex-start; flex: none; margin-top: .1rem; padding: .32rem .6rem .45rem; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 85%, 0 100%); background: #e8dfcc; color: #463d2e; font: 700 .62rem var(--display); letter-spacing: .07em; text-transform: uppercase; }
.tier-medium { background: #dbe5dc; color: #234237; }
.tier-major { background: #ead8b6; color: #634317; }
.tier-artifact { background: var(--oxblood); color: #fff8ec; }
.stat-block { border: 1px solid var(--rule-strong); background: rgba(226,210,179,.24); padding: .75rem .9rem 0; break-inside: avoid; }
.stat-heading { margin: 0 0 .6rem; color: var(--oxblood-deep); font: 700 .67rem var(--display); letter-spacing: .13em; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 1rem; margin: 0; }
.stat-grid > div { padding: .45rem 0 .6rem; border-top: 1px solid var(--rule); min-width: 0; }
.stat-grid dt { margin-bottom: .18rem; color: var(--oxblood-deep); font: .65rem/1.3 var(--display); font-variant: small-caps; letter-spacing: .055em; }
.stat-grid dd { margin: 0; font-size: 1rem; line-height: 1.25; overflow-wrap: anywhere; }
.stat-grid .stat-value { grid-column: 1 / -1; display: flex; gap: 1rem; align-items: baseline; margin: .1rem -.9rem 0; padding: .6rem .9rem; border-top: 1px solid var(--rule-strong); background: rgba(226,210,179,.18); }
.stat-value dd { font-weight: 600; }
.stat-grid .stat-wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(5.5rem, 20%) minmax(0, 1fr); gap: .65rem; align-items: baseline; }
.card-section { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--gold-soft); }
.card-section h3 { margin: 0 0 .35rem; color: var(--oxblood-deep); font: 700 .8rem/1.3 var(--display); letter-spacing: .045em; break-after: avoid; }
.card-section p { margin: .25rem 0; }
.sensory { color: var(--ink-soft); }
.power-list { list-style: none; margin: .45rem 0 0; padding: 0; }
.power-list li { display: flex; gap: .65rem; margin: .7rem 0; break-inside: avoid; }
.power-id { display: inline-grid; place-items: center; flex: none; align-self: flex-start; min-width: 1.55rem; height: 1.55rem; border: 1px solid var(--rule-strong); color: var(--oxblood-deep); font: .7rem var(--display); }
.power-list .power-effect { margin: 0; }
.power-list .power-mechanics { margin: .18rem 0 0; color: var(--ink-soft); font-size: .93rem; line-height: 1.3; }
.referee-only { border-left: 2px solid var(--oxblood); padding: .35rem .7rem; margin-top: 1rem; background: rgba(110,43,51,.035); font-size: 1rem; }
.referee-only summary { cursor: pointer; color: var(--oxblood-deep); font: .72rem/1.5 var(--display); }
.referee-only p { margin: .4rem 0 .1rem; }
.will-contest { color: var(--ink-soft); font-size: .96rem; }
.card-notes { margin-top: 1rem; padding-top: .6rem; border-top: 3px double var(--gold-soft); color: var(--ink-soft); font-size: .88rem; line-height: 1.35; }
.card-notes p { margin: .3rem 0; }
@media (max-width: 600px) {
  .site-head { padding-top: 1.5rem; }
  .panel { padding: 1rem; }
  .sheet { padding: 1.5rem 1.15rem; }
  .sheet-banner { flex-wrap: wrap; gap: .65rem; }
  .category-emblem { width: 42px; height: 42px; }
  .banner-copy { flex-basis: calc(100% - 56px); }
  .tier-badge { margin-left: 3.3rem; margin-top: -.25rem; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .8rem; }
  .stat-grid dd { font-size: .98rem; }
  .option-field { flex: 1 1 100%; }
  .option-field select { width: 100%; }
  .btn { flex-grow: 1; }
  .mark { width: 44px; height: 44px; }
  .brand { gap: .65rem; }
}
/* Tiered relic powers keep each effect and its shorthand together. */
.artifact-powers { margin-top: .8rem; }
.artifact-powers > p { margin: .35rem 0; font-size: .95rem; }
.power-table { width: 100%; border-collapse: collapse; margin-top: .8rem; table-layout: fixed; }
.power-table caption { text-align: left; color: var(--oxblood-deep); font: 700 .8rem/1.3 var(--display); padding-bottom: .4rem; }
.power-table th { width: 2.7rem; color: var(--oxblood-deep); font: .75rem var(--display); }
.power-table th, .power-table td { border: 1px solid var(--rule); padding: .45rem .55rem; vertical-align: top; overflow-wrap: anywhere; }
.power-table tr { break-inside: avoid; }
.power-table p { margin: 0; }
.power-table .power-mechanics { margin-top: .2rem; color: var(--ink-soft); font-size: .93rem; line-height: 1.3; }
.card-section h4 { font-size: 1rem; margin: .7rem 0 .25rem; }
