/* ============================================================
   BTF Date Night — "cosmic crystal" design system
   Landscape game board. Dark, mystical, tarot-adjacent.
   The purple is intentional + textured (a crystal stone on a
   starfield), never a flat gradient.
   ============================================================ */

:root {
  /* void / atmosphere */
  --void:      #0a0712;
  --void-2:    #140b22;
  --void-3:    #1c0f33;

  /* crystal stone */
  --stone:     #7b44bd;
  --stone-2:   #b27ee8;
  --stone-deep:#2a1640;

  /* metals + ember */
  --gold:      #e9c87d;
  --gold-hi:   #fff3cf;
  --silver:    #d7dcec;
  --burn:      #ff5a3c;

  /* ink */
  --fg:        #ece6f7;
  --muted:     #9a8fb8;
  --hair:      rgba(202,166,239,0.22);   /* faint stone hairline */

  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --body:    "EB Garamond", Georgia, "Times New Roman", serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  font-family: var(--body);
  color: var(--fg);
  background: var(--void);
  /* atmosphere: starfield dots layered over a deep nebula wash */
  background-image:
    radial-gradient(2px 2px at 18% 24%, rgba(255,255,255,0.85), transparent 60%),
    radial-gradient(1.5px 1.5px at 72% 16%, rgba(255,255,255,0.7), transparent 60%),
    radial-gradient(1.5px 1.5px at 38% 72%, rgba(231,225,255,0.6), transparent 60%),
    radial-gradient(1px 1px at 86% 64%, rgba(255,255,255,0.75), transparent 60%),
    radial-gradient(1px 1px at 8% 82%, rgba(255,255,255,0.6), transparent 60%),
    radial-gradient(1.5px 1.5px at 58% 44%, rgba(255,255,255,0.5), transparent 60%),
    radial-gradient(ellipse 80% 60% at 50% 18%, rgba(123,68,189,0.20), transparent 70%),
    radial-gradient(ellipse 70% 70% at 78% 88%, rgba(63,31,108,0.30), transparent 70%),
    linear-gradient(160deg, var(--void), var(--void-2) 60%, var(--void-3));
  background-attachment: fixed;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* grain overlay — adds tooth so the dark never reads as flat */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* the scaffold's container becomes a full-bleed stage */
.container {
  width: 100%;
  height: 100dvh;
  display: block;
}

/* ============================================================
   Board — landscape, three columns, the centre is widest
   ============================================================ */
.board {
  height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  gap: clamp(0.6rem, 1.8vw, 1.75rem);
  padding: calc(env(safe-area-inset-top) + clamp(0.6rem, 2vh, 1.5rem))
           calc(env(safe-area-inset-right) + clamp(0.75rem, 2.4vw, 2rem))
           calc(env(safe-area-inset-bottom) + clamp(0.6rem, 2vh, 1.5rem))
           calc(env(safe-area-inset-left) + clamp(0.75rem, 2.4vw, 2rem));
}

.pane { min-width: 0; min-height: 0; }

/* staggered entrance — one orchestrated page load */
.pane--left   { animation: rise 0.7s var(--ease) both 0.05s; }
.pane--center { animation: rise 0.7s var(--ease) both 0.18s; }
.pane--right  { animation: rise 0.7s var(--ease) both 0.31s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---- LEFT: card (2/3) over locks (1/3) ---- */
.pane--left {
  display: grid;
  grid-template-rows: 2fr 1fr;
  gap: clamp(0.5rem, 1.4vh, 1rem);
}

/* ---- CENTER: egg + label + feedback, vertically centred ---- */
.pane--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 1.6vh, 1.1rem);
}

/* ---- RIGHT: number (top half) over tooltip (bottom, hugging the corner) ---- */
.pane--right {
  display: grid;
  grid-template-rows: 1fr 1fr;
}

/* ============================================================
   The Card (left, top 2/3) — a tarot face
   ============================================================ */
