/* Coin Flip — vanilla DOM, namespaced under #coinflip-game.
   Stage-first vertical layout: history · 3D coin arena · payout readout ·
   control deck. The toss tumbles the coin end over end with no perspective:
   constant width, symmetric silhouette, visible rim edge-on. */

#coinflip-game {
  --cf-bg-1: #161B34;
  --cf-bg-2: #0B0E1C;
  --cf-panel: rgba(255,255,255,.035);
  --cf-line: rgba(255,255,255,.08);
  --cf-text: #ffffff;
  --cf-dim: rgba(255,255,255,.62);
  --cf-gold: #FFD54A;
  --cf-gold-deep: #E0A11B;
  --cf-silver: #C6D3E6;
  --cf-green: #2ECC71;
  --cf-green-deep: #1E9E52;
  --cf-red: #FF5A5F;
  --cf-blue: #4DA3FF;

  position: relative;
  width: 100%;
  height: 100%;
  background: transparent;   /* backdrop lives on .game-player-wrapper (see shell) */
  color: var(--cf-text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#coinflip-game * { box-sizing: border-box; }
#coinflip-game button { font-family: inherit; -webkit-tap-highlight-color: transparent; }

#coinflip-game .cf-inner {
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
  padding: 6px 14px 12px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ---------- stage ---------- */
#coinflip-game .cf-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 36px 0 4px;
  overflow: hidden;            /* nothing (coin, flash, confetti) may leave the stage */
}

#coinflip-game .cf-history {
  position: absolute;
  top: 6px; left: 0; right: 0;
  height: 26px;
  overflow: hidden;
  /* older chips fade as they slide off the left edge (limbo parity) */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 100%);
}
#coinflip-game .cf-history-track {
  display: flex; flex-direction: row; align-items: center;
  justify-content: flex-end;   /* newest pinned right */
  gap: 6px; height: 100%; width: 100%;
}
#coinflip-game .cf-hist-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: rgba(255,255,255,.28); letter-spacing: .3px;
  pointer-events: none;
}
#coinflip-game .cf-hist-empty[hidden] { display: none; }
#coinflip-game .cf-hist-dot,
#coinflip-game .cf-hist-chip {
  flex: 0 0 auto;
  height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; letter-spacing: .3px;
  font-variant-numeric: tabular-nums;
  will-change: transform, opacity;
  transform: translateZ(0);
  transition: transform .42s cubic-bezier(.32,.72,.20,1), opacity .42s ease-in;
}
#coinflip-game .cf-hist-dot {
  width: 22px; border-radius: 50%;
  color: #4A3000; background: linear-gradient(145deg, #FFE68A, #E0A11B);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.25);
}
#coinflip-game .cf-hist-dot.tails { color: #2B3A55; background: linear-gradient(145deg, #F4F8FF, #8A9BB8); }
#coinflip-game .cf-hist-chip { min-width: 44px; padding: 0 8px; border-radius: 11px; background: rgba(255,90,95,.18); color: #FF8A8E; }
#coinflip-game .cf-hist-chip.won { background: rgba(46,204,113,.2); color: #6CF0A2; }
#coinflip-game .cf-hist-dot.exiting,
#coinflip-game .cf-hist-chip.exiting { transform: translate3d(-80px, 0, 0); opacity: 0; }

/* Flexible air above/below the coins (1 : 0.6) — coins sit just below
   centre, leaving more headroom for the toss than footroom. */
#coinflip-game .cf-air { flex: 1 1 0; min-height: 0; }
#coinflip-game .cf-air-bottom { flex: 0.6 1 0; }

/* Arena: 1 coin centred, 2–4 in two columns, 5–10 in five. */
#coinflip-game .cf-arena {
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), auto);
  gap: 14px 18px;
  justify-content: center;
  align-items: center;
  position: relative;   /* win flash + confetti anchor here, over the coins */
}
#coinflip-game .cf-arena[data-count="1"] { gap: 0; }

