/* ═══════════════════════════════════════════════════════════════════════════
   GRAND ATLANTIC — casino gateway
   Sections: 1 tokens/reset · 2 entrance · 3 ambient · 4 hero + crest ·
             5 floor/tiles · 6 game scenes · 7 footer · 8 responsive · 9 motion
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1 · tokens / reset ─────────────────────────────────────────────────── */
:root {
  color-scheme: dark;
  --bg: #0a0908;
  --panel: #14100d;
  --ink: #f4ead2;
  --muted: #a89877;
  --gold: #e2b755;
  --gold-hi: #f7df9a;
  --gold-dim: #8a6d33;
  --line: rgba(226, 183, 85, .20);
  --crimson: #8c1c26;
  --disp: 'Cinzel', Georgia, 'Times New Roman', serif;
  --body: 'Jost', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
  /* one content rail: desk, floor & trophy case share this outer edge */
  --wrap: 1180px;
  /* parallax vars, driven by app.js */
  --mx: 0px;
  --my: 0px;
}

* { box-sizing: border-box; }

html, body { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 400 16px/1.55 var(--body);
  overflow-x: hidden;
  /* the room: warm light from the chandeliers, red and sea-blue spill at the edges */
  background:
    radial-gradient(1100px 560px at 50% -120px, rgba(226, 183, 85, .13), transparent 60%),
    radial-gradient(900px 520px at 88% 18%, rgba(140, 28, 38, .10), transparent 60%),
    radial-gradient(1000px 700px at 8% 85%, rgba(23, 58, 85, .12), transparent 60%),
    var(--bg);
}

/* lock scroll while the curtains are still closed (JS adds .lit) */
body:not(.lit) { overflow: hidden; }

a { color: var(--gold); }
::selection { background: rgba(226, 183, 85, .35); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ── 2 · entrance (velvet curtains part, house lights come up) ──────────── */
#entrance {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  cursor: pointer;
}
body.open #entrance { pointer-events: none; }
body.done #entrance { visibility: hidden; }

