/* Adventure Mode's screens (/run): a 1440x900 stage scaled to the window, like the table.
   The look follows the round 2 mockups: a parchment map on the tavern table, ink trees, a
   pewter token, lanterns and coins on the table, notes pinned beside the map. */
:root {
  --gold: #c9a84c; --gold-2: #e6cc7a; --gold-dk: #7a6024;
  --ink: #e9dfc4; --ink-dim: #a99d7d; --wax: #8e1f1f;
  --parch: #e9dcb8; --parch-2: #d6c497; --parch-ink: #3b2b17;
  --sepia: #3b2b17; --red-ink: #8a2a1a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #120c07; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }

#run { position: fixed; inset: 0; }
#stage {
  position: absolute; left: 0; top: 0; width: 1440px; height: 900px; overflow: hidden;
  transform-origin: 0 0; transform: translate(var(--ox, 0px), var(--oy, 0px)) scale(var(--k, 1));
  color: var(--ink); font-family: 'IM Fell English', Georgia, serif;
  background:
    radial-gradient(ellipse at 42% 50%, rgba(255,200,120,.16), transparent 55%),
    radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,.72) 96%),
    repeating-linear-gradient(92deg, rgba(0,0,0,.18) 0 2px, transparent 2px 9px, rgba(255,255,255,.025) 9px 10px, transparent 10px 23px),
    repeating-linear-gradient(90deg, #3a2414 0 140px, #31200f 140px 300px, #3d2716 300px 420px);
}

