/**
 * CIB Casino — layout and animation for the house games.
 * Playing-card styling is inherited from cardGames.css.
 */

.casino-felt {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(16, 185, 129, 0.10), transparent 60%),
    linear-gradient(135deg, #08361f 0%, #0d4a2b 45%, #07301c 100%);
  border-radius: 20px;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .55), 0 12px 36px rgba(0, 0, 0, .35);
  position: relative;
  overflow: hidden;
}
.casino-felt::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(45deg, transparent, transparent 12px, rgba(255, 255, 255, .015) 12px, rgba(255, 255, 255, .015) 24px);
}

/* ── Slots ────────────────────────────────────────────────────────────────── */

.slot-window {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 28px 16px;
}
.slot-reel {
  width: 92px;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  line-height: 1;
  border-radius: 14px;
  background: linear-gradient(180deg, #1c1c24 0%, #0e0e14 100%);
  border: 2px solid rgba(255, 215, 0, .35);
  box-shadow: inset 0 6px 18px rgba(0, 0, 0, .6);
  user-select: none;
}
@keyframes reelPop {
  0% { transform: scale(.82); filter: brightness(1.6); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); filter: brightness(1); }
}
.reel-pop { animation: reelPop .35s ease-out; }

/* ── Coinflip ─────────────────────────────────────────────────────────────── */

.coin-face {
  width: 140px;
  height: 140px;
  margin: 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  background: linear-gradient(145deg, #fde68a 0%, #d97706 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45), inset 0 -6px 14px rgba(0, 0, 0, .25);
  border: 4px solid rgba(255, 255, 255, .25);
}
@keyframes coinSpin {
  0% { transform: rotateY(0) scale(1); }
  50% { transform: rotateY(900deg) scale(1.12); }
  100% { transform: rotateY(1800deg) scale(1); }
}
.coin-spin { animation: coinSpin .9s cubic-bezier(.3, .1, .3, 1); }

/* ── Dice ─────────────────────────────────────────────────────────────────── */

.dice-slider {
  width: 100%;
  appearance: none;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981 0%, #f59e0b 55%, #ef4444 100%);
  outline: none;
}
.dice-slider::-webkit-slider-thumb {
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #0b0e14;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
.dice-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #0b0e14;
  cursor: pointer;
}

/* ── Roulette ─────────────────────────────────────────────────────────────── */

@keyframes wheelSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(1440deg); }
}
.wheel-spin { animation: wheelSpin 1.2s cubic-bezier(.2, .7, .2, 1); }

.roulette-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 3px;
}
.rl-cell {
  padding: 9px 2px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  border-radius: 5px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease;
  color: #fff;
  user-select: none;
}
.rl-cell:hover { transform: translateY(-2px); }
.rl-cell.selected {
  border-color: #ffd700;
  box-shadow: 0 0 12px rgba(255, 215, 0, .55);
}
.rl-red { background: #dc2626; }
.rl-black { background: #111827; }
.rl-green { background: #059669; }
.rl-outside {
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, .08);
  transition: background .15s ease, transform .15s ease;
  user-select: none;
}
.rl-outside:hover { background: rgba(255, 255, 255, .16); transform: translateY(-1px); }
.rl-outside.selected { border-color: #ffd700; box-shadow: 0 0 12px rgba(255, 215, 0, .45); }

/* ── Shared ───────────────────────────────────────────────────────────────── */

.casino-chip {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  border: 3px dashed rgba(255, 255, 255, .3);
  transition: transform .15s ease;
  user-select: none;
}
.casino-chip:hover { transform: scale(1.08); }
.casino-chip.selected {
  border-style: solid;
  border-color: #ffd700;
  box-shadow: 0 0 14px rgba(255, 215, 0, .55);
}

.casino-action {
  padding: 12px 26px;
  border-radius: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: transform .15s ease, filter .15s ease;
}
.casino-action:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.1); }
.casino-action:disabled { opacity: .45; cursor: not-allowed; }

.bet-item {
  background: rgba(255, 255, 255, .1);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: #fff;
  border: none;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .reel-pop, .coin-spin, .wheel-spin { animation: none !important; }
  .casino-action:hover, .casino-chip:hover, .rl-cell:hover { transform: none; }
}

@media (max-width: 640px) {
  .slot-reel { width: 70px; height: 88px; font-size: 36px; }
  .coin-face { width: 110px; height: 110px; font-size: 52px; }
  .roulette-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .casino-chip { width: 44px; height: 44px; font-size: 10px; }
}
