/* Casino + Store + Toasts */

.casino-tabs, .store-tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 24px 0 18px;
  overflow-x: auto;
}

.cas-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-1);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
  min-width: 100px;
}
.cas-tab svg { width: 14px; height: 14px; }
.cas-tab:hover { color: var(--text-0); background: var(--bg-3); }
.cas-tab.active {
  background: linear-gradient(135deg, var(--bg-4), var(--bg-3));
  border-color: var(--border-strong);
  color: var(--text-0);
  box-shadow: 0 0 16px var(--amber-glow);
}

.casino-stage { position: relative; }
.game-panel { display: none; grid-template-columns: 320px 1fr; gap: 20px; }
.game-panel.active { display: grid; animation: fadeIn 0.25s ease; }

.game-controls {
  background: linear-gradient(180deg, rgba(16, 13, 31, 0.7) 0%, rgba(10, 8, 20, 0.7) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  backdrop-filter: blur(10px);
}

.game-stage {
  background: linear-gradient(180deg, rgba(16, 13, 31, 0.7) 0%, rgba(10, 8, 20, 0.7) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.control-group { display: flex; flex-direction: column; gap: 8px; }
.control-group label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-2);
  font-weight: 700;
  display: flex;
  justify-content: space-between;
}

.bet-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  height: 44px;
}
.bet-input .ccy { color: var(--gold); font-family: 'Instrument Serif', serif; font-size: 22px; }
.bet-input input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-0);
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  width: 100%;
}

.seg-bar {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.seg {
  flex: 1;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text-1);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.seg:hover { color: var(--text-0); }
.seg.active { background: var(--bg-4); color: var(--text-0); }

.game-btn {
  height: 44px;
  font-size: 13px;
  font-weight: 700;
  justify-content: center;
}

.game-summary {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Plinko */
.plinko-board {
  position: relative;
  width: 100%;
  max-width: 540px;
  aspect-ratio: 1.2;
  margin: 0 auto;
}

.plinko-svg { width: 100%; height: 100%; display: block; }
.plinko-peg { fill: rgba(167, 139, 250, 0.7); }
.plinko-peg-bright { fill: var(--amber-soft); filter: drop-shadow(0 0 6px var(--amber)); }
.plinko-ball {
  fill: var(--gold);
  filter: drop-shadow(0 0 8px var(--gold));
}

.plinko-mults {
  display: flex;
  gap: 2px;
  margin-top: 12px;
  width: 100%;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.plinko-mult {
  flex: 1;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  color: white;
  border-radius: 4px;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.plinko-mult.flash {
  transform: translateY(-8px) scale(1.1);
  box-shadow: 0 0 24px currentColor;
  filter: brightness(1.4);
}

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

.mine-cell {
  background: linear-gradient(180deg, var(--bg-4), var(--bg-3));
  border: 1px solid var(--border-mid);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  color: transparent;
  transition: all 0.15s;
  position: relative;
}
.mine-cell:hover:not(.revealed):not(.disabled) {
  background: var(--bg-5);
  transform: scale(1.04);
  box-shadow: 0 0 12px var(--amber-glow);
}
.mine-cell.disabled { cursor: not-allowed; opacity: 0.5; }
.mine-cell.gem {
  background: linear-gradient(135deg, var(--success-bg), var(--bg-3));
  border-color: var(--success-border);
  color: var(--success);
  animation: revealPop 0.3s ease;
}
.mine-cell.bomb {
  background: linear-gradient(135deg, var(--danger-bg), var(--bg-3));
  border-color: var(--danger-border);
  color: var(--danger);
  animation: revealShake 0.4s ease;
}
.mine-cell.gem svg, .mine-cell.bomb svg { width: 22px; height: 22px; }

@keyframes revealPop {
  0% { transform: scale(0.6); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes revealShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.mines-status {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--text-1);
  text-align: center;
  font-weight: 500;
}

/* Crash */
.crash-display {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.crash-mult {
  font-family: 'Instrument Serif', serif;
  font-size: 96px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text-0);
  line-height: 1;
  text-shadow: 0 0 40px var(--amber-glow);
  position: relative;
  z-index: 2;
  transition: color 0.2s;
}
.crash-mult.crashed { color: var(--danger); text-shadow: 0 0 40px rgba(244, 63, 94, 0.5); }
.crash-mult.cashed { color: var(--success); text-shadow: 0 0 40px rgba(52, 211, 153, 0.5); }

.crash-status {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 10px;
  letter-spacing: 0.04em;
}

.crash-curve {
  position: absolute;
  inset: 24px;
  width: calc(100% - 48px);
  height: 50%;
  bottom: 60px;
  z-index: 1;
  opacity: 0.7;
}

.crash-history {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 24px;
  position: relative;
  z-index: 2;
}

.crash-hist {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg-3);
  border: 1px solid var(--border);
}
.crash-hist-low { color: var(--danger); border-color: var(--danger-border); background: var(--danger-bg); }
.crash-hist-mid { color: var(--text-1); }
.crash-hist-high { color: var(--success); border-color: var(--success-border); background: var(--success-bg); }

/* Dice */
.dice-display {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.dice-result {
  font-family: 'Instrument Serif', serif;
  font-size: 96px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text-0);
  line-height: 1;
  transition: color 0.3s;
}
.dice-result.win { color: var(--success); text-shadow: 0 0 40px rgba(52, 211, 153, 0.5); }
.dice-result.lose { color: var(--danger); text-shadow: 0 0 40px rgba(244, 63, 94, 0.5); }

.dice-label {
  font-size: 12.5px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
}

.dice-track {
  position: relative;
  width: 100%;
  height: 14px;
  background: linear-gradient(90deg, var(--danger-bg) 0%, var(--success-bg) 100%);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-top: 12px;
}
.dice-track-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, var(--success), var(--success-bg));
  border-radius: 999px;
  opacity: 0.4;
}
.dice-marker {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 22px;
  background: var(--gold);
  border-radius: 2px;
  transform: translateX(-50%);
  box-shadow: 0 0 8px var(--gold);
}

.dice-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: var(--bg-3);
  border-radius: 999px;
  outline: none;
}
.dice-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  background: var(--gold);
  border: 2px solid var(--bg-0);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px var(--gold);
}