/* ── the bar ─────────────────────────────────────────────────────────── */
.bar { position: absolute; top: 0; left: 22px; right: 22px; height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 6px; z-index: 5; }
.brand { font-family: 'Cinzel'; font-weight: 900; font-size: 19px; letter-spacing: .14em; color: var(--gold-2); text-shadow: 0 2px 0 #000; margin-right: 10px; text-decoration: none; }
.tab { font-family: 'Cinzel'; font-size: 12px; letter-spacing: .14em; color: var(--ink); padding: 7px 13px 6px; border-radius: 3px; text-decoration: none;
  background: linear-gradient(#3b2a19, #2a1c10); box-shadow: inset 0 1px 0 rgba(255,220,160,.15), 0 0 0 1px #120b05, 0 2px 4px rgba(0,0,0,.5); }
.tab b { color: var(--gold-2); font-weight: 700; }
.tab.plain { cursor: default; }
button.tab:hover { background: linear-gradient(#5a3f1e, #3d2a14); color: var(--gold-2); }
.spacer { flex: 1; }
#screen { position: absolute; left: 0; right: 0; top: 46px; bottom: 0; }

/* ── shared pieces ───────────────────────────────────────────────────── */
.k { font-family: 'Cinzel'; font-size: 11px; letter-spacing: .2em; color: #6b5230; text-transform: uppercase; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border-radius: 6px;
  font-family: 'Cinzel'; font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #fff1dc;
  background: linear-gradient(#a8352f, #7a1f12); box-shadow: 0 3px 0 #4a1008, 0 6px 12px rgba(0,0,0,.45); }
.btn:hover { filter: brightness(1.08); }
.btn.green { background: linear-gradient(#4f7a26, #34521a); box-shadow: 0 3px 0 #1f3410, 0 6px 12px rgba(0,0,0,.45); }
.btn.plain { color: var(--gold-2); background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px rgba(201,168,76,.6); }
.btn:disabled { opacity: .5; filter: none; cursor: default; }
.paper { color: var(--parch-ink); background: linear-gradient(#f3ead2, #e2d4b0); box-shadow: 0 14px 24px rgba(0,0,0,.6); }
.pin { position: absolute; left: 50%; top: -7px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e86a5a, #8a1f12); box-shadow: 0 3px 4px rgba(0,0,0,.5); }
.coin { display: inline-block; width: 18px; height: 18px; border-radius: 50%; vertical-align: -3px;
  background: radial-gradient(circle at 35% 30%, #fff1b8, #d4a83c 55%, #6b4b12); box-shadow: 0 2px 3px rgba(0,0,0,.6), inset 0 0 0 2px rgba(110,75,15,.6); }

@keyframes flicker { 0%,100% { opacity: 1; transform: scale(1); } 40% { opacity: .8; transform: scale(.92); } 70% { opacity: .95; transform: scale(1.05); } }
@keyframes halo { 0%,100% { opacity: .9; } 50% { opacity: .6; } }
@keyframes bob { 0%,100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 2px var(--red-ink), 0 0 0 6px rgba(138,42,26,.28); } 50% { box-shadow: 0 0 0 2px var(--red-ink), 0 0 0 11px rgba(138,42,26,.08); } }
@keyframes blink { 0%,93%,100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
@keyframes glance { 0%,24% { transform: translateX(0); } 30%,46% { transform: translateX(-3.5px); } 52%,68% { transform: translateX(3.5px); } 74%,100% { transform: translateX(0); } }
@keyframes smoke { 0% { transform: translateY(0) scale(.6); opacity: .55; } 100% { transform: translateY(-46px) scale(1.5); opacity: 0; } }
@keyframes sway { 0%,100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes lamplight { 0%,100% { opacity: 1; } 45% { opacity: .72; } 70% { opacity: .9; } }
@keyframes hop { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-14px) rotate(-3deg); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes march { to { stroke-dashoffset: -26; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* lanterns standing on the table */
.lanterns { display: flex; justify-content: center; align-items: flex-end; gap: 22px; }
.lantern { position: relative; width: 40px; height: 60px; }
.lantern .glow { position: absolute; left: -26px; top: -16px; width: 92px; height: 92px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,200,100,.42), rgba(255,200,100,0) 65%); animation: halo 2.4s ease-in-out infinite; }
.lantern svg { position: relative; display: block; }
.lantern .flame { animation: flicker 1.4s ease-in-out infinite; transform-origin: 10px 16px; }
.lantern .wisp { position: absolute; left: 14px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: rgba(200,190,170,.5); filter: blur(3px); animation: smoke 2.4s ease-out infinite; }

/* ── the map ─────────────────────────────────────────────────────────── */
.parchment-wrap { position: absolute; left: 50px; top: 18px; width: 1010px; height: 816px; transform: rotate(-1deg); filter: drop-shadow(0 18px 24px rgba(0,0,0,.6)); }
.parchment { position: absolute; inset: 0;
  clip-path: polygon(0% 2%, 3% 0%, 9% 1.2%, 16% .2%, 24% 1%, 33% 0%, 41% 1.4%, 50% .3%, 58% 1%, 67% 0%, 75% 1.2%, 84% .2%, 92% 1%, 100% .4%, 99.4% 9%, 100% 18%, 99.2% 28%, 100% 39%, 99.4% 50%, 100% 61%, 99.3% 72%, 100% 83%, 99.5% 93%, 100% 100%, 91% 99.2%, 82% 100%, 72% 99.4%, 61% 100%, 50% 99.1%, 39% 100%, 28% 99.4%, 17% 100%, 7% 99.2%, 0% 100%, .6% 90%, 0% 79%, .7% 67%, 0% 55%, .6% 44%, 0% 32%, .7% 20%, 0% 10%);
  background: radial-gradient(circle at 78% 82%, rgba(120,80,30,.22), transparent 14%), radial-gradient(circle at 18% 24%, rgba(120,80,30,.14), transparent 18%),
    radial-gradient(ellipse at 50% 50%, #efe0bb, #e2cb98 70%, #c9a970); }
.parchment svg.ink-layer { position: absolute; left: 0; top: 0; }
.parchment svg.parchment-age { position: absolute; left: 0; top: 0; pointer-events: none; mix-blend-mode: multiply; }
.map-title h1, .map-title p { opacity: .9; }
.ink { fill: none; stroke: var(--sepia); stroke-linecap: round; stroke-linejoin: round; }
.lbl { font-family: 'IM Fell English', Georgia, serif; font-style: italic; font-size: 16px; fill: #4a3820; }
.map-title { position: absolute; left: 40px; top: 28px; }
.map-title h1 { margin: 0; font-family: 'Uncial Antiqua', serif; font-weight: 400; font-size: 40px; color: var(--sepia); }
.map-title p { margin: 0; font-size: 17px; font-style: italic; color: #5a4628; }
.edge-done { stroke: var(--sepia); stroke-width: 3.2; fill: none; stroke-linecap: round; }
.edge-next { stroke: var(--red-ink); stroke-width: 2.4; fill: none; stroke-dasharray: 8 5; animation: march 1.2s linear infinite; }
.edge-far { stroke: rgba(59,43,23,.35); stroke-width: 1.6; fill: none; stroke-dasharray: 3 6; stroke-linecap: round; }

/* Stops are wax seals (map.js iconSvg): the SVG is the whole stop, so the box is only its hit area and ring. */
.st { position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; display: grid; place-items: center;
  cursor: default; transition: transform .18s ease, filter .18s ease; }
.st svg.seal { width: 100%; height: 100%; overflow: visible; }
.st.big { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
.st.done { filter: saturate(.35) brightness(.88); opacity: .82; }
.st.next { animation: pulse 2s ease-in-out infinite; cursor: pointer; }
.st.next:hover, .st.next:focus-visible { transform: translateY(-3px) scale(1.08); filter: brightness(1.08) drop-shadow(0 6px 5px rgba(40,20,6,.35)); outline: none; }
.st.chosen { transform: translateY(-3px) scale(1.08); box-shadow: 0 0 0 3px var(--red-ink), 0 0 0 8px rgba(138,42,26,.25); animation: none; }
.st.here { box-shadow: 0 0 0 3px var(--red-ink); }
.hollow { position: absolute; width: 150px; height: 150px; margin: -75px 0 0 -75px; }
.hollow.next { cursor: pointer; }
/* The Hollow's eyes blink now and then, in place (fill-box: they close on themselves, not from a point
   below the cave), and glance one way, then the other. */
.hollow .eyes { animation: blink 6.5s infinite; transform-box: fill-box; transform-origin: center; }
.hollow .pupils { animation: glance 11s ease-in-out infinite; }
.hollow .halo { animation: halo 2.6s ease-in-out infinite; }
.hollow-label { position: absolute; width: 180px; margin-left: -90px; text-align: center; }
.hollow-label b { display: block; font-family: 'Uncial Antiqua', serif; font-weight: 400; font-size: 22px; color: var(--sepia); }
.hollow-label i { font-size: 16px; color: #5a4628; }
.token { position: absolute; width: 70px; height: 96px; margin: -88px 0 0 -35px; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.token svg { display: block; overflow: visible; }
.token.walking { transition: left .8s ease-in-out, top .8s ease-in-out; }
.token.walking svg { animation: hop .8s ease-in-out; }
.token .tk-lantern { transform-box: view-box; transform-origin: 51.5px 52.5px; animation: sway 3.4s ease-in-out infinite; }
.token .tk-flame { transform-box: fill-box; transform-origin: 50% 90%; animation: flicker 1.3s infinite; }
.token .tk-glow { animation: lamplight 2.6s ease-in-out infinite; }
.here-label.late { animation: fadein .4s .8s both; }
.here-label { position: absolute; width: 160px; margin-left: -80px; text-align: center; font-size: 15px; font-style: italic; color: var(--red-ink); pointer-events: none; }

/* the right column: a pinned note, lanterns, the deck, the purse, a candle */
.candle { position: absolute; left: 1300px; top: 6px; width: 60px; height: 150px; pointer-events: none; }
.candle .halo { position: absolute; left: -70px; top: -60px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,200,110,.32), transparent 65%); animation: halo 2.4s ease-in-out infinite; }
.candle .fl { position: absolute; left: 24px; top: 6px; width: 13px; height: 24px; border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
  background: radial-gradient(circle at 50% 70%, #fff8d8, #ffcf5a 45%, #e8862a); animation: flicker 1.4s ease-in-out infinite; }
.candle .wax-body { position: absolute; left: 20px; top: 32px; width: 20px; height: 84px; border-radius: 3px; background: linear-gradient(90deg, #e8dcc2, #fffaf0 45%, #d2c4a6); }
.candle .dish { position: absolute; left: 4px; top: 112px; width: 52px; height: 16px; border-radius: 50%; background: linear-gradient(#a07a40, #5a3f1c); }
.note { position: absolute; left: 1096px; top: 160px; width: 304px; padding: 22px 20px 18px; transform: rotate(1.5deg); }
.note h3 { margin: 6px 0 0; font-family: 'Uncial Antiqua', serif; font-weight: 400; font-size: 21px; }
.note p { margin: 8px 0 0; font-size: 15px; line-height: 1.4; }
.note .said { margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(59,43,23,.4); font-style: italic; }
.note .btn { width: 100%; margin-top: 14px; }
.note .warn { color: var(--red-ink); }
.side-lanterns { position: absolute; left: 1100px; top: 540px; width: 300px; text-align: center; }
.side-lanterns .k { color: var(--ink-dim); margin-bottom: 8px; }
.deck-pile { position: absolute; left: 1124px; top: 664px; width: 96px; height: 136px; border-radius: 8px; overflow: hidden; transform: rotate(-6deg);
  box-shadow: 2px 3px 0 #2a1d10, 4px 6px 0 #1d140b, 6px 9px 0 #2a1d10, 10px 18px 22px rgba(0,0,0,.65); }
.deck-pile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.deck-label { position: absolute; left: 1114px; top: 814px; width: 120px; text-align: center; }
.deck-label .k, .purse .k { color: var(--ink-dim); }
.purse { position: absolute; left: 1262px; top: 690px; width: 130px; height: 120px; text-align: center; }
.purse b { display: block; font-family: 'Cinzel'; font-weight: 900; font-size: 28px; color: var(--gold-2); text-shadow: 0 2px 0 #000; }
.purse .pile { position: relative; height: 60px; margin-top: 8px; }
.purse .pile span { position: absolute; width: 50px; height: 19px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffe7a3, #d8a43c 55%, #8a5f1c); }

/* ── overlays ────────────────────────────────────────────────────────── */
#overlay { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(8,5,2,.66); }
#overlay[hidden] { display: none; }
.sheet { position: relative; width: 640px; max-height: 820px; overflow: auto; padding: 28px 34px 30px; border-radius: 6px; }
.sheet h2 { margin: 0; font-family: 'Uncial Antiqua', serif; font-weight: 400; font-size: 38px; color: var(--sepia); }
.sheet .lead { margin: 6px 0 0; font-size: 18px; font-style: italic; color: #5a4628; }
.sheet .actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.stop-icon { width: 72px; height: 72px; display: grid; place-items: center; float: right; margin: 0 0 8px 16px; }
.stop-icon svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 3px 3px rgba(0,0,0,.35)); }

/* payout */
.payout .row { display: grid; grid-template-columns: 32px minmax(0, 1fr) 72px; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed rgba(90,70,40,.35); }
.payout .row .amt { font-family: 'Cinzel'; font-weight: 700; font-size: 20px; text-align: right; }
.payout .row .mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; }
.payout .row.on .mark { background: #4f7a26; color: #f6efd8; }
.payout .row.off { color: #7a6a50; }
.payout .row.off .mark { box-shadow: inset 0 0 0 1.5px rgba(90,70,40,.5); }
.payout .row small { display: block; font-size: 14px; font-style: italic; color: #6a5638; }
.payout .total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; }
.payout .total b { font-family: 'Cinzel'; font-weight: 900; font-size: 38px; color: #8a5f1c; }
.payout .flip-note { margin-top: 10px; font-size: 15px; color: #5a4628; }
.coin-big { width: 84px; height: 84px; margin: 6px auto 0; border-radius: 50%; display: grid; place-items: center; font-family: 'Cinzel', serif; font-weight: 900; font-size: 32px; color: #5a3a10;
  background: radial-gradient(circle at 35% 30%, #ffe7a3, #d8a43c 55%, #8a5f1c); box-shadow: inset 0 0 0 4px rgba(255,255,255,.25), 0 6px 14px rgba(0,0,0,.5); }
.coin-big.spin { animation: coinspin 1.1s cubic-bezier(.2,.7,.3,1); }
@keyframes coinspin { from { transform: rotateY(0); } to { transform: rotateY(1440deg); } }

/* deck viewer */
.deck-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.deck-grid img { width: 100%; border-radius: 6px; box-shadow: 0 4px 8px rgba(0,0,0,.4); display: block; }
.sheet.wide { width: 900px; }

/* ── the start screen and the end screens ────────────────────────────── */
.start { position: absolute; inset: 0; text-align: center; }
.start h1 { margin: 22px 0 0; font-family: 'Uncial Antiqua', serif; font-weight: 400; font-size: 54px; color: var(--gold-2); text-shadow: 0 3px 0 #000, 0 0 30px rgba(242,196,90,.3); }
.start .sub { font-size: 20px; font-style: italic; color: #e2d6b6; }
.starters { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 24px; max-width: 1300px; margin: 26px auto 0; }   /* four to a row: eight decks fit the stage */
.starter { width: 300px; padding: 12px 14px 16px; border-radius: 10px; text-align: center; cursor: pointer; color: var(--parch-ink);
  background: linear-gradient(#f3ead2, #e2d4b0); box-shadow: 0 14px 24px rgba(0,0,0,.6); transition: transform .15s; }
.starter:hover, .starter:focus-visible { transform: translateY(-6px); outline: none; box-shadow: 0 0 0 3px var(--gold-2), 0 18px 28px rgba(0,0,0,.65); }
.starter h2 { margin: 0; font-family: 'Uncial Antiqua', serif; font-weight: 400; font-size: 25px; }
.starter p { margin: 4px 0 0; font-size: 15px; font-style: italic; color: #5a4628; }
.fan { position: relative; height: 154px; margin-top: 8px; }
.fan img { position: absolute; left: 50%; top: 8px; width: 94px; margin-left: -47px; border-radius: 8px; box-shadow: 0 8px 14px rgba(0,0,0,.45); transform-origin: 50% 120%; }
.start .note-line { margin-top: 30px; font-size: 16px; color: var(--ink-dim); }
.start .last { display: inline-block; margin-top: 14px; padding: 8px 16px; border-radius: 6px; background: rgba(0,0,0,.35); font-size: 17px; }
.end { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.end h1 { margin: 0; font-family: 'Uncial Antiqua', serif; font-weight: 400; font-size: 60px; color: var(--gold-2); text-shadow: 0 3px 0 #000; }
.end.lost h1 { color: #e9a07a; }
.end p { font-size: 20px; font-style: italic; color: #e2d6b6; }
.end .stats { display: flex; justify-content: center; gap: 28px; margin: 22px 0 28px; }
.end .stats div { min-width: 120px; padding: 12px 16px; border-radius: 8px; background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px rgba(201,168,76,.35); }
.end .stats b { display: block; font-family: 'Cinzel'; font-weight: 900; font-size: 30px; color: var(--gold-2); }
.end .stats small { font-family: 'Cinzel'; font-size: 11px; letter-spacing: .18em; color: var(--ink-dim); text-transform: uppercase; }
.error { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30; padding: 10px 18px; border-radius: 6px;
  background: rgba(90,20,10,.92); color: #ffe9de; font-size: 16px; box-shadow: 0 6px 14px rgba(0,0,0,.5); }

/* ── the Tavern, the Shop, Discovery and the pick after a win (.store) ── */
.store .purse-line { margin: 10px 0 0; font-size: 17px; color: #3a2a14; }
.store .had { margin: 8px 0 0; font-style: italic; color: #6b2a17; }
.store .offer { margin-top: 18px; padding-top: 14px; border-top: 1px dashed rgba(90,70,40,.45); }
.store .offer-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.store .offer-head h3 { margin: 0; font-family: 'Cinzel', serif; font-size: 20px; color: var(--sepia); }
.store .offer-head small, .store .why { color: #6b5636; font-style: italic; }
.store .why { display: block; margin-top: 6px; }
.store .lanterns { gap: 10px; }
.store .lanterns .lantern { width: 26px; height: 39px; }
.store .lanterns svg { width: 26px; height: 39px; }
.store .lanterns .glow { left: -18px; top: -12px; width: 62px; height: 62px; }
.store .btn.plain { color: #3a2a14; background: rgba(255,245,220,.5); box-shadow: inset 0 0 0 1px rgba(90,70,40,.6); }
.store-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: 0; }
.store-card { position: relative; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 6px; }
.store-card img { width: 100%; border-radius: 6px; box-shadow: 0 4px 8px rgba(0,0,0,.4); display: block; transition: transform .12s; }
.store-card:hover img { transform: translateY(-3px); }
.store-card.picked img { box-shadow: 0 0 0 3px #8b1d1d, 0 0 0 6px rgba(139,29,29,.25), 0 8px 14px rgba(0,0,0,.45); transform: translateY(-4px); }
.store-card.dimmed { cursor: not-allowed; }
.store-card.dimmed img { filter: grayscale(.7) brightness(.8); opacity: .7; }
.store-card .price { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); padding: 2px 8px; border-radius: 10px;
  font-family: 'Cinzel', serif; font-size: 12px; font-weight: 700; white-space: nowrap; color: #f3e3b5; background: var(--sepia); }
.store-card .have { position: absolute; top: 4px; right: 4px; padding: 1px 6px; border-radius: 8px; font-size: 12px; color: #f3e3b5; background: rgba(30,20,8,.75); }
.store .deck-grid { row-gap: 22px; }
.store-card.big { width: 168px; }
.store .picks { display: flex; justify-content: center; gap: 26px; margin-top: 18px; }
.store-card .tag { position: absolute; left: 50%; top: -11px; transform: translateX(-50%); padding: 2px 8px; border-radius: 10px;
  font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: .06em; white-space: nowrap; color: #f3e3b5; background: #6b2a17; }
.store .offer-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 24px; }
.store .picks + .why, .store .offer > .btn { margin-top: 8px; }

/* ── rule changes ── */
.rules .rule-picks { display: flex; justify-content: center; gap: 22px; margin-top: 20px; flex-wrap: wrap; }
.rule-card { width: 300px; min-height: 150px; padding: 18px 20px; text-align: left; border-radius: 6px; cursor: pointer;
  background: linear-gradient(#f3e7c6, #e2d1a2); box-shadow: inset 0 0 0 1px rgba(90,70,40,.45), 0 6px 14px rgba(0,0,0,.25);
  transition: transform .12s; color: #3a2a14; }
div.rule-card { cursor: default; }
button.rule-card:hover { transform: translateY(-3px); }
.rule-card.picked { box-shadow: inset 0 0 0 1px rgba(90,70,40,.45), 0 0 0 3px #8b1d1d, 0 10px 18px rgba(0,0,0,.3); transform: translateY(-4px); }
.rule-card h3 { margin: 0 0 8px; font-family: 'Cinzel', serif; font-size: 20px; color: var(--sepia); }
.rule-card p { margin: 0; font-size: 17px; line-height: 1.35; }
.end .divine-line { font-size: 19px; color: #e6cc7a; }
.store.divine .store-card img { box-shadow: 0 0 0 2px rgba(230,204,122,.7), 0 0 26px rgba(255,220,140,.45), 0 6px 12px rgba(0,0,0,.45); }
.rule-card .pay { margin-top: 10px; font-family: 'Cinzel', serif; font-size: 14px; letter-spacing: .04em; color: #6b2a17; }
.rule-card.done { opacity: .7; }
.rule-card.done .pay { color: #3f6a22; }
.rule-card.dimmed { opacity: .55; cursor: not-allowed; }
.decision .results { margin: 14px 0 0; padding-left: 22px; font-size: 17px; color: #3a2a14; }
.decision .results li { margin: 3px 0; }
.decision .step-title { margin: 18px 0 0; font-family: 'Cinzel', serif; font-size: 18px; color: var(--sepia); }
.decision .step-note { margin: 6px 0 0; font-style: italic; color: var(--sepia); }

/* ── the title screen ────────────────────────────────────────────────── */
/* Night in the woods under drifting mist; the logo, "Adventure Mode" and the doors fade up in turn. */
.title-screen { position: absolute; inset: -46px 0 0; overflow: hidden; display: grid; place-items: center;
  background:
    radial-gradient(ellipse 60% 45% at 50% 46%, rgba(170,190,170,.16), transparent 70%),
    radial-gradient(ellipse at 50% 120%, rgba(30,45,32,.9), transparent 60%),
    linear-gradient(#0b110d, #131c15 55%, #0a0f0b); }
.title-screen::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.75) 100%); }
.mist { position: absolute; left: 0; width: 200%; pointer-events: none; filter: blur(24px); }
.mist.far  { top: 8%;  height: 50%; opacity: .6; animation: mist-drift 90s linear infinite;
  background: radial-gradient(ellipse 18% 40% at 12% 50%, rgba(200,214,200,.35), transparent 70%),
              radial-gradient(ellipse 22% 36% at 38% 60%, rgba(200,214,200,.28), transparent 70%),
              radial-gradient(ellipse 18% 40% at 62% 50%, rgba(200,214,200,.35), transparent 70%),
              radial-gradient(ellipse 22% 36% at 88% 60%, rgba(200,214,200,.28), transparent 70%); }
.mist.mid  { top: 38%; height: 46%; opacity: .75; animation: mist-drift 60s linear infinite reverse;
  background: radial-gradient(ellipse 20% 34% at 20% 50%, rgba(214,226,214,.32), transparent 70%),
              radial-gradient(ellipse 16% 30% at 45% 40%, rgba(214,226,214,.26), transparent 70%),
              radial-gradient(ellipse 20% 34% at 70% 50%, rgba(214,226,214,.32), transparent 70%),
              radial-gradient(ellipse 16% 30% at 95% 40%, rgba(214,226,214,.26), transparent 70%); }
.mist.near { bottom: -10%; height: 42%; opacity: .95; animation: mist-drift 40s linear infinite;
  background: radial-gradient(ellipse 24% 46% at 10% 60%, rgba(226,234,226,.34), transparent 70%),
              radial-gradient(ellipse 20% 40% at 35% 70%, rgba(226,234,226,.28), transparent 70%),
              radial-gradient(ellipse 24% 46% at 60% 60%, rgba(226,234,226,.34), transparent 70%),
              radial-gradient(ellipse 20% 40% at 85% 70%, rgba(226,234,226,.28), transparent 70%); }
@keyframes mist-drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.title-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.title-logo { width: 620px; max-width: 86vw; height: auto; opacity: 0; animation: title-rise 2.4s ease-out .5s forwards;
  filter: drop-shadow(0 0 30px rgba(201,168,76,.25)) drop-shadow(0 6px 18px rgba(0,0,0,.8)); }
.title-sub { margin-top: 6px; font-family: 'Cinzel'; font-weight: 700; font-size: 26px; letter-spacing: .5em; text-indent: .5em;
  text-transform: uppercase; color: var(--gold-2); text-shadow: 0 2px 0 #000, 0 0 24px rgba(242,196,90,.35);
  opacity: 0; animation: title-rise 2s ease-out 1.7s forwards; }
.title-doors { margin-top: 54px; opacity: 0; animation: title-rise 1.6s ease-out 2.6s forwards; }
.title-row { display: flex; gap: 22px; justify-content: center; }
.title-btn { min-width: 210px; min-height: 52px; font-size: 15px; text-decoration: none; }
.title-btn:disabled { opacity: .38; }
.title-why { max-width: 470px; margin: 0 auto 18px; font-size: 19px; font-style: italic; color: #d8cfb6; text-shadow: 0 2px 6px #000; }
@keyframes title-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .title-logo, .title-sub, .title-doors { opacity: 1; } }
.start-back { position: absolute; left: 34px; top: 22px; }

/* a starter deck not unlocked yet: greyed, a lock, and who to beat */
.starter.locked { cursor: default; background: linear-gradient(#cfc5ad, #b8ab8b);
  min-height: 264px; display: flex; flex-direction: column; justify-content: center; }   /* as tall as an open deck */
.starter.locked:hover { transform: none; box-shadow: 0 14px 24px rgba(0,0,0,.6); }
.starter.locked .fan { filter: brightness(.6); }
.starter .lock { position: absolute; left: 50%; top: 50%; margin: -26px 0 0 -26px; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; color: #f3e6c4; background: rgba(40,28,14,.85); box-shadow: 0 0 0 2px var(--gold-dk), 0 6px 12px rgba(0,0,0,.5); }
.starter { position: relative; }
.payout .unlocked { margin: 10px 0 4px; padding: 10px 14px; border-radius: 6px; text-align: center;
  background: linear-gradient(#3b2a19, #2a1c10); color: var(--gold-2); box-shadow: 0 0 0 2px var(--gold-dk); }
.payout .unlocked .k { display: block; color: #c9b37a; }
.payout .unlocked b { font-family: 'Uncial Antiqua', serif; font-weight: 400; font-size: 24px; }

/* the bar's Music panel */
.music-pop { position: absolute; top: 46px; right: 22px; z-index: 30; width: 230px; padding: 14px 16px 16px; border-radius: 6px;
  background: linear-gradient(#3b2a19, #24180c); box-shadow: 0 0 0 1px #120b05, 0 10px 22px rgba(0,0,0,.6); }
.music-pop[hidden] { display: none; }
.music-pop .k { display: flex; justify-content: space-between; color: #c9b37a; margin-bottom: 8px; }
.music-pop .k output { color: var(--ink); letter-spacing: .06em; }
.music-pop .seg { display: flex; margin-bottom: 14px; box-shadow: inset 0 0 0 1px var(--gold-dk); border-radius: 3px; overflow: hidden; }
.music-pop .seg button { flex: 1; padding: 7px 0; font-family: 'Cinzel'; font-size: 12px; letter-spacing: .12em; color: var(--ink); }
.music-pop .seg button.on { background: var(--gold-dk); color: #fff3cf; }
.music-pop input[type=range] { width: 100%; accent-color: var(--gold); }

/* ── a phone held upright (#run.portrait, run.js fit): the same screens, restacked ── */
/* The bar: the brand and Music, and in a run a second row for Rules, Bounties and Abandon
   (lanterns and purse sit on the map's tray instead). */
#run.portrait .bar { left: 10px; right: 10px; height: auto; flex-wrap: wrap; row-gap: 6px; padding: 8px 2px 0; }
#run.portrait .bar::after { content: ''; order: 3; flex-basis: 100%; height: 0; }
#run.portrait .brand { order: 0; font-size: 15px; margin-right: 0; }
#run.portrait .spacer { order: 1; }
#run.portrait #bar-music { order: 2; }
#run.portrait #bar-rules, #run.portrait #bar-bounties, #run.portrait #bar-abandon { order: 4; }
#run.portrait #bar-abandon { margin-left: auto; }
#run.portrait #bar-where, #run.portrait #bar-lanterns, #run.portrait #bar-purse { display: none; }
#run.portrait .tab { font-size: 11px; letter-spacing: .1em; padding: 7px 10px 6px; }
#run.portrait.run-on #screen { top: 84px; }
#run.portrait .music-pop { top: 44px; right: 10px; }

/* the title: the logo, "Adventure Mode" and the doors in a column */
#run.portrait .title-logo { width: 340px; }
#run.portrait .title-sub { font-size: 17px; letter-spacing: .34em; text-indent: .34em; }
#run.portrait .title-doors { margin-top: 44px; }
#run.portrait .title-row { flex-direction: column; align-items: center; gap: 14px; }
#run.portrait .title-btn { min-width: 250px; }
#run.portrait .title-why { max-width: 330px; font-size: 17px; }

/* picking a starter deck: one deck to a row, scrolling */
#run.portrait .start { overflow-y: auto; padding: 0 16px 28px; }
#run.portrait .start h1 { margin-top: 60px; font-size: 34px; }
#run.portrait .start .sub { font-size: 16px; }
#run.portrait .start-back { left: 14px; top: 12px; }
#run.portrait .starters { flex-direction: column; align-items: center; gap: 16px; margin-top: 18px; }
#run.portrait .starter { width: 100%; max-width: 400px; }
#run.portrait .starter:hover { transform: none; }

/* the end of a run */
#run.portrait .end { padding: 0 18px; }
#run.portrait .end h1 { font-size: 38px; }
#run.portrait .end p { font-size: 17px; }
#run.portrait .end .stats { flex-wrap: wrap; gap: 12px; }
#run.portrait .end .stats div { min-width: 140px; }

/* the map: a tall parchment that scrolls, the note pinned over its foot, and a tray below
   with the lanterns, the deck and the purse */
#run.portrait .map-scroll { position: absolute; left: 0; right: 0; top: 0; bottom: 96px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
#run.portrait .parchment-wrap { position: relative; left: auto; top: auto; margin: 12px auto 0; transform: rotate(-.6deg); }
#run.portrait .map-title { left: 26px; top: 22px; }
#run.portrait .map-title h1 { font-size: 32px; }
#run.portrait .map-title p { font-size: 15px; }
#run.portrait .candle { display: none; }
#run.portrait .note { left: 12px; right: 12px; top: auto; bottom: 104px; width: auto; max-height: 340px; overflow-y: auto; padding: 16px 16px 14px; transform: none; }
#run.portrait .note h3 { font-size: 19px; }
#run.portrait .note p { font-size: 14px; }
#run.portrait .side-lanterns { left: 10px; top: auto; bottom: 12px; width: 140px; }
#run.portrait .side-lanterns .k { margin-bottom: 6px; font-size: 9px; }
#run.portrait .side-lanterns .lanterns { gap: 14px; }
#run.portrait .side-lanterns .lantern, #run.portrait .side-lanterns .lantern svg { width: 26px; height: 39px; }
#run.portrait .side-lanterns .lantern .glow { left: -18px; top: -12px; width: 62px; height: 62px; }
#run.portrait .deck-pile { left: 50%; top: auto; bottom: 28px; width: 46px; height: 64px; margin-left: -23px; border-radius: 5px; }
#run.portrait .deck-label { left: 50%; top: auto; bottom: 6px; margin-left: -60px; }
#run.portrait .purse { left: auto; right: 10px; top: auto; bottom: 6px; width: 110px; height: 84px; }
#run.portrait .purse b { font-size: 22px; }
#run.portrait .purse .pile { height: 36px; margin-top: 2px; transform: scale(.62); transform-origin: 50% 0; }

/* the stops, the payout and the deck: sheets the width of the screen, cards three to a row */
#run.portrait .sheet, #run.portrait .sheet.wide { width: calc(100% - 20px); max-height: calc(100% - 24px); padding: 20px 18px 22px; }
#run.portrait .sheet h2 { font-size: 28px; }
#run.portrait .sheet .lead { font-size: 16px; }
#run.portrait .stop-icon { width: 54px; height: 54px; }
#run.portrait .deck-grid, #run.portrait .store-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#run.portrait .store .picks { gap: 12px; flex-wrap: wrap; }
#run.portrait .store-card.big { width: 108px; }
#run.portrait .rule-card { width: 100%; min-height: 0; }
#run.portrait .sheet .actions .btn { flex: 1 1 auto; }

/* an enchanted copy: its class's icon stamped across it in red (the same at the table) */
.enchant-stamp { position: absolute; inset: 22% 14%; pointer-events: none; opacity: .5; transform: rotate(-14deg);
  background: #b3121a; -webkit-mask: var(--stamp) center / contain no-repeat; mask: var(--stamp) center / contain no-repeat; }
.deck-card { position: relative; }

/* the road between maps */
.sheet.road h2 { font-size: 44px; }
.sheet.road .lead { margin-top: 10px; }

/* the Enchant stop's class choice */
.class-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.class-pick { display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 20px;
  background: rgba(255,245,220,.5); box-shadow: inset 0 0 0 1px rgba(90,70,40,.6); font-family: 'Cinzel'; font-size: 13px; color: #3a2a14; }
.class-pick img { width: 22px; height: 22px; }
.class-pick.picked { box-shadow: inset 0 0 0 2px #8b1d1d; background: #f6e7c0; }
#run.portrait .class-pick { font-size: 12px; padding: 5px 10px 5px 6px; }
