/* ============================================================
   play.css — Play mode: wheel, table, chips, spin
   ============================================================ */

/* -- Play header (credits + info) --------------------------- */
.play-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--glass-shadow);
  gap: 12px;
}
.play-bankroll__label {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.play-bankroll__value {
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--gold-2);
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.play-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.play-info__row { display: flex; gap: 8px; justify-content: flex-end; }
.play-info__row strong { color: var(--ink); min-width: 30px; text-align: right; }

/* -- Wheel -------------------------------------------------- */
.play-wheel-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
}
.play-wheel {
  position: relative;
  width: min(280px, 70vw);
  height: min(280px, 70vw);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #1a3329 0%, #0a1f17 70%);
  border: 4px solid var(--gold);
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.6),
    0 0 24px rgba(212, 175, 55, 0.3),
    0 4px 20px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.play-wheel::before {
  /* Inner ring decoration */
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.3);
  pointer-events: none;
}
.play-wheel::after {
  /* Center hub */
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--gold);
}
.play-wheel__inner {
  position: absolute;
  inset: 0;
  transform-origin: center center;
  will-change: transform;
}
.play-wheel__num {
  position: absolute;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 10px;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.play-wheel__num--red   { background: var(--red); }
.play-wheel__num--black { background: #1a1a1a; border-color: #444; }
.play-wheel__num--green { background: var(--green); }
.play-wheel__pointer {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 14px solid var(--gold-2);
  filter: drop-shadow(0 0 4px var(--gold));
  z-index: 5;
}

/* -- Result display ----------------------------------------- */
.play-result {
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.play-result__hint {
  color: var(--ink-3);
  font-size: var(--fs-sm);
  font-style: italic;
}
.play-result__num {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  animation: resultPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.play-result__num--red   { background: linear-gradient(160deg, #e8506b 0%, #a91b2d 100%); }
.play-result__num--black { background: linear-gradient(160deg, #2c2c2c 0%, #0a0a0a 100%); }
.play-result__num--green { background: linear-gradient(160deg, #2bbd7a 0%, #126b41 100%); }
@keyframes resultPop {
  0%   { transform: scale(0.2) rotate(-180deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
.play-result__meta {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.play-result__color {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.play-result__payout {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--gold-2);
}
.play-result__payout .muted { color: var(--ink-3); font-weight: 400; font-size: var(--fs-xs); }
.play-result__net {
  font-size: var(--fs-sm);
  font-weight: 600;
}
.play-result__net.is-up   { color: var(--green-2); }
.play-result__net.is-down { color: var(--red); }

/* -- Betting table ------------------------------------------ */
.play-table-card { padding: 12px; }
.play-table-wrap { overflow-x: auto; }
.play-table {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-auto-rows: 38px;
  gap: 3px;
  user-select: none;
  min-width: 280px;
}
.pt-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--felt);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  color: #fff;
  font-weight: 600;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
  padding: 0;
  font-family: inherit;
  text-align: center;
  line-height: 1.1;
  overflow: hidden;
}
.pt-cell:active { transform: scale(0.96); }
.pt-cell:hover  { background: var(--felt-2); border-color: var(--gold); }

.pt-num--red   { background: linear-gradient(160deg, #e8506b 0%, #a91b2d 100%); }
.pt-num--black { background: linear-gradient(160deg, #2c2c2c 0%, #0a0a0a 100%); }
.pt-zero {
  background: linear-gradient(160deg, #2bbd7a 0%, #126b41 100%);
  font-size: var(--fs-md);
  grid-column: span 1;
}
.pt-zero--single { grid-column: 1 / -1; max-height: 38px; }

.pt-outside {
  background: linear-gradient(180deg, #16352b 0%, #0a1f17 100%);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pt-outside small { font-size: 9px; opacity: 0.6; font-weight: 400; }
.pt-outside--red   { background: linear-gradient(160deg, #e8506b 0%, #a91b2d 100%); }
.pt-outside--black { background: linear-gradient(160deg, #2c2c2c 0%, #0a0a0a 100%); }

.pt-chip-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.pt-chip {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--gold);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  animation: chipPlace 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.pt-chip--1   { background: #f1d271; color: #1a1a1a; }
.pt-chip--5   { background: var(--red); }
.pt-chip--25  { background: var(--green); }
.pt-chip--100 { background: #1a1a1a; border-color: var(--gold); }
@keyframes chipPlace {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* -- Chip rack --------------------------------------------- */
.play-rack {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  bottom: calc(var(--nav-h) + 12px + var(--safe-bottom));
  z-index: 10;
}
.play-chips {
  display: flex;
  gap: 6px;
  flex: 1;
}
.chip-rack-chip {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: var(--bg-2);
  color: var(--ink);
  font-weight: 700;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s;
  font-family: inherit;
}
.chip-rack-chip:active { transform: scale(0.94); }
.chip-rack-chip.is-active {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
  transform: translateY(-2px);
}
.chip-rack-chip--1   { background: #f1d271; color: #1a1a1a; }
.chip-rack-chip--5   { background: var(--red); color: #fff; }
.chip-rack-chip--25  { background: var(--green); color: #fff; }
.chip-rack-chip--100 { background: #1a1a1a; color: var(--gold); border-color: var(--gold); }
.chip-rack-chip--500 { background: linear-gradient(135deg, #7c3aed, #4f46e5); color: #fff; border-color: #a78bfa; }

.play-rack-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.play-spin-btn {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
  color: #1a1a1a;
  border: none;
  padding: 0 18px;
  height: 44px;
  border-radius: 22px;
  font-weight: 800;
  font-size: var(--fs-md);
  letter-spacing: 1px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.4);
  transition: transform 0.1s, box-shadow 0.2s;
  font-family: inherit;
}
.play-spin-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.5);
}
.play-spin-btn:active:not(:disabled) { transform: scale(0.98); }
.play-spin-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}
.play-spin-btn.is-spinning {
  background: linear-gradient(135deg, #6c7770 0%, #444 100%);
  color: var(--ink-2);
}
.play-spin-btn.is-spinning i { animation: spinIcon 1s linear infinite; }
@keyframes spinIcon {
  to { transform: rotate(360deg); }
}

/* When play mode is active, stick rack to bottom without gap */
.app.is-mode-play .play-rack {
  position: sticky;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 25;
}

/* When play mode is active, hide the FAB (not needed) */
.app.is-mode-play .fab { display: none; }

/* In-game stats & actions */
.chip-btn--stats, .icon-btn--stats {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.35);
  color: var(--gold-2);
}
.chip-btn--stats:hover, .icon-btn--stats:hover {
  background: rgba(212, 175, 55, 0.28);
  border-color: var(--gold);
}
.chip-btn--danger-text {
  color: #ff8595;
}
.chip-btn--danger-text:hover {
  background: rgba(212, 54, 74, 0.2);
  border-color: rgba(212, 54, 74, 0.4);
}

/* Play stats modal */
.play-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.play-stat-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.play-stat-card__label {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}
.play-stat-card__val {
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--gold-2);
}
.play-stat-summary {
  display: flex;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.play-stat-summary strong { color: var(--ink); }
.play-stat-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}
.play-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}
.play-stat-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.play-stat-num--red { background: var(--red); }
.play-stat-num--black { background: #1a1a1a; border: 1px solid #444; }
.play-stat-num--green { background: var(--green); }
.play-stat-net { font-weight: 700; }
.text-green { color: var(--green-2); }
.text-red { color: var(--red); }
