/*
 * Emberdorne: a lit keep at night. Plum-dark stone, ember gold and a rose
 * accent for care. System fonts only: a book serif for headings, the
 * platform sans for reading, a monospace for numbers.
 */

:root {
  --ebd-bg: #140f1c;
  --ebd-bg2: #1a1324;
  --ebd-panel: #211a2e;
  --ebd-panel2: #2b2140;
  --ebd-stone: #33284a;
  --ebd-line: rgba(255, 190, 110, 0.24);
  --ebd-line2: rgba(255, 255, 255, 0.09);
  --ebd-ink: #f6f0e7;
  --ebd-mute: #c4b7cf;
  --ebd-gold: #ffb547;
  --ebd-ember: #ff6b3d;
  --ebd-rose: #ff93b4;
  --ebd-jade: #6fdcb0;
  --ebd-dark: #1f1208;
  --ebd-serif: "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", P052, Georgia, serif;
  --ebd-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ebd-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --r1: 6px;
  --r2: 12px;
  --r3: 20px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 120px;
}

body {
  margin: 0;
  background-color: var(--ebd-bg);
  background-image:
    radial-gradient(1200px 520px at 50% -180px, rgba(255, 120, 60, 0.16), transparent 70%),
    repeating-linear-gradient(180deg, transparent 0 55px, rgba(255, 255, 255, 0.018) 55px 56px);
  color: var(--ebd-ink);
  font: 400 1rem/1.6 var(--ebd-sans);
  min-height: 100vh;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--ebd-gold);
  text-underline-offset: 3px;
}

a:hover {
  color: #ffd08a;
}

:focus-visible {
  outline: 2px solid var(--ebd-gold);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: var(--ebd-serif);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin: 0 0 var(--s3);
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.25rem);
}

h2 {
  font-size: clamp(1.45rem, 2.6vw, 2rem);
}

h3 {
  font-size: 1.2rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 var(--s4);
}

.ebd-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.ebd-vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ebd-skip {
  position: absolute;
  left: var(--s4);
  top: -60px;
  z-index: 90;
  background: var(--ebd-gold);
  color: var(--ebd-dark);
  padding: var(--s2) var(--s4);
  border-radius: var(--r1);
}

.ebd-skip:focus {
  top: var(--s2);
}

.ebd-fine {
  font-size: 0.875rem;
  color: var(--ebd-mute);
}

/* ---------- crown (header) ---------- */

.ebd-crown {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(20, 15, 28, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ebd-line2);
}

.ebd-crown__bar {
  display: flex;
  align-items: center;
  gap: var(--s4);
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--s2) var(--s5);
  min-height: 64px;
}

.ebd-brand {
  display: flex;
  align-items: center;
  gap: var(--s2);
  color: var(--ebd-ink);
  text-decoration: none;
  flex: none;
}

.ebd-brand__word {
  font: 700 1.3rem/1 var(--ebd-serif);
  letter-spacing: 0.04em;
  font-variant: small-caps;
}

.ebd-brand__word b {
  color: var(--ebd-gold);
  font-weight: 700;
}

.ebd-nav {
  display: flex;
  gap: var(--s1);
  margin: 0 auto;
}

.ebd-nav__link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--s2) var(--s3);
  border-radius: 999px;
  color: var(--ebd-mute);
  text-decoration: none;
  font-size: 0.94rem;
  white-space: nowrap;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}

.ebd-nav__link:hover {
  color: var(--ebd-ink);
  background: rgba(255, 255, 255, 0.06);
}

.ebd-nav__link.is-here {
  color: var(--ebd-dark);
  background: linear-gradient(180deg, #ffcf7d, var(--ebd-gold));
}

.ebd-hud {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex: none;
}

.ebd-hud__glints,
.ebd-hud__visit {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px var(--s3);
  border-radius: 999px;
  border: 1px solid var(--ebd-line);
  color: var(--ebd-ink);
  text-decoration: none;
  font: 600 0.92rem/1.1 var(--ebd-mono);
}

.ebd-hud__glints .ebd-icon {
  color: var(--ebd-ember);
}

.ebd-hud__glints small {
  font: 400 0.72rem/1.1 var(--ebd-sans);
  color: var(--ebd-mute);
}

.ebd-hud__pause,
.ebd-hud__map {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 var(--s3);
  border-radius: 999px;
  border: 1px solid rgba(255, 147, 180, 0.5);
  background: rgba(255, 147, 180, 0.1);
  color: var(--ebd-rose);
  font: 600 0.9rem var(--ebd-sans);
  cursor: pointer;
  transition: background-color 160ms var(--ease);
}

.ebd-hud__pause:hover {
  background: rgba(255, 147, 180, 0.2);
}

.ebd-hud__map {
  display: none;
  border-color: var(--ebd-line);
  background: transparent;
  color: var(--ebd-ink);
}

.ebd-runes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px var(--s3);
  margin: 0;
  padding: 6px var(--s4);
  background: linear-gradient(90deg, #2a1424, #3a1d1c 50%, #2a1424);
  border-top: 1px solid rgba(255, 107, 61, 0.35);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: #ffe2c4;
}

.ebd-runes b {
  color: var(--ebd-gold);
}

.ebd-runes span::before {
  content: "◆";
  color: var(--ebd-ember);
  font-size: 0.6rem;
  margin-right: var(--s3);
  vertical-align: 1px;
}

/* ---------- layout ---------- */

.ebd-main {
  display: block;
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--s5) var(--s5) var(--s8);
}

.ebd-trail ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s5);
  font-size: 0.875rem;
  color: var(--ebd-mute);
}

.ebd-trail li + li::before {
  content: "›";
  margin-right: var(--s2);
  color: var(--ebd-gold);
}

.ebd-kicker {
  font: 600 0.8rem/1.3 var(--ebd-sans);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ebd-gold);
  margin-bottom: var(--s2);
}

.ebd-lead {
  font-size: 1.15rem;
  color: #e9dfee;
  max-width: 62ch;
}

.ebd-head {
  padding: var(--s5) 0 var(--s6);
  max-width: 820px;
}

.ebd-section {
  margin: var(--s8) 0 0;
}

.ebd-section__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s5);
}

.ebd-section__top h2 {
  margin: 0;
}

.ebd-prose {
  max-width: 68ch;
}

.ebd-prose li {
  margin-bottom: var(--s2);
}

.ebd-split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--s5);
  align-items: start;
}

