/* DegenScape: an adventurer's journal open on a tavern table.
   Parchment pages, iron-gall ink, gold leaf, forest-green wax seals; the plates are the kit's moonlit paintings.
   Motion animates transform and opacity only, and stops under prefers-reduced-motion. */

:root {
  --table: #1b120c;
  --table-2: #2a1a10;
  --leather: #2c1a10;
  --leather-2: #3b2415;
  --parch: #efe2c0;
  --parch-2: #e4d2a6;
  --parch-3: #d3bd8b;
  --ink: #2a1d12;
  --ink-soft: #5b4630;
  --ink-mute: #7a6346;
  --ink-line: rgba(42, 29, 18, .22);
  --gold: #c9a24b;
  --gold-hi: #ecd28a;
  --gold-lo: #8a6a26;
  --seal: #1f4a2a;
  --seal-hi: #4e8a57;
  --seal-lo: #0e2515;
  --verd: #3f7a4a;
  --lime: #adff1a;
  --oxblood: #8c1c13;
  --plate: #101b22;

  --display: 'Pirata One', 'UnifrakturMaguntia', Georgia, serif;
  --text: 'Alegreya', Georgia, 'Times New Roman', serif;
  --sc: 'Alegreya SC', 'Alegreya', Georgia, serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .32  0 0 0 0 .22  0 0 0 0 .09  0 0 0 .2 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --paper:
    var(--noise),
    radial-gradient(ellipse 70% 55% at 22% 14%, rgba(255, 249, 228, .7), transparent 60%),
    radial-gradient(ellipse 60% 50% at 88% 92%, rgba(168, 126, 64, .22), transparent 62%),
    radial-gradient(ellipse 40% 30% at 70% 30%, rgba(190, 150, 90, .08), transparent 70%),
    linear-gradient(170deg, var(--parch), var(--parch-2));

  --wax:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .22), transparent 26%),
    radial-gradient(circle at 50% 45%, var(--seal-hi) 0%, var(--seal) 46%, var(--seal-lo) 100%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--table);
  color: var(--ink);
  font: 400 17px/1.5 var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; box-shadow: 0 0 0 5px rgba(31, 74, 42, .55); }

/* ---------------------------------------------------------------- the table */
.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.scene__bg {
  position: absolute; inset: -4%;
  background:
    repeating-linear-gradient(90deg, transparent 0 236px, rgba(0, 0, 0, .55) 236px 239px, rgba(255, 205, 150, .05) 239px 240px),
    repeating-linear-gradient(91.2deg, rgba(255, 214, 160, .035) 0 2px, transparent 2px 9px, rgba(0, 0, 0, .09) 9px 11px, transparent 11px 21px),
    repeating-linear-gradient(89.4deg, transparent 0 37px, rgba(255, 200, 140, .03) 37px 40px, transparent 40px 77px),
    var(--noise),
    linear-gradient(180deg, #2b1b10 0%, #20150d 55%, #160e08 100%);
  transform: translate3d(var(--px, 0), var(--py, 0), 0);
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
  will-change: transform;
}
.scene__candle {
  position: absolute; inset: -10%;
  background:
    radial-gradient(circle at 16% 14%, rgba(255, 186, 104, .30), rgba(255, 160, 80, .10) 26%, transparent 46%),
    radial-gradient(circle at 86% 78%, rgba(255, 170, 90, .10), transparent 40%);
  animation: candle 7s ease-in-out infinite alternate;
}
@keyframes candle {
  0% { opacity: .72; transform: translate3d(0, 0, 0) scale(1); }
  45% { opacity: 1; transform: translate3d(.6%, .4%, 0) scale(1.02); }
  70% { opacity: .82; transform: translate3d(-.3%, .2%, 0) scale(1.01); }
  100% { opacity: .95; transform: translate3d(.4%, -.3%, 0) scale(1.03); }
}
.scene__embers { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .45; mix-blend-mode: screen; }
.scene__shade { position: absolute; inset: 0; background: radial-gradient(ellipse 85% 75% at 50% 42%, transparent 45%, rgba(8, 5, 2, .55) 85%, rgba(5, 3, 1, .8) 100%); }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: relative; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) clamp(14px, 3vw, 32px) 6px;
}
.world-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px 7px 22px;
  font: 700 14px/1 var(--sc); letter-spacing: .08em; color: var(--ink);
  background: var(--paper);
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5));
}
.world-pill__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 1px var(--seal), 0 0 8px rgba(173, 255, 26, .8); animation: pulse 2.4s ease-in-out infinite; }
.world-pill__sep { color: var(--ink-mute); }
@keyframes pulse { 50% { opacity: .4; } }
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.topbar__tg svg { flex: none; }