/* ---------- the coin: two faces + rim stack, tumbling about the X axis ---------- */
#coinflip-game .cf-coin {
  position: relative;
  width: var(--size, 150px);
  height: var(--size, 150px);
  transform-style: preserve-3d;
  will-change: transform;
}
#coinflip-game .cf-shadow {
  position: absolute;
  left: 50%; bottom: -12%;
  width: 78%; height: 14%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.6) 0%, rgba(0,0,0,0) 70%);
  opacity: .55;
  pointer-events: none;
}
#coinflip-game .cf-coin3d {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(0deg);
  will-change: transform;
  border-radius: 50%;
}
#coinflip-game .cf-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0,0,0,.45);
}
#coinflip-game .cf-face svg { width: 100%; height: 100%; display: block; }
#coinflip-game .cf-heads { transform: rotateX(0deg) translateZ(4px); }
#coinflip-game .cf-tails { transform: rotateX(180deg) translateZ(4px); }
/* rim discs between the faces: a milled gold edge when the coin turns side-on */
#coinflip-game .cf-edge {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: #C39A2C;
  backface-visibility: visible;
  -webkit-backface-visibility: visible;
}
#coinflip-game .cf-edge.alt { background: #9C7418; }

/* outcome glow on the coin */
#coinflip-game .cf-coin.hit .cf-face { box-shadow: 0 0 0 3px rgba(46,204,113,.85), 0 0 26px rgba(46,204,113,.55), 0 8px 22px rgba(0,0,0,.45); }
#coinflip-game .cf-coin.miss .cf-face svg { filter: saturate(.4) brightness(.62); transition: filter .25s; }
#coinflip-game .cf-coin.miss .cf-face { box-shadow: 0 0 0 3px rgba(255,90,95,.85), 0 0 22px rgba(255,90,95,.4), 0 8px 22px rgba(0,0,0,.45); }
#coinflip-game .cf-arena[data-count="1"] .cf-coin.miss .cf-face { box-shadow: 0 0 0 4px rgba(255,90,95,.9), 0 0 36px rgba(255,90,95,.45), 0 8px 22px rgba(0,0,0,.45); }
#coinflip-game .cf-arena[data-count="1"] .cf-coin.hit .cf-face { box-shadow: 0 0 0 4px rgba(46,204,113,.9), 0 0 40px rgba(46,204,113,.6), 0 8px 22px rgba(0,0,0,.45); }

/* payout / chance readout */
#coinflip-game .cf-readout {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--cf-line);
}
#coinflip-game .cf-ro-item { text-align: center; min-width: 70px; }
#coinflip-game .cf-ro-label { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(255,255,255,.42); }
#coinflip-game .cf-ro-value { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
#coinflip-game .cf-ro-value.gold { color: var(--cf-gold); }
#coinflip-game .cf-ro-sep { width: 1px; height: 22px; background: var(--cf-line); }

/* ---------- win flash + confetti ---------- */
#coinflip-game .cf-win-flash {
  position: absolute;
  left: 50%; top: 100%;  /* multi: straddles the bottom row's lower edge so most coins stay readable */
  transform: translate(-50%, -50%) scale(.6);
  padding: 16px 36px;
  background: rgba(10, 10, 30, 0.9);
  border: 2px solid #ffd54a;
  border-radius: 16px;
  font-family: 'Bangers', 'Poppins', system-ui, sans-serif;
  text-align: center;
  color: #fff;
  opacity: 0;
  animation: cf-win-pop 2.1s ease forwards;
  box-shadow: 0 12px 36px rgba(0,0,0,.65), 0 0 40px rgba(255,213,74,.18);
  white-space: nowrap;
  z-index: 50;
  pointer-events: none;
}
#coinflip-game .cf-win-multi { font-size: 34px; color: #00E676; letter-spacing: 2px; line-height: 1.05; }
#coinflip-game .cf-win-amount { font-size: 30px; color: #ffc107; margin-top: 4px; letter-spacing: 2px; line-height: 1.05; text-shadow: 2px 2px 6px rgba(0,0,0,.5); }
@keyframes cf-win-pop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
  10%  { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  20%  { transform: translate(-50%, -50%) scale(.95); }
  30%  { transform: translate(-50%, -50%) scale(1); }
  85%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -55%) scale(1); }
}
#coinflip-game .cf-arena[data-count="1"] .cf-win-flash { top: 92%; }   /* single: over the coin's lower edge, face stays visible */
#coinflip-game .cf-confetti { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 49; pointer-events: none; }
#coinflip-game .cf-confetti i {
  position: absolute; left: 0; top: 0; display: block;
  animation: cf-confetti var(--dur, 1.2s) cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes cf-confetti {
  0%   { transform: translate(0,0) rotate(0); opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) + 120px)) rotate(var(--rot)); opacity: 0; }
}

/* ---------- control deck ---------- */
#coinflip-game .cf-deck {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px 10px 5px;
  border-radius: 16px;
  background: var(--cf-panel);
  border: 1px solid var(--cf-line);
}