/* panels with gold studs in the corners */
.ebd-frame {
  position: relative;
  padding: var(--s5);
  border: 1px solid var(--ebd-line);
  border-radius: var(--r2);
  background:
    radial-gradient(circle at 9px 9px, var(--ebd-gold) 0 1.6px, transparent 2.6px),
    radial-gradient(circle at calc(100% - 9px) 9px, var(--ebd-gold) 0 1.6px, transparent 2.6px),
    radial-gradient(circle at 9px calc(100% - 9px), var(--ebd-gold) 0 1.6px, transparent 2.6px),
    radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), var(--ebd-gold) 0 1.6px, transparent 2.6px),
    linear-gradient(180deg, var(--ebd-panel2), var(--ebd-panel));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 40px -24px rgba(0, 0, 0, 0.8);
}

.ebd-frame--rose {
  border-color: rgba(255, 147, 180, 0.4);
}

.ebd-frame h2 {
  font-size: 1.35rem;
}

.ebd-note {
  padding: var(--s3) var(--s4);
  border-left: 3px solid var(--ebd-gold);
  background: rgba(255, 181, 71, 0.08);
  border-radius: 0 var(--r1) var(--r1) 0;
}

.ebd-note--rose {
  border-left-color: var(--ebd-rose);
  background: rgba(255, 147, 180, 0.08);
}

.ebd-grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s5);
}

.ebd-grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s5);
}

/* ---------- buttons ---------- */

.ebd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 46px;
  padding: 0 var(--s5);
  border: 0;
  font: 700 0.98rem/1.1 var(--ebd-sans);
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%);
  transition: transform 140ms var(--ease), filter 160ms var(--ease), background-color 160ms var(--ease);
}

.ebd-btn:active {
  transform: scale(0.97);
}

.ebd-btn--ember {
  color: var(--ebd-dark);
  background: linear-gradient(180deg, #ffd28a, var(--ebd-gold) 55%, #ff9a45);
}

.ebd-btn--ember:hover {
  filter: brightness(1.08);
  color: var(--ebd-dark);
}

.ebd-btn--line {
  color: var(--ebd-gold);
  background: rgba(255, 181, 71, 0.14);
}

.ebd-btn--line:hover {
  background: rgba(255, 181, 71, 0.24);
  color: #ffd08a;
}

.ebd-btn--rose {
  color: #2a0f19;
  background: linear-gradient(180deg, #ffc0d3, var(--ebd-rose));
}

.ebd-btn--ghost {
  color: var(--ebd-mute);
  background: rgba(255, 255, 255, 0.06);
}

.ebd-btn--even {
  min-width: 140px;
  color: var(--ebd-ink);
  background: rgba(255, 255, 255, 0.12);
}

.ebd-btn--even:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ebd-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ebd-textbtn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ebd-gold);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.ebd-acts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin: var(--s5) 0;
}

.ebd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  list-style: none;
  padding: 0;
  margin: var(--s4) 0;
}

.ebd-chips li {
  padding: 4px var(--s3);
  border: 1px solid var(--ebd-line);
  border-radius: 999px;
  font-size: 0.85rem;
  color: #ffe2c4;
  background: rgba(255, 181, 71, 0.06);
}

/* ---------- home: gate (hero) ---------- */

.ebd-gatehero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--s6);
  align-items: center;
  padding: var(--s4) 0 var(--s6);
}

.ebd-gatehero__art {
  position: relative;
  border-radius: 200px 200px var(--r2) var(--r2);
  overflow: hidden;
  border: 1px solid var(--ebd-line);
  box-shadow: 0 30px 80px -30px rgba(255, 107, 61, 0.45);
}

.ebd-gatehero__art img {
  aspect-ratio: 4 / 3.4;
  object-fit: cover;
  width: 100%;
}

.ebd-fire {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s2);
  margin: var(--s5) 0 0;
  padding: var(--s3);
  border: 1px solid var(--ebd-line2);
  border-radius: var(--r2);
  background: rgba(0, 0, 0, 0.22);
}

.ebd-fire div {
  padding: var(--s2);
}

.ebd-fire dt {
  font-size: 0.75rem;
  color: var(--ebd-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ebd-fire dd {
  margin: 2px 0 0;
  font: 700 1.2rem/1.2 var(--ebd-mono);
}

/* ---------- home: the keep cutaway ---------- */

.ebd-keep {
  position: relative;
  max-width: 1000px;
  margin: var(--s7) auto 0;
  padding: 0 22px;
}

.ebd-keep::before {
  content: "";
  display: block;
  height: 30px;
  margin: 0 -22px;
  background: repeating-linear-gradient(90deg, var(--ebd-stone) 0 44px, transparent 44px 70px);
  border-bottom: 6px solid var(--ebd-stone);
}

.ebd-keep__walls {
  position: relative;
  border-left: 14px solid var(--ebd-stone);
  border-right: 14px solid var(--ebd-stone);
  background: linear-gradient(180deg, #1d1529, #170f20);
}

.ebd-shaft {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 44px;
  width: 2px;
  background: linear-gradient(180deg, rgba(255, 181, 71, 0.5), rgba(255, 181, 71, 0.1));
}

.ebd-shaft__ember {
  position: absolute;
  left: -7px;
  top: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff2c8, var(--ebd-gold) 45%, var(--ebd-ember));
  box-shadow: 0 0 18px 4px rgba(255, 107, 61, 0.6);
  transition: transform 420ms var(--ease);
}

.ebd-floor {
  position: relative;
  display: grid;
  grid-template-columns: 72px 210px minmax(0, 1fr);
  gap: var(--s5);
  align-items: center;
  padding: var(--s5) var(--s5) var(--s5) var(--s3);
  border-bottom: 10px solid #2a1f3a;
  box-shadow: inset 0 -1px 0 rgba(255, 181, 71, 0.18);
}

.ebd-floor--flip {
  grid-template-columns: 72px minmax(0, 1fr) 210px;
}

.ebd-floor--flip .ebd-window {
  order: 3;
}

.ebd-plaque {
  justify-self: center;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ebd-bg);
  border: 2px solid var(--ebd-gold);
  font: 700 0.95rem/1 var(--ebd-serif);
  color: var(--ebd-gold);
  position: relative;
  z-index: 1;
}

.ebd-window {
  position: relative;
  border-radius: 105px 105px var(--r1) var(--r1);
  overflow: hidden;
  border: 2px solid rgba(255, 181, 71, 0.4);
  background: #0d0912;
  transition: box-shadow 220ms var(--ease), border-color 220ms var(--ease);
}

.ebd-window img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  width: 100%;
}

