/* v39 t157u: every button and the LIFE LOTTERY slab is ONE stone: the timeline's current stone (same marble craquelure,
   grain, gold rim, bevels, lighting, colours) drawn out into a capsule with fully round ends.
   - assets/stone/stone-pill-d.webp (dark screens) and stone-pill-p.webp (ivory screens): one 768x193 sprite each, rendered by
     app-test/v39/gen (render.py drives pill.html, which reuses js/timeline.js's own <defs>). Layout: cap 144 | tile 480 | cap 144.
   - used as a 3-slice border-image: the caps keep their shape at any width, the middle TILES ("round"), and the marble noise
     is stitched with the tile's period, so there is no stretch and no seam. Width >= 1.5 x height (two caps), so an icon
     button is the shortest capsule.
   - size = --sh (the height); the caps are --sh x .75 wide (integer px for the sizes used). Theme by --st-img / --st-core / --st-ink (d by default, .st-p ivory).
   - states move only transform + opacity: hover lifts 1px and fades in a light sheen (::after), press sinks and fades in
     the hollow (::before). The shadow is a static box-shadow. No per-frame filters, no per-button images. */
:root { --st-ink-d: #33271a; --st-ink-p: #5b4a35; }

/* ---------- the stone pill ---------- */
:where(.spin-wrap .cta, #again.cta, #again-btn.parch, #ex-back.parch, .ix-cta, #wheel-go.parch, #wheel-respin.parch, .ex-zoom button, .zoom-ctl button, .deck-nav .chev, body.from-explore #ex-return, .ll-chip) { --sh: 48px; }   /* default height; any size rule below wins */
:is(.spin-wrap .cta, #again.cta, #again-btn.parch, #ex-back.parch, .ix-cta, #wheel-go.parch, #wheel-respin.parch, .ex-zoom button, .zoom-ctl button, .deck-nav .chev, body.from-explore #ex-return), .ll-chip {
  --st-img: url("../assets/stone/stone-pill-d.webp"); --st-core: linear-gradient(#e9ddcc 0, #ddc4a9 6%, #d9c1a7 20%, #d0b79c 50%, #c5aa8f 80%, #a1896f 90%, #6e4a1e 100%); --st-ink: var(--st-ink-d);
  appearance: none; position: relative; isolation: isolate; box-sizing: border-box; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em; vertical-align: middle;
  height: var(--sh); min-width: calc(var(--sh) * 1.5); margin: 0; padding: 0 calc(var(--sh) * .06) calc(var(--sh) * .09);
  border-style: solid; border-color: transparent; border-width: 0 calc(var(--sh) * .75);
  border-image: var(--st-img) 0 144 fill / 0 calc(var(--sh) * .75) round;
  border-radius: 999px; clip-path: none; filter: none; transform: none; translate: none; outline: 0;
  /* the stone's own colour under the slices, so a sub-pixel seam never shows the page through */
  background: var(--st-core) center / calc(100% + var(--sh) * .3) 100% no-repeat padding-box border-box;
  font-family: "EB Garamond", Georgia, serif; font-style: normal; font-weight: 600; font-variant-caps: all-small-caps;
  font-size: calc(var(--sh) * var(--st-fs, .4)); line-height: 1; letter-spacing: var(--st-ls, .15em); white-space: nowrap; text-decoration: none;
  color: var(--st-ink);
  text-shadow: 0 1px 0 rgba(255,250,238,.85), 0 -1px 0 rgba(60,40,18,.35);
  box-shadow: 0 1px 1px rgba(20,12,4,.3), 0 4px 7px -2px rgba(20,12,4,.32), 0 12px 18px -9px rgba(20,12,4,.5);
  transition: transform 160ms ease; }
:is(.ix-cta, #again-btn.parch, #wheel-go.parch, #wheel-respin.parch, .deck-nav .chev, body.from-explore #ex-return), .rs-chip .ll-chip, .mark-chip .ll-chip { --st-img: url("../assets/stone/stone-pill-p.webp"); --st-core: linear-gradient(#f9f3e8 0, #f9ead2 6%, #f7e6cd 20%, #f0ddc0 50%, #e5d0b1 80%, #baa487 90%, #6e4a1e 100%); --st-ink: var(--st-ink-p);
  box-shadow: 0 1px 1px rgba(60,40,18,.28), 0 4px 7px -2px rgba(60,40,18,.25), 0 12px 18px -9px rgba(60,40,18,.4); }
/* ::after = the light shift on hover (a warm sheen across the top, as if the stone turned to the light);
   ::before = the pressed hollow. Both cover the whole capsule (out over the caps), opacity only. */
:is(.spin-wrap .cta, #again.cta, #again-btn.parch, #ex-back.parch, .ix-cta, #wheel-go.parch, #wheel-respin.parch, .ex-zoom button, .zoom-ctl button, .deck-nav .chev, body.from-explore #ex-return)::before, :is(.spin-wrap .cta, #again.cta, #again-btn.parch, #ex-back.parch, .ix-cta, #wheel-go.parch, #wheel-respin.parch, .ex-zoom button, .zoom-ctl button, .deck-nav .chev, body.from-explore #ex-return)::after { content: ""; display: block !important; position: absolute; z-index: 1; pointer-events: none; border: 0;
  inset: 0 calc(var(--sh) * -.75); border-radius: 999px; opacity: 0; transition: opacity 140ms ease; will-change: opacity; transform: none; clip-path: none; }
:is(.spin-wrap .cta, #again.cta, #again-btn.parch, #ex-back.parch, .ix-cta, #wheel-go.parch, #wheel-respin.parch, .ex-zoom button, .zoom-ctl button, .deck-nav .chev, body.from-explore #ex-return)::after { background: radial-gradient(70% 90% at 50% 8%, rgba(255,247,226,.5), rgba(255,247,226,0) 70%); mix-blend-mode: normal; }
:is(.spin-wrap .cta, #again.cta, #again-btn.parch, #ex-back.parch, .ix-cta, #wheel-go.parch, #wheel-respin.parch, .ex-zoom button, .zoom-ctl button, .deck-nav .chev, body.from-explore #ex-return)::before { background: none; box-shadow: inset 0 calc(var(--sh) * .06) calc(var(--sh) * .14) rgba(60,40,16,.45), inset 0 -1px 1px rgba(255,250,238,.55); }
:is(.spin-wrap .cta, #again.cta, #again-btn.parch, #ex-back.parch, .ix-cta, #wheel-go.parch, #wheel-respin.parch, .ex-zoom button, .zoom-ctl button, .deck-nav .chev, body.from-explore #ex-return) > * { position: relative; z-index: 2; }
:is(.spin-wrap .cta, #again.cta, #again-btn.parch, #ex-back.parch, .ix-cta, #wheel-go.parch, #wheel-respin.parch, .ex-zoom button, .zoom-ctl button, .deck-nav .chev, body.from-explore #ex-return) svg { width: calc(var(--sh) * .42); height: calc(var(--sh) * .22); stroke-width: 1.6; flex: none; }
@media (hover: hover) { :is(.spin-wrap .cta, #again.cta, #again-btn.parch, #ex-back.parch, .ix-cta, #wheel-go.parch, #wheel-respin.parch, .ex-zoom button, .zoom-ctl button, .deck-nav .chev, body.from-explore #ex-return):hover { transform: translateY(-1px); color: var(--st-ink); filter: none; background: var(--st-core) center / calc(100% + var(--sh) * .3) 100% no-repeat padding-box border-box; }
  :is(.spin-wrap .cta, #again.cta, #again-btn.parch, #ex-back.parch, .ix-cta, #wheel-go.parch, #wheel-respin.parch, .ex-zoom button, .zoom-ctl button, .deck-nav .chev, body.from-explore #ex-return):hover::after { opacity: 1; } }
:is(.spin-wrap .cta, #again.cta, #again-btn.parch, #ex-back.parch, .ix-cta, #wheel-go.parch, #wheel-respin.parch, .ex-zoom button, .zoom-ctl button, .deck-nav .chev, body.from-explore #ex-return):active { transform: translateY(1.5px); }
:is(.spin-wrap .cta, #again.cta, #again-btn.parch, #ex-back.parch, .ix-cta, #wheel-go.parch, #wheel-respin.parch, .ex-zoom button, .zoom-ctl button, .deck-nav .chev, body.from-explore #ex-return):active::after { opacity: 0; }
:is(.spin-wrap .cta, #again.cta, #again-btn.parch, #ex-back.parch, .ix-cta, #wheel-go.parch, #wheel-respin.parch, .ex-zoom button, .zoom-ctl button, .deck-nav .chev, body.from-explore #ex-return):active::before { opacity: 1; }
:is(.spin-wrap .cta, #again.cta, #again-btn.parch, #ex-back.parch, .ix-cta, #wheel-go.parch, #wheel-respin.parch, .ex-zoom button, .zoom-ctl button, .deck-nav .chev, body.from-explore #ex-return):focus-visible { outline: 2px solid #d9b56a; outline-offset: 3px; }
:is(.ix-cta, #again-btn.parch, #wheel-go.parch, #wheel-respin.parch, .deck-nav .chev, body.from-explore #ex-return):focus-visible { outline-color: #9a6a24; }
:is(.spin-wrap .cta, #again.cta, #again-btn.parch, #ex-back.parch, .ix-cta, #wheel-go.parch, #wheel-respin.parch, .ex-zoom button, .zoom-ctl button, .deck-nav .chev, body.from-explore #ex-return):disabled { opacity: .42; cursor: default; transform: none; }
:is(.spin-wrap .cta, #again.cta, #again-btn.parch, #ex-back.parch, .ix-cta, #wheel-go.parch, #wheel-respin.parch, .ex-zoom button, .zoom-ctl button, .deck-nav .chev, body.from-explore #ex-return):disabled::after, :is(.spin-wrap .cta, #again.cta, #again-btn.parch, #ex-back.parch, .ix-cta, #wheel-go.parch, #wheel-respin.parch, .ex-zoom button, .zoom-ctl button, .deck-nav .chev, body.from-explore #ex-return):disabled::before { opacity: 0; }
.ex-head #ex-back.parch svg { transform: scaleX(-1); }

/* sizes (height; the width follows the label) */
.spin-wrap .cta { --sh: 52px; }
#again.cta { --sh: 48px; }
#again-btn.parch { --sh: 44px; }
.ix-cta { --sh: 50px; }
:is(#wheel-go.parch, #wheel-respin.parch) { --sh: 48px; --st-fs: .38; }
/* icon buttons: the shortest capsule (just the two caps), 44 px tall everywhere (the tap target) */
:is(.ex-zoom button, .zoom-ctl button, .deck-nav .chev, body.from-explore #ex-return) { --sh: 44px; width: calc(var(--sh) * 1.5); min-width: 0; padding: 0 0 calc(var(--sh) * .07); gap: 0; display: inline-grid; place-items: center;
  font: 600 calc(var(--sh) * .56)/1 "EB Garamond", Georgia, serif; font-variant-caps: normal; letter-spacing: 0; }
:is(.ex-zoom button, .zoom-ctl button, .deck-nav .chev, body.from-explore #ex-return) svg { width: auto; height: calc(var(--sh) * .4); }
.deck-nav .chev svg { width: calc(var(--sh) * .22); height: calc(var(--sh) * .36); stroke-width: 2; }
body.from-explore #ex-return svg { width: calc(var(--sh) * .5); height: calc(var(--sh) * .5); }
body.from-explore #ex-return { translate: 0 -50%; }
body.from-explore #ex-return:is(:hover, :active) { translate: 0 -50%; }
.ex-zoom { gap: 10px; }
.zoom-ctl { gap: 10px; }
@media (max-width: 740px) {
  .spin-wrap .cta { --sh: 46px; --st-ls: .13em; }
  #again.cta { --sh: 46px; }
  #again-btn.parch { --sh: 44px; --st-fs: .34; --st-ls: .12em; }
    .ix-cta { --sh: 48px; }
  :is(#wheel-go.parch, #wheel-respin.parch) { --sh: 44px; --st-fs: .31; --st-ls: .06em; }
  #wheel-go.parch svg { display: none; }   /* one row with Respin on a phone */
  .wheel-actions { gap: 10px; }
}
/* ---------- the tooltip's "i" button (daily salary): a tiny alabaster bead with an engraved i ---------- */
.lv-tip-btn i { background: url("../assets/stone/round-96.webp") center / 100% 100% no-repeat; color: var(--st-ink);
  box-shadow: 0 1px 1px rgba(20,12,4,.35), 0 2px 3px -1px rgba(20,12,4,.3); text-shadow: 0 .5px 0 rgba(255,253,247,.95);
  width: 1.25em; height: 1.25em; font-size: .66em; }
.lv-tip-btn:hover i { filter: brightness(1.05); }

/* ---------- brand: the LIFE LOTTERY slab = the same stone pill, gold-filled capitals between two compass stars ---------- */
/* (was an alabaster tablet bitmap, now deleted; the favicon / touch icon stay the round medallion) */
.ll-chip { cursor: inherit; gap: .5em; padding: 0 calc(var(--sh) * .04) calc(var(--sh) * .1); letter-spacing: .1em; user-select: none;
  font: 500 calc(var(--sh) * .5)/1 "EB Garamond", Georgia, serif; font-variant-caps: normal; text-transform: uppercase; text-shadow: none; }
.ll-chip b { font-weight: 600; color: #5c3a0e;
  background: linear-gradient(180deg, #9a6a26 0%, #6e4612 46%, #8c5d1e 58%, #4f310b 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 rgba(255,250,236,.8)); }
.rs-chip .ll-chip b, .mark-chip .ll-chip b { background-image: linear-gradient(180deg, #a87630 0%, #7a4e15 46%, #94631f 58%, #5c3a0e 100%); }
.ll-chip i { flex: none; width: .5em; height: .5em; transform: translateY(-.04em);
  background: linear-gradient(180deg, #e9c182, #b57a26 55%, #7b4c14);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }
/* landing / Spin card crest */
.crest.crest-chip { width: auto; color: inherit; }
.crest.crest-chip .ll-chip { --sh: clamp(40px, 3.4vw, 54px); }
@media (max-width: 740px) {
  /* the timeline owns the top of the phone card, so the chip sits under the tagline, above the globe */
  body:has(#spin-tl .tl) .crest.crest-chip, .crest.crest-chip { display: block; top: calc(33% + 62px); width: auto; }
  .crest.crest-chip .ll-chip { --sh: 40px; }
}
/* story header */
.rs-mark.rs-chip { opacity: 1; display: block; line-height: 0; text-decoration: none; }
.rs-mark.rs-chip .ll-chip { --sh: clamp(32px, 2.5vw, 44px); cursor: pointer; }
@media (max-width: 740px) { .rs-mark.rs-chip .ll-chip { --sh: 28px; }
  .rs-mark.rs-chip { padding: 8px 0; margin: -8px 0; }   /* a 44 px tap target around the 28 px slab */ }
/* Explore header: the chip at the right, across from Back */
.ex-head .ex-mark { margin-left: auto; display: block; line-height: 0; }
.ex-head .ex-mark .ll-chip { --sh: clamp(34px, 2.8vw, 46px); }
@media (max-width: 740px) { .ex-head .ex-mark .ll-chip { --sh: 30px; } }

/* v46 t170u: Explore Back matches the Life Lottery chip (same --sh, padding, type). Leave the chip alone — its border-image is size-sensitive. */
.ex-head #ex-back.parch {
  --sh: clamp(34px, 2.8vw, 46px);
  padding: 0 calc(var(--sh) * .04) calc(var(--sh) * .1);
  font: 600 calc(var(--sh) * .5)/1 "EB Garamond", Georgia, serif;
  font-variant-caps: normal; text-transform: uppercase; letter-spacing: .1em;
}
@media (max-width: 740px) { .ex-head #ex-back.parch { --sh: 30px; } }
