/* =====================================================================
   Per-game stage styling. Loaded only on game.php.
   ===================================================================== */

/* ---------- Shared ---------- */
.stage-title { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 10px; }
.bigmult { font-size: clamp(38px, 7vw, 68px); font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }

/* ---------- Mines ---------- */
.mines-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; width: min(430px, 100%); }
.mine-tile {
  aspect-ratio: 1; border-radius: var(--r); background: var(--surface-2);
  border: 1px solid var(--border-soft); display: grid; place-items: center;
  font-size: 22px; color: transparent; transition: transform var(--fast), background var(--fast), border-color var(--fast);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.28);
}
.mine-tile:not(:disabled):hover { background: var(--surface-3); transform: translateY(-2px); }
.mine-tile:disabled { cursor: default; }
.mine-tile.gem { background: rgba(22,217,127,.13); border-color: rgba(22,217,127,.35); color: var(--brand); animation: pop .28s var(--ease); }
.mine-tile.bomb { background: rgba(240,84,106,.14); border-color: rgba(240,84,106,.38); color: var(--loss); animation: pop .28s var(--ease); }
.mine-tile.ghost { opacity: .38; color: var(--muted); }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* ---------- Dice ---------- */
.dice-wrap { width: min(620px, 100%); }
.dice-track {
  position: relative; height: 12px; border-radius: 99px; margin: 46px 0 30px;
  background: linear-gradient(90deg, var(--loss) 0 var(--split), var(--brand) var(--split) 100%);
}
.dice-track.flip { background: linear-gradient(90deg, var(--brand) 0 var(--split), var(--loss) var(--split) 100%); }
.dice-thumb {
  position: absolute; top: 50%; translate: -50% -50%; width: 26px; height: 30px; border-radius: 7px;
  background: var(--text); box-shadow: var(--sh-2); cursor: grab; z-index: 2;
}
.dice-thumb::after { content: ""; position: absolute; inset: 11px 10px; border-radius: 2px; background: var(--surface); }
.dice-marks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.dice-result {
  position: absolute; top: -46px; translate: -50% 0; padding: 7px 13px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border); font-weight: 700; font-variant-numeric: tabular-nums;
  transition: left .28s var(--ease); z-index: 3;
}
.dice-result.win { border-color: rgba(22,217,127,.5); color: var(--brand); }
.dice-result.loss { border-color: rgba(240,84,106,.45); color: var(--loss); }
.dice-history { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.dice-chip { padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.dice-chip.win { background: rgba(22,217,127,.15); color: var(--brand); }
.dice-chip.loss { background: var(--surface-3); color: var(--muted); }

/* ---------- Limbo ---------- */
.limbo-stage { display: grid; place-items: center; gap: 8px; }
.limbo-mult { transition: color var(--med); }
.limbo-mult.win { color: var(--brand); }
.limbo-mult.loss { color: var(--loss); }

/* ---------- Crash ---------- */
.crash-wrap { position: relative; width: 100%; height: 100%; min-height: 320px; }
.crash-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.crash-overlay { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.crash-mult { font-size: clamp(40px, 8vw, 76px); font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; text-shadow: 0 6px 30px rgba(0,0,0,.6); }
.crash-mult.busted { color: var(--loss); }
.crash-history { display: flex; gap: 6px; flex-wrap: wrap; }
.crash-tag { padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.crash-tag.hi { background: rgba(22,217,127,.14); color: var(--brand); }
.crash-tag.lo { background: rgba(240,84,106,.12); color: var(--loss); }

/* ---------- Plinko ---------- */
.plinko-wrap { position: relative; width: min(560px, 100%); aspect-ratio: 1 / .92; }
.plinko-canvas { width: 100%; height: 100%; }
.plinko-bins { display: flex; gap: 3px; margin-top: 10px; }
.plinko-bin {
  flex: 1; text-align: center; padding: 6px 2px; border-radius: 6px; font-size: 11px; font-weight: 700;
  color: #14100a; transition: transform var(--fast); font-variant-numeric: tabular-nums;
}
.plinko-bin.hit { animation: binhit .4s var(--ease); }
@keyframes binhit { 0% { transform: translateY(0); } 40% { transform: translateY(7px); } 100% { transform: translateY(0); } }

/* ---------- Keno ---------- */
.keno-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; width: min(520px, 100%); }
.keno-cell {
  aspect-ratio: 1; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border-soft);
  font-weight: 700; font-size: 14px; color: var(--muted); transition: all var(--fast); font-variant-numeric: tabular-nums;
}
.keno-cell:hover { background: var(--surface-3); color: var(--text); }
.keno-cell.picked { background: var(--surface-3); border-color: var(--border); color: var(--text); }
.keno-cell.drawn { background: rgba(56,189,248,.14); border-color: rgba(56,189,248,.4); color: var(--info); }
.keno-cell.hit { background: var(--brand); border-color: var(--brand); color: #04140c; animation: pop .3s var(--ease); }
.keno-pay { display: flex; gap: 5px; flex-wrap: wrap; }
.keno-pay div { flex: 1 1 62px; text-align: center; padding: 7px 4px; border-radius: 7px; background: var(--surface-2); font-size: 11.5px; }
.keno-pay div b { display: block; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.keno-pay div.on { background: rgba(22,217,127,.14); color: var(--brand); }

/* ---------- Wheel ---------- */
.wheel-wrap { position: relative; width: min(380px, 82vw); aspect-ratio: 1; }
.wheel-svg { width: 100%; height: 100%; transition: transform 4.2s cubic-bezier(.15,.9,.2,1); }
.wheel-pin { position: absolute; top: -6px; left: 50%; translate: -50% 0; width: 0; height: 0;
  border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 18px solid var(--text); z-index: 2; }
.wheel-hub { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.wheel-hub div { background: var(--surface); border: 1px solid var(--border); border-radius: 50%;
  width: 34%; height: 34%; display: grid; place-items: center; font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; }

/* ---------- Tower ---------- */
.tower-grid { display: flex; flex-direction: column-reverse; gap: 7px; width: min(430px, 100%); }
.tower-row { display: grid; gap: 7px; }
.tower-cell {
  height: 42px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border-soft);
  display: grid; place-items: center; font-size: 15px; color: transparent; transition: all var(--fast);
}
.tower-row.active .tower-cell { background: var(--surface-3); cursor: pointer; }
.tower-row.active .tower-cell:hover { border-color: var(--brand); transform: translateY(-2px); }
.tower-cell.safe { background: rgba(22,217,127,.14); border-color: rgba(22,217,127,.35); color: var(--brand); }
.tower-cell.trap { background: rgba(240,84,106,.14); border-color: rgba(240,84,106,.35); color: var(--loss); }
.tower-cell.ghost { opacity: .35; color: var(--muted); }
.tower-row .rowmult { display: grid; place-items: center; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tower-row.active .rowmult { color: var(--brand); font-weight: 700; }

/* ---------- Coin flip ---------- */
.coin { width: 150px; height: 150px; position: relative; transform-style: preserve-3d; transition: transform 1s var(--ease); }
.coin.spin { animation: coinspin 1s var(--ease); }
@keyframes coinspin { to { transform: rotateY(1800deg); } }
.coin__face {
  position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center;
  font-size: 42px; font-weight: 800; backface-visibility: hidden;
}
.coin__face--h { background: linear-gradient(140deg, #f7d774, #d09a1f); color: #4a3403; }
.coin__face--t { background: linear-gradient(140deg, #b9c9c1, #6f8479); color: #17251e; transform: rotateY(180deg); }
.coin.tails { transform: rotateY(180deg); }

/* ---------- Cases ---------- */
.case-reel { position: relative; width: min(600px, 100%); height: 122px; overflow: hidden;
  border-radius: var(--r); border: 1px solid var(--border-soft); background: var(--bg-2); }
.case-reel__track { display: flex; gap: 8px; padding: 12px 0; position: absolute; left: 0; top: 0; will-change: transform; }
.case-item { width: 104px; flex: none; height: 98px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border-soft); font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.case-reel__needle { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--brand); z-index: 3; box-shadow: 0 0 14px var(--brand-glow); }

/* ---------- Blackjack (OG 92goa table) ---------- */
.ogbj {
  position: relative; width: 100%; min-height: 430px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px 14px; border-radius: var(--r-lg);
  background: radial-gradient(ellipse at 50% 28%, #114f36 0%, #0c3d29 55%, #082c1e 100%);
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: inset 0 0 70px rgba(0,0,0,.45);
}
.ogbj__feltmark { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-size: 220px; color: rgba(255,255,255,.025); }
.ogbj__side { position: relative; z-index: 1; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ogbj__label { font-size: 12px; font-weight: 700; color: rgba(224,244,235,.55);
  text-transform: uppercase; letter-spacing: 1px; display: flex; align-items: center; gap: 10px; }
.ogbj__score { display: inline-grid; place-items: center; min-width: 32px; padding: 3px 9px; border-radius: 8px;
  background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.14); color: #fff;
  font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.ogbj__score.bust { color: var(--loss); border-color: rgba(240,84,106,.4); background: rgba(240,84,106,.08); }
.ogbj__cards { display: flex; justify-content: center; min-height: 100px; padding-left: 28px; }
.ogbj-card {
  position: relative; width: 70px; height: 100px; border-radius: 9px; flex-shrink: 0; margin-left: -28px;
  background: linear-gradient(160deg, #fff, #e6eaf0); border: 1px solid rgba(0,0,0,.18);
  box-shadow: 0 6px 16px rgba(0,0,0,.45); overflow: hidden;
}
.ogbj-card.red { color: #e3173e; }
.ogbj-card.black { color: #1a1f2b; }
.ogbj-card .ci { position: absolute; display: flex; flex-direction: column; align-items: center;
  font-weight: 800; font-size: 15px; line-height: .85; }
.ogbj-card .ci small { font-size: 11px; line-height: 1; }
.ogbj-card .ci.tl { top: 6px; left: 7px; }
.ogbj-card .ci.br { bottom: 6px; right: 7px; }
.ogbj-card .cc { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; opacity: .92; }
.ogbj-card.hidden { background: linear-gradient(135deg, #1e9e6a, #0d7a4c); border-color: transparent; }
.ogbj-card.hidden::after { content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.12) 0 7px, transparent 7px 14px); }
.ogbj-card.hidden * { display: none; }
.ogbj-card.deal { animation: ogdeal .3s ease-out; }
.ogbj-card.flip { animation: ogflip .45s ease-out; }
@keyframes ogdeal { from { opacity: 0; transform: translateY(-18px) rotate(-5deg); } }
@keyframes ogflip { from { transform: rotateY(90deg); } }
.ogbj__deck { position: relative; z-index: 1; display: flex; justify-content: center; align-items: flex-end;
  height: 92px; margin: 2px 0; }
.ogbj__deck .bk { width: 58px; height: 82px; border-radius: 9px; position: relative; margin: 0 -14px;
  background: linear-gradient(135deg, #1e9e6a, #0d7a4c); border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 8px 20px rgba(0,0,0,.45); }
.ogbj__deck .bk::after { content: ''; position: absolute; inset: 0; border-radius: 9px;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.13) 0 6px, transparent 6px 12px); }
.ogbj__deck .b1 { transform: rotate(-13deg); }
.ogbj__deck .b2 { transform: translateY(-8px); z-index: 2; }
.ogbj__deck .b3 { transform: rotate(13deg); }
.ogbj__msg { position: relative; z-index: 1; font-weight: 800; font-size: 15px;
  color: rgba(224,244,235,.6); text-align: center; margin: 12px 0; min-height: 22px; }
.ogbj__msg.win { color: var(--brand); }
.ogbj__msg.loss { color: var(--loss); }
.ogbj__msg.push { color: #38bdf8; }

.ogbj-readout { display: flex; flex-direction: column; gap: 12px; background: var(--surface-2);
  border: 1px solid var(--border-soft); border-radius: var(--r); padding: 14px 16px; margin-bottom: 10px; }
.ogbj-readout > div { display: flex; justify-content: space-between; align-items: center; }
.ogbj-readout span { color: var(--muted); font-size: 13px; font-weight: 600; }
.ogbj-readout b { font-weight: 800; font-size: 15px; color: var(--text); }
.ogbj-acts { margin-top: auto; display: flex; gap: 10px; }
.ogbj-act { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px;
  border: 0; border-radius: var(--r); font-weight: 800; font-size: 15px; color: #fff; cursor: pointer; transition: .2s; }
.ogbj-act--hit { background: linear-gradient(135deg, #1ec97f, #0da05c); color: #04140c; }
.ogbj-act--stand { background: linear-gradient(135deg, #f0703a, #d4501d); }
.ogbj-act:hover:not(:disabled) { transform: translateY(-2px); }
.ogbj-act:active { transform: scale(.96); }
.ogbj-act:disabled { opacity: .5; cursor: not-allowed; transform: none; }

@media (max-width: 767px) {
  .ogbj { min-height: 360px; padding: 20px 10px; }
  .ogbj-card { width: 58px; height: 84px; margin-left: -24px; }
  .ogbj-card .ci { font-size: 13px; }
  .ogbj-card .ci small { font-size: 9px; }
  .ogbj-card .cc { font-size: 32px; }
  .ogbj__cards { min-height: 84px; padding-left: 24px; }
  .ogbj__deck .bk { width: 46px; height: 66px; }
  .ogbj__feltmark { font-size: 150px; }
}

/* ---------- Chicken Road ---------- */
.cr-stage { width: 100%; }
.cr-road { display: flex; gap: 6px; overflow-x: auto; padding: 12px 4px 16px; scroll-behavior: smooth; }
.cr-lane {
  flex: 0 0 76px; height: 168px; border-radius: var(--r); position: relative;
  background: linear-gradient(180deg, var(--surface-2), var(--bg-2));
  border: 1px solid var(--border-soft); display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; padding-bottom: 10px; transition: all var(--fast);
}
.cr-lane::before { content: ""; position: absolute; left: 50%; top: 10px; bottom: 44px; width: 2px; translate: -50% 0;
  background: repeating-linear-gradient(180deg, var(--border) 0 8px, transparent 8px 18px); }
.cr-lane__mult { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; z-index: 1;
  background: var(--surface); padding: 3px 8px; border-radius: 99px; border: 1px solid var(--border-soft); }
.cr-lane.done { border-color: rgba(22,217,127,.35); background: linear-gradient(180deg, rgba(22,217,127,.10), var(--bg-2)); }
.cr-lane.done .cr-lane__mult { color: var(--brand); border-color: rgba(22,217,127,.35); }
.cr-lane.next { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22,217,127,.12); }
.cr-lane.dead { border-color: rgba(240,84,106,.5); background: linear-gradient(180deg, rgba(240,84,106,.14), var(--bg-2)); }
.cr-chicken { position: absolute; top: 46px; font-size: 30px; transition: none; z-index: 2; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
.cr-lane.dead .cr-chicken { animation: squish .4s var(--ease) forwards; }
@keyframes squish { to { transform: scaleY(.3) scaleX(1.25); opacity: .75; } }
.cr-start { flex: 0 0 60px; display: grid; place-items: center; height: 168px; border-radius: var(--r);
  background: var(--surface-3); font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .06em; }

/* ---------- Chicken Road (full Pixi build) ---------- */
.cr2-frame { position: relative; width: 100%; height: min(62vh, 560px); min-height: 340px;
  border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border-soft); background: #0a1a12; }
.cr2-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- WinGo ---------- */
.wg-pick--green { border-color: rgba(22,217,127,.55) !important; color: var(--brand) !important; }
.wg-pick--violet { border-color: rgba(168,85,247,.55) !important; color: #c084fc !important; }
.wg-pick--red { border-color: rgba(240,84,106,.55) !important; color: var(--loss) !important; }
.wg-pick.is-active { background: var(--brand) !important; border-color: var(--brand) !important; color: #04140c !important; }
.wg-pick--violet.is-active { background: #a855f7 !important; border-color: #a855f7 !important; color: #fff !important; }
.wg-pick--red.is-active { background: var(--loss) !important; border-color: var(--loss) !important; color: #fff !important; }