.ebd-floor:hover .ebd-window,
.ebd-floor:focus-within .ebd-window {
  border-color: var(--ebd-gold);
  box-shadow: 0 0 0 4px rgba(255, 181, 71, 0.18), 0 0 46px rgba(255, 107, 61, 0.5);
}

.ebd-floor h3 {
  font-size: 1.6rem;
  margin-bottom: var(--s2);
}

.ebd-floor h3 a {
  color: var(--ebd-ink);
  text-decoration: none;
}

.ebd-floor h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.ebd-floor .ebd-btn,
.ebd-floor .ebd-textbtn,
.ebd-floor p a {
  position: relative;
  z-index: 2;
}

.ebd-wingtag {
  display: inline-block;
  font: 600 0.75rem var(--ebd-sans);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ebd-rose);
  margin-bottom: var(--s2);
}

.ebd-pips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
  list-style: none;
  padding: 0;
  margin: var(--s3) 0 0;
  font-size: 0.85rem;
  color: var(--ebd-mute);
}

.ebd-pips b {
  font: 700 0.9rem var(--ebd-mono);
  color: var(--ebd-gold);
  margin-left: 6px;
  letter-spacing: 0.1em;
}

.ebd-floor--beacon,
.ebd-floor--gatehouse {
  grid-template-columns: 72px minmax(0, 1fr) auto;
  background: rgba(255, 181, 71, 0.05);
}

.ebd-floor--gatehouse {
  background: rgba(255, 147, 180, 0.06);
  border-bottom: 0;
}

.ebd-floor--gatehouse .ebd-plaque {
  border-color: var(--ebd-rose);
  color: var(--ebd-rose);
}

.ebd-courtyard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: var(--s5);
  align-items: center;
  margin: var(--s6) auto 0;
  max-width: 1000px;
  padding: var(--s5);
  border-radius: var(--r3);
  background: #eef3fb;
  color: #13213a;
}

.ebd-courtyard a:not(.ebd-btn) {
  color: #2c5fcc;
}

.ebd-courtyard img {
  border-radius: var(--r2);
}

.ebd-courtyard .ebd-kicker {
  color: #b5481f;
}

.ebd-laws {
  counter-reset: law;
}

.ebd-law {
  counter-increment: law;
}

.ebd-law h3::before {
  content: counter(law, upper-roman) " · ";
  color: var(--ebd-gold);
}

.ebd-scrollcards a {
  display: block;
  height: 100%;
  text-decoration: none;
  color: var(--ebd-ink);
}

.ebd-scrollcards a:hover h3 {
  color: var(--ebd-gold);
}

.ebd-faq details {
  border-bottom: 1px solid var(--ebd-line2);
  padding: var(--s3) 0;
}

.ebd-faq summary {
  cursor: pointer;
  font: 700 1.08rem/1.4 var(--ebd-serif);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: var(--s4);
}

.ebd-faq summary::-webkit-details-marker {
  display: none;
}

.ebd-faq summary::after {
  content: "+";
  color: var(--ebd-gold);
  font-family: var(--ebd-mono);
}

.ebd-faq details[open] summary::after {
  content: "–";
}

.ebd-faq details p {
  margin: var(--s2) 0 0;
  color: #e6dcec;
  max-width: 70ch;
}

/* ---------- chambers ---------- */

.ebd-chamberhead {
  position: relative;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: var(--s5);
  align-items: end;
  padding: var(--s5);
  border-radius: var(--r3);
  overflow: hidden;
  border: 1px solid var(--ebd-line);
  isolation: isolate;
}

.ebd-chamberhead__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  z-index: -1;
}

.ebd-chamberhead::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(20, 15, 28, 0.94) 20%, rgba(20, 15, 28, 0.45));
}

.ebd-chamberhead__cover {
  border-radius: 95px 95px var(--r1) var(--r1);
  border: 2px solid var(--ebd-gold);
}

.ebd-chamberhead h1 {
  margin-bottom: var(--s2);
}

.ebd-altar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-areas: "stage brazier" "bar brazier" "lock lock";
  gap: var(--s4) var(--s5);
  margin-top: var(--s5);
}

.ebd-stage {
  grid-area: stage;
  position: relative;
  padding: var(--s5);
  border-radius: var(--r3);
  border: 1px solid var(--ebd-line);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 107, 61, 0.14), transparent 60%),
    linear-gradient(180deg, #1c1428, #120c19);
  min-height: 300px;
}

.ebd-msg {
  margin: var(--s4) 0 0;
  min-height: 3.2em;
  color: #eadfee;
}

.ebd-verdict {
  margin: var(--s2) 0 0;
  font: 600 0.95rem/1.4 var(--ebd-mono);
  color: var(--ebd-mute);
  min-height: 1.4em;
}

.ebd-verdict.is-up {
  color: var(--ebd-gold);
}

.ebd-runebar {
  grid-area: bar;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s4);
  padding: var(--s4) var(--s5);
  border-radius: var(--r2);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--ebd-line2);
}

.ebd-stakes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

.ebd-stakes legend {
  float: left;
  margin-right: var(--s2);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ebd-mute);
}

.ebd-stakes button {
  min-width: 52px;
  height: 40px;
  padding: 0 var(--s2);
  border: 0;
  font: 700 0.9rem var(--ebd-mono);
  color: var(--ebd-ink);
  background: rgba(255, 255, 255, 0.08);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
  cursor: pointer;
  transition: background-color 140ms var(--ease), transform 140ms var(--ease);
}

.ebd-stakes button:active {
  transform: scale(0.95);
}

.ebd-stakes button[aria-pressed="true"] {
  color: var(--ebd-dark);
  background: linear-gradient(180deg, #ffd28a, var(--ebd-gold));
}

.ebd-stakes button:disabled {
  opacity: 0.5;
  cursor: default;
}

.ebd-brazierbtn {
  width: 96px;
  height: 96px;
  margin-left: auto;
  border-radius: 50%;
  border: 2px solid #ffd28a;
  background: radial-gradient(circle at 50% 35%, #ffe0a3, var(--ebd-gold) 40%, var(--ebd-ember) 80%);
  color: var(--ebd-dark);
  font: 700 0.98rem/1.1 var(--ebd-serif);
  padding: var(--s2);
  cursor: pointer;
  box-shadow: 0 0 0 6px rgba(255, 107, 61, 0.15), 0 10px 30px -6px rgba(255, 107, 61, 0.7);
  transition: transform 140ms var(--ease), filter 160ms var(--ease);
}

.ebd-brazierbtn:hover {
  filter: brightness(1.06);
}

.ebd-brazierbtn:active {
  transform: scale(0.96);
}

.ebd-brazierbtn:disabled {
  filter: grayscale(0.7) brightness(0.7);
  cursor: not-allowed;
}

.ebd-alts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.ebd-brazier {
  grid-area: brazier;
  align-self: start;
}

.ebd-brazier dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px var(--s3);
  margin-bottom: var(--s4);
}

.ebd-brazier dt {
  color: var(--ebd-mute);
  font-size: 0.9rem;
}

.ebd-brazier dd {
  margin: 0;
  font: 700 0.95rem var(--ebd-mono);
  text-align: right;
}

.ebd-log {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s4);
  font-size: 0.85rem;
}