/* mode tabs */
#coinflip-game .cf-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 3px; border-radius: 12px; background: rgba(0,0,0,.35);
}
#coinflip-game .cf-tab {
  height: 30px; border: 0; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--cf-dim);
  font-size: 12.5px; font-weight: 700; letter-spacing: .2px;
  transition: background .15s, color .15s;
}
#coinflip-game .cf-tab.active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
#coinflip-game .cf-tab:disabled { cursor: default; }

/* multi params */
#coinflip-game .cf-multi { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#coinflip-game .cf-multi[hidden] { display: none; }
#coinflip-game .cf-param { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 4px 12px; border-radius: 12px; background: rgba(0,0,0,.28); border: 1px solid var(--cf-line); }
#coinflip-game .cf-param-label { font-size: 12px; font-weight: 600; color: var(--cf-dim); white-space: nowrap; }
#coinflip-game .cf-param-side { font-size: 10.5px; font-weight: 800; letter-spacing: .3px; margin-left: 2px; }
#coinflip-game .cf-param-side.heads { color: var(--cf-gold); }
#coinflip-game .cf-param-side.tails { color: var(--cf-silver); }
#coinflip-game .cf-stepper { display: inline-flex; align-items: center; gap: 4px; }
#coinflip-game .cf-step {
  width: 28px; height: 28px; border-radius: 8px; border: 0; cursor: pointer;
  background: rgba(255,255,255,.1); color: #fff; font-size: 15px; font-weight: 800; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, transform .1s;
}
#coinflip-game .cf-step:hover:not(:disabled) { background: rgba(255,255,255,.18); }
#coinflip-game .cf-step:active:not(:disabled) { transform: scale(.94); }
#coinflip-game .cf-step:disabled { opacity: .35; cursor: default; }
#coinflip-game .cf-step-value { min-width: 26px; text-align: center; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* side picker */
#coinflip-game .cf-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#coinflip-game .cf-side {
  height: 42px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--cf-line); background: rgba(0,0,0,.28); color: var(--cf-dim);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 14px; font-weight: 800; letter-spacing: .3px;
  transition: border-color .15s, background .15s, color .15s, transform .1s;
}
#coinflip-game .cf-side-coin {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: Georgia, serif; font-size: 13px; font-weight: 700; color: #4A3000;
  background: linear-gradient(145deg, #FFE68A, #E0A11B);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.25);
}
#coinflip-game .cf-side.tails .cf-side-coin { color: #2B3A55; background: linear-gradient(145deg, #F4F8FF, #8A9BB8); }
#coinflip-game .cf-side.active { color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.45); }
#coinflip-game .cf-side.heads.active { border-color: var(--cf-gold); box-shadow: 0 0 0 1px rgba(255,213,74,.35), 0 0 18px rgba(255,213,74,.18); }
#coinflip-game .cf-side.tails.active { border-color: var(--cf-silver); box-shadow: 0 0 0 1px rgba(198,211,230,.35), 0 0 18px rgba(198,211,230,.15); }
#coinflip-game .cf-side:active:not(:disabled) { transform: scale(.98); }
#coinflip-game .cf-side:disabled { cursor: default; }

/* bet · credits · FLIP */
#coinflip-game .cf-actions {
  display: grid;
  /* bet · credits · flip — credits gets a real share so a 5-digit balance breathes */
  grid-template-columns: minmax(0, 1fr) minmax(104px, 0.95fr) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}
#coinflip-game .cf-bet {
  background: #1C1C1D;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
}
#coinflip-game .cf-bet-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: rgba(255,255,255,0.06); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, transform .1s;
}
#coinflip-game .cf-bet-btn:hover:not(:disabled) { background: rgba(255,255,255,0.12); }
#coinflip-game .cf-bet-btn:active:not(:disabled) { transform: scale(.94); }
#coinflip-game .cf-bet-btn:disabled { opacity: .35; cursor: default; }
#coinflip-game .cf-bet-btn svg { width: 18px; height: 18px; fill: currentColor; }
#coinflip-game .cf-bet-readout { text-align: center; min-width: 0; }
#coinflip-game .cf-bet-label { font-size: 11px; color: #8C8C91; letter-spacing: .5px; text-transform: uppercase; }
#coinflip-game .cf-bet-value { font-size: 18px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.15; }
#coinflip-game .cf-balance {
  background: #1C1C1D;
  border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px 8px; min-width: 0;
}
#coinflip-game .cf-bal-label { font-size: 11px; color: #8C8C91; letter-spacing: .5px; text-transform: uppercase; }
#coinflip-game .cf-bal-value { font-size: 18px; font-weight: 800; color: var(--cf-gold); font-variant-numeric: tabular-nums; line-height: 1.15; }