.card {
  /* per-suit template accent (overridden by [data-suit] below) */
  --suit-accent: var(--gold);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.4rem, 1.4vh, 0.9rem);
  text-align: center;
  padding: clamp(0.75rem, 2vh, 1.5rem);
  border: 1px solid color-mix(in srgb, var(--suit-accent) 30%, var(--hair));
  border-radius: 14px;
  background:
    radial-gradient(ellipse 90% 65% at 50% 0%,
      color-mix(in srgb, var(--suit-accent) 22%, transparent), transparent 72%),
    linear-gradient(180deg, rgba(28,15,51,0.78), rgba(10,7,18,0.82));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03),
              inset 0 1px 26px color-mix(in srgb, var(--suit-accent) 14%, transparent),
              0 18px 40px -24px #000;
  overflow: hidden;
  transition: transform 0.45s var(--ease), border-color 0.45s var(--ease),
              box-shadow 0.45s var(--ease);
}

/* the five flavors — each suit its own accent (template backgrounds drop in here later) */
.card[data-suit="scene"]    { --suit-accent: #9fb4d8; }  /* moonlit silver */
.card[data-suit="focus"]    { --suit-accent: #e89ab0; }  /* rose */
.card[data-suit="action"]   { --suit-accent: #ff7a4d; }  /* ember */
.card[data-suit="prop"]     { --suit-accent: #6fc89a; }  /* jade */
.card[data-suit="position"] { --suit-accent: #e9c87d; }  /* gold */

/* gilt corners */
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid color-mix(in srgb, var(--suit-accent) 70%, transparent);
}
.card::before { top: 8px;    left: 8px;    border-right: 0; border-bottom: 0; }
.card::after  { bottom: 8px; right: 8px;   border-left: 0;  border-top: 0;    }

.card__eyebrow {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  font-size: clamp(0.55rem, 1.4vw, 0.78rem);
  color: var(--suit-accent);
}

.card__art {
  font-size: clamp(2.2rem, 9vh, 4.5rem);
  line-height: 1;
  color: var(--stone-2);
  text-shadow: 0 0 26px rgba(178,126,232,0.6);
}

.card__img {
  width: clamp(120px, 34vh, 290px);
  height: clamp(120px, 34vh, 290px);
  object-fit: contain;
  border-radius: 10px;
  cursor: zoom-in;
  filter: drop-shadow(0 8px 22px rgba(0,0,0,0.55))
          drop-shadow(0 0 18px color-mix(in srgb, var(--suit-accent) 45%, transparent));
}

.card__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.1rem, 3.2vw, 2rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
}

/* empty / pre-roll state */
.card[data-empty="true"] .card__art   { color: var(--muted); text-shadow: none; opacity: 0.6; }
.card[data-empty="true"] .card__title { color: var(--muted); font-weight: 600; }

/* deal animation on each draw */
.card.is-dealing { animation: deal 0.5s var(--ease); }
@keyframes deal {
  0%   { transform: perspective(900px) rotateY(34deg) translateZ(-30px); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

/* ============================================================
   Tier selector (left, bottom 1/3) — a compact dropdown (was a button stack)
   ============================================================ */
.stagenav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  justify-content: center;
  align-items: flex-start;
}
.stagesel__label {
  font-family: var(--display);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: clamp(0.55rem, 1.3vw, 0.7rem);
  color: var(--muted);
}
.stagesel {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(0.62rem, 1.4vw, 0.8rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  background-color: rgba(255,255,255,0.04);
  border: 1px solid var(--hair);
  border-radius: 9px;
  padding: 0.6em 2em 0.6em 0.9em;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23e9c87d'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8em center;
  background-size: 0.7em;
  transition: border-color 0.25s var(--ease);
}
.stagesel:hover { border-color: rgba(202,166,239,0.5); }
.stagesel:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.stagesel option { color: var(--fg); background: var(--void-2); }

/* ============================================================
   The Egg (centre) — the button that rules the page
   ============================================================ */
.egg {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  width: clamp(140px, 30vh, 300px);
  line-height: 0;
  filter: drop-shadow(0 24px 40px rgba(0,0,0,0.55))
          drop-shadow(0 0 26px rgba(123,68,189,0.45));
  animation: eggFloat 7s ease-in-out infinite, eggGlow 4.5s ease-in-out infinite;
  transition: transform 0.18s var(--ease), filter 0.18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.egg:hover  { filter: drop-shadow(0 26px 44px rgba(0,0,0,0.55)) drop-shadow(0 0 38px rgba(178,126,232,0.7)); }
.egg:active { transform: scale(0.955); }
.egg:focus-visible { outline: 2px solid var(--gold); outline-offset: 8px; border-radius: 50%; }
.egg.is-rolling { animation: eggRoll 0.6s var(--ease); }

.egg__svg { width: 100%; height: auto; display: block; overflow: visible; }
.egg__marble    { mix-blend-mode: screen; opacity: 0.5; }
.egg__streak    { mix-blend-mode: screen; }
.egg__highlight { transform-origin: center; animation: sheenDrift 7s ease-in-out infinite; }

@keyframes eggFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes eggGlow {
  0%,100% { filter: drop-shadow(0 24px 40px rgba(0,0,0,0.55)) drop-shadow(0 0 22px rgba(123,68,189,0.40)); }
  50%     { filter: drop-shadow(0 24px 40px rgba(0,0,0,0.55)) drop-shadow(0 0 40px rgba(178,126,232,0.65)); }
}
@keyframes sheenDrift {
  0%,100% { opacity: 0.55; transform: translate(0,0) rotate(-24deg); }
  50%     { opacity: 0.9;  transform: translate(10px,6px) rotate(-24deg); }
}
@keyframes eggRoll {
  0%   { transform: scale(0.955) rotate(-6deg); }
  40%  { transform: scale(1.04) rotate(5deg); }
  70%  { transform: scale(0.99) rotate(-2deg); }
  100% { transform: none; }
}

.egg__label {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  font-size: clamp(0.6rem, 1.5vw, 0.85rem);
  color: var(--gold);
  text-indent: 0.4em; /* compensate tracking */
}

/* ---- roll bar (under the egg): CTA + tier crumb (dots + name) ---- */
.rollbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.crumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.stage__dots { display: flex; gap: 0.4rem; }
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  border: 1px solid var(--hair);
  transition: all 0.3s var(--ease);
}
.dot.is-done    { background: var(--stone-2); border-color: var(--stone-2); }
.dot.is-current { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 10px -1px var(--gold); transform: scale(1.25); }
.stage__name {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: clamp(0.62rem, 1.5vw, 0.9rem);
  color: var(--fg);
}

/* ---- advance / "deepen" (manual escape hatch; lit when locks cue it) ---- */
.advance {
  appearance: none;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: clamp(0.78rem, 2vw, 1.05rem);
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 0.72em 1.6em;
  margin-top: 0.2rem;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.advance:hover { color: var(--fg); border-color: rgba(202,166,239,0.5); }
.advance.is-cued {
  color: var(--void);
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  border-color: var(--gold);
  box-shadow: 0 0 18px -2px rgba(233,200,125,0.7);
  animation: cuePulse 2.2s ease-in-out infinite;
}
@keyframes cuePulse {
  0%,100% { box-shadow: 0 0 14px -3px rgba(233,200,125,0.55); }
  50%     { box-shadow: 0 0 22px 0 rgba(233,200,125,0.85); }
}

/* finale card glows */
.card[data-finale="true"] {
  border-color: rgba(233,200,125,0.6);
  box-shadow: inset 0 0 0 1px rgba(233,200,125,0.25),
              inset 0 1px 30px rgba(233,200,125,0.15),
              0 0 40px -16px var(--gold);
}
.card[data-finale="true"] .card__art { color: var(--gold); text-shadow: 0 0 26px rgba(233,200,125,0.7); }

/* ---- action row under the egg: Deepen (long pill) + Spike (round pink) ---- */
.actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 1.6vw, 1rem);
}

/* Spike = "not for us": veto the card for the session + reroll. Round + pink to
   contrast the long gold Deepen pill. */
.spike-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
.spike__label {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(0.52rem, 1.3vw, 0.66rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ffb3cd;
  text-indent: 0.22em; /* offset tracking */
}

.spike {
  appearance: none;
  width: clamp(2.9rem, 6.6vh, 3.8rem);
  height: clamp(2.9rem, 6.6vh, 3.8rem);
  display: grid;
  place-items: center;
  font-size: clamp(1.05rem, 2.7vh, 1.4rem);
  color: #5a1730;
  background: radial-gradient(circle at 38% 30%, #ffe1ec, #ff9ec2 72%);
  border: 1px solid #ffc1d6;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 16px -3px rgba(255,158,194,0.6);
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
}
.spike:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 0 22px -2px rgba(255,158,194,0.85); }
.spike:active { transform: scale(0.92); }
.spike:focus-visible { outline: 2px solid #ff9ec2; outline-offset: 3px; }

/* dormant until the first roll */
.spike:disabled {
  opacity: 0.3;
  filter: grayscale(0.75);
  cursor: default;
  box-shadow: none;
}
.spike:disabled:hover { transform: none; box-shadow: none; }
.spike-wrap:has(.spike:disabled) .spike__label { color: var(--muted); opacity: 0.4; }

/* ---- finish ("bind completed"): bottom-centre, grayed until hover ---- */
.finish {
  appearance: none;
  margin-top: clamp(0.5rem, 1.8vh, 1.2rem);
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: clamp(0.55rem, 1.3vw, 0.72rem);
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  opacity: 0.22;
  transition: opacity 0.3s var(--ease), color 0.3s var(--ease), letter-spacing 0.3s var(--ease);
}
.finish:hover, .finish:focus-visible {
  opacity: 1;
  color: var(--gold);
  letter-spacing: 0.34em;
  outline: none;
}
.spike.is-spiked { animation: spikePop 0.4s var(--ease); }
@keyframes spikePop {
  0%   { transform: scale(0.8) rotate(-8deg); }
  50%  { transform: scale(1.12) rotate(6deg); }
  100% { transform: none; }
}

/* ============================================================
   Right column — number (top) + tooltip (bottom right)
   ============================================================ */
.numeral {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  gap: 0.12em;
}
.numeral__value {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(5rem, 28vh, 15rem);
  line-height: 0.82;
  color: var(--fg);
  text-shadow: 0 0 38px rgba(178,126,232,0.5);
}
.numeral__value.is-rolling { animation: tick 0.5s var(--ease); }
@keyframes tick {
  0% { opacity: 0; transform: translateY(-0.15em) scale(0.92); }
  100% { opacity: 1; transform: none; }
}
.numeral__label {
  font-family: var(--display);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: clamp(0.55rem, 1.3vw, 0.72rem);
  color: var(--muted);
}
.numeral__hint {
  margin-top: 0.15rem;
  font-family: var(--body);
  font-style: italic;
  font-size: clamp(0.62rem, 1.5vh, 0.82rem);
  line-height: 1.3;
  max-width: 24ch;
  color: var(--muted);
  opacity: 0.7;
}
/* the number hint only orients the first paint; reclaim its space after a roll */
.board.has-rolled .numeral__hint { display: none; }
.numeral[data-empty] .numeral__value { color: var(--muted); text-shadow: none; }

.tip {
  align-self: stretch;          /* fill the bottom half of the right column */
  justify-self: stretch;        /* full width */
  display: flex;
  align-items: center;
  padding: clamp(0.8rem, 2.2vh, 1.4rem) clamp(0.9rem, 1.8vw, 1.4rem);
  text-align: left;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(28,15,51,0.7), rgba(10,7,18,0.7));
  box-shadow: 0 16px 36px -26px #000;
}
.tip__text {
  margin: 0;
  font-style: italic;
  font-size: clamp(1.6rem, 6vh, 3rem);
  line-height: 1.35;
  color: var(--fg);
  transition: opacity 0.4s var(--ease);
}
.tip[data-empty="true"] .tip__text { color: var(--muted); }
.tip__text.is-fading { opacity: 0; }

/* ============================================================
   Portrait — the rite wants landscape
   ============================================================ */
.rotate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  text-align: center;
  padding: 2rem;
  background: radial-gradient(ellipse at center, var(--void-2), var(--void));
}
.rotate__glyph {
  font-size: 3.5rem;
  color: var(--gold);
  animation: rock 2.4s ease-in-out infinite;
}
@keyframes rock { 0%,100% { transform: rotate(-12deg); } 50% { transform: rotate(78deg); } }
.rotate__text {
  font-family: var(--display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 1rem;
  color: var(--fg);
  line-height: 1.8;
}
.rotate__text span { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.16em; }

/* ============================================================
   Mobile PORTRAIT -> single stacked column. (Phone landscape keeps the
   3-column board, compacted — see the landscape block further down.)
   ============================================================ */
@media (orientation: portrait) {
  .rotate { display: none !important; }   /* the stacked layout is first-class now */

  /* allow the page to scroll in portrait (base body is overflow:hidden for the
     full-screen landscape board) so the stacked content below the fold is reachable */
  html, body { height: auto; overflow-y: auto; }
  .container { height: auto; min-height: 100dvh; }
  .board {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    gap: clamp(0.35rem, 1.3vh, 0.75rem);
    padding: clamp(0.7rem, 2.5vh, 1.3rem) clamp(0.9rem, 4vw, 1.5rem)
             calc(env(safe-area-inset-bottom) + 2.8rem);
  }
  .pane--left, .pane--center, .pane--right { display: contents; }

  /* vertical order of the now-dissolved elements.
     `.board .title-banner` (not bare `.title-banner`) so this beats the base
     `.title-banner{position:fixed}` rule that appears LATER in the file — equal
     specificity would otherwise let the later base rule win and float the title
     over the card. */
  .board .title-banner { position: static; transform: none; order: 0; text-align: center; }
  .card    { order: 1; width: min(82%, 320px); padding: clamp(0.6rem, 2vh, 1rem); }
  .egg     { order: 2; width: clamp(92px, 28vw, 150px); }
  .rollbar { order: 3; }
  .stagenav { order: 4; width: min(80%, 300px); align-items: stretch; }
  .numeral { order: 5; align-items: center; text-align: center; }
  .tip     { order: 6; width: min(92%, 460px); }
  .actions { order: 7; }
  .finish  { order: 8; }

  .card__img { width: clamp(96px, 30vw, 150px); height: clamp(96px, 30vw, 150px); }
  .numeral__value { font-size: clamp(2.3rem, 12vw, 3.6rem); }
  .numeral__hint { display: none; }  /* keep portrait tight; the cue carries it */
  .tip { align-self: center; }
}

/* ============================================================
   Phone LANDSCAPE (short + touch): keep the desktop 3-column board but
   COMPACT it so the whole rite fits the short height with no scrolling.
   `(max-height:480px) and (pointer:coarse)` = a phone held sideways; a
   real desktop/laptop (fine pointer) or tablet (taller) never matches, so
   their full-size landscape board is untouched.
   ============================================================ */
@media (orientation: landscape) and (max-height: 480px) and (pointer: coarse) {
  .board {
    gap: clamp(0.4rem, 1.4vw, 1rem);
    padding: calc(env(safe-area-inset-top) + 0.4rem)
             calc(env(safe-area-inset-right) + 0.7rem)
             calc(env(safe-area-inset-bottom) + 0.4rem)
             calc(env(safe-area-inset-left) + 0.7rem);
  }
  .pane--left { gap: 0.4rem; }
  .pane--center { gap: 0.3rem; }

  /* card: smaller art + tighter type so it never overflows its cell */
  .card { padding: clamp(0.45rem, 1.6vh, 0.85rem); gap: 0.3rem; }
  .card__img  { width: clamp(74px, 24vh, 130px); height: clamp(74px, 24vh, 130px); }
  .card__art  { font-size: clamp(1.6rem, 7vh, 2.8rem); }
  .card__title { font-size: clamp(0.9rem, 4.4vh, 1.35rem); }
  .card__eyebrow { font-size: 0.58rem; letter-spacing: 0.26em; }

  /* egg sized off the short axis so it always fits */
  .egg { width: clamp(92px, 24vh, 150px); }

  /* right column: tame the giant numeral + cue, drop the pre-roll hint */
  .numeral__value { font-size: clamp(2.8rem, 26vh, 6rem); }
  .numeral__hint { display: none; }
  .tip { padding: clamp(0.45rem, 1.6vh, 0.9rem) clamp(0.55rem, 1.6vw, 1rem); }
  .tip__text { font-size: clamp(0.95rem, 5vh, 1.55rem); line-height: 1.25; }
}

/* ---- subtle brand footer (lower-left): link + version (also a refresh check) ---- */
.brand-footer {
  position: fixed;
  left: calc(env(safe-area-inset-left) + 0.9rem);
  bottom: calc(env(safe-area-inset-bottom) + 0.5rem);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--display);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.45;
  pointer-events: none;       /* subtle; only the link is interactive */
  transition: opacity 0.3s var(--ease);
}
.brand-footer:hover { opacity: 0.9; }
.brand-footer__link { color: var(--muted); text-decoration: none; pointer-events: auto; }
.brand-footer__link:hover { color: var(--gold); }
.brand-footer__ver { color: var(--muted); opacity: 0.7; }
/* BTF heart-wings mark, recoloured via mask so the black line-art sits in the footer tone */
.brand-footer__logo {
  flex: none;
  width: 1em;
  height: 1.5em;
  background-color: var(--gold);
  -webkit-mask: url("../brand/btf-logo.png") center / contain no-repeat;
  mask: url("../brand/btf-logo.png") center / contain no-repeat;
}

/* ---- reset session (lower-right): mirrors the footer; destructive on hover ---- */
.reset-session {
  position: fixed;
  right: calc(env(safe-area-inset-right) + 0.9rem);
  bottom: calc(env(safe-area-inset-bottom) + 0.5rem);
  z-index: 60;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 0.42em 0.95em;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.3s var(--ease);
}
.reset-session:hover {
  opacity: 1;
  color: var(--burn);
  border-color: var(--burn);
  box-shadow: 0 0 14px -3px rgba(255,90,60,0.6);
}

/* ---- brand title banner: pre-roll, top-center; fades once play starts ---- */
.title-banner {
  position: fixed;
  top: calc(env(safe-area-inset-top) + clamp(0.4rem, 2vh, 1.3rem));
  left: 50%;
  transform: translateX(-50%);
  z-index: 55;
  text-align: center;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.title-banner.is-ghosted {
  opacity: 0.16;       /* ghosted, not gone — restored on reset */
  pointer-events: none;
}
.title-banner__name {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.3rem, 3.4vw, 2.1rem);
  letter-spacing: 0.06em;
  color: var(--fg);
  text-shadow: 0 0 26px rgba(178,126,232,0.5);
}
.title-banner__tag {
  margin: 0.1rem 0 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(0.55rem, 1.4vw, 0.78rem);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
  text-indent: 0.34em;
}

/* ---- fullscreen lightbox: tap a card image to enlarge it ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vmin;
  background: rgba(5, 3, 12, 0.92);
  backdrop-filter: blur(4px);
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox__img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 16px;
  box-shadow: 0 30px 90px -20px #000, 0 0 70px -10px rgba(123,68,189,0.55);
}

/* ---- "bind completed" finale overlay: bind, then fly ---- */
.complete {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6vmin;
  background: radial-gradient(ellipse at center, rgba(20,11,34,0.97), rgba(5,3,12,0.985));
  backdrop-filter: blur(6px);
}
.complete[hidden] { display: none; }
.complete__eyebrow {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  font-size: clamp(0.6rem, 1.6vw, 0.85rem);
  color: var(--gold);
}
.complete__title {
  margin: 0 0 1.6rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.6rem, 11vw, 6.5rem);
  line-height: 0.95;
  color: var(--fg);
  text-shadow: 0 0 44px rgba(178,126,232,0.6);
}
.complete__again {
  appearance: none;
  font-family: var(--display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: clamp(0.7rem, 1.8vw, 0.95rem);
  color: var(--void);
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  border: 0;
  border-radius: 999px;
  padding: 0.72em 1.8em;
  cursor: pointer;
  box-shadow: 0 0 24px -4px rgba(233,200,125,0.7);
}
.complete__again:hover { filter: brightness(1.05); }

/* ---- 18+ age gate: covers everything until confirmed (persists per device) ---- */
.age-ok .agegate { display: none; }
.agegate {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6vmin;
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(123,68,189,0.22), transparent 70%),
    linear-gradient(160deg, var(--void), var(--void-2) 60%, var(--void-3));
}
.agegate__inner { max-width: 46ch; }
.agegate__brand {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  font-size: clamp(0.6rem, 1.6vw, 0.85rem);
  color: var(--gold);
  text-indent: 0.4em;
}
.agegate__title {
  margin: 0 0 1.2rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.2rem, 7vw, 4rem);
  color: var(--fg);
  text-shadow: 0 0 36px rgba(178,126,232,0.5);
}
.agegate__body {
  margin: 0 0 1.4rem;
  font-family: var(--body);
  font-size: clamp(0.95rem, 2.4vw, 1.2rem);
  line-height: 1.5;
  color: var(--muted);
}
.agegate__confirm {
  margin: 0 0 1.5rem;
  font-family: var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: clamp(0.72rem, 1.8vw, 0.95rem);
  color: var(--fg);
}
.agegate__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}
.agegate__enter {
  appearance: none;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: clamp(0.8rem, 2vw, 1.05rem);
  color: var(--void);
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  border: 0;
  border-radius: 999px;
  padding: 0.8em 2em;
  cursor: pointer;
  box-shadow: 0 0 26px -4px rgba(233,200,125,0.7);
  transition: transform 0.2s var(--ease);
}
.agegate__enter:hover { transform: translateY(-2px); }
.agegate__leave {
  font-family: var(--display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: clamp(0.6rem, 1.4vw, 0.75rem);
  color: var(--muted);
  text-decoration: none;
}
.agegate__leave:hover { color: var(--burn); }

/* ---- Books tab (top-right) + companion feed panel ---- */
.books-tab {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 0.7rem);
  right: calc(env(safe-area-inset-right) + 0.9rem);
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.6rem;
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 0.45em 0.9em;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.3s var(--ease);
}
.books-tab:hover { opacity: 1; color: var(--gold); border-color: var(--gold); }
.books-tab__glyph { color: var(--gold); font-size: 1.05em; }

.books {
  position: fixed;
  inset: 0;
  z-index: 220;
  overflow-y: auto;
  padding: clamp(2rem, 6vh, 4rem) clamp(1.2rem, 5vw, 4rem);
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(123,68,189,0.18), transparent 70%),
    linear-gradient(160deg, var(--void), var(--void-2) 70%, var(--void-3));
}
.books[hidden] { display: none; }
.books__close {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 0.8rem);
  right: calc(env(safe-area-inset-right) + 1rem);
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  color: var(--fg);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--hair);
  border-radius: 50%;
  cursor: pointer;
}
.books__close:hover { border-color: var(--gold); color: var(--gold); }
.books__back {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 0.85rem);
  left: calc(env(safe-area-inset-left) + 1rem);
  z-index: 1;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: clamp(0.62rem, 1.5vw, 0.78rem);
  color: var(--fg);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 0.5em 1.1em;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.books__back:hover { border-color: var(--gold); color: var(--gold); }
