/* ===========================================================
   Games — shared layout + per-game styles
   =========================================================== */

.game-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  margin-top: 20px;
}

.game-stage {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-height: 600px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.game-controls {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: start;
  position: sticky;
  top: 90px;
}

.game-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.game-title .icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-size: 20px;
}
.game-title h1 {
  font-size: 22px;
  letter-spacing: 1px;
}
.game-title small {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.bet-input-group {
  display: flex;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.bet-input-group input {
  flex: 1;
  padding: 12px 14px;
  background: transparent;
  border: none;
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  outline: none;
  font-variant-numeric: tabular-nums;
}
.bet-input-group .bet-quick {
  padding: 0 12px;
  background: var(--bg-3);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  border-left: 1px solid var(--line);
}
.bet-input-group .bet-quick:hover { color: var(--accent); }

.amount-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.amount-grid button {
  padding: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.amount-grid button:hover { color: var(--accent); border-color: var(--accent); }

.btn-bet {
  background: linear-gradient(135deg, var(--green), #00b4ff);
  color: #001530;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 1px;
  padding: 16px;
  border-radius: 12px;
  text-transform: uppercase;
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.3);
  transition: 0.15s;
}
.btn-bet:hover { transform: translateY(-1px); box-shadow: 0 0 28px rgba(0, 230, 118, 0.5); }
.btn-bet:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-cashout {
  background: linear-gradient(135deg, var(--gold), var(--accent-2));
  color: #1a1300;
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.stat-cell {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.stat-cell .lbl { font-size: 10px; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; }
.stat-cell .val { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }

@media (max-width: 980px) {
  .game-shell { grid-template-columns: 1fr; }
  .game-controls { position: static; }
}

/* ============== Provably Fair panel ============== */

.fair-panel {
  margin-top: 16px;
  padding: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 11px;
}
.fair-panel summary {
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--cyan);
  text-transform: uppercase;
  list-style: none;
}
.fair-panel summary::before { content: '▸ '; }
.fair-panel[open] summary::before { content: '▾ '; }
.fair-panel .row { margin-top: 10px; word-break: break-all; line-height: 1.6; color: var(--muted); }
.fair-panel code { color: var(--cyan); font-family: 'Courier New', monospace; }

/* ============== SLOTS — Turbo Reels ============== */

.slot-frame {
  background:
    linear-gradient(180deg, #1a0e0a 0%, #2b0f04 100%);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 22px;
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(255, 61, 0, 0.25);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.slot-banner {
  text-align: center;
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--gold);
  letter-spacing: 4px;
  text-shadow:
    0 0 20px rgba(255, 215, 0, 0.6),
    0 2px 0 rgba(0, 0, 0, 0.5);
}

.reels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  background: #000;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #2b0f04;
}

.reel {
  position: relative;
  overflow: hidden;
  background: #1a0a04;
  border-radius: 6px;
  height: 330px;
}

.reel-strip {
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.05s linear;
}

.reel-cell {
  flex: 1 0 110px;
  height: 110px;
  display: grid;
  place-items: center;
  font-size: 56px;
  border-bottom: 1px solid rgba(255, 61, 0, 0.1);
  user-select: none;
}

.reel-cell.win {
  background: radial-gradient(circle, rgba(255, 215, 0, 0.4), transparent 70%);
  animation: pulse 0.6s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { background: radial-gradient(circle, rgba(255, 215, 0, 0.3), transparent 70%); }
  to { background: radial-gradient(circle, rgba(255, 215, 0, 0.55), transparent 70%); }
}

.win-ribbon {
  text-align: center;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gold);
  letter-spacing: 2px;
  min-height: 30px;
  text-shadow: 0 0 16px rgba(255, 215, 0, 0.6);
}

.win-ribbon.huge {
  animation: bigwin 0.8s ease-in-out infinite alternate;
}
@keyframes bigwin {
  from { transform: scale(1); color: var(--gold); }
  to { transform: scale(1.05); color: #fff8b0; }
}

/* ============== CRASH ============== */

.crash-stage {
  flex: 1;
  background:
    radial-gradient(ellipse at bottom, rgba(255, 61, 0, 0.18), transparent 70%),
    linear-gradient(180deg, #050811, #0a0e1a);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  min-height: 480px;
  border: 1px solid var(--line);
}

#crash-canvas { width: 100%; height: 100%; display: block; position: absolute; inset: 0; }

.crash-multi {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: clamp(60px, 10vw, 120px);
  color: var(--green);
  text-shadow: 0 0 30px rgba(0, 230, 118, 0.5);
  z-index: 2;
  letter-spacing: 4px;
  pointer-events: none;
}

.crash-multi.crashed { color: var(--pink); text-shadow: 0 0 30px rgba(255, 46, 107, 0.6); }
.crash-multi.waiting { color: var(--muted); font-size: 32px; letter-spacing: 6px; }

.crash-history {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  gap: 6px;
  z-index: 3;
  flex-wrap: wrap;
}

.crash-history .pt {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--line);
}
.crash-history .pt.green { color: var(--green); border-color: rgba(0, 230, 118, 0.4); }
.crash-history .pt.gold { color: var(--gold); border-color: rgba(255, 215, 0, 0.4); }
.crash-history .pt.red { color: var(--pink); border-color: rgba(255, 46, 107, 0.4); }

/* ============== DICE ============== */

.dice-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding: 20px;
}

.dice-result {
  text-align: center;
  font-family: var(--font-display);
  font-size: 96px;
  color: var(--text);
  text-shadow: 0 0 30px rgba(255, 61, 0, 0.4);
  font-variant-numeric: tabular-nums;
  min-height: 110px;
}
.dice-result.win { color: var(--green); text-shadow: 0 0 30px rgba(0, 230, 118, 0.5); }
.dice-result.lose { color: var(--pink); text-shadow: 0 0 30px rgba(255, 46, 107, 0.5); }

.slider-wrap {
  position: relative;
  height: 56px;
  background: var(--bg-2);
  border-radius: 999px;
  padding: 6px;
  border: 1px solid var(--line);
}

.slider-track {
  position: absolute;
  inset: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--pink) var(--cut), var(--green) var(--cut), var(--green));
  --cut: 50%;
}

.slider-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 56px;
  background: var(--bg-3);
  border: 2px solid var(--accent);
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
  box-shadow: 0 0 20px rgba(255, 61, 0, 0.4);
  cursor: grab;
  z-index: 2;
}

