/* ====== Dice ====== */
.dice-slider-wrap {
  width: 100%;
  max-width: 760px;
  position: relative;
  padding: 72px 16px 40px;
}

.dice-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(to right,
    var(--green) 0%,
    var(--green) var(--win-pct, 50%),
    var(--red) var(--win-pct, 50%),
    var(--red) 100%);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

.dice-track.over {
  background: linear-gradient(to right,
    var(--red) 0%,
    var(--red) var(--win-pct, 50%),
    var(--green) var(--win-pct, 50%),
    var(--green) 100%);
}

.dice-thumb {
  position: absolute;
  top: 50%;
  left: var(--win-pct, 50%);
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(180deg, #3a566e 0%, #22394d 100%);
  border: 2px solid var(--text);
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
  user-select: none;
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.12s var(--ease);
}

.dice-thumb:hover { transform: translate(-50%, -50%) scale(1.06); }
.dice-thumb:active { cursor: grabbing; transform: translate(-50%, -50%) scale(0.98); }

.dice-marker {
  position: absolute;
  top: -56px;
  transform: translateX(-50%);
  background: var(--surface-3);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-weight: 800;
  color: var(--text);
  font-size: 15px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.4s, left 0.5s var(--ease);
  box-shadow: var(--shadow-md);
  font-variant-numeric: tabular-nums;
}

.dice-marker.show { opacity: 1; }

.dice-marker.win {
  background: var(--grad-primary);
  color: #052a18;
  box-shadow: 0 8px 20px rgba(0, 230, 118, 0.4);
}

.dice-marker.loss {
  background: var(--grad-danger);
  color: var(--text);
  box-shadow: 0 8px 20px rgba(255, 71, 120, 0.4);
}

.dice-marker::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: var(--surface-3);
}

.dice-marker.win::after { border-top-color: #00e676; }
.dice-marker.loss::after { border-top-color: var(--red); }

.dice-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dice-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 760px;
  margin-top: 28px;
}

.history-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 760px;
  margin-bottom: 20px;
  min-height: 30px;
}

/* ====== Mines ====== */
.mines-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1;
}