.ebd-log li {
  display: flex;
  justify-content: space-between;
  gap: var(--s2);
  padding: 6px 0;
  border-top: 1px solid var(--ebd-line2);
}

.ebd-log li b {
  font-family: var(--ebd-mono);
}

.ebd-log .is-up b {
  color: var(--ebd-gold);
}

.ebd-log .is-down b {
  color: var(--ebd-mute);
}

.ebd-log__empty {
  color: var(--ebd-mute);
}

.ebd-locknote {
  grid-area: lock;
  margin: 0;
  padding: var(--s3) var(--s4);
  border-radius: var(--r1);
  border: 1px solid rgba(255, 147, 180, 0.5);
  background: rgba(255, 147, 180, 0.1);
  color: #ffd9e5;
}

/* reels */
.ebd-reels {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  max-width: 640px;
  margin: 0 auto;
}

.ebd-reel {
  display: grid;
  gap: 6px;
}

.ebd-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: var(--r1);
  background: radial-gradient(circle at 50% 40%, #3a2b4f, #1a1224 75%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: opacity 160ms var(--ease), transform 160ms var(--ease), box-shadow 200ms var(--ease);
}

.ebd-cell img {
  width: 84%;
}

.ebd-cell.is-out {
  opacity: 0.12;
  transform: translateY(-6px);
}

.ebd-cell.is-hit {
  box-shadow: 0 0 0 2px var(--ebd-gold), 0 0 22px rgba(255, 181, 71, 0.55);
}

.ebd-lavarow {
  position: absolute;
  left: -4px;
  right: -4px;
  top: 0;
  height: calc((100% - (var(--rows) - 1) * 6px) / var(--rows));
  border-radius: var(--r1);
  border: 2px solid #ffcf7d;
  background: linear-gradient(90deg, rgba(255, 107, 61, 0.35), rgba(255, 181, 71, 0.25), rgba(255, 107, 61, 0.35));
  box-shadow: 0 0 30px rgba(255, 107, 61, 0.6);
  pointer-events: none;
  transform: translateY(calc(var(--row, 3) * (100% + 6px)));
  transition: transform 420ms var(--ease);
}

/* gems */
.ebd-hearth {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  max-width: 470px;
  margin: 0 auto;
  padding: var(--s3);
  border-radius: var(--r2);
  background: repeating-linear-gradient(45deg, #2a1f38 0 10px, #251b33 10px 20px);
  border: 4px solid #3a2c50;
}

.ebd-gem {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--r1);
  background: radial-gradient(circle at 50% 40%, #33264a, #18101f 80%);
  cursor: pointer;
  transition: opacity 160ms var(--ease), transform 140ms var(--ease), box-shadow 200ms var(--ease);
}

.ebd-gem img {
  width: 78%;
}

.ebd-gem:disabled {
  cursor: default;
}

.ebd-gem:not(:disabled):hover {
  transform: translateY(-2px);
}

.ebd-gem.is-out {
  opacity: 0.1;
  transform: translateY(-8px);
}

.ebd-gem.is-picked {
  box-shadow: 0 0 0 3px var(--ebd-rose);
}

.ebd-gem.is-hint {
  box-shadow: 0 0 0 3px var(--ebd-jade);
}

.ebd-gem.is-hit {
  box-shadow: 0 0 0 2px var(--ebd-gold), 0 0 20px rgba(255, 181, 71, 0.55);
}

/* cards */
.ebd-card {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 62px;
  height: 88px;
  flex: none;
  border-radius: 8px;
  background: linear-gradient(180deg, #fffaf2, #efe6d8);
  color: #1d1626;
  border: 1px solid #d8cbb7;
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.6);
  font-family: var(--ebd-sans);
  padding: 0;
  transition: transform 160ms var(--ease), box-shadow 200ms var(--ease);
}

.ebd-card--h,
.ebd-card--d {
  color: #c2243b;
}

.ebd-card__corner {
  position: absolute;
  top: 4px;
  left: 6px;
  font: 700 0.9rem/1 var(--ebd-mono);
}

.ebd-card__pip {
  font-size: 1.9rem;
  line-height: 1;
  margin-top: 10px;
}

.ebd-card--back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 181, 71, 0.25) 0 4px, transparent 4px 10px),
    linear-gradient(180deg, #4a2a5c, #2a1838);
  border-color: rgba(255, 181, 71, 0.5);
}

button.ebd-card {
  cursor: pointer;
}

button.ebd-card:disabled {
  cursor: default;
}

.ebd-card.is-live {
  box-shadow: 0 0 0 3px var(--ebd-gold), 0 0 18px rgba(255, 181, 71, 0.5);
}

.ebd-card.is-hint {
  box-shadow: 0 0 0 3px var(--ebd-jade), 0 0 18px rgba(111, 220, 176, 0.6);
}

.ebd-card.is-low {
  transform: translateY(-10px);
  box-shadow: 0 0 0 3px var(--ebd-rose);
}

.ebd-steps__cols {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--s2);
  justify-items: center;
  min-height: 240px;
}

.ebd-steps__col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ebd-steps__col .ebd-card + .ebd-card {
  margin-top: -60px;
}

.ebd-steps__base {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s5);
  margin-top: var(--s5);
  padding-top: var(--s4);
  border-top: 1px dashed var(--ebd-line);
}

.ebd-steps__base .ebd-card {
  width: 74px;
  height: 104px;
}

.ebd-stocklabel {
  font: 600 0.9rem var(--ebd-mono);
  color: var(--ebd-mute);
}

.ebd-hand {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  justify-content: center;
  min-height: 104px;
  padding-top: var(--s3);
}

.ebd-handlabel {
  text-align: center;
  font-size: 0.85rem;
  color: var(--ebd-mute);
  margin: var(--s2) 0 var(--s4);
  min-height: 1.4em;
}