#coinflip-game .cf-action {
  min-height: 44px; border: 0; border-radius: 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: #fff; font-weight: 900; letter-spacing: 1px; text-transform: uppercase;
  background: linear-gradient(180deg, var(--cf-green) 0%, var(--cf-green-deep) 100%);
  box-shadow: 0 6px 18px rgba(46,204,113,.28), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .1s, filter .15s, box-shadow .15s;
}
#coinflip-game .cf-action:hover:not(:disabled) { filter: brightness(1.06); }
#coinflip-game .cf-action:active:not(:disabled) { transform: scale(.97); }
#coinflip-game .cf-action:disabled { filter: saturate(.5) brightness(.75); cursor: default; box-shadow: none; }
#coinflip-game .cf-act-main { font-size: 16px; line-height: 1.1; }
#coinflip-game .cf-act-sub { font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: none; opacity: .85; }

/* auto row — label + switch, limbo parity */
#coinflip-game .cf-auto { display: inline-flex; align-items: center; gap: 10px; }
#coinflip-game .cf-auto-label { font-size: 13px; font-weight: 700; color: var(--cf-dim); }
#coinflip-game .cf-auto-count { color: var(--cf-gold); font-variant-numeric: tabular-nums; margin-left: 4px; }
#coinflip-game .cf-auto-switch {
  position: relative; width: 44px; height: 24px; border-radius: 12px; border: 0; padding: 0; cursor: pointer;
  background: rgba(255,255,255,0.12); transition: background .2s;
}
#coinflip-game .cf-auto-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform .2s;
}
#coinflip-game .cf-auto-switch[data-on="1"] { background: var(--cf-green); }
#coinflip-game .cf-auto-switch[data-on="1"]::after { transform: translateX(20px); }

/* aux */
#coinflip-game .cf-aux { display: flex; align-items: center; justify-content: space-between; margin-top: -3px; min-height: 26px; }
#coinflip-game .cf-aux-right { display: inline-flex; align-items: center; gap: 2px; }
#coinflip-game .cf-tips, #coinflip-game .cf-sound {
  height: 26px; border: 0; background: transparent; color: rgba(255,255,255,.55); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; border-radius: 8px;
  font-size: 12px; font-weight: 600; transition: color .15s, background .15s;
}
#coinflip-game .cf-tips svg, #coinflip-game .cf-sound svg { width: 18px; height: 18px; fill: currentColor; }
#coinflip-game .cf-tips:hover, #coinflip-game .cf-sound:hover { color: #fff; background: rgba(255,255,255,.06); }

/* locked state (mid-toss / auto) */
#coinflip-game.is-locked .cf-tabs, #coinflip-game.is-locked .cf-sides, #coinflip-game.is-locked .cf-multi { opacity: .75; }