.slider-handle:active { cursor: grabbing; }

.slider-rule {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}

.dice-mode {
  display: flex;
  gap: 6px;
  background: var(--bg-2);
  border-radius: 10px;
  padding: 4px;
}
.dice-mode button {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
}
.dice-mode button.active { background: var(--bg-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }

/* ============== PLINKO ============== */

.plinko-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#plinko-canvas {
  background: linear-gradient(180deg, #0a0e1a, #050811);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  height: 500px;
}

.plinko-slots {
  display: flex;
  width: 100%;
  max-width: 600px;
  margin-top: 8px;
  gap: 2px;
}
.plinko-slots .slot {
  flex: 1;
  text-align: center;
  padding: 8px 2px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 11px;
  color: #001020;
}

.risk-row {
  display: flex;
  gap: 6px;
}
.risk-row button {
  flex: 1;
  padding: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.risk-row button.active { background: var(--bg-3); color: var(--text); border-color: var(--accent); }

/* ============== MINES ============== */

.mines-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.mines-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1;
}

.mine-cell {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 28px;
  cursor: pointer;
  transition: 0.15s;
  user-select: none;
  position: relative;
}

.mine-cell:hover:not(.revealed):not(:disabled) {
  background: var(--bg-2);
  border-color: var(--accent);
  transform: scale(1.04);
}

.mine-cell.revealed {
  cursor: default;
}
.mine-cell.gem {
  background: radial-gradient(circle, rgba(0, 230, 118, 0.3), var(--bg-2));
  border-color: var(--green);
}
.mine-cell.bomb {
  background: radial-gradient(circle, rgba(255, 46, 107, 0.3), var(--bg-2));
  border-color: var(--pink);
}
.mine-cell.dim { opacity: 0.4; }

/* ============== LIMBO ============== */

.limbo-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.limbo-display {
  font-family: var(--font-display);
  font-size: clamp(80px, 14vw, 160px);
  color: var(--text);
  text-shadow: 0 0 40px rgba(0, 229, 255, 0.3);
  font-variant-numeric: tabular-nums;
}
.limbo-display.win { color: var(--green); text-shadow: 0 0 40px rgba(0, 230, 118, 0.5); }
.limbo-display.lose { color: var(--pink); text-shadow: 0 0 40px rgba(255, 46, 107, 0.5); }

/* ============== BLACKJACK ============== */

.bj-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(ellipse at center, #0d3b1f 0%, #051a0c 70%);
  border: 2px solid #2a5a3a;
  border-radius: 16px;
  padding: 30px;
  min-height: 500px;
}

.bj-row { display: flex; flex-direction: column; gap: 14px; align-items: center; }

.bj-label {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 3px;
  color: #87b89a;
  text-transform: uppercase;
}

.bj-cards { display: flex; gap: -20px; min-height: 130px; }
.bj-cards .card-el { margin-left: -30px; }
.bj-cards .card-el:first-child { margin-left: 0; }

.card-el {
  width: 90px;
  height: 130px;
  background: #fff;
  border-radius: 8px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 36px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  animation: dealIn 0.3s ease;
}

.card-el.red { color: #c2185b; }
.card-el.black { color: #0a0e1a; }
.card-el.back {
  background:
    repeating-linear-gradient(45deg, #ff3d00 0 6px, #c2185b 6px 12px);
  color: transparent;
}

.card-el .corner {
  position: absolute;
  font-size: 12px;
  font-family: var(--font-body);
  font-weight: 700;
}
.card-el .corner.tl { top: 6px; left: 8px; }
.card-el .corner.br { bottom: 6px; right: 8px; transform: rotate(180deg); }

@keyframes dealIn {
  from { transform: translateY(-40px) rotate(-10deg); opacity: 0; }
  to { transform: translateY(0) rotate(0); opacity: 1; }
}

.bj-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bj-actions.four { grid-template-columns: repeat(4, 1fr); }

.btn-action {
  padding: 14px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text);
}
.btn-action:hover:not(:disabled) { border-color: var(--accent); background: var(--bg-2); }
.btn-action:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============== ROULETTE ============== */

.roulette-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 16px;
}

.wheel-wrap {
  position: relative;
  width: 300px;
  height: 300px;
}

#roulette-wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6), inset 0 0 30px rgba(0, 0, 0, 0.5);
  transition: transform 5s cubic-bezier(0.17, 0.67, 0.16, 1);
}

.wheel-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 20px solid var(--gold);
  z-index: 3;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 1px;
  z-index: 2;
  box-shadow: var(--shadow-glow);
}