.ebd-handtitle {
  text-align: center;
  font: 700 0.8rem var(--ebd-sans);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ebd-gold);
  margin: 0;
}

/* dice */
.ebd-dicerow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s3);
  min-height: 64px;
  margin: var(--s4) 0;
  transition: opacity 160ms var(--ease);
}

.ebd-dicerow.is-rolling {
  opacity: 0.3;
}

.ebd-die {
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  width: 54px;
  height: 54px;
  padding: 8px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffaf2, #eadfcd);
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.7), inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.ebd-die i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2a1838;
  place-self: center;
}

.ebd-die[data-face="1"] i {
  background: #c2243b;
}

.ebd-die[data-face="1"] i:nth-child(1) { grid-area: 2 / 2; }
.ebd-die[data-face="2"] i:nth-child(1) { grid-area: 1 / 1; }
.ebd-die[data-face="2"] i:nth-child(2) { grid-area: 3 / 3; }
.ebd-die[data-face="3"] i:nth-child(1) { grid-area: 1 / 1; }
.ebd-die[data-face="3"] i:nth-child(2) { grid-area: 2 / 2; }
.ebd-die[data-face="3"] i:nth-child(3) { grid-area: 3 / 3; }
.ebd-die[data-face="4"] i:nth-child(1) { grid-area: 1 / 1; }
.ebd-die[data-face="4"] i:nth-child(2) { grid-area: 1 / 3; }
.ebd-die[data-face="4"] i:nth-child(3) { grid-area: 3 / 1; }
.ebd-die[data-face="4"] i:nth-child(4) { grid-area: 3 / 3; }
.ebd-die[data-face="5"] i:nth-child(1) { grid-area: 1 / 1; }
.ebd-die[data-face="5"] i:nth-child(2) { grid-area: 1 / 3; }
.ebd-die[data-face="5"] i:nth-child(3) { grid-area: 2 / 2; }
.ebd-die[data-face="5"] i:nth-child(4) { grid-area: 3 / 1; }
.ebd-die[data-face="5"] i:nth-child(5) { grid-area: 3 / 3; }
.ebd-die[data-face="6"] i:nth-child(1) { grid-area: 1 / 1; }
.ebd-die[data-face="6"] i:nth-child(2) { grid-area: 2 / 1; }
.ebd-die[data-face="6"] i:nth-child(3) { grid-area: 3 / 1; }
.ebd-die[data-face="6"] i:nth-child(4) { grid-area: 1 / 3; }
.ebd-die[data-face="6"] i:nth-child(5) { grid-area: 2 / 3; }
.ebd-die[data-face="6"] i:nth-child(6) { grid-area: 3 / 3; }

.ebd-gates {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
  max-width: 600px;
  margin: 0 auto;
}

.ebd-gates button {
  height: 92px;
  padding: 0;
  border: 2px solid #8a5a2a;
  border-radius: 40px 40px 6px 6px;
  background: linear-gradient(180deg, #a36a33, #6e4220);
  color: #fff3df;
  font: 700 1.5rem var(--ebd-serif);
  cursor: pointer;
  transition: transform 140ms var(--ease), box-shadow 200ms var(--ease), background-color 200ms var(--ease);
}

.ebd-gates button:disabled {
  cursor: default;
}

.ebd-gates button[aria-pressed="true"] {
  transform: translateY(-6px);
  box-shadow: 0 0 0 3px var(--ebd-gold), 0 0 20px rgba(255, 181, 71, 0.6);
}

.ebd-gates button.is-shut {
  color: rgba(255, 255, 255, 0.25);
  border-color: #3b2d4c;
  background:
    repeating-linear-gradient(90deg, #2b2138 0 6px, #18111f 6px 12px);
}

.ebd-gatesread {
  text-align: center;
  font: 600 0.92rem var(--ebd-mono);
  color: var(--ebd-mute);
}

.ebd-heats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s2);
  margin-bottom: var(--s5);
}

.ebd-heats button {
  min-width: 96px;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--ebd-line);
  border-radius: var(--r2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ebd-ink);
  font: 600 0.9rem var(--ebd-sans);
  cursor: pointer;
  transition: background-color 140ms var(--ease);
}

.ebd-heats button b {
  display: block;
  font: 700 1.3rem var(--ebd-mono);
}

.ebd-heats button small {
  color: var(--ebd-mute);
}

.ebd-heats button[aria-pressed="true"] {
  background: rgba(255, 181, 71, 0.18);
  border-color: var(--ebd-gold);
}

.ebd-heatbar {
  position: relative;
  height: 18px;
  max-width: 520px;
  margin: 0 auto;
  border-radius: 999px;
  background: #251b33;
  overflow: hidden;
  border: 1px solid var(--ebd-line);
}

.ebd-heatbar::after {
  content: "";
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(var(--fill, 0));
  background: linear-gradient(90deg, var(--ebd-ember), var(--ebd-gold));
  transition: transform 300ms var(--ease);
}

.ebd-heatsum {
  text-align: center;
  font: 700 1rem var(--ebd-mono);
  margin: var(--s2) 0 0;
}

/* info tabs under a game */
.ebd-tabs {
  margin-top: var(--s6);
}

.ebd-tabs__list {
  display: none;
  flex-wrap: wrap;
  gap: var(--s1);
  margin-bottom: var(--s4);
  border-bottom: 1px solid var(--ebd-line2);
}

.ebd-tabs.is-tabbed .ebd-tabs__list {
  display: flex;
}

.ebd-tabs__list button {
  padding: var(--s3) var(--s4);
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--ebd-mute);
  font: 600 0.95rem var(--ebd-sans);
  cursor: pointer;
}

.ebd-tabs__list button[aria-selected="true"] {
  color: var(--ebd-ink);
  border-bottom-color: var(--ebd-gold);
}

.ebd-tabpanel {
  margin-bottom: var(--s6);
}

.ebd-tabs.is-tabbed .ebd-tabpanel {
  margin-bottom: 0;
}

.ebd-tablewrap {
  overflow-x: auto;
  margin-bottom: var(--s4);
}

.ebd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.ebd-table th,
.ebd-table td {
  padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--ebd-line2);
  text-align: left;
  vertical-align: middle;
}

.ebd-table th {
  color: var(--ebd-gold);
  font: 700 0.78rem var(--ebd-sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ebd-table td.num {
  font-family: var(--ebd-mono);
  text-align: right;
}

.ebd-table img {
  width: 40px;
  height: 40px;
  display: inline-block;
  vertical-align: middle;
  margin-right: var(--s2);
}

.ebd-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s4);
}