.mine-tile {
  background: linear-gradient(180deg, #2b465c 0%, #1f3649 100%);
  border-radius: var(--radius);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  cursor: pointer;
  transition: background 0.14s var(--ease), transform 0.1s var(--ease), box-shadow 0.14s var(--ease);
  user-select: none;
  position: relative;
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.mine-tile:hover:not(.revealed):not(:disabled) {
  background: linear-gradient(180deg, #35536b 0%, #274257 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.mine-tile:active:not(.revealed):not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.mine-tile.revealed {
  cursor: default;
  box-shadow: none;
  transform: none;
}

.mine-tile.gem {
  background:
    radial-gradient(circle at 40% 30%, rgba(255, 255, 255, 0.15), transparent 50%),
    linear-gradient(160deg, rgba(0, 230, 118, 0.22), rgba(0, 230, 118, 0.08));
  border-color: var(--green);
  animation: pop 0.28s var(--ease);
}

.mine-tile.gem::before {
  content: '';
  width: 54%;
  height: 54%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'><defs><linearGradient id='g' x1='0' y1='0' x2='1' y2='1'><stop offset='0' stop-color='%23a5ffce'/><stop offset='1' stop-color='%2300e676'/></linearGradient></defs><path d='M24 4 L40 18 L24 44 L8 18 Z' fill='url(%23g)' stroke='%23ffffff' stroke-width='1.5' stroke-linejoin='round'/><path d='M24 4 L40 18 L24 18 L8 18 Z' fill='%23ffffff' opacity='0.35'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 3px 6px rgba(0, 230, 118, 0.35));
}

.mine-tile.bomb {
  background:
    radial-gradient(circle at 40% 30%, rgba(255, 255, 255, 0.1), transparent 50%),
    linear-gradient(160deg, rgba(255, 71, 120, 0.25), rgba(255, 71, 120, 0.08));
  border-color: var(--red);
  animation: pop 0.28s var(--ease);
}

.mine-tile.bomb::before {
  content: '';
  width: 56%;
  height: 56%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'><circle cx='22' cy='28' r='14' fill='%23160a10' stroke='%23ff4778' stroke-width='2'/><rect x='20' y='14' width='4' height='5' rx='1' fill='%23ff4778'/><path d='M24 14 L33 6' stroke='%23ff4778' stroke-width='2.5' stroke-linecap='round'/><circle cx='34' cy='6' r='3' fill='%23ffcb3a'/><circle cx='34' cy='6' r='5.5' fill='none' stroke='%23ffcb3a' stroke-width='1' opacity='0.6'/><circle cx='17' cy='24' r='3' fill='%23ffffff' opacity='0.35'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 3px 6px rgba(255, 71, 120, 0.4));
}

.mine-tile.dim {
  opacity: 0.35;
  filter: saturate(0.6);
}

.mine-tile.bomb.dim,
.mine-tile.gem.dim {
  opacity: 0.5;
}

@keyframes pop {
  0% { transform: scale(0.5); opacity: 0.4; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

/* ====== Limbo ====== */
.limbo-display {
  text-align: center;
  padding: 50px 0;
  position: relative;
}

.limbo-multiplier {
  font-size: 112px;
  font-weight: 800;
  letter-spacing: -4px;
  color: var(--text);
  transition: color 0.2s;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
  line-height: 1;
}

.limbo-multiplier.win {
  background: linear-gradient(135deg, #a5ffce 0%, #00e676 50%, #0cb863 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(0, 230, 118, 0.5));
  animation: limboPop 0.45s var(--ease);
}

.limbo-multiplier.loss {
  color: var(--red);
  filter: drop-shadow(0 0 20px rgba(255, 71, 120, 0.35));
}

.limbo-multiplier .x {
  font-size: 52px;
  opacity: 0.55;
  margin-left: 6px;
  font-weight: 700;
}

@keyframes limboPop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ====== Crash ====== */
.crash-canvas-wrap {
  width: 100%;
  height: 400px;
  position: relative;
  background:
    radial-gradient(600px 300px at 50% 100%, rgba(51, 217, 255, 0.08), transparent 70%),
    var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.crash-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.crash-multiplier {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 84px;
  font-weight: 800;
  color: var(--text);
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
  transition: color 0.2s var(--ease);
}

.crash-multiplier.crashed {
  background: linear-gradient(135deg, #ff88a6, #ff4778);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.crash-multiplier.cashed {
  background: linear-gradient(135deg, #a5ffce, #00e676);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.crash-history {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
  justify-content: center;
}

/* ====== Plinko ====== */
.plinko-wrap {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.plinko-canvas {
  width: 100%;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: block;
}

.plinko-multipliers {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  width: 100%;
  justify-content: center;
}

.plinko-mult {
  flex: 1;
  text-align: center;
  padding: 7px 0;
  font-size: 11px;
  font-weight: 800;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text);
  min-width: 30px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  font-variant-numeric: tabular-nums;
}

.plinko-mult.hit {
  transform: translateY(-6px) scale(1.12);
  box-shadow: 0 10px 24px rgba(255, 211, 106, 0.35);
}

/* ====== Wheel ====== */
.wheel-wrap {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
}

.wheel-svg {
  width: 100%;
  height: 100%;
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.21, 1);
}

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

.wheel-center {
  position: absolute;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #1f3649 0%, #070d13 100%);
  border: 3px solid var(--bg-4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
  font-variant-numeric: tabular-nums;
  transition: color 0.25s var(--ease);
}
.wheel-center.win {
  color: var(--green-bright);
  text-shadow: 0 0 14px rgba(0, 230, 118, 0.6);
}
.wheel-center.loss { color: var(--text-muted); }