/* ---------------------------------------------------------------- buttons: ink rules and wax seals */
.rs-btn {
  position: relative; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  font: 700 15px/1 var(--sc); letter-spacing: .06em; color: var(--ink); text-decoration: none;
  background: transparent; border: 0; border-radius: 0;
  border-top: 3px double var(--ink); border-bottom: 3px double var(--ink);
  transition: transform .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.rs-btn:hover { background-color: rgba(42, 29, 18, .07); transform: translateY(-1px); }
.rs-btn:active { transform: translateY(1px); background-color: rgba(42, 29, 18, .13); }
.rs-btn[disabled] { cursor: not-allowed; opacity: .55; transform: none; }
.rs-btn--small { font-size: 14px; padding: 8px 13px; }
.rs-btn__torch { display: none; }

/* on the table (top bar): gold rules */
.topbar .rs-btn { color: var(--gold-hi); border-color: rgba(201, 162, 75, .75); }
.topbar .rs-btn:hover { color: #fff3cf; background-color: rgba(201, 162, 75, .12); }
.topbar .rs-btn--wallet {
  white-space: nowrap;
  color: var(--ink); border: 0; padding: 9px 16px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(42, 29, 18, .5), inset 0 0 0 4px var(--parch), inset 0 0 0 5px rgba(42, 29, 18, .35), 0 3px 6px rgba(0, 0, 0, .45);
}
.topbar .rs-btn--wallet:hover { color: var(--seal); background: var(--paper); }

/* primary: the round wax seal */
.rs-btn--enter {
  flex: none; width: 146px; height: 146px; padding: 0; border: 0;
  border-radius: 51% 48% 50% 47% / 47% 52% 48% 53%;
  background: var(--wax);
  color: var(--gold-hi);
  box-shadow:
    inset 0 0 0 7px rgba(0, 0, 0, .18),
    inset 0 0 0 9px var(--gold),
    inset 0 0 0 10px rgba(60, 40, 10, .6),
    inset 0 -6px 14px rgba(0, 0, 0, .35),
    0 5px 0 #0a1a0e, 0 12px 22px rgba(30, 18, 6, .45);
  transform: rotate(-4deg);
}
.rs-btn--enter::before {
  content: ''; position: absolute; z-index: -1; inset: -9px -12px -7px -8px;
  border-radius: 46% 54% 42% 58% / 55% 44% 56% 45%;
  background: radial-gradient(circle at 50% 50%, var(--seal) 0%, var(--seal-lo) 70%);
  opacity: .9;
}
.rs-btn--enter::after {
  content: ''; position: absolute; inset: -14px; border-radius: 50%;
  box-shadow: 0 0 22px 4px rgba(173, 255, 26, .38);
  opacity: 0; animation: rune 3.2s ease-in-out infinite;
}
@keyframes rune { 50% { opacity: 1; } }
.rs-btn__enter { font: 400 30px/.92 var(--display); letter-spacing: .02em; text-shadow: 0 -1px 0 rgba(0, 0, 0, .55), 0 1px 0 rgba(255, 240, 190, .25); }
.rs-btn--enter:hover { background: var(--wax); transform: rotate(-7deg) scale(1.04); }
.rs-btn--enter:active { transform: rotate(-4deg) scale(.95); }

/* primary in a column: the wax slab with a stamped seal */
.rs-btn--mint {
  width: 100%; min-height: 60px; padding: 14px 18px 14px 66px; margin-top: 6px; border: 0;
  border-radius: 12px 16px 10px 15px / 14px 10px 16px 12px;
  background: var(--wax);
  color: var(--gold-hi); font: 400 25px/1.05 var(--display); letter-spacing: .02em; text-transform: none;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, .55);
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, .15), inset 0 0 0 5px var(--gold), inset 0 -5px 12px rgba(0, 0, 0, .3), 0 4px 0 #0a1a0e, 0 10px 18px rgba(30, 18, 6, .35);
}
.rs-btn--mint::before {
  content: 'D'; position: absolute; left: 12px; top: 50%; width: 42px; height: 42px; margin-top: -21px;
  display: grid; place-items: center; border-radius: 50%;
  font: 400 26px/1 var(--display); color: var(--gold-hi);
  background: radial-gradient(circle at 40% 35%, var(--seal), var(--seal-lo));
  box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 0 4px rgba(0, 0, 0, .3), 0 1px 0 rgba(255, 255, 255, .12);
}
.rs-btn--mint:hover:not([disabled]) { background: var(--wax); transform: translateY(-1px); }
.rs-btn--mint:active:not([disabled]) { transform: scale(.98); }
.rs-btn--mint[disabled] { opacity: .62; }

/* ---------------------------------------------------------------- stage */
.stage { position: relative; z-index: 10; flex: 1; width: 100%; padding: 10px clamp(10px, 2.4vw, 32px) 8px; }
body.is-lobby .title { display: none; }

/* ---------------------------------------------------------------- the book */
.book {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  width: min(1340px, 100%); margin: 6px auto 0;
  padding: 12px;
  border-radius: 9px;
  background: var(--noise), linear-gradient(160deg, var(--leather-2), var(--leather) 60%, #20130b);
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, .4),
    inset 0 0 0 5px rgba(201, 162, 75, .28),
    inset 0 0 0 6px rgba(0, 0, 0, .35),
    0 34px 70px rgba(0, 0, 0, .65), 0 6px 14px rgba(0, 0, 0, .5);
}
.page {
  position: relative; min-width: 0;
  padding: clamp(40px, 4.4vw, 62px) clamp(22px, 4vw, 60px) clamp(46px, 4vw, 58px);
  background: var(--paper);
  box-shadow: 0 1px 0 #d8c59a, 0 2px 0 #bea777, 0 3px 0 #d6c294, 0 4px 0 #b39c6c, 0 5px 0 #ccb889;
}
.page--l { border-radius: 4px 1px 1px 4px; animation: pageL .8s cubic-bezier(.2, .8, .2, 1) both; }
.page--r { border-radius: 1px 4px 4px 1px; animation: pageR .8s cubic-bezier(.2, .8, .2, 1) .08s both; }
.page--l::after, .page--r::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 70px; pointer-events: none;
}
.page--l::after { right: 0; background: linear-gradient(to right, transparent, rgba(110, 76, 30, .14) 55%, rgba(60, 38, 12, .38)); }
.page--r::after { left: 0; background: linear-gradient(to left, transparent, rgba(110, 76, 30, .14) 55%, rgba(60, 38, 12, .38)); }
@keyframes pageL { from { opacity: 0; transform: translateX(-14px); } }
@keyframes pageR { from { opacity: 0; transform: translateX(14px); } }
.page__run {
  position: absolute; top: 18px; left: 0; right: 0; text-align: center;
  font: 700 12px/1 var(--sc); letter-spacing: .26em; color: var(--ink-mute);
}
.page__folio { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; font: italic 400 15px/1 var(--text); color: var(--ink-mute); }

