/* ==========================================================================
   Originais GrenGren — painel de aposta e tabuleiros
   ========================================================================== */
.og { display: grid; grid-template-columns: 337px 1fr; gap: 16px; min-height: 560px; background: transparent; }
.og-panel { background: var(--bg-elev); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.og-panel .field + .field { margin-top: 0; }
.og-panel .form-row { gap: 10px; }
.og-modes { margin-bottom: 2px; }
.og-amount { position: relative; display: flex; align-items: center; background: var(--bg); border: 1px solid var(--surface-3); border-radius: var(--r-sm); overflow: hidden; }
.og-amount:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.og-amount-coin { padding-left: 12px; display: flex; }
.og-amount .input { border: 0; box-shadow: none !important; background: transparent; padding-left: 10px; min-width: 0; }
.og-amount .input::-webkit-outer-spin-button, .og-amount .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.og-amount-btns { display: flex; height: 100%; }
.og-amount-btns button { height: 44px; padding: 0 12px; background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 13px; border-left: 1px solid var(--bg); }
.og-amount-btns button:hover { color: var(--text); background: var(--surface-3); }
.og-controls:empty { display: none; }
.og-onx { display: flex; align-items: center; gap: 6px; }
.og-onx .select { width: 110px; flex-shrink: 0; padding-right: 26px; }
.og-onx span { color: var(--muted-2); }
.og-profit .field-label { margin: 0; }
.og-main { margin-top: 4px; font-size: 16px; }
.og-main:disabled { opacity: 0.55; }
.og.is-busy .og-main:not(:disabled) { box-shadow: 0 0 0 0 var(--brand-glow); }
.og-fun { display: flex; gap: 8px; font-size: 12px; color: var(--muted); background: var(--bg-elev); padding: 10px 12px; border-radius: var(--r-sm); line-height: 1.45; }
.og-fun .ic { flex-shrink: 0; color: var(--info); margin-top: 1px; }
.og-balance { font-size: 12.5px; text-align: center; }
.og-balance strong { color: var(--text); font-weight: 600; }

.og-board { position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: 12px; overflow: hidden; background-color: var(--bg-elev); background-image: linear-gradient(rgba(22,39,47,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(22,39,47,.35) 1px, transparent 1px), radial-gradient(80% 60% at 50% 40%, rgba(16,171,225,.06), transparent 70%); background-size: 88px 88px, 88px 88px, 100% 100%; background-position: center; }
.og-history { display: flex; gap: 6px; justify-content: flex-end; padding: 14px 16px 0; min-height: 44px; overflow: hidden; }
.og-chip { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 99px; background: var(--surface); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.og-chip.win { background: var(--brand); color: var(--brand-ink); }
.og-chip.is-new { animation: pop 320ms var(--ease); }
.og-stage { flex: 1; display: grid; place-items: center; padding: 20px; min-height: 0; }

@media (max-width: 1023px) {
  .og { grid-template-columns: 1fr; }
  .og-board { order: -1; min-height: 360px; }
  .og-main { margin-top: 4px; }
}

/* Toolbar abaixo do jogo */
.game-stage { border-radius: var(--r-lg); overflow: hidden; background: var(--bg-elev); }
.game-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--bg-elev); }
.game-toolbar-brand { gap: 8px; }
.icon-btn[data-fav].is-on { color: var(--gold); }
.icon-btn[data-fav].is-on .ic { fill: currentColor; }

/* ---------- Dice ---------- */
.dice { width: min(640px, 100%); display: grid; gap: 34px; }
.dice-result { font-size: 64px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; color: var(--text); transition: color var(--t); }
.dice-result.win { color: var(--win); }
.dice-result.loss { color: var(--loss); }
.dice-track { background: var(--surface); border-radius: 99px; padding: 26px 26px 22px; position: relative; }
.dice-labels { position: absolute; left: 26px; right: 26px; top: -26px; display: flex; justify-content: space-between; font-size: 12px; color: var(--muted-2); }
.dice-rail { position: relative; height: 10px; }
.dice-fill { position: absolute; inset: 0; border-radius: 99px; }
.dice-range { position: absolute; inset: -12px 0; width: 100%; appearance: none; background: transparent; cursor: pointer; margin: 0; }
.dice-range::-webkit-slider-thumb { appearance: none; width: 34px; height: 34px; border-radius: 8px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2303121a' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M9 6v12M15 6v12'/%3E%3C/svg%3E") center / 16px no-repeat; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.dice-range::-moz-range-thumb { width: 34px; height: 34px; border-radius: 8px; background: #fff; border: 0; }
.dice-range:disabled { cursor: default; }
.dice-marker { position: absolute; top: -58px; transform: translateX(-50%); transition: left 300ms var(--ease); }
.dice-marker span { display: block; padding: 6px 10px; border-radius: 8px; font-weight: 700; font-size: 14px; background: #fff; color: var(--bg); box-shadow: var(--shadow-md); animation: pop 260ms var(--ease); }
.dice-marker.win span { background: var(--win); color: #051b02; }
.dice-marker.loss span { background: var(--loss); color: #fff; }
.dice-info { display: grid; grid-template-columns: 1fr; max-width: 280px; margin: 0 auto; width: 100%; }
.dice-info .icon-btn { font-size: 16px; }

/* ---------- Limbo ---------- */
.limbo { position: relative; display: grid; justify-items: center; gap: 10px; width: 100%; }
.limbo-glow { position: absolute; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(34,226,122,0.12), transparent 70%); top: 50%; left: 50%; transform: translate(-50%, -50%); }
.limbo-rocket { font-size: 54px; transition: transform 700ms var(--ease); filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5)); }
.limbo-rocket.fly { transform: translateY(-20px) rotate(-12deg) scale(1.08); }
.limbo-value { position: relative; font-size: clamp(56px, 9vw, 96px); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -2px; }
.limbo-value.win { color: var(--win); }
.limbo-value.loss { color: var(--loss); }
.limbo-target { font-size: 14px; position: relative; }

/* ---------- Plinko ---------- */
.plinko { width: min(640px, 100%); }
.plinko-svg { width: 100%; height: auto; display: block; }
.plinko-svg .peg { fill: #d9e7ee; transition: fill 120ms, r 120ms; }
.plinko-svg .peg.hit { fill: var(--brand); }
.plinko-ball { fill: var(--brand); filter: drop-shadow(0 0 6px var(--brand-glow)); }
.plinko-slots { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; width: calc(var(--n) * var(--gap)); margin: -4px auto 0; }
.plinko-slot { font-size: clamp(8px, 1.1vw, 11px); font-weight: 700; text-align: center; padding: 6px 0; border-radius: 5px; background: var(--c); color: #1b0d00; box-shadow: 0 3px 0 rgba(0,0,0,0.35); white-space: nowrap; overflow: hidden; }
.plinko-slot.bump { animation: slotBump 400ms var(--ease); }
@media (max-width: 420px) { .plinko-slots { gap: 2px; } .plinko-slot { font-size: 7px; letter-spacing: -0.06em; padding: 5px 0; } }
@media (max-width: 350px) { .plinko-slots { gap: 1px; } .plinko-slot { font-size: 6.5px; letter-spacing: -0.08em; } }
@keyframes slotBump { 30% { transform: translateY(6px); filter: brightness(1.3); } }

/* ---------- Keno ---------- */
.keno { width: min(640px, 100%); display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.keno-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.keno-cell { aspect-ratio: 1; border-radius: var(--r-md); background: var(--surface-2); font-weight: 700; font-size: 15px; box-shadow: 0 4px 0 #0a171d; transition: transform var(--t-fast), background var(--t); }
.keno-cell:hover:not(:disabled) { transform: translateY(-2px); background: var(--surface-3); }
.keno-cell.picked { background: #7717ff; box-shadow: 0 4px 0 #4a0aa8; }
.keno-cell.drawn { background: #0c1d25; color: var(--loss); box-shadow: inset 0 0 0 2px rgba(255,90,106,0.4); }
.keno-cell.hit { background: var(--brand); color: var(--brand-ink); box-shadow: 0 4px 0 var(--brand-press); animation: pop 300ms var(--ease); }
.keno-cell:disabled { cursor: default; }
.keno-pay { min-height: 58px; }
.keno-pay p { text-align: center; font-size: 13px; }
.keno-pay-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.keno-pay-cell { background: var(--surface); border-radius: 6px; padding: 6px 2px; text-align: center; transition: background var(--t); }
.keno-pay-cell strong { display: block; font-size: 12px; }
.keno-pay-cell span { font-size: 10px; color: var(--muted-2); }
.keno-pay-cell.is-hit { background: var(--brand); }
.keno-pay-cell.is-hit strong, .keno-pay-cell.is-hit span { color: var(--brand-ink); }
@media (max-width: 479px) { .keno-grid { gap: 5px; } .keno-cell { font-size: 12px; border-radius: 6px; } .keno-pay-row { grid-auto-columns: minmax(42px, 1fr); overflow-x: auto; scrollbar-width: none; } .keno-pay-cell strong { font-size: 11px; } }

/* ---------- Wheel / Roulette wheel ---------- */
.wheel { display: grid; justify-items: center; gap: 18px; width: 100%; }
.wheel-wrap, .rl-wheel-wrap { position: relative; width: min(380px, 80vw); aspect-ratio: 1; }
.wheel-svg, .rl-wheel { width: 100%; height: 100%; }
.wheel-svg [data-rotor], .rl-wheel [data-rotor] { transform-origin: 0 0; transform-box: view-box; }
.wheel-pointer { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 22px solid var(--brand); z-index: 2; filter: drop-shadow(0 3px 4px rgba(0,0,0,0.5)); }
.wheel-center { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none; }
.wheel-legend { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.wheel-chip { font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 6px; background: var(--surface); border-bottom: 3px solid var(--c); transition: transform var(--t); }
.wheel-chip.is-hit { transform: translateY(-3px); background: var(--c); color: #06161d; }

/* ---------- Mines ---------- */
.mines { width: min(520px, 100%); }
.mines-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.mines-cell { aspect-ratio: 1; border-radius: var(--r-md); background: var(--surface-2); box-shadow: 0 5px 0 #0a171d; transition: transform var(--t-fast), background var(--t); display: grid; place-items: center; padding: 16%; }
.mines-cell:not(:disabled):hover { transform: translateY(-3px); background: var(--surface-3); }
.mines-cell:disabled { cursor: default; }
.mines-cell.revealed { background: #06161d; box-shadow: inset 0 0 0 2px var(--surface-2); animation: flipIn 260ms var(--ease); }
.mines-cell.revealed:not(.dim) .mines-gem { filter: drop-shadow(0 0 10px rgba(53,184,255,0.7)); }
.mines-cell.dim { opacity: 0.45; }
.mines-cell.boom { background: rgba(255,90,106,0.2); box-shadow: inset 0 0 0 2px var(--loss); animation: shake 400ms; }
.mines-gem, .mines-bomb { width: 100%; height: 100%; }
.mines-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.mines-stats .card-soft { padding: 10px 12px; display: grid; gap: 2px; background: var(--bg-elev); }
.mines-stats span { font-size: 11.5px; }
.mines-stats strong { font-size: 15px; font-variant-numeric: tabular-nums; }

/* ---------- Tower ---------- */
.tower { width: min(460px, 100%); display: grid; gap: 6px; }
.tower-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 4px; border-radius: var(--r-md); transition: background var(--t); }
.tower-row.is-active { background: rgba(34,226,122,0.08); box-shadow: inset 0 0 0 1px rgba(34,226,122,0.35); }
.tower-cell { height: 42px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--muted-2); box-shadow: 0 3px 0 #0a171d; transition: transform var(--t-fast), background var(--t); }
.tower-row.is-active .tower-cell { color: var(--text); }
.tower-row.is-active .tower-cell:hover:not(:disabled) { background: var(--surface-3); transform: translateY(-2px); }
.tower-cell.revealed { background: #06161d; animation: flipIn 240ms var(--ease); }
.tower-cell.dim { opacity: 0.45; }
.tower-cell.boom { box-shadow: inset 0 0 0 2px var(--loss); animation: shake 400ms; }
.tower-cell:disabled { cursor: default; }

/* ---------- Cartas ---------- */
.pcard { position: relative; width: 86px; height: 122px; border-radius: 10px; background: #fff; color: #141a1f; box-shadow: 0 8px 18px rgba(0,0,0,0.45); flex-shrink: 0; font-family: var(--font); }
.pcard.red { color: #d63447; }
.pcard-r { position: absolute; top: 6px; left: 8px; font-size: 20px; font-weight: 700; line-height: 1; }
.pcard-s { position: absolute; top: 28px; left: 9px; font-size: 16px; line-height: 1; }
.pcard-big { position: absolute; right: 8px; bottom: 4px; font-size: 44px; line-height: 1; }
.pcard.back { background: linear-gradient(135deg, #0f7a44, #0a4d2b); border: 3px solid #fff; }
.pcard.back span { position: absolute; inset: 8px; border-radius: 6px; border: 2px dashed rgba(255,255,255,0.35); background: url("../assets/brand/mark.svg") center / 40% no-repeat; opacity: 0.8; }
.pcard.flip { animation: flipIn 300ms var(--ease); }
.pcard.deal { animation: dealIn 320ms var(--ease) both; }
.pcard.mini { width: 44px; height: 62px; border-radius: 6px; }
.pcard.mini .pcard-r { font-size: 12px; top: 4px; left: 5px; }
.pcard.mini .pcard-s { font-size: 10px; top: 18px; left: 5px; }
.pcard.mini .pcard-big { font-size: 22px; }
@keyframes dealIn { from { opacity: 0; transform: translate(40px, -40px) rotate(8deg); } to { opacity: 1; transform: none; } }

/* HiLo */
.hilo { display: grid; justify-items: center; gap: 18px; width: 100%; }
.hilo-hint { display: flex; gap: 40px; font-size: 12px; color: var(--muted-2); }
.hilo-card .pcard { width: 120px; height: 170px; }
.hilo-card .pcard-r { font-size: 28px; }
.hilo-card .pcard-s { top: 38px; font-size: 22px; }
.hilo-card .pcard-big { font-size: 64px; }
.hilo-trail { display: flex; gap: 8px; max-width: 100%; overflow-x: auto; padding: 8px 4px; scrollbar-width: none; }
.hilo-t { position: relative; }
.hilo-t::after { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: var(--surface-3); }
.hilo-t.hi::after { content: '▲'; color: var(--win); }
.hilo-t.lo::after { content: '▼'; color: var(--win); }
.hilo-t.skip::after { content: '↷'; color: var(--muted); }
.hilo-actions { display: grid; gap: 8px; }
.hilo-actions .btn-lg { justify-content: space-between; }
.hilo-actions small { color: var(--muted); font-weight: 500; }

/* Coinflip */
.coinflip { display: grid; justify-items: center; gap: 24px; perspective: 800px; }
.coin3d { position: relative; width: 170px; height: 170px; transform-style: preserve-3d; transition: transform 900ms cubic-bezier(0.3, 0.9, 0.3, 1); }
.coin3d .face { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; font-size: 64px; font-weight: 800; backface-visibility: hidden; box-shadow: inset 0 0 0 8px rgba(0,0,0,0.12), 0 14px 30px rgba(0,0,0,0.5); }
.coin3d .heads { background: radial-gradient(circle at 35% 30%, #fff3b0, #f3ba2f 60%, #b8860b); color: #6b4a00; }
.coin3d .tails { background: radial-gradient(circle at 35% 30%, #d9fff0, #22e27a 60%, #0f8a49); color: #03351b; transform: rotateY(180deg); }
.coin-trail { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 360px; }
.coin-dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; }
.coin-dot.heads { background: #f3ba2f; }
.coin-dot.tails { background: #22e27a; }
.coin-dot.miss { box-shadow: 0 0 0 2px var(--loss); }
.coin-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Roulette */
.roulette { width: 100%; display: grid; justify-items: center; gap: 22px; }
.rl-wheel-wrap { width: min(260px, 60vw); }
.rl-result { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; font-weight: 800; pointer-events: none; }
.rl-result.red { color: #ff6b7a; } .rl-result.black { color: #fff; } .rl-result.green { color: #3ee08a; }
.rl-table { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto auto; gap: 4px; width: min(720px, 100%); }
.rl-zero { grid-row: 1; height: 100%; }
.rl-grid { display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px; }
.rl-dozens { grid-column: 2; display: grid; grid-template-columns: repeat(3, 1fr) calc((100% - 48px) / 13); gap: 4px; }
.rl-dozens::after { content: ''; }
.rl-outs { grid-column: 2; display: grid; grid-template-columns: repeat(6, 1fr) calc((100% - 48px) / 13); gap: 4px; }
.rl-outs::after { content: ''; }
.rl-cell { position: relative; height: 40px; border-radius: 6px; font-weight: 700; font-size: 13px; color: #fff; transition: filter var(--t), transform var(--t-fast); }
.rl-cell:hover:not(:disabled) { filter: brightness(1.2); }
.rl-cell:disabled { cursor: default; }
.rl-cell.red { background: #c62f41; }
.rl-cell.black { background: #1e2c34; }
.rl-cell.green { background: #1f9d55; }
.rl-cell.out { background: var(--surface-2); font-size: 12px; }
.rl-cell.red-sw { background: #c62f41; }
.rl-cell.black-sw { background: #1e2c34; }
.rl-cell.is-hit { box-shadow: 0 0 0 2px var(--brand); filter: brightness(1.25); }
.rl-chip { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); min-width: 24px; height: 24px; padding: 0 4px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 2px dashed rgba(3,23,12,0.4); animation: pop 200ms var(--ease); pointer-events: none; }
@media (max-width: 767px) { .rl-cell { height: 30px; font-size: 10px; border-radius: 4px; } .rl-table { grid-template-columns: 30px 1fr; gap: 3px; } .rl-grid, .rl-dozens, .rl-outs { gap: 3px; } }

/* Baccarat */
.bac { width: min(680px, 100%); display: grid; gap: 22px; }
.bac-hands { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bac-hand { background: var(--surface); border-radius: var(--r-lg); padding: 14px; min-height: 180px; }
.bac-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; margin-bottom: 12px; }
.bac-score { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 8px; border-radius: 99px; background: var(--surface-3); font-size: 13px; font-weight: 700; }
.bac-cards { display: flex; gap: 8px; flex-wrap: wrap; }
.bac-cards .pcard { width: 72px; height: 102px; }
.bac-outcome { text-align: center; min-height: 30px; }
.bac-win { display: inline-block; padding: 6px 14px; border-radius: 99px; font-weight: 700; animation: pop 300ms var(--ease); }
.bac-win.player { background: #1f6fff; } .bac-win.banker { background: #d63447; } .bac-win.tie { background: #1f9d55; }
.bac-spots { display: grid; grid-template-columns: 1fr 0.8fr 1fr; gap: 10px; }
.bac-spot { position: relative; border-radius: var(--r-lg); padding: 16px 10px; display: grid; gap: 2px; text-align: center; border: 2px solid transparent; transition: transform var(--t-fast), filter var(--t); }
.bac-spot:hover:not(:disabled) { filter: brightness(1.15); transform: translateY(-2px); }
.bac-spot.player { background: rgba(31,111,255,0.18); border-color: rgba(31,111,255,0.5); }
.bac-spot.banker { background: rgba(214,52,71,0.18); border-color: rgba(214,52,71,0.5); }
.bac-spot.tie { background: rgba(31,157,85,0.18); border-color: rgba(31,157,85,0.5); }
.bac-spot span { font-size: 11.5px; color: var(--muted); }
.bac-spot em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--brand); min-height: 18px; }
.bac-spot.is-hit { box-shadow: 0 0 0 3px var(--brand); }
@media (max-width: 479px) { .bac-cards .pcard { width: 52px; height: 74px; } .bac-cards .pcard-big { font-size: 26px; } .bac-hands { gap: 8px; } }

/* Blackjack */
.bj { width: min(680px, 100%); display: grid; gap: 22px; justify-items: center; }
.bj-side, .bj-hand { display: grid; justify-items: center; gap: 10px; }
.bj-cards { display: flex; }
.bj-cards .pcard + .pcard { margin-left: -38px; }
.bj-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.bj-msg { min-height: 26px; font-weight: 600; color: var(--muted); }
.bj-hands { display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; }
.bj-hand { padding: 10px 14px; border-radius: var(--r-lg); border: 2px solid transparent; }
.bj-hand.is-active { border-color: var(--brand); background: rgba(34,226,122,0.05); }
.bj-hand.win, .bj-hand.bj { border-color: var(--win); }
.bj-hand.lose, .bj-hand.bust { opacity: 0.7; }
.bj-res { font-style: normal; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); }
.bj-hand.win .bj-res, .bj-hand.bj .bj-res { background: var(--win); color: #051b02; }
.bj-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
