/* GameTableLayout: Z-0 table, Z-10 disc + hub, Z-20 section light, Z-30 overlay, Z-40 crown.
   Game stylesheets load later, so these selectors carry an extra `:root body`. */
:root body .rc-table-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 18px;
  background-color: #120d0a;
  background-position: 50% 0;
  background-size: cover;
  background-repeat: no-repeat;
}
/* The stage canvas keeps the table hole concentric with the wheel; royal-table.js sets the variables. */
:root body .rc-table-stage[style*="--rc-bd-w"] {
  background-size: var(--rc-bd-w) auto;
  background-position: var(--rc-bd-x) var(--rc-bd-y);
}
:root body .rc-bg--wheel { background-image: url(assets/figma/stage/wheel.webp?v=20261104-wood); }
:root body .rc-bg--double { background-image: url(assets/figma/stage/double.webp?v=20261104-wood); }
:root body .rc-bg--dream { background-image: url(assets/figma/stage/dream.webp?v=20261104-wood); }
:root body .rc-bg--crazy { background-image: url(assets/figma/stage/crazy.webp?v=20261104-wood); }
:root body .rc-table-stage > .rc-table-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background: url(assets/figma/bg/overlay.webp) 50% 0 / cover no-repeat;
  mix-blend-mode: screen;
  opacity: .55;
}
/* Taller than the disc so the rim clears the rounded clip, with room for the pointer above. */
:root body .wheel-ornament.rc-table-stage { aspect-ratio: 1 / 1.2; padding: 12% 5% 7%; box-sizing: border-box; }
:root body .double-stage.rc-table-stage,
:root body .dream-stage.rc-table-stage,
:root body .crazy-stage.rc-table-stage { padding: 54px 0 18px; }
:root body .lightning-stage.rc-table-stage { border-radius: 18px 18px 0 0; }

:root body .rc-table { position: relative; isolation: isolate; }
:root body .rc-table > .double-pointer,
:root body .rc-table > .dream-pointer,
:root body .rc-table > .crazy-pointer,
:root body .rc-table > .double-hub,
:root body .rc-table > .dream-hub,
:root body .rc-table > .crazy-hub { display: none; }
:root body .rc-table > .double-countdown,
:root body .rc-table > .dream-countdown,
:root body .rc-table > .crazy-countdown { z-index: 45; }

:root body .rc-textured { filter: drop-shadow(0 14px 22px #000b) drop-shadow(0 3px 5px #0009); }
/* The pointer rides above the disc; the stage itself clips. */
:root body .rc-table-stage .rc-wheel-stack.rc-textured { overflow: visible; }
:root body .rc-textured > svg,
:root body .rc-textured .rc-wheel-rotor > svg { visibility: hidden; filter: none; }
:root body .rc-textured .rc-wheel-foreground > svg { visibility: visible; }
:root body .rc-keep-labels .rc-wheel-rotor text { visibility: visible; }
:root body .rc-textured .rc-wheel-texture { visibility: hidden; }

:root body .rc-table-disc {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  pointer-events: none;
}
:root body .rc-table--crazy-bonus .rc-table-disc { inset: 5%; width: 90%; height: 90%; }
:root body .rc-table--crazy-bonus .rc-textured > svg { visibility: visible; }
:root body .rc-table--crazy-bonus .rc-textured { filter: none; }
:root body .rc-table--crazy-bonus .crazy-bonus-sector-label { fill: #fff; stroke: #0008; stroke-width: 2.4px; paint-order: stroke; }

/* The roulette ball orbit sits over the pocket ring of the texture. */
:root body .rc-table--wheel .rc-wheel-ball-travel > svg,
:root body .rc-table--lightning .rc-wheel-ball-travel > svg { transform: scale(.9); }
:root body .rc-table--wheel .roulette-ball,
:root body .rc-table--lightning .roulette-ball { fill: #f4efe6; stroke: #6d5b48; stroke-width: .8; }

:root body .rc-table-hub {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: opacity .35s ease, transform .45s cubic-bezier(.2,.8,.2,1);
}
:root body .rc-table-hub img { display: block; width: 100%; height: auto; filter: drop-shadow(0 4px 8px #000c); }
:root body .rc-table--double .rc-table-hub {
  width: 19%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #3b2e25, #17110d 70%);
  box-shadow: inset 0 0 0 2px #0c0907, inset 0 0 0 4px #6b5236, 0 6px 14px #000b;
}
:root body .rc-table--double .rc-table-hub img { width: 58%; }
:root body .rc-table--dream .rc-table-hub { width: 40%; }
:root body .rc-table--crazy .rc-table-hub { width: 36%; }
:root body .has-countdown .rc-table-hub { opacity: 0; transform: translate(-50%, -50%) scale(.86); }

:root body .rc-table-section {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
:root body .rc-table-section.is-lit { animation: rc-section-in .5s cubic-bezier(.2,.8,.2,1) forwards, rc-section-glow 1.4s .5s ease-in-out infinite alternate; }
@keyframes rc-section-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rc-section-glow { from { opacity: 1; } to { opacity: .6; } }

/* Royal Coin pointer: crown + C + chevron; the tip bites 2% into the rim and the pivot sits in the crown. */
:root body .rc-crown {
  --rc-pointer-w: clamp(30px, 9%, 54px);
  position: absolute;
  z-index: 40;
  left: 50%;
  top: 2.2%;
  width: var(--rc-pointer-w);
  transform: translate(-50%, -100%);
  pointer-events: none;
  filter: drop-shadow(0 4px 5px #000b) drop-shadow(0 1px 1px #0009);
}
:root body .rc-crown svg { display: block; width: 100%; height: auto; overflow: visible; transform-origin: 50% 12%; }
:root body .rc-crown .rc-pointer-crown { fill: var(--rc-pointer-crown, #ddc188); }
:root body .rc-crown .rc-pointer-body { fill: var(--rc-pointer-body, #fff); }
:root body .rc-crown .rc-pointer-notch { fill: var(--rc-pointer-notch, #827f7d); }

@media (prefers-reduced-motion: reduce) {
  :root body .rc-table-section.is-lit { animation: none; opacity: 1; }
}