/* left page: the title */
.page--l { display: flex; flex-direction: column; align-items: center; text-align: center; }
.wordmark { position: relative; margin: clamp(4px, 2vh, 26px) 0 clamp(14px, 2.4vh, 26px); padding-right: 30px; }
.title__logo { margin: 0; line-height: 0; }
.title__logo img { display: block; width: clamp(190px, min(17vw, 27vh), 250px); height: auto; border-radius: 14px; box-shadow: 0 0 0 3px var(--gold), 0 0 0 5px rgba(42, 26, 8, .7), 0 10px 22px rgba(30, 18, 6, .45); }
.seal {
  position: relative; display: inline-grid; place-items: center; flex: none;
  border-radius: 50%; background: var(--wax);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .2), inset 0 0 0 5px var(--gold), inset 0 0 0 6px rgba(50, 32, 8, .55), 0 3px 6px rgba(30, 18, 6, .45);
}
.seal--ticker {
  position: absolute; right: -58px; top: -44px; width: 92px; height: 92px;
  border-radius: 49% 52% 47% 51% / 52% 48% 53% 47%;
  transform: rotate(-14deg);
  animation: sealIn .6s cubic-bezier(.3, 1.6, .5, 1) .2s both;
}
.seal--ticker span { font: 800 14px/1 var(--sc); letter-spacing: .04em; color: var(--lime); text-shadow: 0 0 6px rgba(173, 255, 26, .45), 0 1px 0 rgba(0, 0, 0, .7); }
@keyframes sealIn { from { opacity: 0; transform: rotate(-14deg) scale(1.5); } }
.seal--pfp::before { content: 'D'; font: 400 24px/1 var(--display); color: var(--gold-hi); }
.seal--pfp img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); border-radius: 50%; object-fit: cover; }

.rule { display: block; position: relative; height: 14px; }
.rule--orn { width: min(300px, 70%); margin: 22px auto 16px; background: linear-gradient(var(--ink-soft), var(--ink-soft)) left 50% / calc(50% - 16px) 1px no-repeat, linear-gradient(var(--ink-soft), var(--ink-soft)) right 50% / calc(50% - 16px) 1px no-repeat; }
.rule--orn::before, .rule--orn::after { content: ''; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; transform: rotate(45deg); background: var(--gold); box-shadow: 0 0 0 1px var(--ink-soft); }
.rule--orn::after { width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px; background: var(--ink); box-shadow: none; }

.title__tag { margin: 0; max-width: 24ch; font: italic 500 clamp(21px, 2.1vw, 28px)/1.22 var(--text); color: var(--ink); }
.title__sub { margin: 12px 0 0; max-width: 38ch; font: 500 15px/1.4 var(--sc); letter-spacing: .03em; color: var(--ink-soft); }
.title__actions { display: flex; align-items: center; gap: clamp(22px, 3vw, 40px); margin-top: clamp(26px, 4vh, 44px); text-align: left; }
.title__ledger { display: grid; gap: 14px; min-width: 0; }
.title__mint { margin: 0; padding: 0 0 10px; border-bottom: 1px solid var(--ink-line); font: 400 17px/1.35 var(--text); color: var(--ink); }
.title__mint b { color: var(--seal); font-weight: 700; }