/* Coinflip */
.coin-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  perspective: 1000px;
}

.coin {
  position: relative;
  width: 160px; height: 160px;
  transform-style: preserve-3d;
  transition: transform 0s;
}
.coin.flipping { transition: transform 1.4s cubic-bezier(0.5, 0, 0.5, 1); }
.coin-side {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Serif', serif;
  font-size: 80px;
  font-weight: 400;
  color: white;
  backface-visibility: hidden;
  border: 4px solid rgba(0,0,0,0.2);
}
.coin-heads {
  background: radial-gradient(circle at 30% 30%, var(--amber-soft), var(--amber-deep));
  box-shadow: 0 8px 32px var(--amber-glow), inset 0 -4px 12px rgba(0,0,0,0.3);
}
.coin-tails {
  background: radial-gradient(circle at 30% 30%, var(--violet-soft), #0891b2);
  transform: rotateY(180deg);
  box-shadow: 0 8px 32px var(--violet-glow), inset 0 -4px 12px rgba(0,0,0,0.3);
}

.coin-status {
  font-size: 13px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
}

.coin-history {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 280px;
}

.coin-hist {
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.coin-hist.heads { background: var(--amber-glow); color: var(--amber-soft); border: 1px solid rgba(167, 139, 250, 0.4); }
.coin-hist.tails { background: var(--violet-glow); color: var(--violet-soft); border: 1px solid rgba(34, 211, 238, 0.3); }

/* Wheel */
.wheel-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  position: relative;
}

.wheel-svg {
  width: 320px;
  height: 320px;
  filter: drop-shadow(0 8px 32px rgba(167, 139, 250, 0.2));
}

.wheel-pointer {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 18px solid var(--gold);
  filter: drop-shadow(0 0 6px var(--gold));
  z-index: 2;
}

.wheel-status {
  font-size: 13px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
}

#wheel-g {
  transform-box: fill-box;
  transform-origin: 100px 100px;
  transition: transform 4.5s cubic-bezier(0.15, 0.7, 0.25, 1);
}

