/* =============================================================================
 * cards.css — Lenormand Cards: the card itself, the lander ceremony (hold-to-
 * shuffle → 36-fan → pick/flip/wow/spin/land), the three seats, the Grand
 * Tableau grid, and the chat card bubbles. Self-contained tokens so it works
 * on every page that loads theme.css.
 * ===========================================================================*/
:root {
  --lc-paper:    #f4ecd8;
  --lc-paper-2:  #e6d8b8;
  --lc-ink:      #2a211c;
  --lc-ink-soft: #5c4f44;
  --lc-gold:     #c99f4b;
  --lc-gold-2:   #e7b53c;
  --lc-gold-soft:#f0d68f;
  --lc-bordeaux: #4a1020;
  --lc-bordeaux-2:#2a0a14;
  --lc-light:    #8a6a1f;   /* family tints — the thin bar at the foot of a face */
  --lc-shadow:   #3b2b4a;
  --lc-motion:   #1f5a73;
  --lc-ground:   #4a5f3a;
  --k: 1;                   /* hero scale, set by lander.js from the viewport */
}

/* ---------- the card ---------- */
.lc-card { position: relative; margin: 0; aspect-ratio: 2 / 3; border-radius: 10px; overflow: visible; }
.lc-card .lc-face, .lc-card .lc-img, .lc-cell .lc-face, .lc-cell .lc-img, .slot .lc-face, .slot .lc-img,
.fly .fc .lc-face, .fly .fc .lc-img, .cb .lc-face, .cb .lc-img {
  position: absolute; inset: 0; border-radius: 9px; overflow: hidden;
}
.lc-face {
  display: grid; grid-template-rows: auto 1fr auto; align-items: center; justify-items: center;
  padding: 7% 8%; color: var(--lc-ink); text-align: center;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.45), transparent 60%),
    linear-gradient(180deg, var(--lc-paper) 0%, var(--lc-paper-2) 100%);
  box-shadow: inset 0 0 0 1px rgba(201,159,75,.55), inset 0 0 0 3px rgba(244,236,216,.9), inset 0 0 0 4px rgba(201,159,75,.35);
  font-family: "Cormorant Garamond", "Cinzel", Georgia, serif;
}
.lc-face .lc-num { font-size: clamp(9px, 1.1em, 14px); letter-spacing: .12em; font-weight: 600; color: var(--lc-gold); align-self: start; justify-self: start; }
.lc-face .lc-glyph { width: 46%; aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(201,159,75,.6);
  background: radial-gradient(circle at 40% 35%, rgba(255,255,255,.7), rgba(201,159,75,.25) 70%, transparent 72%); }