/* ---------------------------------------------------------------- contract-address slots */
.ca { display: inline-flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ca__label { font: 700 13px/1 var(--sc); letter-spacing: .1em; color: var(--ink-soft); white-space: nowrap; }
.ca__addr { font: 500 13.5px/1.2 var(--mono); color: var(--ink); padding: 2px 6px; background: rgba(42, 29, 18, .07); border-radius: 2px; }
.ca__addr:empty { display: inline-block; min-width: 15ch; height: 1.1em; padding: 0; background: none; border-bottom: 1px dotted var(--ink-soft); border-radius: 0; }
.ca__copy {
  cursor: pointer; padding: 4px 9px; border: 1px solid currentColor; border-radius: 2px; background: transparent;
  font: 700 12px/1 var(--sc); letter-spacing: .08em; color: var(--ink-soft);
  transition: transform .12s ease;
}
.ca__copy:hover { color: var(--ink); transform: translateY(-1px); }
.ca__copy:active { transform: translateY(1px); }
.ca__copy.is-copied { color: var(--gold-hi); background: var(--seal); border-color: var(--seal); }
.ca__ex { display: inline-grid; place-items: center; width: 26px; height: 26px; color: inherit; transition: transform .15s ease; }
.ca__ex:hover { transform: translateY(-1px); }
.ca--title { justify-content: flex-start; }

/* ---------------------------------------------------------------- plates */
.page--r { display: flex; flex-direction: column; gap: 22px; }
.plate { margin: 0; display: grid; gap: 12px; justify-items: center; }
.plate__frame {
  position: relative; width: 100%;
  padding: 7px; background: var(--plate);
  box-shadow: 0 0 0 1px var(--gold-lo), 0 0 0 6px rgba(255, 248, 225, .55), 0 0 0 7px rgba(91, 70, 48, .5), 0 14px 22px rgba(70, 45, 15, .28);
  transform: rotate(.5deg);
}
.plate__frame img { width: 100%; height: auto; box-shadow: 0 0 0 1px rgba(201, 162, 75, .55); }
.plate__frame::before, .plate__frame::after {
  content: ''; position: absolute; width: 34px; height: 34px;
  background: linear-gradient(135deg, #3a2618 50%, transparent 50%);
  filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, .35));
}
.plate__frame::before { left: -8px; top: -8px; }
.plate__frame::after { right: -8px; bottom: -8px; transform: rotate(180deg); }
.plate figcaption { font: italic 400 15px/1.3 var(--text); color: var(--ink-soft); text-align: center; }
.plate__no { margin-right: 6px; font: 700 13px/1 var(--sc); font-style: normal; letter-spacing: .1em; color: var(--gold-lo); }
.plate--small .plate__frame { width: min(300px, 100%); transform: rotate(-1.2deg); }

/* the roll of heroes on the right page */
.roll { margin-top: auto; }
.roll__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--ink-line); font: 700 13px/1 var(--sc); letter-spacing: .12em; color: var(--ink-soft); }
.roll__hint { font: italic 400 14px/1 var(--text); letter-spacing: 0; color: var(--ink-mute); }
.lineup {
  position: relative; height: clamp(150px, 19vh, 200px);
  display: flex; justify-content: center; align-items: flex-end;
  padding: 26px 4% 0;
  border-bottom: 3px double var(--ink);
}
.hero {
  position: relative; flex: 0 1 auto; min-width: 0; cursor: pointer; border: 0; background: none; padding: 0;
  height: var(--h, 78%); margin: 0 -2.6%;
  transform-origin: 50% 100%;
  animation: heroIn .9s cubic-bezier(.2, .8, .2, 1) both, bob 4.6s ease-in-out infinite;
  animation-delay: var(--d, 0s), calc(var(--d, 0s) * 3);
}
.hero img { height: 100%; width: auto; max-width: none; filter: drop-shadow(0 4px 3px rgba(42, 29, 18, .45)); transition: transform .2s ease; }
.hero:hover, .hero:focus-visible { z-index: 3; }
.hero:hover img, .hero:focus-visible img { transform: translateY(-8px) scale(1.05); }
.hero:focus-visible { outline: none; box-shadow: none; }
.hero:focus-visible img { filter: drop-shadow(0 0 3px var(--lime)) drop-shadow(0 4px 3px rgba(42, 29, 18, .45)); }
.hero__tag {
  position: absolute; left: 50%; bottom: calc(100% + 2px); z-index: 4;
  transform: translateX(-50%) translateY(6px); opacity: 0; pointer-events: none; white-space: nowrap;
  padding: 5px 9px; font: 700 13px/1 var(--sc); letter-spacing: .04em; color: var(--ink);
  background: var(--parch); box-shadow: 0 0 0 1px var(--ink-soft), 0 3px 6px rgba(42, 29, 18, .25);
  transition: opacity .15s ease, transform .15s ease;
}
.hero__tag em { font: italic 400 13px/1 var(--text); color: var(--verd); }
.hero:hover .hero__tag, .hero:focus-visible .hero__tag { opacity: 1; transform: translateX(-50%) translateY(-6px); }
@keyframes bob { 50% { transform: translateY(-4px); } }
@keyframes heroIn { from { opacity: 0; transform: translateY(24px); } }

/* ---------------------------------------------------------------- lobby: the next spread */
.lobby { display: grid; justify-items: center; padding: 8px 0 20px; }
.panel {
  --pad: clamp(18px, 3vw, 40px);
  --gap: clamp(40px, 5vw, 76px);
  --split: .5;
  position: relative;
  width: min(1200px, calc(100% - 20px));
  padding: 20px var(--pad) 34px;
  color: var(--ink);
  background: var(--paper);
  border-radius: 4px;
  box-shadow:
    0 2px 0 #c9b385, 0 4px 0 #d6c294, 0 5px 0 #b39c6c,
    0 0 0 11px var(--leather), 0 0 0 12px rgba(201, 162, 75, .35), 0 0 0 14px #1c110a,
    0 36px 70px rgba(0, 0, 0, .6);
  margin: 14px 0;
  animation: panelIn .55s cubic-bezier(.2, .8, .2, 1) both;
}
/* the gutter between the two pages */
.panel::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 120px; pointer-events: none;
  left: calc(var(--pad) + (100% - 2 * var(--pad) - var(--gap)) * var(--split) + var(--gap) / 2 - 60px);
  background: linear-gradient(to right, transparent, rgba(110, 76, 30, .12) 40%, rgba(50, 32, 10, .42) 50%, rgba(110, 76, 30, .12) 60%, transparent);
}
@keyframes panelIn { from { opacity: 0; transform: translateY(16px); } }
.panel__head {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 14px;
  padding: 6px 0 14px; margin-bottom: 22px;
  border-bottom: 3px double var(--ink);
}
.panel__head h2 { flex: 1; margin: 0; font: 400 clamp(30px, 3.2vw, 44px)/1 var(--display); color: var(--ink); letter-spacing: .01em; }
.panel__emblem { width: 50px; height: 50px; }
.panel__x {
  flex: none; display: grid; place-items: center; padding: 0; width: 38px; height: 38px; cursor: pointer; border-radius: 50%;
  border: 1px solid var(--ink-soft); background: transparent;
  font: 400 16px/1 var(--text); color: var(--ink);
  transition: transform .15s ease;
}
.panel__x:hover { transform: rotate(90deg); background: rgba(42, 29, 18, .08); }

