:root {
  --dw-bg: #0e0a1a; --dw-fg: #efe3c8; --dw-accent: #e6b85c; --dw-panel: rgba(22, 15, 36, .95);
  --dw-font-body: 'Crimson Pro', Georgia, serif; --display: 'Cinzel Decorative', 'Cinzel', Georgia, serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ember: #ff8a3d; --acid: #8bea4b; --storm: #8fd3ff; --violet: #b07cff; --line: rgba(230, 184, 92, .2); --card: #17112a;
}
body { overflow-x: hidden; font-size: 1.12rem; background: radial-gradient(100% 50% at 50% 0%, #22163a, #0e0a1a 70%) fixed; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0 0 .5em; letter-spacing: .01em; }
h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); color: var(--dw-accent); }
h3 { font-size: 1.15rem; }
section { padding: clamp(56px, 9vw, 120px) clamp(16px, 5vw, 64px); }
.dw-plain { font: inherit; color: inherit; }

.topbar { position: fixed; inset: 0 0 auto; z-index: 50; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 12px clamp(16px, 4vw, 40px); background: #0e0a1acc; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--display); font-weight: 900; font-size: 1.35rem; color: var(--dw-accent); text-decoration: none; letter-spacing: .04em; }
.topbar nav { display: flex; align-items: center; gap: 18px; font-family: var(--mono); font-size: .8rem; }
.topbar nav a { color: var(--dw-fg); text-decoration: none; opacity: .8; }
.topbar nav a:hover { opacity: 1; color: var(--dw-accent); }
@media (max-width: 640px) { .topbar nav a { display: none; } }

.hero { position: relative; min-height: 100svh; display: grid; align-items: end; padding: 0; overflow: hidden; }
.hero-art { position: absolute; inset: -4% 0 auto; width: 100%; height: 110%; object-fit: cover; object-position: 60% 30%; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, #0e0a1af0 0%, #0e0a1a99 38%, transparent 62%), linear-gradient(transparent 55%, #0e0a1a 98%); }
.hero-copy { position: relative; z-index: 2; max-width: 700px; padding: 110px clamp(16px, 5vw, 64px) clamp(40px, 8vh, 96px); }
.kicker { font-family: var(--mono); font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--violet); margin: 0 0 1rem; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 4rem); text-shadow: 0 4px 30px #000; }
.hero h1 em { font-style: normal; color: var(--ember); }
.lede { font-size: clamp(1.1rem, 2vw, 1.3rem); max-width: 54ch; }
.word { background: none; border: 0; padding: 0; cursor: pointer; color: #ff6a4d; text-decoration: underline dotted #ff6a4d88; text-underline-offset: .2em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6rem; }
.btn { font-family: var(--mono); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; color: var(--dw-fg);
  border: 1px solid var(--dw-accent); padding: .95em 1.3em; border-radius: 4px; transition: background .2s, color .2s; }
.btn:hover { background: var(--dw-accent); color: var(--dw-bg); }
.btn-hot { background: linear-gradient(135deg, var(--ember), #c2457a); border-color: transparent; color: #1a0a06; font-weight: 700; }
.btn-hot:hover { background: linear-gradient(135deg, #ffb07a, #e0679a); color: #1a0a06; }

.rules { max-width: 1180px; margin: 0 auto; text-align: center; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 1.5rem; text-align: left; }
.steps article { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.4rem 1.4rem 1rem; position: relative; }
.glyphnum { font-family: var(--display); color: var(--violet); font-size: 2rem; opacity: .7; }

.bench { background: linear-gradient(#0e0a1a, #160f26 30%, #0e0a1a); }
.bench-head { max-width: 860px; margin: 0 auto 1.6rem; text-align: center; }
.bench-grid { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; }
@media (max-width: 900px) { .bench-grid { grid-template-columns: 1fr; } }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; align-content: start; }
.reagent { --c: #fff; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left;
  font: inherit; color: var(--dw-fg); background: var(--card); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); border-left: 5px solid var(--c);
  border-radius: 8px; padding: .55em .7em; cursor: pointer; transition: transform .15s, background .15s; }
.reagent:hover:not(:disabled), .reagent:focus-visible { transform: translateY(-2px); background: color-mix(in srgb, var(--c) 14%, var(--card)); }
.reagent:disabled { opacity: .35; cursor: not-allowed; }
.sym { grid-row: span 2; font-size: 1.5rem; color: var(--c); font-variant-emoji: text; text-shadow: 0 0 12px var(--c); width: 1.3em; text-align: center; }
.rn { font-weight: 700; line-height: 1.1; }
.rc { font-family: var(--mono); font-size: .68rem; opacity: .7; }
.chain-wrap { background: #120d20; border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 14px; }
.chain { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; counter-reset: link; }
@media (max-width: 560px) { .chain { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.chain li { min-height: 74px; border-radius: 8px; position: relative; }
.chain li.empty { border: 1px dashed #e6b85c44; background: repeating-linear-gradient(45deg, transparent 0 8px, #e6b85c08 8px 16px); }
.link { --c: #fff; width: 100%; height: 100%; min-height: 74px; display: grid; place-items: center; align-content: center; gap: 2px; font: inherit; font-size: .82rem; line-height: 1.1; color: var(--dw-fg);
  background: color-mix(in srgb, var(--c) 18%, #120d20); border: 1px solid var(--c); border-radius: 8px; cursor: pointer; padding: 4px; }
.link .sym { font-size: 1.3rem; grid-row: auto; }
.link:hover, .link:focus-visible { background: #3a1620; border-color: #ff6a4d; }
.code { margin: 0; font-family: var(--mono); font-size: .82rem; line-height: 1.6; color: #c9f1b0; background: #07050d; border: 1px solid #ffffff12; border-radius: 8px; padding: 12px 14px; min-height: 8.5em; white-space: pre-wrap; }
.spell-name { font-family: var(--display); font-size: 1.35rem; color: var(--dw-accent); margin: 0 0 .4rem; }
.spell-name.err { color: #ff6a4d; font-family: var(--mono); font-size: 1rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px 14px; margin: 0; font-size: .95rem; }
.stats div { border-bottom: 1px solid #ffffff10; padding-bottom: 2px; }
.stats dt { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; opacity: .6; }
.stats dd { margin: 0; font-weight: 600; }
.bench-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.cast { font-family: var(--mono); font-weight: 700; font-size: .95rem; padding: .85em 1.4em; border: 0; border-radius: 6px; cursor: pointer; color: #1a0a06; background: linear-gradient(135deg, var(--ember), #c2457a); }
.cast:disabled { opacity: .45; cursor: not-allowed; }
.clear { font-family: var(--mono); font-size: .85rem; padding: .85em 1.1em; border-radius: 6px; cursor: pointer; color: var(--dw-fg); background: transparent; border: 1px solid var(--line); }
.arena-frame { max-width: 1180px; margin: 20px auto 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #120c18; }
#arena { width: 100%; height: auto; aspect-ratio: 3 / 1; display: block; }
.arena-msg { margin: 0; padding: 10px 16px; font-family: var(--mono); font-size: .85rem; border-top: 1px solid var(--line); min-height: 2.8em; }
.forbidden { max-width: 1180px; margin: 14px auto 0; display: grid; gap: 8px; }
.forb { text-align: left; background: #1d0f2a; border: 1px solid var(--violet); color: #e2d2ff; border-radius: 8px; padding: .8em 1em; cursor: pointer; font-family: var(--mono); font-size: .85rem; }
.forb.is-found { border-color: #e6b85c88; color: var(--dw-accent); }

.workshop { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 900px) { .workshop { grid-template-columns: 1fr; } }
.art { position: relative; margin: 0; border-radius: 10px; overflow: hidden; box-shadow: 0 30px 90px #000b; border: 1px solid var(--line); }
.art img { width: 100%; height: auto; }
.art.small { margin-top: 1.2rem; }
.hs { position: absolute; width: 8%; aspect-ratio: 1; border-radius: 50%; border: 1px dashed transparent; background: transparent; cursor: pointer; transition: border-color .3s, background .3s; }
.hs:hover, .hs:focus-visible { border-color: var(--dw-accent); background: #e6b85c22; }
.hs.is-found { border-color: #b07cff99; }
.hs-figure { left: 42%; top: 63%; } .hs-glass { left: 17.5%; top: 39%; width: 9%; } .hs-book { left: 16%; top: 64%; width: 12%; }
.hs-hoods { left: 14%; top: 51%; width: 14%; }

.found-wrap { text-align: center; padding-top: 30px; }
.found { font-family: var(--mono); font-size: .95rem; }
.found b { color: var(--dw-accent); }
.reward { max-width: 640px; margin: 1rem auto; padding: 1rem 1.2rem; border: 1px solid var(--dw-accent); border-radius: 8px; background: #e6b85c14; }
.journal { max-width: 760px; margin: 1rem auto 0; text-align: left; }
.journal li { margin: .5em 0; }

.vote { text-align: center; max-width: 1000px; margin: 0 auto; }
.vote h3 { color: var(--violet); margin-top: 2rem; }
.offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 1rem auto 0; }
.offers.four { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.offer { font: inherit; font-size: 1.1rem; font-weight: 700; color: var(--dw-fg); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.1em; cursor: pointer; transition: border-color .2s, transform .2s; }
.offer.small { padding: .9em; }
.offer small { font-weight: 400; font-size: .92rem; opacity: .75; }
.offer:hover, .offer:focus-visible { border-color: var(--dw-accent); transform: translateY(-2px); }

.council { display: grid; justify-items: center; text-align: center; background: linear-gradient(transparent, #1a1030); }
.council .dw-optin { text-align: left; width: 100%; }
.offer-note { margin: 0; color: var(--dw-accent); font-family: var(--mono); font-size: .85rem; }

.foot { padding: 30px 16px 10px; text-align: center; border-top: 1px solid var(--line); }
.more { font-family: var(--mono); font-size: .85rem; }
.sigil { background: none; border: 0; color: var(--violet); cursor: pointer; font-size: 1.1rem; opacity: .55; }
.sigil:hover, .sigil:focus-visible { opacity: 1; }
@media (max-width: 760px) { .hero-shade { background: linear-gradient(#0e0a1a33 0%, #0e0a1acc 40%, #0e0a1a 92%); } .kicker { text-shadow: 0 1px 8px #000; } }