.ebd-railcard {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: var(--s3);
  align-items: center;
  padding: var(--s3);
  border-radius: var(--r2);
  border: 1px solid var(--ebd-line2);
  background: var(--ebd-panel);
  color: var(--ebd-ink);
  text-decoration: none;
  transition: border-color 160ms var(--ease);
}

.ebd-railcard:hover {
  border-color: var(--ebd-gold);
  color: var(--ebd-ink);
}

.ebd-railcard img {
  border-radius: 42px 42px 4px 4px;
}

.ebd-railcard b {
  display: block;
  font: 700 1.1rem var(--ebd-serif);
}

.ebd-railcard small {
  color: var(--ebd-mute);
  font-size: 0.85rem;
}

/* chamber list page */
.ebd-wing {
  margin-top: var(--s7);
}

.ebd-wing__cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s5);
}

.ebd-doorcard {
  display: flex;
  flex-direction: column;
  border-radius: 140px 140px var(--r2) var(--r2);
  overflow: hidden;
  border: 1px solid var(--ebd-line);
  background: var(--ebd-panel);
  color: var(--ebd-ink);
  text-decoration: none;
  transition: border-color 160ms var(--ease), box-shadow 200ms var(--ease);
}

.ebd-doorcard:hover {
  color: var(--ebd-ink);
  border-color: var(--ebd-gold);
  box-shadow: 0 0 40px rgba(255, 107, 61, 0.3);
}

.ebd-doorcard img {
  aspect-ratio: 3 / 3.4;
  object-fit: cover;
  width: 100%;
}

.ebd-doorcard div {
  padding: var(--s4) var(--s5) var(--s5);
}

.ebd-doorcard h3 {
  margin-bottom: var(--s2);
}

.ebd-doorcard p {
  margin: 0;
  color: var(--ebd-mute);
  font-size: 0.95rem;
}

/* banners */
.ebd-ranks {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--s2);
  list-style: none;
  padding: 0;
}

.ebd-ranks li {
  padding: var(--s3);
  border-radius: var(--r1);
  border: 1px solid var(--ebd-line2);
  text-align: center;
  font-size: 0.85rem;
  color: var(--ebd-mute);
}

.ebd-ranks li b {
  display: block;
  font: 700 1rem var(--ebd-serif);
  color: var(--ebd-ink);
}

.ebd-ranks li.is-now {
  border-color: var(--ebd-gold);
  background: rgba(255, 181, 71, 0.12);
}

.ebd-bannergrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--s4);
  list-style: none;
  padding: 0;
}

.ebd-pennant {
  position: relative;
  padding: var(--s4) var(--s4) var(--s6);
  background: linear-gradient(180deg, #2c2240, #221a2f);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%);
  opacity: 0.55;
  transition: opacity 200ms var(--ease);
}

.ebd-pennant b {
  display: block;
  font: 700 1.05rem var(--ebd-serif);
}

.ebd-pennant small {
  color: var(--ebd-mute);
}

.ebd-pennant.is-won {
  opacity: 1;
  background: linear-gradient(180deg, #6b2a2a, #3d1822);
  box-shadow: inset 0 3px 0 var(--ebd-gold);
}

.ebd-pennant.is-won b::after {
  content: " ✦";
  color: var(--ebd-gold);
}

.ebd-meter {
  height: 12px;
  border-radius: 999px;
  background: #251b33;
  overflow: hidden;
  border: 1px solid var(--ebd-line);
}

.ebd-meter i {
  display: block;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(var(--fill, 0));
  background: linear-gradient(90deg, var(--ebd-ember), var(--ebd-gold));
}

/* responsible play tools */
.ebd-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s5);
}

.ebd-choice {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: var(--s3) 0;
}

.ebd-choice button {
  min-height: 40px;
  padding: 0 var(--s3);
  border: 1px solid var(--ebd-line);
  border-radius: 999px;
  background: transparent;
  color: var(--ebd-ink);
  font: 600 0.9rem var(--ebd-sans);
  cursor: pointer;
  transition: background-color 140ms var(--ease);
}

.ebd-choice button[aria-pressed="true"] {
  background: rgba(255, 147, 180, 0.2);
  border-color: var(--ebd-rose);
}

.ebd-choice button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ebd-state {
  font: 600 0.9rem/1.4 var(--ebd-mono);
  color: var(--ebd-rose);
}

.ebd-check ol {
  padding-left: 0;
  list-style: none;
  counter-reset: q;
}

.ebd-check li {
  counter-increment: q;
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--ebd-line2);
}

.ebd-check li > p::before {
  content: counter(q) ". ";
  color: var(--ebd-rose);
  font-family: var(--ebd-mono);
}

.ebd-check fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s4);
  border: 0;
  margin: 0;
  padding: 0;
}

.ebd-check label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
}

.ebd-helplist {
  list-style: none;
  padding: 0;
}

.ebd-helplist li {
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--ebd-line2);
}

/* forms */
.ebd-form label {
  display: block;
  margin-bottom: var(--s4);
  font-weight: 600;
}

.ebd-form input,
.ebd-form select,
.ebd-form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: var(--s3);
  border-radius: var(--r1);
  border: 1px solid var(--ebd-line);
  background: #140f1c;
  color: var(--ebd-ink);
  font: 400 1rem var(--ebd-sans);
}

.ebd-form .ebd-tick {
  display: flex;
  gap: var(--s2);
  font-weight: 400;
}

.ebd-form .ebd-tick input {
  width: auto;
  margin-top: 4px;
}

.ebd-err {
  display: block;
  color: var(--ebd-rose);
  font-weight: 400;
  font-size: 0.88rem;
}

.ebd-msgbox {
  padding: var(--s3) var(--s4);
  border-radius: var(--r1);
  border: 1px solid var(--ebd-line);
}

.ebd-msgbox--ok {
  border-color: var(--ebd-jade);
  background: rgba(111, 220, 176, 0.1);
}

.ebd-msgbox--bad {
  border-color: var(--ebd-rose);
  background: rgba(255, 147, 180, 0.1);
}

/* ---------- Free Roam: a daylight courtyard inside the dark keep ---------- */

.ebd--roam .ebd-main {
  max-width: none;
  padding: 0;
  background: #eef3fb;
  color: #13213a;
}

.ebd-roam {
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--s5) var(--s5) var(--s8);
  --roam-ink: #13213a;
  --roam-mute: #4a5872;
  --roam-acc: #2c5fcc;
  --roam-sun: #f3b62b;
  --roam-coral: #d4553d;
  --roam-paper: #fbf8f1;
}