.curtain {
  position: absolute; top: -2%; bottom: -2%; width: 51%;
  background:
    linear-gradient(180deg, rgba(0,0,0,.55), transparent 22%, transparent 78%, rgba(0,0,0,.65)),
    repeating-linear-gradient(90deg,
      #3c0a11 0 14px, #55101a 14px 30px, #2a060b 30px 46px);
  box-shadow: inset 0 0 90px rgba(0, 0, 0, .8);
  border-bottom: 3px solid var(--gold-dim);
  transition: transform 1.25s cubic-bezier(.76, .04, .22, 1);
}
.curtain-l { left: 0; }
.curtain-r { right: 0; }
body.open .curtain-l { transform: translateX(-103%); }
body.open .curtain-r { transform: translateX(103%); }

.entr-center {
  position: relative; z-index: 2;
  text-align: center; color: var(--gold);
  opacity: 0; transform: translateY(8px);
  transition: opacity .45s ease, transform .45s ease;
}
body.reveal .entr-center { opacity: 1; transform: none; }
body.open   .entr-center { opacity: 0; transform: scale(1.05); }

.entr-word {
  margin: 14px 0 4px;
  font: 700 clamp(26px, 6vw, 46px) var(--disp);
  letter-spacing: .22em;
  background: linear-gradient(#fbeab4, #e2b755 55%, #9a7a3a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.entr-tag {
  margin: 0; font: italic 300 clamp(13px, 2.4vw, 17px) var(--body);
  letter-spacing: .3em; color: #cdb787;
}
.entr-rule {
  width: 0; height: 1px; margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transition: width 1s ease .15s;
}
.entr-rule-b { transition-delay: .3s; }
body.reveal .entr-rule { width: min(360px, 70vw); }
.entr-hint {
  margin-top: 26px; font-size: 11px; letter-spacing: .28em;
  text-transform: uppercase; color: rgba(205, 183, 135, .55);
  /* gentle breathing so "tap anywhere to enter" reads as interactive */
  animation: hintPulse 2.4s ease-in-out infinite;
}
@keyframes hintPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* ── 3 · ambient: gold-dust canvas + marquee light strips ───────────────── */
#ambient {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
}
header, main, footer { position: relative; z-index: 1; }

.lights {
  height: 7px; max-width: 560px; margin: 0 auto;
  background-image: radial-gradient(circle at 11px 3.5px,
    #ffd98c 1.5px, rgba(255, 217, 140, .28) 2.6px, transparent 3.5px);
  background-size: 22px 7px;
  opacity: .75;
  animation: lightsChase 2.6s linear infinite;
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
.lights-b { margin-top: 8px; }
@keyframes lightsChase { to { background-position-x: 44px; } }

/* sound toggle chip */
#soundToggle {
  position: fixed; top: 18px; right: 18px; z-index: 40;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--gold); background: rgba(20, 16, 13, .72);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  transition: border-color .3s, color .3s, transform .3s;
}
#soundToggle:hover, #soundToggle:focus-visible { border-color: var(--gold); transform: translateY(-1px); }
#soundToggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
#soundToggle[aria-pressed="false"] .snd-on  { display: none; }
#soundToggle[aria-pressed="true"]  .snd-off { display: none; }
#soundToggle[aria-pressed="false"] { color: var(--muted); }

/* ── 4 · hero + crest ───────────────────────────────────────────────────── */
.hall { text-align: center; padding: clamp(38px, 7vh, 80px) 20px 26px; }

.hall-kicker {
  margin: 18px 0 0; font-size: 11px; letter-spacing: .34em;
  color: var(--gold-dim); text-transform: uppercase;
}

.crest-wrap {
  width: clamp(168px, 24vw, 228px);
  margin: 26px auto 6px;
  filter: drop-shadow(0 0 28px rgba(226, 183, 85, .16));
}
.crest { width: 100%; height: auto; display: block; }

.crest-band   { font: 700 13.5px var(--disp); letter-spacing: 3.5px; fill: #e8c568; }
.crest-band-b { font-size: 10px; letter-spacing: 2.4px; fill: #b99b55; }
.crest-suit { font-size: 14px; fill: var(--gold); }
.crest-suit.red { fill: #c9424e; }
.crest-mono {
  font: 700 52px var(--disp); letter-spacing: 1px;
  fill: url(#gaGoldV);
  paint-order: stroke; stroke: #2a1f0e; stroke-width: 1px;
}

/* crest choreography: rotating glint, orbiting spark, breathing halo & sun */
.crest-glint, .crest-orbit { transform-box: view-box; transform-origin: 130px 130px; }
.crest-glint { animation: crestSpin 15s linear infinite; }
.crest-orbit { animation: crestSpin 9s linear infinite; }
.crest-halo  { animation: haloPulse 6s ease-in-out infinite; }
.crest-rays  { animation: raysPulse 5s ease-in-out infinite; }
.crest-sun   { transform-box: view-box; transform-origin: 130px 151px;
               animation: sunBreathe 8s ease-in-out infinite; }
@keyframes crestSpin  { to { transform: rotate(360deg); } }
@keyframes haloPulse  { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes raysPulse  { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes sunBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }

/* explicit check-in flourish: a ~1s gold shimmer + gentle scale/rotate settle
   (app.js adds .crest-flourish on the wrapper, then removes it on animationend) */
.crest-flourish { animation: crestFlourish 1s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes crestFlourish {
  0%   { transform: scale(.9)  rotate(-6deg); filter: drop-shadow(0 0 12px rgba(226, 183, 85, .12)) brightness(1); }
  35%  { transform: scale(1.07) rotate(3deg); filter: drop-shadow(0 0 42px rgba(247, 223, 154, .55)) brightness(1.35); }
  70%  { transform: scale(.99) rotate(-1deg); filter: drop-shadow(0 0 30px rgba(226, 183, 85, .3)) brightness(1.12); }
  100% { transform: none;                     filter: drop-shadow(0 0 28px rgba(226, 183, 85, .16)) brightness(1); }
}

.hall-title {
  margin: .15em 0 0;
  font: 900 clamp(27px, 7vw, 72px)/1.05 var(--disp);
  letter-spacing: .09em;
  background: linear-gradient(#fbeab4, #e2b755 55%, #9a7a3a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hall-tagline {
  margin: 10px 0 0;
  font: italic 300 clamp(15px, 2.4vw, 21px) var(--body);
  letter-spacing: .2em; color: #d9c391;
}
.hall-sub {
  max-width: 580px; margin: 16px auto 30px;
  font-weight: 300; color: var(--muted);
}

/* entrance stagger: everything marked .rise fades up once the lights are on */
.rise { opacity: 0; transform: translateY(18px); }
body.lit .rise {
  animation: riseIn .8s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(var(--d, 0) * 95ms);
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

/* ── 4½ · front desk: shared-session HUD ────────────────────────────────── */
.desk {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px 8px;
  text-align: center;
}
.desk-kicker {
  margin: 0 0 10px;
  font-size: 10px; letter-spacing: .34em;
  color: var(--gold-dim); text-transform: uppercase;
}
.desk-card {
  position: relative;
  border-radius: 16px;
  background: linear-gradient(180deg, #171210, #0e0b09);
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px -18px rgba(0, 0, 0, .8),
              inset 0 1px 0 rgba(247, 223, 154, .06);
  padding: 16px 22px;
  text-align: left;
}
/* thin brass rule along the top, like the cage counter */
.desk-card::before {
  content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(226, 183, 85, .55), transparent);
}

/* state switch: empty (no player) vs live HUD */
.desk[data-state="empty"] .desk-live  { display: none; }
.desk[data-state="live"]  .desk-empty { display: none; }

/* player-card reveal: on an explicit check-in app.js adds .desk-reveal, the
   card warms up and the live cells fade/slide in with a stagger, then the class
   is stripped so a later edit can replay it (returning players never get it —
   initial paint doesn't run the 'onboard' path). */
.desk-reveal .desk-card { animation: deskCardGlow 1.1s ease both; }
@keyframes deskCardGlow {
  0%   { box-shadow: 0 14px 34px -18px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(247, 223, 154, .06), 0 0 0 0 rgba(226, 183, 85, 0); }
  40%  { box-shadow: 0 14px 34px -18px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(247, 223, 154, .06), 0 0 34px -4px rgba(226, 183, 85, .4); }
  100% { box-shadow: 0 14px 34px -18px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(247, 223, 154, .06), 0 0 0 0 rgba(226, 183, 85, 0); }
}
.desk-reveal .desk-live > * { animation: deskCellIn .55s cubic-bezier(.2, .7, .2, 1) both; }
.desk-reveal .desk-live > *:nth-child(1) { animation-delay: .06s; }
.desk-reveal .desk-live > *:nth-child(2) { animation-delay: .14s; }
.desk-reveal .desk-live > *:nth-child(3) { animation-delay: .22s; }
.desk-reveal .desk-live > *:nth-child(4) { animation-delay: .30s; }
.desk-reveal .desk-live > *:nth-child(5) { animation-delay: .38s; }
@keyframes deskCellIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.desk-empty {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.desk-empty-copy { margin: 0; font-weight: 300; font-size: 14px; color: var(--muted); }

.desk-live {
  display: grid;
  grid-template-columns: minmax(120px, auto) auto auto 1fr auto;
  gap: 12px 30px;
  align-items: center;
}
.desk-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.desk-label {
  font-size: 9.5px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--gold-dim); white-space: nowrap;
}
.desk-value {
  font: 700 19px/1.2 var(--disp); letter-spacing: .04em;
  color: var(--ink); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.desk-gold { color: var(--gold-hi); }
/* while the buy-in counts up from 0 the number glows, so the total "lands" */
.desk-gold.is-counting { text-shadow: 0 0 16px rgba(247, 223, 154, .5); }
.desk-subvalue { font-size: 11px; font-weight: 300; color: var(--muted); white-space: nowrap; }
.desk-subvalue.is-up   { color: #7fd7a8; }
.desk-subvalue.is-down { color: #e0808f; }

.desk-progress { min-width: 150px; }
.desk-pct { color: #d9c391; letter-spacing: .08em; margin-left: 4px; }
.desk-hit .desk-pct { color: #2dd4bf; }
.desk-bar {
  display: block; height: 7px; border-radius: 999px;
  background: rgba(226, 183, 85, .13);
  border: 1px solid rgba(226, 183, 85, .18);
  overflow: hidden;
}
.desk-fill {
  display: block; height: 100%; width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #9a7a3a, #e2b755 60%, #f7df9a);
  box-shadow: 0 0 10px rgba(226, 183, 85, .45);
  transition: width .6s cubic-bezier(.2, .7, .2, 1);
}
.desk-hit .desk-fill {
  background: linear-gradient(90deg, #14806c, #2dd4bf 60%, #9ff2e2);
  box-shadow: 0 0 12px rgba(45, 212, 191, .5);
}

.desk-btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 600 12px/1 var(--body);
  letter-spacing: .16em; text-transform: uppercase;
  background: linear-gradient(180deg, #f0ca6e, #d3a63e);
  color: #241b0c;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .3s, box-shadow .3s, border-color .3s, color .3s;
}
.desk-btn:hover, .desk-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -6px rgba(226, 183, 85, .55);
}
.desk-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.desk-btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--gold);
}
.desk-btn-ghost:hover, .desk-btn-ghost:focus-visible { border-color: var(--gold); box-shadow: none; }

.desk-fine {
  margin: 10px 0 0;
  font-size: 11px; font-weight: 300; letter-spacing: .06em;
  color: rgba(168, 152, 119, .8);
}

/* ── 5 · the floor: five tables ─────────────────────────────────────────── */
.floor {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 26px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 18px 28px 64px;
}
.table { grid-column: span 2; }
.table:nth-of-type(4) { grid-column: 2 / span 2; }
.table:nth-of-type(5) { grid-column: 4 / span 2; }

.table {
  position: relative;
  display: flex; flex-direction: column;
  border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, #171210, #0e0b09);
  border: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
  box-shadow: 0 14px 34px -18px rgba(0, 0, 0, .8);
  transition: transform .45s cubic-bezier(.2, .8, .25, 1),
              border-color .45s, box-shadow .45s;
}
.table:hover, .table:focus-visible {
  transform: translateY(-8px);
  border-color: rgba(226, 183, 85, .6);
  box-shadow:
    0 26px 54px -20px rgba(0, 0, 0, .85),
    0 0 44px -10px rgba(226, 183, 85, .33);
}
.table:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* pointer-following sheen (JS sets --hx/--hy per tile) */
.table::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(260px circle at var(--hx, 50%) var(--hy, 40%),
    rgba(247, 223, 154, .10), transparent 65%);
  opacity: 0; transition: opacity .4s;
}
.table:hover::after, .table:focus-visible::after { opacity: 1; }

.table-scene {
  display: block; aspect-ratio: 16 / 9; overflow: hidden;
  border-bottom: 1px solid var(--line);
  animation: idleDrift 7s ease-in-out infinite alternate;
}
/* let neighbouring tables breathe out of phase */
.table:nth-of-type(2) .table-scene { animation-delay: -2s; }
.table:nth-of-type(3) .table-scene { animation-delay: -4s; }
.table:nth-of-type(4) .table-scene { animation-delay: -1s; }
.table:nth-of-type(5) .table-scene { animation-delay: -3s; }
@keyframes idleDrift { from { transform: translateY(0); } to { transform: translateY(-3px); } }

/* parallax: scenes drift gently against the cursor (vars from app.js) */
.table-scene svg {
  width: 100%; height: 100%; display: block;
  transform: translate(calc(var(--mx) * var(--pf, .5)),
                       calc(var(--my) * var(--pf, .5))) scale(1.07);
  will-change: transform;
}
.table:nth-of-type(1) .table-scene svg { --pf: .45; }
.table:nth-of-type(2) .table-scene svg { --pf: .75; }
.table:nth-of-type(3) .table-scene svg { --pf: .55; }
.table:nth-of-type(4) .table-scene svg { --pf: .85; }
.table:nth-of-type(5) .table-scene svg { --pf: .65; }

.table-info { display: flex; flex-direction: column; gap: 6px; padding: 16px 20px 20px; }
.table-kicker { font-size: 10px; letter-spacing: .3em; color: var(--gold-dim); }
.table-name { font: 700 23px/1.15 var(--disp); letter-spacing: .04em; color: var(--gold-hi); }
.table-blurb { font-size: 14px; font-weight: 300; color: var(--muted); min-height: 2.6em; }
.table-meta {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-top: 6px; flex-wrap: wrap;
}
.edge {
  font-size: 9.5px; letter-spacing: .12em; color: #c8b183;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px;
  white-space: nowrap;
}
.cta {
  font-size: 12px; letter-spacing: .18em; color: var(--gold);
  transition: transform .35s, text-shadow .35s;
}
.table:hover .cta, .table:focus-visible .cta {
  transform: translateX(4px);
  text-shadow: 0 0 14px rgba(226, 183, 85, .8);
}

/* ── 6 · game scenes ────────────────────────────────────────────────────── */
/* shared card + label styles (SVG text) */
.card { transform-box: fill-box; transform-origin: 50% 50%;
        transition: transform .55s cubic-bezier(.22, 1.2, .32, 1); }
.card-rank { font: 700 14px var(--body); fill: #211d16; }
.card-pip  { font-size: 12px; fill: #211d16; }
.card-big  { font-size: 30px; fill: #211d16; text-anchor: middle; }
.card-rank.red, .card-pip.red, .card-big.red { fill: #b3202e; }
.scene-arc { font: 500 9px var(--body); letter-spacing: 3px; fill: var(--gold); opacity: .5; }

/* — blackjack: the shoe deals, the hand fans, 21 stamps in — */
.bj-c1 { transform: translate(108px, 60px) rotate(-9deg); }
.bj-c2 { transform: translate(150px, 68px) rotate(7deg); }
.t-blackjack:hover .bj-c1, .t-blackjack:focus-visible .bj-c1 { transform: translate(98px, 50px)  rotate(-17deg); }
.t-blackjack:hover .bj-c2, .t-blackjack:focus-visible .bj-c2 { transform: translate(160px, 55px) rotate(15deg); }
.bj-badge {
  transform-box: fill-box; transform-origin: 50% 50%;
  transform: translate(226px, 112px) scale(0);
  transition: transform .5s cubic-bezier(.3, 1.7, .4, 1) .08s;
}
.t-blackjack:hover .bj-badge, .t-blackjack:focus-visible .bj-badge { transform: translate(226px, 112px) scale(1); }
.badge-txt { font: 700 15px var(--disp); fill: #241b0c; }

/* — roulette: always turning; on hover the wheel takes off and the ball flies — */
.rl-spin, .rl-orbit, .rl-wheel { transform-box: view-box; transform-origin: 160px 100px; }
.rl-spin  { animation: crestSpin 80s linear infinite; }
.rl-orbit { animation: crestSpin 12s linear infinite reverse; }
.t-roulette:hover .rl-wheel, .t-roulette:focus-visible .rl-wheel { animation: crestSpin 2.6s linear infinite; }
.t-roulette:hover .rl-orbit, .t-roulette:focus-visible .rl-orbit { animation-duration: 12s; } /* relative blur comes from the wheel */

/* — baccarat: the squeeze — the back card folds away to reveal the natural — */
.bc-label { font: 600 11px var(--disp); letter-spacing: 3px; fill: var(--gold); opacity: .85; }
.bc-p     { transform: translate(58px, 58px) rotate(-3deg); }
.bc-stack { transform-box: fill-box; transform-origin: 50% 50%;
            transform: translate(214px, 58px) rotate(3deg); }
.bc-back {
  transform-box: fill-box; transform-origin: 50% 100%;
  transition: transform 1.05s cubic-bezier(.65, 0, .22, 1) .06s;
}
.t-baccarat:hover .bc-back, .t-baccarat:focus-visible .bc-back { transform: scaleY(.06) skewX(-4deg); }
.bc-natural {
  font: 500 10px var(--body); letter-spacing: 3px; fill: #f2d68a;
  opacity: 0; transition: opacity .5s ease .6s;
}
.t-baccarat:hover .bc-natural, .t-baccarat:focus-visible .bc-natural { opacity: 1; }

/* — craps: dice leap, tumble and land; the seven flashes — */
/* dice geometry is centred on local (0,0), so origin 0 0 spins them in place */
.cr-d1, .cr-d2 { transform-box: view-box; transform-origin: 0 0; }
.cr-d1 { transform: translate(128px, 100px) rotate(-8deg); }
.cr-d2 { transform: translate(184px, 112px) rotate(12deg); }
.t-craps:hover .cr-d1, .t-craps:focus-visible .cr-d1 { animation: crTumble1 .95s cubic-bezier(.3, .9, .35, 1.05); }
.t-craps:hover .cr-d2, .t-craps:focus-visible .cr-d2 { animation: crTumble2 .95s cubic-bezier(.3, .9, .35, 1.05) .07s; }
@keyframes crTumble1 {
  0%   { transform: translate(128px, 100px) rotate(-8deg); }
  42%  { transform: translate(112px, 56px)  rotate(-250deg); }
  74%  { transform: translate(132px, 104px) rotate(-345deg); }
  100% { transform: translate(128px, 100px) rotate(-368deg); }
}
@keyframes crTumble2 {
  0%   { transform: translate(184px, 112px) rotate(12deg); }
  42%  { transform: translate(202px, 62px)  rotate(280deg); }
  74%  { transform: translate(180px, 116px) rotate(350deg); }
  100% { transform: translate(184px, 112px) rotate(372deg); }
}
.cr-win {
  font: 600 12px var(--disp); letter-spacing: 2px; fill: #f2d68a;
  opacity: 0;
}
.t-craps:hover .cr-win, .t-craps:focus-visible .cr-win { animation: crWin .55s ease .5s both; }
@keyframes crWin {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* — poker: hole cards fan, the stack shoves, ALL IN glows — */
.pk-c1 { transform: translate(140px, 50px) rotate(-5deg); }
.pk-c2 { transform: translate(172px, 54px) rotate(8deg); }
.t-poker:hover .pk-c1, .t-poker:focus-visible .pk-c1 { transform: translate(128px, 42px) rotate(-15deg); }
.t-poker:hover .pk-c2, .t-poker:focus-visible .pk-c2 { transform: translate(186px, 44px) rotate(18deg); }
.pk-chips {
  transform-box: fill-box; transform-origin: 50% 50%;
  transition: transform .7s cubic-bezier(.3, .9, .3, 1.1) .05s;
}
.t-poker:hover .pk-chips, .t-poker:focus-visible .pk-chips { transform: translate(38px, -10px) rotate(2deg); }
.pk-allin {
  font: 700 17px var(--disp); letter-spacing: 2px; fill: var(--gold);
  opacity: 0; transform: translateY(6px);
  transform-box: fill-box; transform-origin: 50% 50%;
  transition: opacity .5s ease .3s, transform .5s ease .3s;
}
.t-poker:hover .pk-allin, .t-poker:focus-visible .pk-allin { opacity: 1; transform: translateY(0); }

/* — scroll payoffs (touch): mirror every :hover reveal under .table.in-view so
     phones, which never fire :hover, still get the full card craft as each table
     scrolls up. app.js (§3½) tags the tiles; desktop keeps its hover states. — */
.table.in-view .cta { transform: translateX(4px); text-shadow: 0 0 14px rgba(226, 183, 85, .8); }

.t-blackjack.in-view .bj-c1 { transform: translate(98px, 50px)  rotate(-17deg); }
.t-blackjack.in-view .bj-c2 { transform: translate(160px, 55px) rotate(15deg); }
.t-blackjack.in-view .bj-badge { transform: translate(226px, 112px) scale(1); }

.t-roulette.in-view .rl-wheel { animation: crestSpin 2.6s linear infinite; }
.t-roulette.in-view .rl-orbit { animation-duration: 12s; }

.t-baccarat.in-view .bc-back { transform: scaleY(.06) skewX(-4deg); }
.t-baccarat.in-view .bc-natural { opacity: 1; }

.t-craps.in-view .cr-d1 { animation: crTumble1 .95s cubic-bezier(.3, .9, .35, 1.05); }
.t-craps.in-view .cr-d2 { animation: crTumble2 .95s cubic-bezier(.3, .9, .35, 1.05) .07s; }
.t-craps.in-view .cr-win { animation: crWin .55s ease .5s both; }

.t-poker.in-view .pk-c1 { transform: translate(128px, 42px) rotate(-15deg); }
.t-poker.in-view .pk-c2 { transform: translate(186px, 44px) rotate(18deg); }
.t-poker.in-view .pk-chips { transform: translate(38px, -10px) rotate(2deg); }
.t-poker.in-view .pk-allin { opacity: 1; transform: translateY(0); }

/* ── 7 · footer ─────────────────────────────────────────────────────────── */
.colophon {
  max-width: 640px; margin: 0 auto;
  padding: 8px 24px 64px; text-align: center;
}
.colophon-lede {
  margin: 26px 0 10px;
  font: 700 13px var(--disp); letter-spacing: .3em; color: var(--gold);
  text-transform: uppercase;
}
.colophon p { color: var(--muted); font-weight: 300; font-size: 14.5px; }
.colophon em { color: #d9c391; }
.colophon-fine { font-size: 12.5px; opacity: .8; }

/* ── 8 · responsive ─────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .floor { grid-template-columns: repeat(2, 1fr); gap: 20px; padding: 14px 20px 52px; }
  .table, .table:nth-of-type(4), .table:nth-of-type(5) { grid-column: auto; }
  .table:nth-of-type(5) { grid-column: 1 / -1; max-width: 540px; width: 100%; justify-self: center; }
}
@media (max-width: 900px) {
  .desk-live { grid-template-columns: 1fr 1fr; gap: 14px 22px; }
  .desk-progress { grid-column: 1 / -1; }
  .desk-live .desk-btn { grid-column: 1 / -1; justify-self: center; }
}
@media (max-width: 620px) {
  /* phones: compact 2-up cards so the whole floor scrolls in a glance */
  .floor { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 12px 14px 44px; }
  .table:nth-of-type(5) { grid-column: 1 / -1; max-width: none; }
  .table-scene { aspect-ratio: 16 / 10; }
  .table-info { padding: 9px 11px 12px; gap: 3px; }
  .table-kicker { font-size: 8.5px; letter-spacing: .12em; }
  .table-name { font-size: 15px; letter-spacing: .02em; }
  .table-blurb { display: none; } /* name + edge/CTA carry the card; keeps it short */
  .table-meta { font-size: 9.5px; }
  .hall { padding-top: 30px; }
  #soundToggle { top: 12px; right: 12px; }
  .desk { padding: 0 16px 8px; }
  .desk-card { padding: 14px 16px; }
  .desk-empty { justify-content: center; text-align: center; }
}
/* the poker card spans full width on phones — give it a slightly taller scene
   so the lone wide card doesn't look starved next to the 2-up grid above it */
@media (max-width: 620px) {
  .table:nth-of-type(5) .table-scene { aspect-ratio: 16 / 7; }
}
@media (max-width: 420px) {
  .desk-live { grid-template-columns: 1fr; }
}

/* ── 9 · reduced motion: keep the glamour, drop the choreography ────────── */
@media (prefers-reduced-motion: reduce) {
  #entrance { display: none; }
  body:not(.lit) { overflow: auto; }
  .rise, body.lit .rise { animation: none; opacity: 1; transform: none; }
  .lights, .table-scene,
  .crest-glint, .crest-orbit, .crest-halo, .crest-rays, .crest-sun,
  .crest-flourish, .desk-reveal .desk-card, .desk-reveal .desk-live > *,
  .rl-spin, .rl-orbit, .rl-wheel,
  .cr-d1, .cr-d2 { animation: none !important; }
  .table, .card, .bj-badge, .bc-back, .pk-chips, .pk-allin, .cta,
  .cr-win, .bc-natural, #soundToggle,
  .desk-fill, .desk-btn,
  .rm-inner, .rm-stat, .rm-prog-fill { transition: none !important; }
  /* rating band: hold still — no glint sweep, no entrance, no lift */
  .rm-glint { display: none !important; }
  .rating-marquee.rm-live .rm-inner { animation: none !important; }
  .rm-inner:hover, .rm-inner:focus-within, .rm-stat:hover { transform: none; }
  .desk-btn:hover, .desk-btn:focus-visible { transform: none; }
  .table:hover, .table:focus-visible { transform: none; }
  .table-scene svg { transform: scale(1.07); }
  /* hover states resolve instantly but still inform */
  .t-craps:hover .cr-win, .t-craps:focus-visible .cr-win { animation: none !important; opacity: 1; }
  .bj-badge { transform: translate(226px, 112px) scale(1); }
}

/* ── tonight so far · per-table ledger ── */
.desk-ledger {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(226, 183, 85, 0.18);
}
.desk-ledger-rows {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 8px;
}
.desk-ledger-row {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid rgba(226, 183, 85, 0.22);
  border-radius: 999px;
  background: rgba(226, 183, 85, 0.05);
  font-size: 12.5px;
}
.desk-ledger-row em { font-style: normal; opacity: 0.8; }
.desk-ledger-row b { font-variant-numeric: tabular-nums; }
.desk-ledger-row.is-up b { color: #3ddc84; }
.desk-ledger-row.is-down b { color: #ff5d6c; }

/* ── trophy case ── */
.trophies {
  max-width: var(--wrap);
  margin: 34px auto 0;
  padding: 0 clamp(16px, 4vw, 40px);
}
.trophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.trophy {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid rgba(226, 183, 85, 0.14);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(24, 20, 12, 0.55), rgba(12, 10, 8, 0.55));
  transition: opacity 0.25s ease, filter 0.25s ease;
}
/* locked previews: readable enough to pull the player forward, dim enough to
   read as "not yet earned" (bumped from 0.45 so the how-to-earn copy is legible) */
.trophy.is-locked {
  opacity: 0.68;
  filter: grayscale(0.5);
}
.trophy.is-earned {
  opacity: 1;
  filter: none;
  border-color: rgba(226, 183, 85, 0.45);
  box-shadow: 0 0 18px rgba(226, 183, 85, 0.08);
}
.trophy-icon { position: relative; font-size: 22px; line-height: 1.2; }
/* small padlock badge tucked on the previewed icon */
.trophy-lock {
  position: absolute; right: -6px; bottom: -4px;
  font-size: 11px; line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6));
}
.trophy-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.trophy-body b { font-size: 13px; letter-spacing: 0.03em; color: #e7c574; }
.trophy-body em { font-style: normal; font-size: 11.5px; opacity: 0.8; line-height: 1.35; }

/* ═══ casino rating · headline band under the hero ═══════════════════════════
   The pit's math promoted to the top of the house: two hero stats (Tier
   Credits + Theo) in big gold tabular mono, an animated tier-progress bar, a
   slow gold glint sweep echoing the crest, hover lift, and a JS count-up on
   first reveal. #deskRating is the wrapper app.js toggles [hidden]. */
.rating-marquee {
  max-width: var(--wrap);
  margin: 4px auto 6px;
  padding: 0 24px;
}
.rating-marquee[hidden] { display: none; }

.rm-inner {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 20px clamp(18px, 4vw, 34px) 18px;
  background:
    radial-gradient(130% 150% at 12% -30%, rgba(226, 183, 85, .16), transparent 58%),
    linear-gradient(180deg, #1b140d, #0d0a08);
  border: 1px solid rgba(226, 183, 85, .34);
  box-shadow: 0 22px 52px -26px rgba(0, 0, 0, .9),
              inset 0 1px 0 rgba(247, 223, 154, .10);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1), box-shadow .5s, border-color .5s;
}
.rm-inner:hover, .rm-inner:focus-within {
  transform: translateY(-3px);
  border-color: rgba(226, 183, 85, .6);
  box-shadow: 0 30px 62px -26px rgba(0, 0, 0, .92), 0 0 48px -14px rgba(226, 183, 85, .42);
}
/* first-reveal entrance (app.js adds .rm-live when the band un-hides) */
.rating-marquee.rm-live .rm-inner { animation: rmRise .7s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rmRise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* the gold glint — a slow diagonal sweep, kin to the crest's rotating glint */
.rm-glint {
  position: absolute; inset: -1px; z-index: 3; pointer-events: none;
  background: linear-gradient(115deg,
    transparent 38%, rgba(255, 247, 221, .30) 49%, rgba(255, 247, 221, .12) 55%, transparent 66%);
  transform: translateX(-135%);
  animation: rmGlint 7s ease-in-out infinite;
  mix-blend-mode: screen;
}
@keyframes rmGlint { 0%, 62% { transform: translateX(-135%); } 100% { transform: translateX(135%); } }

.rm-head {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px 16px; flex-wrap: wrap;
}
.rm-kicker {
  margin: 0; font-size: 10px; letter-spacing: .34em;
  color: var(--gold-dim); text-transform: uppercase;
}
.rm-tier {
  font: 600 13px var(--body); letter-spacing: .05em;
  color: #f4d888;
  border: 1px solid rgba(226, 183, 85, .5);
  border-radius: 999px; padding: 5px 14px;
  background: rgba(226, 183, 85, .10);
  box-shadow: inset 0 0 18px -6px rgba(247, 223, 154, .55);
  white-space: nowrap;
}

.rm-hero {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 16px;
}
.rm-stat {
  border-radius: 14px; padding: 13px 16px;
  background: linear-gradient(180deg, rgba(226, 183, 85, .09), rgba(226, 183, 85, .02));
  border: 1px solid rgba(226, 183, 85, .22);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s, border-color .35s;
}
.rm-stat:hover {
  transform: translateY(-2px);
  border-color: rgba(226, 183, 85, .5);
  box-shadow: 0 0 30px -10px rgba(226, 183, 85, .5);
}
.rm-stat-label {
  display: block;
  font-size: 9.5px; line-height: 1.3; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold-dim);
}
/* the two hero labels reserve the same height so their big numbers line up,
   even when one label wraps to two lines on a narrow tile */
.rm-hero .rm-stat-label { min-height: 2.6em; }
.rm-stat-num {
  display: block; margin-top: 5px;
  font: 700 clamp(30px, 8vw, 46px)/1 var(--mono);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
  background: linear-gradient(#fbeab4, #e2b755 55%, #b0842f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* count-up glow: the number burns brighter while it's still landing */
.rm-stat-num.rm-counting { filter: drop-shadow(0 0 14px rgba(247, 223, 154, .5)); }

.rm-prog { position: relative; z-index: 2; margin-top: 16px; }
.rm-prog-bar {
  display: block; height: 8px; border-radius: 999px;
  background: rgba(226, 183, 85, .12);
  border: 1px solid rgba(226, 183, 85, .2);
  overflow: hidden;
}
.rm-prog-fill {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, #9a7a3a, #e2b755 55%, #f7df9a);
  box-shadow: 0 0 14px rgba(226, 183, 85, .5);
  transition: width 1s cubic-bezier(.2, .7, .2, 1);
}
.rm-next {
  margin: 8px 0 0; font-size: 12px; letter-spacing: .02em; color: #cdb787;
}

.rm-sub {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 8px 30px; margin-top: 14px;
}
.rm-substat { display: flex; flex-direction: column; gap: 3px; }
.rm-substat b {
  font: 600 15px var(--mono); font-variant-numeric: tabular-nums;
  color: var(--ink); white-space: nowrap;
}

/* "What the edge cost you" — the end-of-session payoff card */
.rm-edge {
  position: relative; z-index: 2;
  margin-top: 16px; padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid rgba(226, 183, 85, .3);
  background: linear-gradient(180deg, rgba(226, 183, 85, .10), rgba(226, 183, 85, .03));
  display: flex; flex-direction: column; gap: 5px;
}
.rm-edge[hidden] { display: none; }
.edge-cost-kicker {
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold, #e2b755); opacity: .85;
}
.edge-cost-headline {
  font: 700 clamp(14px, 2.4vw, 17px)/1.35 var(--body);
  font-variant-numeric: tabular-nums; color: #f4ead2;
}
.edge-cost-sub { font-size: 12.5px; line-height: 1.5; opacity: .8; }

.rm-fine {
  position: relative; z-index: 2;
  margin: 14px 0 0; font-size: 11px; line-height: 1.55; opacity: .62;
}
.rm-fine em { font-style: italic; color: #d9c391; }

@media (max-width: 620px) {
  .rating-marquee { padding: 0 16px; }
  .rm-inner { padding: 16px 15px 15px; border-radius: 15px; }
  .rm-hero { gap: 10px; }
  .rm-stat { padding: 11px 12px; }
  .rm-sub { gap: 8px 22px; }
}
