/* Production skin for bet controls and bonus rounds (assets from Figma "Игровые элементы").
   Game stylesheets load later, so selectors carry an extra `:root body`. */
:root {
  --rc-gold: #ddc188;
  --rc-gold-hi: #ffe3a6;
  --rc-wood: #1e1915;
  --rc-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------------------------------------------------------- bet chips */
:root body .double-choice,
:root body .dream-choice,
:root body .crazy-choice {
  transition: transform .32s var(--rc-spring), box-shadow .25s ease, border-color .25s ease, opacity .2s ease, filter .25s ease;
  -webkit-tap-highlight-color: transparent;
}
:root body .double-choice:active:not(:disabled),
:root body .dream-choice:active:not(:disabled),
:root body .crazy-choice:active:not(:disabled) { transform: scale(.92); transition-duration: .09s; }

:root body .double-choices { gap: 10px; }
:root body .double-choice {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 4px;
  min-height: 0;
  padding: 10px 4px 9px;
  border: 1px solid #ffffff14;
  border-radius: 16px;
  background: linear-gradient(180deg, #2b221bcc, #15100dee);
  box-shadow: inset 0 1px #ffffff12, 0 6px 14px #0007;
}
:root body .double-choice::before {
  content: '';
  display: block;
  width: min(74px, 78%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--rc-token) center / contain no-repeat;
  filter: drop-shadow(0 6px 8px #000b);
  transition: transform .4s var(--rc-spring), filter .3s ease;
}
:root body .double-blue { --rc-token: url(assets/figma/double/token-blue.webp); }
:root body .double-gold { --rc-token: url(assets/figma/double/token-gold.webp); }
:root body .double-red { --rc-token: url(assets/figma/double/token-red.webp); }
:root body .double-green { --rc-token: url(assets/figma/double/token-green.webp); }
:root body .double-choice > span { font-size: 12px; color: #e9dcc4; letter-spacing: .02em; }
:root body .double-choice > b { font-size: 18px; line-height: 1; color: #fff3da; }
:root body .double-choice > small { font-size: 10px; color: #cdb99a; }
:root body .double-choice:hover:not(:disabled)::before { transform: translateY(-3px) rotate(-6deg); }
:root body .double-choice.selected {
  border-color: var(--rc-gold);
  box-shadow: inset 0 0 0 1px #ddc18866, 0 0 0 1px #ddc18833, 0 0 22px #f2c46a55, 0 8px 18px #000a;
}
:root body .double-choice.selected::before { filter: drop-shadow(0 0 10px #ffd36fcc) drop-shadow(0 6px 8px #000b); transform: scale(1.05); }
:root body .double-choice.selected > small { color: var(--rc-gold-hi); }

:root body .dream-choice,
:root body .crazy-choice {
  border-radius: 14px;
  border-color: #ffffff1c;
  background: radial-gradient(120% 90% at 50% 0%, #ffffff1f, transparent 60%), linear-gradient(180deg, var(--rc-chip, #3b2f25), #120d0a);
  box-shadow: inset 0 1px #ffffff1a, inset 0 -2px #0006, 0 6px 14px #0007;
}
:root body .dream-choice.selected,
:root body .crazy-choice.selected {
  border-color: var(--rc-gold);
  box-shadow: inset 0 0 0 1px #ddc18877, 0 0 22px #f2c46a50, 0 8px 18px #000a;
}
:root body .dream-amber, :root body .crazy-amber { --rc-chip: #8a5a23; }
:root body .dream-blue, :root body .crazy-blue { --rc-chip: #225b77; }
:root body .dream-purple, :root body .crazy-purple { --rc-chip: #5b2f7a; }
:root body .dream-green, :root body .crazy-green { --rc-chip: #3f6a1f; }
:root body .dream-red, :root body .crazy-red { --rc-chip: #772d22; }
:root body .dream-gold, :root body .crazy-gold { --rc-chip: #9a7420; }

:root body .wheel-choice,
:root body .dice-choice { transition: transform .32s var(--rc-spring), box-shadow .25s ease; }
:root body .wheel-choice:active:not(:disabled),
:root body .dice-choice:active:not(:disabled) { transform: scale(.94); transition-duration: .09s; }
:root body .wheel-choice.selected,
:root body .dice-choice.selected { box-shadow: inset 0 0 0 1px #ddc18899, 0 0 18px #f2c46a44; }

/* --------------------------------------------------------- lightning */
:root body .lightning-sign-board {
  border-color: #6b5236;
  background: radial-gradient(120% 80% at 50% 0%, #ffffff12, transparent 60%), linear-gradient(180deg, #2a211b, #120e0b);
}
:root body .lightning-reel {
  height: 46px;
  border: 0;
  border-radius: 10px;
  background: url(assets/figma/lightning/point-dark.svg) center / cover no-repeat;
  box-shadow: -3px 3px 0 #0007;
}
:root body .lightning-reel.reel-multiplier { background-image: url(assets/figma/lightning/point-green.svg); }
:root body .lightning-reel::after { background: linear-gradient(#0008, transparent 30% 70%, #0008); }
:root body .lightning-reel-track span { height: 46px; color: #fff; font-weight: 700; text-shadow: -2px 2px 0 #000a; }
:root body .lightning-sign.is-charged .lightning-reel { background-image: url(assets/figma/lightning/point-red.svg); }
:root body .lightning-sign.is-charged .lightning-reel.reel-multiplier { background-image: url(assets/figma/lightning/point-green.svg); }
:root body .lightning-sign.is-charged .lightning-sign-board { animation: rc-shake .55s cubic-bezier(.36,.07,.19,.97) both; }
:root body .lightning-sign.is-charged .lightning-reel-row { animation: rc-panel-in .5s var(--rc-spring) both; }
:root body .lightning-sign.is-charged .lightning-reel-row:nth-of-type(2) { animation-delay: .08s; }
:root body .lightning-sign.is-charged .lightning-reel-row:nth-of-type(3) { animation-delay: .16s; }
:root body .lightning-sign.is-charged .lightning-reel-row:nth-of-type(4) { animation-delay: .24s; }
:root body .lightning-sign.is-charged .lightning-reel-row:nth-of-type(5) { animation-delay: .32s; }
:root body .lightning-sign-board::after {
  content: '';
  position: absolute;
  inset: -40% -10%;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(104deg, transparent 46%, #fff8 48.5%, #fff 49.3%, #fff8 50%, transparent 52.5%),
    radial-gradient(closest-side, #fff4c0aa, transparent);
  mix-blend-mode: screen;
}
:root body .lightning-sign.is-charged .lightning-sign-board::after { animation: rc-bolt .7s ease-out both; }
:root body .lightning-stage.is-revealing::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 35;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 260' fill='none' stroke-linejoin='bevel'%3E%3Cg stroke='%23f2c46a' stroke-width='3.4' opacity='.4'%3E%3Cpath d='M128 0l-14 40 12 3-22 46 13 2-27 58 10 2-14 30'/%3E%3Cpath d='M58 10l13 32-10 2 19 33-11 3 16 34'/%3E%3C/g%3E%3Cg stroke='%23fffdf2' stroke-width='1.3'%3E%3Cpath d='M128 0l-14 40 12 3-22 46 13 2-27 58 10 2-14 30'/%3E%3Cpath d='M58 10l13 32-10 2 19 33-11 3 16 34'/%3E%3Cpath d='M104 89l-15 9M91 149l14 12M80 77l14-6'/%3E%3C/g%3E%3C/svg%3E") 50% 0 / 100% auto no-repeat;
  animation: rc-strike 1.9s steps(1, end) infinite;
}
:root body .lightning-stage.is-revealing .rc-table { animation: rc-strike-jolt 1.9s ease-out infinite; }
@keyframes rc-strike { 0%, 100% { opacity: 0; } 4% { opacity: 1; } 7% { opacity: 0; } 10% { opacity: .85; } 16% { opacity: 0; } }
@keyframes rc-strike-jolt { 0%, 3%, 20%, 100% { translate: 0 0; } 5% { translate: 0 2px; } 11% { translate: 0 -1px; } }
@keyframes rc-shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  15% { transform: translateX(-5px) rotate(-1.4deg); }
  30% { transform: translateX(5px) rotate(1.2deg); }
  45% { transform: translateX(-4px) rotate(-.8deg); }
  60% { transform: translateX(3px) rotate(.5deg); }
  75% { transform: translateX(-2px); }
}
@keyframes rc-panel-in { from { opacity: 0; transform: translateY(-10px) scale(.86); } to { opacity: 1; transform: none; } }
@keyframes rc-bolt { 0% { opacity: 0; } 8% { opacity: 1; } 18% { opacity: .2; } 26% { opacity: .9; } 100% { opacity: 0; } }

/* -------------------------------------------------------------- dice */
:root body .dice-screen .dice-stage {
  background: #120d0a url(assets/figma/bg/dice.webp) 50% 50% / cover no-repeat;
  border-color: #6b523677;
}
:root body .dice-screen .dice-stage::before {
  background: url(assets/figma/bg/overlay.webp) 50% 0 / cover no-repeat;
  mix-blend-mode: screen;
  opacity: .5;
  border: 0;
  box-shadow: none;
  inset: 0;
}
:root body .dice-screen .dice-stage::after { display: none; }
:root body .dice-screen .dice-cube-face {
  padding: 0;
  border: 0;
  border-radius: 18%;
  background: #efe4cc var(--rc-face) 50% 0 / 100% auto no-repeat;
  box-shadow: inset 0 0 0 1px #0000000f, inset 0 -6px 10px #7a644222;
}
:root body .dice-screen .dice-cube i { display: none; }
:root body .dice-screen .dice-cube-face[data-value="1"] { --rc-face: url(assets/figma/dice/face-1.webp); }
:root body .dice-screen .dice-cube-face[data-value="2"] { --rc-face: url(assets/figma/dice/face-2.webp); }
:root body .dice-screen .dice-cube-face[data-value="3"] { --rc-face: url(assets/figma/dice/face-3.webp); }
:root body .dice-screen .dice-cube-face[data-value="4"] { --rc-face: url(assets/figma/dice/face-4.webp); }
:root body .dice-screen .dice-cube-face[data-value="5"] { --rc-face: url(assets/figma/dice/face-5.webp); }
:root body .dice-screen .dice-cube-face[data-value="6"] { --rc-face: url(assets/figma/dice/face-6.webp); }
:root body .dice-screen .dice-face-right,
:root body .dice-screen .dice-face-left { filter: brightness(.82); }
:root body .dice-screen .dice-face-bottom { filter: brightness(.7); }
:root body .dice-screen .dice-face-top { filter: brightness(1.06); }
:root body .dice-screen .dice-ground-shadow { background: radial-gradient(ellipse, #000d, #0000 70%); opacity: .7; }

/* ------------------------------------------------------- coin flip */
:root body .crazy-coin-face {
  border: 0;
  box-shadow: none;
  background: var(--rc-coin) center / contain no-repeat;
}
:root body .crazy-coin-face::before,
:root body .crazy-coin-face::after { display: none; }
:root body .crazy-coin-face.front { --rc-coin: url(assets/figma/coin/blue.svg); }
:root body .crazy-coin-face.back { --rc-coin: url(assets/figma/coin/red.svg); transform: rotateX(180deg) translateZ(7px); }
:root body .crazy-coin-face .crazy-coin-seal { display: none; }
:root body .crazy-coin-face span { position: absolute; top: 18%; font-size: 9px; letter-spacing: .14em; color: #ffffffcc; }
:root body .crazy-coin-face strong { position: relative; z-index: 1; font-size: 34px; font-weight: 700; color: #fff; text-shadow: -2px 2px 0 #0009; }
:root body .crazy-coin-edge { background: linear-gradient(0deg, #2a1c12, #8d6a44 30%, #d7b37a 50%, #6b4d31 70%, #21160e); }
:root body .crazy-coin-value { border-radius: 14px; }

/* -------------------------------------------------------- cash hunt */
:root body .crazy-cash-grid { grid-auto-rows: auto; gap: 6px; perspective: 900px; }
:root body .crazy-cash-target,
:root body .crazy-cash-target.revealed,
:root body .crazy-cash-target:not(.revealed),
:root body .crazy-cash-target.selected,
:root body .crazy-cash-target:hover:not(:disabled) {
  height: auto;
  aspect-ratio: 104 / 80;
  padding: 0;
  border: 0;
  outline: 0;
  background: none;
  box-shadow: none;
}
:root body .ct-cash-card {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform .7s var(--rc-spring);
}
:root body .crazy-cash-target.revealed .ct-cash-card { transform: rotateY(180deg); }
:root body .crazy-cash-target:active:not(:disabled) .ct-cash-card { transform: scale(.92); transition-duration: .09s; }
:root body .ct-cash-front,
:root body .ct-cash-back {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
:root body .ct-cash-front img { width: 100%; height: 100%; display: block; }
:root body .ct-cash-back {
  transform: rotateY(180deg);
  background: url(assets/figma/cash/open.svg) center / 100% 100% no-repeat;
  color: #fff;
  font-size: clamp(12px, 3.6vw, 17px);
  font-weight: 700;
  text-shadow: -1px 1px 0 #0009;
}
:root body .crazy-cash-target.selected .ct-cash-front { box-shadow: 0 0 0 2px var(--rc-gold-hi), 0 0 16px #ffd36faa; }
:root body .crazy-cash-target.selected .ct-cash-back { background-image: url(assets/figma/cash/open-big.svg); box-shadow: 0 0 0 2px var(--rc-gold-hi), 0 0 18px #ffd36fcc; }
:root body .crazy-cash-target::before,
:root body .crazy-cash-target::after { display: none; }
:root body .crazy-cash-grid.is-shuffling .crazy-cash-target { animation: rc-cash-shuffle .7s ease-in-out 2; }
:root body .crazy-cash-grid.is-shuffling .crazy-cash-target:nth-child(even) { animation-direction: reverse; }
@keyframes rc-cash-shuffle {
  0%, 100% { transform: none; }
  25% { transform: translate(14%, -10%) rotate(-4deg) scale(.94); }
  50% { transform: translate(-12%, 8%) rotate(3deg) scale(.96); }
  75% { transform: translate(8%, 12%) rotate(-2deg) scale(.95); }
}

/* --------------------------------------------------------- pachinko */
:root body .crazy-peg-board { fill: #15110e; stroke: #6b5236; stroke-width: 2; }
:root body .crazy-peg { fill: #fff; stroke: #1e1915; stroke-width: 2.2; paint-order: stroke; filter: drop-shadow(-1px 1px 0 #0009); }
:root body .crazy-peg-slot { fill: #2a221c; stroke: #ffffff1f; stroke-width: 1; }
:root body .crazy-peg-slot.prize-1 { fill: #2a221c; }
:root body .crazy-peg-slot.prize-2 { fill: #241d18; }
:root body .crazy-peg-slot.prize-3 { fill: #2f2620; }
:root body .crazy-peg-slot.landed { fill: #c9902f; stroke: #ffe3a6; stroke-width: 2; filter: drop-shadow(0 0 8px #ffcf5acc); animation: rc-slot-win 1s ease-in-out infinite alternate; }
:root body .crazy-peg-label { fill: #e9dcc4; font-weight: 700; }
:root body .crazy-peg-label.is-landed { fill: #fff; }
:root body #crazy-puck { fill: #ffe3a6; stroke: #7a5a2c; stroke-width: 2; filter: drop-shadow(0 3px 3px #000b) drop-shadow(0 0 6px #ffd36f88); }
@keyframes rc-slot-win { to { filter: drop-shadow(0 0 3px #ffcf5a66); } }

@media (prefers-reduced-motion: reduce) {
  :root body .lightning-sign.is-charged .lightning-sign-board,
  :root body .lightning-sign.is-charged .lightning-reel-row,
  :root body .lightning-stage.is-revealing .rc-table,
  :root body .crazy-cash-grid.is-shuffling .crazy-cash-target,
  :root body .crazy-peg-slot.landed { animation: none; }
  :root body .ct-cash-card { transition: none; }
  :root body .lightning-stage.is-revealing::after { animation: none; opacity: 0; }
}