.ebd--roam .ebd-trail {
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--s5) var(--s5) 0;
}

.ebd--roam .ebd-trail ol {
  color: #4a5872;
  margin: 0;
}

.ebd--roam .ebd-trail li + li::before {
  color: #d4553d;
}

.ebd-roam a:not(.ebd-btn) {
  color: var(--roam-acc);
}

.ebd-roam a:not(.ebd-btn):hover {
  color: #1d469d;
}

.ebd-roam h1,
.ebd-roam h2,
.ebd-roam h3 {
  font-family: var(--ebd-sans);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.ebd-roam .ebd-kicker {
  color: var(--roam-coral);
}

.ebd-roam .ebd-lead {
  color: #2a3a57;
}

.ebd-roam :focus-visible {
  outline-color: var(--roam-acc);
}

.ebd-roamhero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: var(--s6);
  align-items: center;
  padding: var(--s4) 0 var(--s6);
}

.ebd-roamhero img {
  border-radius: var(--r3);
  box-shadow: 0 20px 50px -30px rgba(19, 33, 58, 0.6);
}

.ebd-roamtag {
  display: inline-block;
  padding: 3px var(--s2);
  margin: 0 var(--s1) var(--s1) 0;
  border-radius: var(--r1);
  font: 700 0.75rem var(--ebd-sans);
  background: #dfe8f7;
  color: #1d3a7a;
}

.ebd-roamgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s5);
  list-style: none;
  padding: 0;
}

.ebd-roamcard {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--r2);
  background: var(--roam-paper);
  border: 1px solid #d9e1ee;
  overflow: hidden;
  transition: transform 180ms var(--ease), box-shadow 200ms var(--ease), opacity 200ms var(--ease);
}

.ebd-roamcard:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px -22px rgba(19, 33, 58, 0.55);
}

.ebd-roamcard.is-dim {
  opacity: 0.35;
}

.ebd-roamcard.is-pick {
  box-shadow: 0 0 0 3px var(--roam-sun), 0 16px 34px -22px rgba(19, 33, 58, 0.55);
}

.ebd-roamcard img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}

.ebd-roamcard__body {
  padding: var(--s4) var(--s5) var(--s5);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ebd-roamcard h3 {
  font-size: 1.25rem;
  margin-bottom: var(--s1);
}

.ebd-roamcard h3 a {
  color: var(--roam-ink);
  text-decoration: none;
}

.ebd-roamcard p {
  color: var(--roam-mute);
  font-size: 0.95rem;
}

.ebd-roamcard dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px var(--s3);
  margin-top: auto;
  font-size: 0.85rem;
}

.ebd-roamcard dt {
  color: var(--roam-mute);
}

.ebd-roamcard dd {
  margin: 0;
  font-weight: 600;
}

.ebd-roampanel {
  padding: var(--s5);
  border-radius: var(--r2);
  background: #ffffff;
  border: 1px solid #d9e1ee;
}

.ebd-roampanel--sun {
  background: #fff6dc;
  border-color: #f0d68b;
}

.ebd-btn--roam {
  color: #ffffff;
  background: var(--roam-acc);
  clip-path: none;
  border-radius: 999px;
}

.ebd-btn--roam:hover {
  color: #ffffff;
  background: #1d469d;
}

.ebd-btn--roamline {
  color: var(--roam-acc);
  background: #dfe8f7;
  clip-path: none;
  border-radius: 999px;
}

.ebd-compass fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 var(--s4);
}

.ebd-compass legend {
  font-weight: 700;
  margin-bottom: var(--s2);
}

.ebd-compass .ebd-choice button {
  color: var(--roam-ink);
  border-color: #b8c7e2;
}

.ebd-compass .ebd-choice button[aria-pressed="true"] {
  background: var(--roam-sun);
  border-color: #c9901a;
}

.ebd-compass__out {
  min-height: 3em;
  font-weight: 600;
}

.ebd-roamfacts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s2) var(--s4);
}

.ebd-roamfacts dt {
  color: var(--roam-mute);
  font-weight: 600;
}

.ebd-roamfacts dd {
  margin: 0;
}

.ebd-roamreview {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: var(--s6);
  align-items: start;
}

.ebd-score {
  font: 800 2.4rem/1 var(--ebd-sans);
  color: var(--roam-coral);
}

.ebd-score small {
  font-size: 1rem;
  color: var(--roam-mute);
}

/* ---------- plinth (footer) ---------- */

.ebd-plinth {
  border-top: 6px solid var(--ebd-stone);
  background: #0f0b15;
  padding: var(--s7) var(--s5) var(--s6);
}

.ebd-plinth > div {
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
}

.ebd-plinth__vow {
  padding: var(--s4) var(--s5);
  border: 1px solid var(--ebd-line);
  border-radius: var(--r2);
  background: rgba(255, 181, 71, 0.05);
  margin-bottom: var(--s6);
}

.ebd-plinth__vow p {
  margin-bottom: var(--s2);
}

.ebd-plinth__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 0.8fr)) minmax(0, 1.4fr);
  gap: var(--s5);
}

.ebd-plinth__h {
  font: 700 0.8rem var(--ebd-sans);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ebd-gold);
}

.ebd-plinth ul {
  list-style: none;
  padding: 0;
  font-size: 0.92rem;
}

.ebd-plinth li {
  margin-bottom: var(--s2);
}

.ebd-plinth li a {
  color: var(--ebd-ink);
}

.ebd-plinth__help li {
  color: var(--ebd-mute);
}

.ebd-plinth__base {
  margin-top: var(--s5);
  padding-top: var(--s4);
  border-top: 1px solid var(--ebd-line2);
  font-size: 0.85rem;
  color: var(--ebd-mute);
}

/* ---------- overlays ---------- */

.ebd-veil {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: var(--s4);
  background: rgba(10, 6, 14, 0.84);
  backdrop-filter: blur(6px);
}

.ebd-veil[hidden],
.ebd-mapsheet[hidden],
.ebd-consent[hidden] {
  display: none;
}

.ebd-tablet {
  width: min(520px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: var(--s6);
  border-radius: var(--r3);
  border: 1px solid var(--ebd-line);
  background: linear-gradient(180deg, #2e2344, #1d1529);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
  animation: ebd-rise 220ms var(--ease);
}

.ebd-tablet--gate {
  text-align: center;
}

.ebd-tablet--gate img {
  margin: 0 auto var(--s4);
}

.ebd-tablet__t {
  font: 700 1.45rem/1.25 var(--ebd-serif);
}

.ebd-tablet__acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s3);
  margin: var(--s5) 0 var(--s3);
}