/* welcome step */
#stepWelcome { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--gap); align-items: start; }
.welcome__l, .welcome__r { min-width: 0; }
.welcome__r { display: grid; gap: 14px; justify-items: center; text-align: center; }
.panel__lede { margin: 0 0 22px; font: 400 19px/1.5 var(--text); color: var(--ink); }
.panel__lede::first-letter { float: left; margin: 4px 8px 0 0; font: 400 3.3em/.8 var(--display); color: var(--seal); }
.welcome-btns { display: grid; border-top: 3px double var(--ink); border-bottom: 3px double var(--ink); }
.rs-btn--block {
  display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto auto; column-gap: 8px; row-gap: 4px;
  justify-content: stretch; align-items: baseline; text-align: left;
  padding: 16px 10px 16px 4px; border: 0; border-bottom: 1px solid var(--ink-line);
}
.rs-btn--block:last-child { border-bottom: 0; }
.rs-btn--block:hover { transform: translateX(4px); }
.rs-btn--block:active { transform: translateX(2px); }
.rs-btn__no { grid-row: 1 / 3; align-self: center; text-align: center; font: 400 30px/1 var(--display); color: var(--gold-lo); }
.rs-btn__title { font: 400 28px/1 var(--display); letter-spacing: .01em; color: var(--ink); text-transform: none; }
.rs-btn__hint { grid-column: 2; font: italic 400 16px/1.3 var(--text); letter-spacing: 0; color: var(--ink-soft); text-transform: none; }
.rs-btn--play .rs-btn__no, .rs-btn--play .rs-btn__title { color: var(--seal); }
.rs-btn--play .rs-btn__title::after { content: ''; display: inline-block; margin-left: 10px; vertical-align: 4px; border-left: 9px solid var(--seal); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.panel__stats { font: 500 16px/1.4 var(--sc); letter-spacing: .02em; color: var(--ink-soft); }
.panel__stats:empty { display: none; }
.panel__stats b { color: var(--seal); }
.panel__contract { font: 400 15px/1.5 var(--text); color: var(--ink-soft); }
.panel__contract a { color: var(--seal); font-weight: 500; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.panel__contract a:hover { color: var(--ink); }

/* character creator */
.panel:has(#stepCreate:not([hidden])) { --split: .43; width: min(1460px, calc(100% - 20px)); }
.creator { display: grid; grid-template-columns: calc((100% - var(--gap)) * var(--split)) 1fr; column-gap: var(--gap); align-items: start; }
.creator > *, .creator__right > * { min-width: 0; }
.creator__pick { display: flex; flex-direction: column; min-height: 0; }
.creator__pickhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--ink-line); }
.creator__pickhead h3 { margin: 0; font: 400 28px/1 var(--display); color: var(--ink); }
.creator__count { font: italic 400 15px/1 var(--text); color: var(--ink-mute); }
.creator__roster {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 12px; align-content: start;
  max-height: max(420px, calc(100vh - 230px)); overflow-y: auto; padding: 4px 8px 8px 2px;
  scrollbar-width: thin; scrollbar-color: var(--ink-mute) transparent;
}
.slot {
  position: relative; display: grid; grid-template-rows: 128px auto; gap: 4px;
  padding: 10px 8px 9px; cursor: pointer; border: 0; border-radius: 2px;
  background: radial-gradient(ellipse 80% 60% at 50% 70%, rgba(255, 250, 232, .7), transparent 75%), rgba(255, 248, 225, .3);
  box-shadow: inset 0 0 0 1px var(--ink-soft), inset 0 0 0 4px rgba(239, 226, 192, .9), inset 0 0 0 5px rgba(42, 29, 18, .35);
  transition: transform .15s ease;
}
.slot:hover { transform: translateY(-2px) rotate(-.6deg); }
.slot:active { transform: translateY(0); }
.slot img { width: 100%; height: 128px; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 3px 2px rgba(42, 29, 18, .4)); transition: transform .2s ease; }
.slot:hover img { transform: scale(1.05); }
.slot__name { min-height: 2.3em; display: grid; place-items: center; text-align: center; font: 700 13px/1.12 var(--sc); letter-spacing: .02em; color: var(--ink); }
.slot__left { position: absolute; top: 8px; right: 8px; padding: 3px 5px; font: 700 11px/1 var(--sc); letter-spacing: .03em; color: var(--ink-soft); background: var(--parch); box-shadow: 0 0 0 1px rgba(42, 29, 18, .35); }
.slot[aria-selected="true"] {
  background: radial-gradient(ellipse 80% 60% at 50% 70%, rgba(255, 252, 238, .95), transparent 75%), rgba(255, 248, 225, .6);
  box-shadow: inset 0 0 0 2px var(--seal), inset 0 0 0 5px var(--parch), inset 0 0 0 6px var(--gold), 0 6px 12px rgba(42, 29, 18, .2);
}
.slot[aria-selected="true"]::before {
  content: ''; position: absolute; left: 12px; top: -4px; width: 14px; height: 30px;
  background: var(--seal); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}