.books__inner { max-width: 680px; margin: 0 auto; }
.books__eyebrow {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  font-size: clamp(0.6rem, 1.4vw, 0.78rem);
  color: var(--gold);
}
.books__title {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--fg);
}
.books__lede {
  margin: 0 0 1.2rem;
  max-width: 52ch;
  font-family: var(--body);
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  line-height: 1.5;
  color: var(--muted);
}
.books__cta {
  display: inline-block;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: clamp(0.72rem, 1.8vw, 0.92rem);
  color: var(--void);
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  border-radius: 999px;
  padding: 0.7em 1.5em;
  text-decoration: none;
  box-shadow: 0 0 22px -4px rgba(233,200,125,0.6);
}
.books__cta:hover { filter: brightness(1.05); }

.books__feed {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.bookcard {
  display: flex;
  gap: 1.1rem;
  padding: 1rem;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(28,15,51,0.6), rgba(10,7,18,0.6));
}
.bookcard__cover {
  flex: none;
  width: clamp(72px, 18vw, 104px);
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  background: linear-gradient(160deg, var(--stone), var(--stone-deep));
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px -12px #000;
}
.bookcard__placeholder {
  font-family: var(--display);
  font-weight: 800;
  font-size: 2rem;
  color: var(--gold);
  opacity: 0.85;
}
.bookcard__body { display: flex; flex-direction: column; gap: 0.25rem; }
.bookcard__tagline {
  margin: 0;
  font-family: var(--display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.6rem;
  color: var(--gold);
}
.bookcard__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--fg);
}
.bookcard__blurb {
  margin: 0.2rem 0 0.5rem;
  font-family: var(--body);
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  line-height: 1.45;
  color: var(--muted);
}
.bookcard__link {
  margin-top: auto;
  font-family: var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--gold);
  text-decoration: none;
}
.bookcard__link:hover { color: var(--gold-hi); }

/* respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