/* ---------- dialogs (shared look with the other vanilla games) ---------- */
.cf-modal-back {
  position: absolute; inset: 0; background: rgba(0,0,0,.55); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  font-family: 'Inter', system-ui, sans-serif;
}
.cf-auto-modal { background: #1C1C1D; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 18px 18px 14px; width: 100%; max-width: 320px; color: #fff; }
.cf-auto-modal-title { font-size: 16px; font-weight: 800; text-align: center; margin: 0 0 14px; }
.cf-auto-modal-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.cf-auto-modal-opt { height: 44px; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.04); border-radius: 10px; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 14px; font-family: inherit; }
.cf-auto-modal-opt:hover { background: rgba(255,255,255,.08); border-color: rgba(255,215,0,.35); }
.cf-auto-modal-num { font-weight: 800; color: #FFD54A; }
.cf-auto-modal-suffix { color: #8C8C91; font-size: 12px; }
.cf-auto-modal-cancel { width: 100%; height: 40px; border: 0; border-radius: 10px; background: rgba(255,255,255,.06); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit; }
.cf-auto-modal-cancel:hover { background: rgba(255,255,255,.10); }
.cf-modal-mask {
  position: absolute; inset: 0; background: rgba(0,0,0,.55); z-index: 9999;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  font-family: 'Inter', system-ui, sans-serif;
}
.cf-ib-dialog { width: 100%; max-width: 320px; background: #2C2C34; border-radius: 20px; padding: 24px 22px 20px; color: #fff; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.cf-ib-title { font-size: 20px; font-weight: 700; margin-bottom: 14px; }
.cf-ib-msg { font-size: 16px; color: rgba(255,255,255,.7); line-height: 1.45; margin-bottom: 22px; }
.cf-ib-btn { background: #607D8B; color: #fff; border: none; border-radius: 8px; padding: 10px 28px; font-size: 16px; font-weight: 600; cursor: pointer; }
.cf-ib-btn:hover { filter: brightness(1.08); }

.cf-ss-mask { position: absolute; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 20px; animation: cf-ss-mask-in 180ms ease; font-family: 'Inter', system-ui, sans-serif; }
@keyframes cf-ss-mask-in { from { opacity: 0; } to { opacity: 1; } }
.cf-ss-dialog { width: 340px; max-width: 100%; background: #1A2332; border: 1px solid rgba(255,255,255,.08); border-radius: 16px; overflow: hidden; color: #fff; animation: cf-ss-dialog-in 220ms cubic-bezier(.2,.9,.3,1.1); }
@keyframes cf-ss-dialog-in { from { opacity: 0; transform: scale(.94) translateY(6px); } to { opacity: 1; transform: none; } }
.cf-ss-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.cf-ss-title { color: rgba(255,255,255,.75); font-size: 14px; font-weight: 700; letter-spacing: 1.5px; }
.cf-ss-close { background: transparent; border: 0; color: rgba(255,255,255,.4); cursor: pointer; padding: 4px; display: inline-flex; border-radius: 4px; }
.cf-ss-close:hover { color: #fff; background: rgba(255,255,255,.08); }
.cf-ss-row { display: flex; align-items: center; padding: 14px 20px; gap: 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
.cf-ss-row:last-child { border-bottom: none; }
.cf-ss-label { flex: 0 0 40%; color: rgba(255,255,255,.6); font-size: 15px; }
.cf-ss-switch { position: relative; display: inline-block; margin-left: auto; cursor: pointer; }
.cf-ss-switch input { appearance: none; position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.cf-ss-switch-track { display: inline-block; position: relative; width: 44px; height: 24px; border-radius: 12px; background: rgba(255,255,255,.12); transition: background .2s; }
.cf-ss-switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.7); transition: transform .2s, background .2s; }
.cf-ss-switch input:checked + .cf-ss-switch-track { background: rgba(74,158,255,.4); }
.cf-ss-switch input:checked + .cf-ss-switch-track .cf-ss-switch-thumb { transform: translateX(20px); background: #4A9EFF; }
input.cf-ss-slider { flex: 1; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; outline: none; cursor: pointer;
  background: linear-gradient(to right, #4A9EFF 0%, #4A9EFF var(--fill, 100%), rgba(255,255,255,.12) var(--fill, 100%), rgba(255,255,255,.12) 100%); }
input.cf-ss-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0,0,0,.5); cursor: pointer; }
input.cf-ss-slider::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0,0,0,.5); cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 380px) {
  #coinflip-game .cf-inner { padding: 4px 10px 10px; }
  #coinflip-game .cf-actions { grid-template-columns: minmax(0, 1fr) minmax(84px, 0.9fr) minmax(0, 1fr); gap: 6px; }
  #coinflip-game .cf-balance { padding: 6px 4px; }
  #coinflip-game .cf-bet-value, #coinflip-game .cf-bal-value { font-size: 16px; }
  #coinflip-game .cf-bet-btn { width: 28px; height: 28px; }
  #coinflip-game .cf-side { height: 40px; font-size: 13px; }
  #coinflip-game .cf-act-main { font-size: 14px; }
}
@media (max-height: 700px) {
  #coinflip-game .cf-stage { min-height: 170px; padding-top: 26px; }
  #coinflip-game .cf-deck { gap: 6px; padding: 6px 8px 4px; }
  #coinflip-game .cf-side { height: 38px; }
  #coinflip-game .cf-action { min-height: 40px; }
  #coinflip-game .cf-readout { margin-top: 8px; padding: 3px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  #coinflip-game .cf-hist-dot, #coinflip-game .cf-hist-chip { transition: none; }
}

/* ad rail present on wide screens: keep dialogs centred on the game column */
@media (min-width: 880px) {
  .car-has-rail .game-player-wrapper .cf-modal-mask,
  .car-has-rail .game-player-wrapper .cf-modal-back,
  .car-has-rail .game-player-wrapper .cf-ss-mask { right: 326px; }
}