.roulette-table {
  display: grid;
  grid-template-columns: 60px repeat(12, 1fr);
  gap: 2px;
  width: 100%;
  max-width: 700px;
  font-size: 12px;
  font-weight: 700;
}

.bet-cell {
  padding: 10px 4px;
  text-align: center;
  background: #0d3b1f;
  border: 1px solid #1a4a2a;
  cursor: pointer;
  position: relative;
  transition: 0.15s;
  border-radius: 4px;
  color: #fff;
  user-select: none;
}
.bet-cell.red { background: #c2185b; border-color: #d62570; }
.bet-cell.black { background: #1a1a1a; border-color: #2a2a2a; }
.bet-cell.green { background: #0d5b1f; border-color: #1a7a30; grid-row: span 3; display: grid; place-items: center; }
.bet-cell.outside { background: var(--bg-3); border-color: var(--line); padding: 12px 4px; font-size: 11px; }

.bet-cell:hover { box-shadow: inset 0 0 0 2px var(--gold); }
.bet-cell .chip-on {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #fff;
  font-size: 9px;
  color: #0a0e1a;
  display: grid;
  place-items: center;
  font-weight: 800;
  z-index: 2;
}

.chips-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.chip-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  color: #fff;
  border: 3px dashed rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: 0.15s;
}
.chip-btn:hover { transform: scale(1.08); }
.chip-btn.active { box-shadow: 0 0 14px rgba(255, 215, 0, 0.6); border-color: var(--gold); }

.chip-1 { background: linear-gradient(135deg, #5a6388, #2a3050); }
.chip-5 { background: linear-gradient(135deg, #00e676, #008a3a); }
.chip-25 { background: linear-gradient(135deg, #00e5ff, #0066ff); }
.chip-100 { background: linear-gradient(135deg, #ff3d00, #c2185b); }
.chip-500 { background: linear-gradient(135deg, #ffd700, #ff7a00); color: #1a1300; }

@media (max-width: 720px) {
  .roulette-table { grid-template-columns: 40px repeat(12, 1fr); font-size: 10px; }
  .bet-cell { padding: 8px 2px; }
  .wheel-wrap { width: 240px; height: 240px; }
}