.slot.is-soldout img { filter: grayscale(1) opacity(.55); }
.slot.is-soldout::after {
  content: 'Sold out'; position: absolute; left: 12%; right: 12%; top: 58px; padding: 5px 0; text-align: center;
  font: 800 14px/1 var(--sc); letter-spacing: .1em; color: var(--oxblood);
  border: 2px solid var(--oxblood); background: rgba(239, 226, 192, .8); transform: rotate(-10deg);
}

.creator__right { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }
.creator__stage { display: flex; flex-direction: column; gap: 10px; }
.card {
  position: relative; width: 100%; aspect-ratio: 1; margin: 7px auto 0;
  overflow: hidden; background: var(--plate);
  box-shadow: 0 0 0 1px var(--gold-lo), 0 0 0 6px rgba(255, 248, 225, .55), 0 0 0 7px rgba(91, 70, 48, .5), 0 14px 22px rgba(70, 45, 15, .28);
}
.card__layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.card__char { inset: auto 0 7% 0; height: 78%; object-position: 50% 100%; transform-origin: 50% 100%; animation: idle 3.6s ease-in-out infinite; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .55)); }
.card__char.swap { animation: swapIn .35s cubic-bezier(.2, .8, .2, 1) both, idle 3.6s ease-in-out .35s infinite; }
@keyframes idle { 50% { transform: translateY(-3px) scale(1.006); } }
@keyframes swapIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.card__look { display: block; text-align: center; font: italic 400 14px/1.35 var(--text); color: var(--ink-soft); }
.arrow {
  position: absolute; top: 50%; z-index: 3; width: 40px; height: 40px; margin-top: -20px;
  display: grid; place-items: center; cursor: pointer; border: 0; border-radius: 50%;
  color: var(--ink); background: var(--paper);
  box-shadow: 0 0 0 1px var(--ink-soft), inset 0 0 0 3px var(--parch), inset 0 0 0 4px rgba(42, 29, 18, .3), 0 4px 8px rgba(0, 0, 0, .4);
  transition: transform .15s ease;
}
.arrow:hover { transform: scale(1.08); }
.arrow:active { transform: scale(.94); }
.arrow--l { left: 10px; }
.arrow--r { right: 10px; }