.ebd-tablet__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--s2);
  margin: var(--s4) 0;
}

@keyframes ebd-rise {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
}

.ebd-consent {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: var(--s4);
  width: min(640px, calc(100% - 32px));
  transform: translateX(-50%);
  padding: var(--s5);
  border-radius: var(--r2);
  border: 1px solid var(--ebd-line);
  background: #241b33;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.9);
  font-size: 0.92rem;
}

.ebd-consent__t {
  font: 700 1.1rem var(--ebd-serif);
  margin-bottom: var(--s2);
}

.ebd-consent__acts {
  display: flex;
  gap: var(--s3);
  flex-wrap: wrap;
}

.ebd-mapsheet {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: flex;
  align-items: flex-end;
  background: rgba(10, 6, 14, 0.7);
}

.ebd-mapsheet__card {
  width: 100%;
  padding: var(--s5) var(--s5) var(--s6);
  border-radius: var(--r3) var(--r3) 0 0;
  background: #241b33;
  border-top: 2px solid var(--ebd-gold);
  animation: ebd-sheet 240ms var(--ease);
}

@keyframes ebd-sheet {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}

.ebd-mapsheet__t {
  font: 700 1.2rem var(--ebd-serif);
}

.ebd-mapsheet nav {
  display: grid;
  gap: var(--s1);
  margin-bottom: var(--s4);
}

.ebd-mapsheet nav a {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3);
  border-radius: var(--r1);
  color: var(--ebd-ink);
  text-decoration: none;
  border-left: 3px solid transparent;
}

.ebd-mapsheet nav a[aria-current] {
  border-left-color: var(--ebd-gold);
  background: rgba(255, 181, 71, 0.1);
}

.ebd-toast {
  position: fixed;
  z-index: 85;
  left: var(--s4);
  bottom: var(--s4);
  max-width: min(420px, calc(100% - 32px));
  margin: 0;
  padding: var(--s3) var(--s4);
  border-radius: var(--r1);
  background: #f6f0e7;
  color: #1d1626;
  font-size: 0.92rem;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

.ebd-toast.is-up {
  opacity: 1;
  transform: none;
}

/* ---------- small screens ---------- */

@media (max-width: 1520px) {
  .ebd-nav__link .ebd-icon,
  .ebd-hud__visit {
    display: none;
  }
}

@media (max-width: 1280px) {
  .ebd-nav {
    display: none;
  }

  .ebd-hud {
    margin-left: auto;
  }

  .ebd-hud__map {
    display: flex;
  }
}

@media (max-width: 960px) {
  .ebd-gatehero,
  .ebd-split,
  .ebd-courtyard,
  .ebd-roamhero,
  .ebd-roamreview {
    grid-template-columns: minmax(0, 1fr);
  }

  .ebd-altar {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "stage" "bar" "lock" "brazier";
  }

  .ebd-grid3,
  .ebd-rail,
  .ebd-tools {
    grid-template-columns: minmax(0, 1fr);
  }

  .ebd-plinth__cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ebd-ranks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .ebd-crown__bar {
    padding: var(--s2) var(--s4);
    gap: var(--s2);
  }

  .ebd-brand__word {
    display: none;
  }

  .ebd-hud__visit,
  .ebd-hud__glints small,
  .ebd-hud__pause span,
  .ebd-hud__map span {
    display: none;
  }

  .ebd-runes {
    font-size: 0.72rem;
    gap: 0 var(--s2);
  }

  .ebd-runes span::before {
    margin-right: var(--s2);
  }

  .ebd-main {
    padding: var(--s4) var(--s4) var(--s7);
  }

  .ebd-roam {
    padding: var(--s4) var(--s4) var(--s7);
  }

  .ebd--roam .ebd-trail {
    padding: var(--s4) var(--s4) 0;
  }

  .ebd-keep {
    padding: 0 10px;
  }

  .ebd-keep::before {
    margin: 0 -10px;
  }

  .ebd-keep__walls {
    border-width: 0 6px;
  }

  .ebd-shaft {
    left: 26px;
  }

  .ebd-floor,
  .ebd-floor--flip,
  .ebd-floor--beacon,
  .ebd-floor--gatehouse {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: var(--s3);
    padding: var(--s4) var(--s3) var(--s4) 6px;
  }

  .ebd-floor .ebd-window,
  .ebd-floor--flip .ebd-window {
    order: 0;
    grid-column: 2;
    max-width: 220px;
  }

  .ebd-floor > div:last-child,
  .ebd-floor--beacon > :last-child,
  .ebd-floor--gatehouse > :last-child {
    grid-column: 2;
  }

  .ebd-plaque {
    width: 36px;
    height: 36px;
    font-size: 0.72rem;
    align-self: start;
  }

  .ebd-fire {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ebd-chamberhead {
    grid-template-columns: minmax(0, 1fr);
  }

  .ebd-chamberhead__cover {
    width: 120px;
  }

  .ebd-stage {
    padding: var(--s3);
  }

  .ebd-runebar {
    padding: var(--s3);
  }

  .ebd-brazierbtn {
    margin: 0 auto;
  }

  .ebd-card {
    width: 40px;
    height: 58px;
  }

  .ebd-card__corner {
    font-size: 0.72rem;
    left: 3px;
  }

  .ebd-card__pip {
    font-size: 1.2rem;
  }

  .ebd-steps__col .ebd-card + .ebd-card {
    margin-top: -40px;
  }

  .ebd-steps__cols {
    gap: 3px;
  }

  .ebd-gates {
    gap: 3px;
  }

  .ebd-gates button {
    height: 64px;
    font-size: 1.05rem;
    border-radius: 24px 24px 4px 4px;
  }

  .ebd-grid2,
  .ebd-plinth__cols {
    grid-template-columns: minmax(0, 1fr);
  }

  .ebd-ranks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ebd-die {
    width: 44px;
    height: 44px;
    padding: 6px;
  }

  .ebd-die i {
    width: 8px;
    height: 8px;
  }
}

/* ---------- calm mode and reduced motion ---------- */

.is-calm *,
.is-calm *::before,
.is-calm *::after {
  transition: none !important;
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

.ebd-glance {
  margin: 0;
}

.ebd-glance div {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(0, 1.4fr);
  gap: var(--s3);
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--ebd-line2);
}

.ebd-glance dt {
  color: var(--ebd-mute);
}

.ebd-glance dd {
  margin: 0;
}
