:root {
  --night: #17110b;      /* tavern dark, from the hero art */
  --oak: #241a11;        /* raised panels */
  --gold: #e6cd8c;       /* card back gold */
  --gold-deep: #b8954a;
  --candle: #f2a541;     /* the one warm accent, used for actions */
  --parchment: #f1e8d2;  /* body text */
  --smoke: #b3a68e;      /* quiet text */
  --line: #3a2c1d;
  --warrior: #a9b6c4; --beast: #8fb36b; --dragon: #d9694e; --ethereal: #8fa7e0; --neutral: #c9bfae;
  --display: 'Marcellus', Georgia, serif;
  --body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--parchment); font: 1.0625rem/1.6 var(--body); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-underline-offset: .2em; }
a:hover { color: var(--candle); }
:focus-visible { outline: 3px solid var(--candle); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; color: var(--gold); line-height: 1.15; margin: 0 0 .5rem; letter-spacing: .01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.35rem; }
.sub { color: var(--smoke); margin: 0 0 1.5rem; }

/* header */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding: .8rem clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--line); background: var(--night); position: sticky; top: 0; z-index: 5; }
.mark { display: flex; align-items: center; gap: .6rem; font-family: var(--display); font-size: 1.35rem; color: var(--gold); text-decoration: none; }
.ring { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle, #000 52%, var(--gold) 56%, rgba(230,205,140,.25) 70%, transparent 72%); box-shadow: 0 0 10px rgba(230,205,140,.5); }
.top nav { display: flex; flex-wrap: wrap; gap: .2rem .9rem; }
.top nav a { color: var(--parchment); text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
.top nav a:hover { color: var(--gold); }
.top nav a[aria-current] { color: var(--gold); border-bottom-color: var(--gold-deep); }

main { min-height: 70vh; }
.band, .head, .filters, .count, .grid, .rules, .acct-wrap { padding-left: clamp(16px, 4vw, 48px); padding-right: clamp(16px, 4vw, 48px); max-width: 1200px; margin: 0 auto; }
.band { padding-top: 4rem; padding-bottom: 2rem; }
.head { padding-top: 2.5rem; }

/* hero: the tavern photo with the eclipse card back laid on the table */
.hero { position: relative; overflow: hidden; min-height: min(78vh, 640px); display: grid; align-items: end; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(23,17,11,.94) 0%, rgba(23,17,11,.7) 45%, rgba(23,17,11,.15) 100%), linear-gradient(0deg, var(--night) 0%, transparent 35%); }
.hero-in { position: relative; z-index: 1; display: flex; align-items: center; gap: clamp(1.5rem, 4vw, 3.5rem); padding: 3rem clamp(16px, 4vw, 48px) 4rem; max-width: 1200px; margin: 0 auto; width: 100%; }
.hero-back { width: clamp(130px, 18vw, 230px); border-radius: 12px; transform: rotate(-6deg); box-shadow: 0 0 0 1px rgba(230,205,140,.4), 0 18px 50px rgba(0,0,0,.7), 0 0 60px rgba(242,165,65,.25); animation: deal .9s cubic-bezier(.2,.8,.2,1) both; }
@keyframes deal { from { transform: translate(-40px, 30px) rotate(-18deg); opacity: 0; } }
.hero-copy { max-width: 36rem; }
.lede { font-size: 1.2rem; margin: 0 0 1.6rem; }
.ctas { display: flex; flex-wrap: wrap; gap: .8rem; margin: 0; }
.btn { display: inline-block; padding: .75rem 1.3rem; border-radius: 999px; background: var(--candle); color: #2a1803; font-weight: 700; text-decoration: none; }
.btn:hover { background: var(--gold); color: #2a1803; }
.btn.ghost { background: transparent; color: var(--gold); box-shadow: inset 0 0 0 2px var(--gold-deep); }
.btn.ghost:hover { color: var(--candle); box-shadow: inset 0 0 0 2px var(--candle); }

/* families */
.fams { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 2rem 1.2rem; }
.fam img { border-radius: 10px; margin-bottom: .9rem; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.fam h3 { border-left: 4px solid var(--c); padding-left: .6rem; }
.fam p { margin: 0 0 .4rem; color: var(--smoke); }
.fam-warrior { --c: var(--warrior); } .fam-beast { --c: var(--beast); } .fam-dragon { --c: var(--dragon); } .fam-ethereal { --c: var(--ethereal); }

/* turn steps (a real sequence, so numbered) */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .6rem; max-width: 40rem; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 2.4rem 1fr; align-items: baseline; }
.steps li::before { content: counter(s); font-family: var(--display); font-size: 1.6rem; color: var(--gold); }
.steps b { color: var(--gold); }

/* gallery */
.filters { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: center; padding-top: .5rem; padding-bottom: 1rem; position: sticky; top: 58px; background: var(--night); z-index: 4; }
.search { flex: 1 1 260px; display: flex; }
.search span, .tier span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tier span { position: static; width: auto; height: auto; clip: auto; color: var(--smoke); margin-right: .4rem; }
input, select { font: inherit; color: var(--parchment); background: var(--oak); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .8rem; }
.search input { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chips button { font: inherit; font-size: .95rem; color: var(--parchment); background: var(--oak); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .85rem; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--gold); color: #2a1803; border-color: var(--gold); }
.count { color: var(--smoke); margin: 0 auto .8rem; }
.grid { list-style: none; margin: 0 auto 4rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.1rem; }
.grid button { all: unset; cursor: pointer; display: block; width: 100%; border-radius: 9px; }
.grid button:focus-visible { outline: 3px solid var(--candle); outline-offset: 3px; }
.grid img { border-radius: 9px; aspect-ratio: 258/360; width: 100%; background: var(--oak); }
.grid button:hover img { box-shadow: 0 0 0 2px var(--gold-deep); }
.noart { aspect-ratio: 258/360; border-radius: 9px; background: var(--oak); border: 1px solid var(--line); padding: .8rem; display: flex; flex-direction: column; gap: .4rem; font-size: .9rem; }
.noart b { font-family: var(--display); color: var(--gold); font-weight: 400; font-size: 1.05rem; }
.empty { grid-column: 1 / -1; color: var(--smoke); }

dialog { background: var(--oak); color: var(--parchment); border: 1px solid var(--line); border-radius: 14px; padding: 1.4rem; max-width: min(820px, 94vw); width: 100%; }
dialog::backdrop { background: rgba(0,0,0,.75); }
dialog .x { float: right; font: inherit; background: none; border: 1px solid var(--line); color: var(--parchment); border-radius: 999px; padding: .25rem .9rem; cursor: pointer; }
.bigcard { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 1.5rem; align-items: start; clear: both; padding-top: .6rem; }
.bigcard img { border-radius: 12px; }
.bigcard dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; margin: 0 0 1rem; }
.bigcard dt { color: var(--smoke); }
.bigcard dd { margin: 0; }
.cardtext { font-size: 1.1rem; }
@media (max-width: 640px) { .bigcard { grid-template-columns: 1fr; } .bigcard img { max-width: 260px; } .filters { position: static; } }

/* rules */
.rules { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 3rem; padding-bottom: 4rem; }
.toc { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow: auto; font-size: .95rem; }
.toc ol { margin: 0; padding-left: 2rem; color: var(--smoke); }
.toc a { color: var(--parchment); text-decoration: none; }
.toc a:hover { color: var(--gold); }
.prose { max-width: 42rem; }
.prose h2 { margin-top: 2.6rem; font-size: 1.7rem; scroll-margin-top: 80px; }
.prose strong { color: var(--gold); font-weight: 700; }
@media (max-width: 860px) { .rules { grid-template-columns: 1fr; gap: 1rem; } .toc { position: static; max-height: none; } }

.foot { border-top: 1px solid var(--line); color: var(--smoke); font-size: .9rem; padding: 1.5rem clamp(16px, 4vw, 48px); }
.foot p { max-width: 1200px; margin: 0 auto; }

@media (max-width: 700px) { .hero-in { flex-direction: column; align-items: flex-start; } .hero::after { background: linear-gradient(0deg, var(--night) 10%, rgba(23,17,11,.75) 60%, rgba(23,17,11,.4) 100%); } }
@media (prefers-reduced-motion: reduce) { .hero-back { animation: none; } }

/* account */
.top nav a.acct { border: 1px solid var(--gold-deep); border-radius: 999px; padding: .2rem .8rem; color: var(--gold); }
.top nav a.acct[aria-current] { border-bottom-width: 1px; background: var(--oak); }
.acct-wrap { margin: 0 auto 4rem; }
.acct-wrap > * { max-width: 34rem; }
.acct-wrap .panel { border: 1px solid var(--line); background: var(--oak); border-radius: 12px; padding: 1.2rem 1.4rem; margin-bottom: 1.2rem; }
.acct-wrap h2 { font-size: 1.5rem; }
.tabs { display: flex; gap: .4rem; margin-bottom: 1.2rem; }
.tabs button { font: inherit; color: var(--parchment); background: none; border: 1px solid var(--line); border-radius: 999px; padding: .4rem 1rem; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--gold); color: #2a1803; border-color: var(--gold); }
.acct-form { display: grid; gap: .9rem; }
.acct-form label { display: grid; gap: .3rem; color: var(--smoke); }
.acct-form input { color: var(--parchment); }
.acct-form small { color: var(--smoke); }
.acct-form .btn { justify-self: start; border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.acct-form .btn:disabled { opacity: .6; cursor: wait; }
.msg { min-height: 1.2em; margin: 0; color: var(--candle); }
.guest { color: var(--smoke); margin-top: 1.5rem; }
.people { margin: 0 0 1rem; padding-left: 1.2rem; }
.acct-wrap button.btn { border: 0; font: inherit; font-weight: 700; cursor: pointer; }