.looks { display: grid; gap: 9px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--ink-line); }
.looks__row { display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 8px; }
.looks__label { font: 700 13px/1 var(--sc); letter-spacing: .08em; color: var(--ink-soft); }
.looks__chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  display: inline-flex; align-items: center; cursor: pointer; padding: 5px 9px;
  border: 1px solid rgba(42, 29, 18, .45); border-radius: 2px; background: transparent;
  font: 500 14px/1 var(--text); color: var(--ink);
  transition: transform .12s ease;
}
.chip:hover { background: rgba(42, 29, 18, .07); transform: translateY(-1px); }
.chip:active { transform: translateY(1px); }
.chip[aria-pressed="true"] { color: var(--parch); background: var(--ink); border-color: var(--ink); }
.chip__dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; box-shadow: 0 0 0 1px rgba(42, 29, 18, .6); }
.looks__chips--scenes .chip { padding: 0; width: 40px; height: 40px; overflow: hidden; border: 0; box-shadow: 0 0 0 1px var(--ink-soft); }
.looks__chips--scenes .chip img { width: 100%; height: 100%; object-fit: cover; }
.looks__chips--scenes .chip[aria-pressed="true"] { background: none; box-shadow: 0 0 0 2px var(--parch), 0 0 0 4px var(--seal); }
.looks__foot { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.looks__foot .rs-btn { flex: none; }
.looks__note { margin: 0; font: italic 400 14px/1.35 var(--text); color: var(--ink-soft); }

/* the hero sheet: ruled ledger */
.creator__sheet { display: flex; flex-direction: column; gap: 8px; }
.sheet__name { font: 400 clamp(32px, 2.8vw, 42px)/1 var(--display); color: var(--ink); }
.sheet__meta { font: 700 15px/1.2 var(--sc); letter-spacing: .05em; color: var(--ink-soft); }
.sheet__origin { font: italic 500 15px/1.2 var(--text); color: var(--verd); }
.sheet__quip { margin: 4px 0; padding-left: 12px; border-left: 2px solid var(--gold); font: italic 400 18px/1.35 var(--text); color: var(--ink); }
.sheet__skills { list-style: none; margin: 2px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
.sheet__skills li { display: flex; align-items: baseline; gap: 6px; padding: 6px 0 4px; border-bottom: 1px solid var(--ink-line); font: 500 15px/1.1 var(--text); color: var(--ink); }
.sheet__skills li::after { content: ''; order: 1; flex: 1; min-width: 6px; border-bottom: 1px dotted var(--ink-mute); transform: translateY(-3px); }
.sheet__skills li b { order: 2; font: 700 15px/1 var(--sc); color: var(--seal); font-variant-numeric: tabular-nums; }
.sheet__kit { margin: 4px 0 2px; font: 400 15px/1.4 var(--text); color: var(--ink-soft); }
.sheet__kit b { font: 700 14px/1 var(--sc); letter-spacing: .04em; color: var(--ink); }
.mintcard { display: grid; margin: 6px 0 4px; border-top: 3px double var(--ink); border-bottom: 1px solid var(--ink); }
.mintcard__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 2px; border-bottom: 1px dotted var(--ink-mute); font: 400 15px/1.25 var(--text); color: var(--ink-soft); }
.mintcard__row:last-child { border-bottom: 0; }
.mintcard__row b { text-align: right; font: 700 15px/1.25 var(--text); color: var(--ink); font-variant-numeric: tabular-nums; }
.sheet__status { min-height: 22px; text-align: center; font: italic 400 15px/1.4 var(--text); color: var(--ink-soft); }
.sheet__status a, .chatbox__log a { color: var(--seal); font-weight: 500; text-underline-offset: 2px; }
.sheet__status b { color: var(--seal); }

/* ---------------------------------------------------------------- the log slip (chat) */
.chatbox {
  width: min(560px, calc(100% - 28px)); margin: 22px auto 0;
  background: var(--noise), linear-gradient(175deg, #f3e8cb, #e2cf9f);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 10px 22px rgba(0, 0, 0, .5);
  transform: rotate(-.7deg);
  font: 400 15px/1.4 var(--text);
}
.chatbox__tabs { display: flex; gap: 2px; padding: 0 10px; transform: translateY(-100%); position: absolute; }
.chatbox { position: relative; }
.chatbox__tabs span { padding: 5px 10px 4px; font: 700 12px/1 var(--sc); letter-spacing: .06em; color: var(--ink-mute); background: #d9c597; border-radius: 3px 3px 0 0; }
.chatbox__tabs .is-on { color: var(--ink); background: #f3e8cb; }
.chatbox__log { list-style: none; margin: 0; padding: 10px 16px 12px; height: 104px; overflow-y: auto; color: var(--ink); scrollbar-width: thin; }
.chatbox__log li { padding: 1px 0; animation: chatIn .25s ease both; }
.chatbox__log li::before { content: '\2014\00a0'; color: var(--ink-mute); }
.chatbox__log .sys { color: var(--ink); }
.chatbox__log .game { color: var(--oxblood); font-style: italic; }
.chatbox__log .good { color: var(--seal); }
.chatbox__log .warn { color: #8a4a12; }
@keyframes chatIn { from { opacity: 0; transform: translateX(-6px); } }

/* ---------------------------------------------------------------- wallet picker */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(12, 7, 3, .7); backdrop-filter: blur(3px); }
.panel--modal {
  width: min(460px, calc(100% - 20px)); padding: 18px 24px 26px;
  box-shadow: 0 2px 0 #c9b385, 0 0 0 7px var(--leather), 0 0 0 8px rgba(201, 162, 75, .4), 0 30px 60px rgba(0, 0, 0, .7);
  transform: rotate(-.4deg);
}
.panel--modal::after { display: none; }
.panel--modal .panel__head { margin-bottom: 14px; }
.panel--modal .panel__head h2 { font-size: 32px; }
.wallets { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--ink-line); }
.wallets:empty { display: none; }
.wallets li { border-bottom: 1px solid var(--ink-line); }
.wallets button {
  width: 100%; display: flex; align-items: center; gap: 14px; cursor: pointer; border: 0; text-align: left;
  padding: 12px 6px; background: transparent;
  font: 400 24px/1 var(--display); color: var(--ink);
  transition: transform .15s ease;
}
.wallets button:hover { transform: translateX(4px); background: rgba(42, 29, 18, .06); }
.wallets img { width: 34px; height: 34px; border-radius: 6px; padding: 2px; background: var(--parch); box-shadow: 0 0 0 1px var(--ink-soft); object-fit: contain; }
.wallets small { margin-left: auto; font: italic 400 14px/1 var(--text); color: var(--ink-mute); }
.wallets__empty p { margin: 4px 0 16px; text-align: center; font: italic 400 18px/1.4 var(--text); color: var(--ink-soft); }
.wallets__links, .wallet-account__row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.wallet-account__addr { margin: 4px 0 16px; padding: 10px; text-align: center; word-break: break-all; font: 500 14px/1.4 var(--mono); color: var(--ink); background: rgba(42, 29, 18, .06); border-top: 1px solid var(--ink-line); border-bottom: 1px solid var(--ink-line); }

/* ---------------------------------------------------------------- your Legends */
.mylegends { width: 100%; margin: 6px 0 0; text-align: left; }
.mylegends__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--ink-line); font: 400 22px/1 var(--display); color: var(--ink); }
.mylegends__head small { font: italic 400 14px/1 var(--text); color: var(--ink-mute); }
.mylegends__row { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.legend-card {
  flex: none; width: 116px; display: grid; gap: 5px; padding: 6px 6px 8px; text-decoration: none;
  background: rgba(255, 248, 225, .45);
  box-shadow: inset 0 0 0 1px var(--ink-soft), inset 0 0 0 4px rgba(239, 226, 192, .9), inset 0 0 0 5px rgba(42, 29, 18, .3);
  transition: transform .15s ease;
}
.legend-card:hover { transform: translateY(-3px) rotate(-.8deg); }
.legend-card__art { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--plate); }
.legend-card__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.legend-card__art img.lc-char { inset: auto 0 7% 0; height: 78%; object-position: 50% 100%; }
.legend-card__name { text-align: center; font: 700 12px/1.15 var(--sc); color: var(--ink); }
.legend-card__play { text-align: center; font: 400 17px/1 var(--display); color: var(--seal); }
.legend-card__play::after { content: ''; display: inline-block; margin-left: 5px; border-left: 6px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.mylegends--title { margin-top: 26px; }

/* ---------------------------------------------------------------- footer: the colophon on the table */
.sitefoot {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 26px;
  width: min(1340px, calc(100% - 28px)); margin: 30px auto 0;
  padding: 18px 4px max(20px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(201, 162, 75, .35);
  color: var(--parch);
}
.sitefoot__brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 400 26px/1 var(--display); color: var(--gold-hi); }
.seal--sm { width: 40px; height: 40px; }
.seal--sm::before { font-size: 20px; }
.sitefoot__brand:hover span:last-child { color: #fff3cf; }
.sitefoot__cas { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: baseline; }
.sitefoot .ca__label { color: rgba(239, 226, 192, .7); }
.sitefoot .ca__addr { color: var(--gold-hi); background: rgba(0, 0, 0, .3); }
.sitefoot .ca__addr:empty { background: none; border-bottom-color: rgba(239, 226, 192, .45); }
.sitefoot .ca__copy { color: rgba(239, 226, 192, .8); }
.sitefoot .ca__copy:hover { color: #fff3cf; }
.sitefoot .ca__copy.is-copied { color: var(--seal-lo); background: var(--lime); border-color: var(--lime); }
.sitefoot__icons { display: inline-flex; gap: 10px; }
.iconlink {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  color: var(--parch); border: 1px solid rgba(201, 162, 75, .6);
  transition: transform .15s ease;
}
.iconlink:hover { color: var(--lime); border-color: var(--gold); transform: translateY(-2px); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1279px) {
  .creator__right { grid-template-columns: 1fr; }
  .card { max-width: 440px; }
  .creator__roster { max-height: 760px; }
}
@media (max-width: 1100px) {
  .hero:nth-child(1), .hero:nth-child(9) { display: none; }
}
@media (max-width: 979px) {
  .book { grid-template-columns: 1fr; padding: 8px; width: min(680px, 100%); }
  .page--l, .page--r { border-radius: 3px; }
  .page--l::after, .page--r::after { display: none; }
  .page--r { margin-top: 8px; }
  .panel { --split: 1; }
  .panel::after { display: none; }
  #stepWelcome { grid-template-columns: 1fr; row-gap: 28px; }
  .creator { grid-template-columns: 1fr; row-gap: 26px; }
  .creator__roster { grid-auto-flow: column; grid-auto-columns: 124px; grid-template-columns: none; max-height: none; overflow-x: auto; overflow-y: hidden; padding-bottom: 10px; }
  .creator__right { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .world-pill span:nth-child(n+3) { display: none; }
  .topbar__tg span { display: none; }
  .topbar__tg { padding: 8px 10px; }
  .topbar__actions { gap: 6px; }
  .topbar .rs-btn--wallet { padding: 8px 11px; font-size: 13px; letter-spacing: .04em; }
  .stage { padding-left: 8px; padding-right: 8px; }
  .page { padding: 44px 20px 48px; }
  .wordmark { padding-right: 18px; }
  .title__logo img { width: min(62vw, 240px); }
  .seal--ticker { width: 68px; height: 68px; right: -22px; top: -20px; }
  .seal--ticker span { font-size: 12px; }
  .seal--ticker span { font-size: 12px; }
  .title__actions { flex-direction: column; gap: 26px; text-align: center; }
  .title__ledger { justify-items: center; }
  .ca--title { justify-content: center; }
  .lineup { height: 150px; padding: 26px 0 0; }
  .hero:nth-child(-n+2), .hero:nth-child(n+8) { display: none; }
  .hero { margin: 0 -4%; }
  .panel { padding: 14px 16px 24px; width: calc(100% - 22px); box-shadow: 0 2px 0 #c9b385, 0 0 0 7px var(--leather), 0 0 0 8px rgba(201, 162, 75, .35), 0 24px 50px rgba(0, 0, 0, .6); }
  .panel__head { gap: 10px; margin-bottom: 16px; }
  .panel__emblem { width: 42px; height: 42px; }
  .creator__right { grid-template-columns: 1fr; }
  .card { max-width: none; }
  .slot { grid-template-rows: 118px auto; }
  .slot img { height: 118px; }
  .looks__row { grid-template-columns: 1fr; gap: 5px; }
  .looks__foot { flex-direction: column; align-items: flex-start; }
  .sheet__skills { column-gap: 14px; }
  .sitefoot { flex-direction: column; align-items: flex-start; }
  .sitefoot__cas { flex-direction: column; gap: 10px; }
}
@media (max-width: 380px) {
  .topbar .rs-btn--wallet { padding: 8px 10px; font-size: 13px; }
  .rs-btn__title { font-size: 25px; }
}

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


.sitefoot__logo { display: block; width: 160px; height: auto; }
.logo-sq { display: block; flex: none; width: 48px; height: 48px; border-radius: 8px; box-shadow: 0 0 0 2px var(--gold), 0 3px 6px rgba(30, 18, 6, .4); }
.logo-sq--foot { width: 44px; height: 44px; }