.lc-face .lc-name { font-size: clamp(10px, 1.35em, 18px); font-weight: 600; letter-spacing: .04em; line-height: 1.05; }
.lc-face .lc-pc { font-size: clamp(8px, .9em, 12px); color: var(--lc-ink-soft); font-family: Inter, system-ui, sans-serif; }
.lc-face::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: 5%; height: 3px; border-radius: 2px; background: var(--lc-gold); opacity: .8; }
.lc-face.fam-light::after  { background: var(--lc-light); }
.lc-face.fam-shadow::after { background: var(--lc-shadow); }
.lc-face.fam-motion::after { background: var(--lc-motion); }
.lc-face.fam-ground::after { background: var(--lc-ground); }
.lc-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lc-face.lc-back {
  display: flex; align-items: center; justify-content: center;
  background:
    repeating-linear-gradient(45deg, rgba(201,159,75,.16) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(-45deg, rgba(201,159,75,.16) 0 2px, transparent 2px 9px),
    linear-gradient(160deg, var(--lc-bordeaux) 0%, var(--lc-bordeaux-2) 100%);
  box-shadow: inset 0 0 0 1px rgba(201,159,75,.7), inset 0 0 0 4px var(--lc-bordeaux-2), inset 0 0 0 5px rgba(201,159,75,.45);
}
.lc-back .lc-back-mark { font-size: 1.6em; color: var(--lc-gold-2); text-shadow: 0 0 10px rgba(231,181,60,.6); }
.lc-card figcaption { position: absolute; left: 0; right: 0; top: 100%; margin-top: 6px; text-align: center;
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint, #9a89b4); line-height: 1.3; }
.lc-card figcaption b { display: block; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--gold-strong, #f4d9a0); font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; }
.lc-card.lc-sm { width: 64px; }  .lc-card.lc-md { width: 92px; }  .lc-card.lc-lg { width: 132px; }

/* ---------- the spread (three in seat order) ---------- */
.lc-spread { display: flex; justify-content: center; gap: 12px; padding-bottom: 42px; }
.lc-spread .lc-card { flex: 0 1 96px; transition: filter .4s, transform .4s, box-shadow .4s; }
.lc-spread .lc-card.is-dim { filter: brightness(.5) saturate(.6); transform: scale(.94); }
.lc-spread .lc-card.is-hot { filter: none; transform: scale(1.04); }
.lc-spread .lc-card.is-hot .lc-face, .lc-spread .lc-card.is-hot .lc-img { box-shadow: 0 0 0 2px var(--lc-gold-2), 0 0 24px rgba(231,181,60,.55); }

/* ---------- the Grand Tableau (9 × 4) ---------- */
.lc-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; }
.lc-cell { position: relative; aspect-ratio: 2 / 3; border-radius: 6px; }
.lc-cell .lc-face { padding: 4% 5%; font-size: 7px; border-radius: 5px; }
.lc-cell .lc-face .lc-glyph { width: 40%; }
.lc-cell .lc-face .lc-pc { display: none; }
.lc-cell .lc-img { border-radius: 5px; }
.lc-cell.sealed { filter: blur(1.5px) brightness(.7); }
.lc-cell.sig .lc-face, .lc-cell.sig .lc-img { box-shadow: 0 0 0 2px var(--lc-gold-2), 0 0 16px rgba(231,181,60,.6); }
.lc-cell.past .lc-face, .lc-cell.past .lc-img { box-shadow: 0 0 0 2px #7fb0ff; }
.lc-cell.present .lc-face, .lc-cell.present .lc-img { box-shadow: 0 0 0 2px #8fe0a0; }
.lc-cell.future .lc-face, .lc-cell.future .lc-img { box-shadow: 0 0 0 2px #ffb68a; }
.lc-cell.sealed.sig, .lc-cell.sealed.past, .lc-cell.sealed.present, .lc-cell.sealed.future { filter: none; }

/* ---------- lander: screens ---------- */
.lander { max-width: 440px; }
.lc-screen { display: none; }
.lc-screen.on { display: block; animation: lcFade .4s ease both; }
@keyframes lcFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.lander h1 { font-size: calc(clamp(1.55rem, 6.2vw, 2.1rem) * var(--k)); line-height: 1.12; margin: .25em 0 .35em; }
.lander .eyebrow { font-size: calc(.72rem * var(--k)); letter-spacing: .14em; text-transform: uppercase; margin: 0; }
.lander .lead { font-size: calc(1rem * var(--k)); margin: 0 0 10px; }
.lander .frame { font-family: "Cormorant Garamond", Georgia, serif; font-size: calc(1.15rem * var(--k)); font-style: italic; color: var(--gold-strong, #f4d9a0); text-align: center; margin: 6px 0 10px; }

/* mute toggle */
.mute { position: fixed; top: 10px; right: 10px; z-index: 50; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(201,159,75,.5); background: rgba(20,8,14,.7); color: var(--lc-gold-2); font-size: 16px; cursor: pointer; backdrop-filter: blur(4px); }
.mute.off { color: #7d6a70; text-decoration: line-through; }

/* proof strip */
.proof { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 4px 0 8px; }
.ticker { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 16px; max-width: 100%; }
.tkdot { width: 6px; height: 6px; border-radius: 50%; background: #3e9e6b; flex: 0 0 auto; animation: tkp 2s infinite; }
@keyframes tkp { 0% { box-shadow: 0 0 0 0 rgba(62,158,107,.5); } 70% { box-shadow: 0 0 0 7px rgba(62,158,107,0); } 100% { box-shadow: 0 0 0 0 rgba(62,158,107,0); } }
.tktx { font-size: 11px; letter-spacing: .04em; color: var(--ink-faint, #9a89b4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .28s; }
.tktx b { color: var(--gold-strong, #f4d9a0); font-weight: 600; }
.online-timer { font-size: 11.5px; color: var(--ink-soft, #c9bcd8); }
.online-timer b { color: var(--gold-strong, #f4d9a0); font-variant-numeric: tabular-nums; }

/* stage 1 — hold to shuffle */
.shuffle-stage { text-align: center; padding: 8px 0 4px; }
.deckstack { position: relative; width: calc(96px * var(--k)); aspect-ratio: 2 / 3; margin: 10px auto 12px; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; }
.deckstack .ds { position: absolute; inset: 0; border-radius: 10px; }
.deckstack .ds:nth-child(1) { transform: translate(-6px, 6px) rotate(-5deg); }
.deckstack .ds:nth-child(2) { transform: translate(3px, 3px) rotate(3deg); }
.deckstack .ds:nth-child(3) { transform: none; }
.deckstack .ds .lc-face, .deckstack .ds .lc-img { box-shadow: 0 10px 26px rgba(0,0,0,.45), inset 0 0 0 1px rgba(201,159,75,.7); }
.deckstack { animation: breathe 3.5s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes rattle { 0%, 100% { transform: translateX(0) rotate(0); } 20% { transform: translateX(-5px) rotate(-2.5deg); } 40% { transform: translateX(5px) rotate(2.5deg); } 60% { transform: translateX(-4px) rotate(-2deg); } 80% { transform: translateX(4px) rotate(2deg); } }
.deckstack.shaking { animation: rattle .22s linear infinite; }
.deckstack.shaking .ds:nth-child(1) { animation: rattle .2s linear infinite reverse; }
.meter { width: 150px; height: 6px; margin: 0 auto 10px; border-radius: 6px; background: rgba(255,255,255,.12); overflow: hidden; opacity: 0; transition: opacity .2s; }
.meter.on { opacity: 1; }
.meter-fill { height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--lc-gold), var(--lc-gold-soft)); transition: width .1s linear; }
.shuffle-hint { font-size: 13.5px; color: var(--ink-soft, #c9bcd8); min-height: 1.4em; }

/* stage 2 — seats + fan */
.seats { display: flex; justify-content: center; gap: 10px; margin: 6px auto 2px; max-width: 320px; }
.seat { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.slab { font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-faint, #9a89b4); line-height: 1.25; min-height: 15px; }
.slab small { display: block; text-transform: none; letter-spacing: 0; font-size: 9.5px; opacity: .8; min-height: 2.5em; } /* two lines reserved so a wrapping sub never drops its slot below the others */
.seat.active .slab { color: var(--gold-strong, #f4d9a0); font-weight: 600; }
.slot { position: relative; width: 100%; aspect-ratio: 2 / 3; border-radius: 9px; border: 1px dashed rgba(201,159,75,.45); background: rgba(255,255,255,.03); transition: .3s; }
.seat.active .slot { border-color: var(--lc-gold-2); box-shadow: 0 0 0 3px rgba(231,181,60,.14); }
.slot.filled { border: none; }
.slot.glow .lc-face, .slot.glow .lc-img { box-shadow: 0 0 0 3px rgba(231,181,60,.55), 0 8px 26px rgba(231,181,60,.4); }
.slot.landpop { animation: landpop .5s cubic-bezier(.2,1.6,.35,1); }
@keyframes landpop { 0% { transform: scale(1.16); } 60% { transform: scale(.96); } 100% { transform: scale(1); } }
.cn { font-size: 12.5px; color: var(--gold-strong, #f4d9a0); font-weight: 600; line-height: 1.15; opacity: 0; transition: opacity .4s; font-family: "Cormorant Garamond", Georgia, serif; }
.cn.in { opacity: 1; }
.count { text-align: center; font-size: calc(13.5px * var(--k)); color: var(--ink-soft, #c9bcd8); margin: 8px 0 2px; min-height: 1.4em; }
.deckwrap { position: relative; height: calc(150px * var(--k)); margin: 0; }
.cb { position: absolute; left: 50%; top: 10px; width: calc(58px * var(--k)); margin-left: calc(-29px * var(--k)); aspect-ratio: 2 / 3; cursor: pointer;
  transition: transform .55s cubic-bezier(.2,.9,.25,1), opacity .4s; will-change: transform; transform-origin: 50% 120%; }
.cb .lc-face, .cb .lc-img { box-shadow: 0 5px 16px rgba(0,0,0,.4); }
.cb::after { content: ""; position: absolute; inset: 0; border-radius: 9px; pointer-events: none; box-shadow: 0 0 0 0 rgba(231,181,60,0); animation: cbPulse 4.2s ease-in-out infinite; }
.cb:nth-child(2n)::after { animation-delay: -1.1s; } .cb:nth-child(3n)::after { animation-delay: -2.3s; }
@keyframes cbPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(231,181,60,0); } 50% { box-shadow: 0 0 12px 1px rgba(231,181,60,.35); } }
.cb.gone { opacity: 0; pointer-events: none; transition: opacity .18s linear; }
.deckwrap.done .cb::after { animation: none; }
.drawfoot { text-align: center; font-size: 12.5px; color: var(--ink-faint, #9a89b4); opacity: 0; transition: opacity .5s; margin: 6px 0 0; }

/* the flight */
.fly { position: fixed; z-index: 1000; pointer-events: none; perspective: 1000px; will-change: transform; }
.fly .in2 { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform .46s cubic-bezier(.4,.05,.25,1); will-change: transform; }
.fly.turn .in2 { transform: rotateY(180deg); }
.fly .fc { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 9px; overflow: hidden; box-shadow: 0 14px 34px rgba(0,0,0,.45); }
.fly .fc.bk { transform: rotateY(180deg); }
/* The WOW glow is a halo painted once behind the card; only its opacity changes, on the compositor.
   (A drop-shadow filter on the scaled, 3D-turning card was re-painted every frame and stuttered on phones.) */
.fly::before { content: ''; position: absolute; inset: -16%; border-radius: 24px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(231,181,60,.62), rgba(231,181,60,.22) 62%, rgba(231,181,60,0));
  opacity: 0; transition: opacity .22s ease-out; will-change: opacity; }
.fly.wow::before { opacity: 1; }
.fly.wow .in2 { animation: wowpulse .66s ease-in-out; }
@keyframes wowpulse { 0% { transform: rotateY(180deg) scale(1); } 45% { transform: rotateY(180deg) scale(1.06); } 100% { transform: rotateY(180deg) scale(1); } }

/* stage 3 — the form */
.interp { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.2rem; font-style: italic; text-align: center; color: var(--gold-strong, #f4d9a0); margin: 10px 0 8px; line-height: 1.35; }
.gen-form label { display: block; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint, #9a89b4); margin: 10px 0 4px; }
.gen-form input { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid rgba(201,159,75,.35); background: rgba(255,255,255,.06); color: var(--ink, #f5eef7); font-size: 16px; }
.gen-form .why { font-size: .78rem; color: var(--ink-faint, #9a89b4); margin: 4px 0 0; }

/* stage 4 — she is at the table */
.seer-online-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; border: 1px solid rgba(201,159,75,.35); background: rgba(255,255,255,.04); margin-top: 12px; }
.seer-online-card .avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: linear-gradient(160deg, var(--lc-bordeaux), var(--lc-bordeaux-2)); color: var(--lc-gold-2); display: grid; place-items: center; font-family: "Cormorant Garamond", Georgia, serif; font-size: 26px; border: 1px solid rgba(201,159,75,.6); flex: 0 0 56px; }
.online-dot { font-size: .8rem; color: #3e9e6b; }
.ladder { list-style: none; padding: 0; margin: 12px 0 0; }
.ladder li { font-size: .92rem; color: var(--ink-faint, #9a89b4); padding: 5px 0; opacity: .35; transition: opacity .3s, color .3s; }
.ladder li.on { opacity: 1; color: var(--ink, #f5eef7); }
.ladder li.done { opacity: 1; color: var(--gold-strong, #f4d9a0); }
.ladder li::before { content: "·"; margin-right: 8px; color: var(--lc-gold-2); }

/* below the fold */
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.vs > div { padding: 14px; border-radius: 14px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); font-size: .9rem; line-height: 1.5; }
.vs > div.ours { border-color: rgba(201,159,75,.45); background: rgba(201,159,75,.06); }
.vs h4 { margin: 0 0 6px; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint, #9a89b4); }
.vs .ours h4 { color: var(--gold-strong, #f4d9a0); }
.steps { display: grid; gap: 10px; margin-top: 10px; }
.steps > div { display: flex; gap: 12px; align-items: flex-start; font-size: .95rem; }
.steps b.n { flex: 0 0 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(201,159,75,.6); color: var(--lc-gold-2); font-family: "Cormorant Garamond", Georgia, serif; }
.dealt { text-align: center; font-size: .85rem; color: var(--ink-faint, #9a89b4); margin: 14px 0 0; }
.dealt b { color: var(--gold-strong, #f4d9a0); font-variant-numeric: tabular-nums; }

/* chat embeds */
.card-bubble { background: transparent !important; padding: 4px 0 0 !important; box-shadow: none !important; border: 0 !important; }
.card-bubble .lc-spread { padding-bottom: 38px; }
.card-bubble .lc-spread .lc-card { flex: 0 1 84px; }
.offer-bubble { border: 1px solid rgba(201,159,75,.5); background: rgba(201,159,75,.07); border-radius: 16px; padding: 14px 16px; }
.offer-bubble h4 { margin: 0 0 6px; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.25rem; color: var(--gold-strong, #f4d9a0); }
.offer-bubble ul { margin: 6px 0 8px; padding-left: 18px; font-size: .92rem; line-height: 1.5; }
.offer-bubble .price-row { margin: 4px 0 2px; }
.offer-bubble .note { font-size: .8rem; color: var(--ink-faint, #9a89b4); margin: 4px 0 0; }

@media (prefers-reduced-motion: reduce) {
  .deckstack, .cb::after, .tkdot { animation: none !important; }
  .cb, .fly .in2, .lc-screen.on { transition: none !important; animation: none !important; }
}
@media (min-width: 720px) {
  .lander { max-width: 520px; }
  .seats { max-width: 360px; }
  .deckwrap { height: calc(170px * var(--k)); }
  .cb { width: calc(66px * var(--k)); margin-left: calc(-33px * var(--k)); }
}

/* the deck stack on the lander: once a real card back exists, the <img> must sit
   ON the CSS back (absolute, clipped), exactly as it does inside .lc-card / .lc-cell —
   otherwise the image flows below the lattice and the stack doubles in height */
.deckstack .ds { overflow: hidden; }
.deckstack .ds .lc-face, .deckstack .ds .lc-img { position: absolute; inset: 0; border-radius: 10px; overflow: hidden; }

/* A long press on a phone must not open the copy / save-image menu or start a selection: on the
   deck it interrupts hold-to-shuffle, on the fan and the seats it covers the cards. The images take
   no pointer events, so a press always lands on the card itself, never on a picture. */
.deckstack, #deck, #seats, .fly { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.deckstack img, #deck img, #seats img, .fly img { -webkit-user-drag: none; pointer-events: none; }