/* Store */
.store-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.store-card {
  background: linear-gradient(180deg, rgba(16, 13, 31, 0.7) 0%, rgba(10, 8, 20, 0.7) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.15s;
  backdrop-filter: blur(10px);
}
.store-card:hover { border-color: var(--border-mid); transform: translateY(-2px); }

.store-card-rare {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.06), rgba(10, 8, 20, 0.7));
  border-color: rgba(34, 211, 238, 0.25);
}
.store-card-rare::before {
  content: '';
  position: absolute;
  top: -50%; right: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.08), transparent 60%);
  pointer-events: none;
}

.store-card-illicit {
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.04), rgba(10, 8, 20, 0.7));
  border-color: rgba(244, 63, 94, 0.22);
}

.store-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--bg-4), var(--bg-2));
  border: 1px solid var(--border-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber-soft);
  position: relative;
  z-index: 1;
}
.store-icon svg { width: 20px; height: 20px; }

.store-card-rare .store-icon { color: var(--violet-soft); }
.store-card-illicit .store-icon { color: var(--danger); }

.store-card .name { font-size: 14px; font-weight: 600; color: var(--text-0); position: relative; z-index: 1; }
.store-card .desc { font-size: 11.5px; color: var(--text-2); line-height: 1.5; position: relative; z-index: 1; }

.store-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
  gap: 8px;
}
.store-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.inv-item {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
  position: relative;
}
.inv-item.equipped {
  border-color: var(--success-border);
  background: linear-gradient(180deg, var(--success-bg), var(--bg-3));
}
.inv-item .name { font-size: 11.5px; font-weight: 600; color: var(--text-0); }
.inv-item .qty {
  position: absolute;
  top: 6px; right: 6px;
  background: var(--bg-4);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--text-1);
}

/* Toasts */
.toast-stack {
  position: fixed;
  top: 88px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
}

.toast {
  background: linear-gradient(180deg, rgba(24, 20, 48, 0.95), rgba(16, 13, 31, 0.95));
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 360px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 24px rgba(167, 139, 250, 0.1);
  animation: toastIn 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
  pointer-events: auto;
  backdrop-filter: blur(20px);
}
.toast.exit { animation: toastOut 0.25s ease forwards; }

.toast.success { border-color: var(--success-border); background: linear-gradient(180deg, rgba(52, 211, 153, 0.12), rgba(16, 13, 31, 0.95)); }
.toast.danger { border-color: var(--danger-border); background: linear-gradient(180deg, rgba(244, 63, 94, 0.12), rgba(16, 13, 31, 0.95)); }
.toast.warning { border-color: rgba(245, 158, 11, 0.3); background: linear-gradient(180deg, rgba(245, 158, 11, 0.1), rgba(16, 13, 31, 0.95)); }
.toast.info { border-color: rgba(34, 211, 238, 0.3); background: linear-gradient(180deg, rgba(34, 211, 238, 0.08), rgba(16, 13, 31, 0.95)); }

.toast-ico {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.toast.success .toast-ico { background: var(--success-bg); color: var(--success); }
.toast.danger .toast-ico { background: var(--danger-bg); color: var(--danger); }
.toast.warning .toast-ico { background: var(--warning-bg); color: var(--warning); }
.toast.info .toast-ico { background: var(--violet-glow); color: var(--violet-soft); }
.toast-ico svg { width: 14px; height: 14px; }

.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 13px; font-weight: 700; color: var(--text-0); }
.toast-msg { font-size: 11.5px; color: var(--text-1); margin-top: 2px; }

@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(20px); opacity: 0; }
}

/* Buy modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 5, 13, 0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.active { display: flex; }
.modal {
  background: linear-gradient(180deg, rgba(24, 20, 48, 0.98), rgba(16, 13, 31, 0.98));
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7), 0 0 48px var(--amber-glow);
  position: relative;
  animation: modalIn 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-1);
  cursor: pointer;
}
@keyframes modalIn {
  from { transform: scale(0.95) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
