/* Crash Arena — Dark / Cyberpunk Theme */
:root {
  --bg: #1a1d24;
  --bg-panel: #22262f;
  --bg-elevated: #2a2f3a;
  --border: #353b48;
  --text: #ffffff;
  --muted: #9aa3b2;
  --green: #22c55e;
  --green-dark: #16a34a;
  --orange: #f59e0b;
  --orange-dark: #d97706;
  --red: #ef4444;
  --gold: #fbbf24;
  --neon: #39ff14;
  --cyan: #22d3ee;
  --blue: #3b82f6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(ellipse at top, #252a35 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.4;
}

body.locked { overflow: hidden; }

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100vh;
}

.hidden { display: none !important; }
.game-shell.hidden { visibility: hidden; pointer-events: none; display: flex !important; }

/* ── Shared form controls ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; min-height: 72px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}
.field .hint { font-size: 0.75rem; color: var(--muted); }
.field .error-text { font-size: 0.75rem; color: #fca5a5; min-height: 1em; }
.field.invalid input,
.field.invalid select,
.field.invalid textarea { border-color: var(--red); }

/* ── Auth Overlay ── */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(251, 191, 36, 0.08), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(34, 211, 238, 0.08), transparent 40%),
    rgba(10, 12, 16, 0.94);
  backdrop-filter: blur(10px);
}

.auth-modal {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, #2a2f3a 0%, #1e232d 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 24px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(34, 211, 238, 0.06);
  max-height: 92vh;
  overflow-y: auto;
}

.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand .logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ef4444, #fbbf24);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
}
.auth-brand h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; }
.auth-brand p { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 16px;
}

.auth-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}
.auth-tab.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.method-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.method-chip {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  border-radius: 8px;
  padding: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.method-chip.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
}

.auth-form { display: none; flex-direction: column; gap: 12px; }
.auth-form.active { display: flex; }

.auth-submit {
  margin-top: 6px;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  color: #1c1000;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.35);
}
.auth-submit:hover { filter: brightness(1.06); }

.auth-error {
  min-height: 1.2em;
  font-size: 0.85rem;
  color: #fca5a5;
  text-align: center;
  margin-top: 8px;
}
.auth-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 10px;
}
.password-rules {
  font-size: 0.72rem;
  color: var(--muted);
  padding-left: 14px;
}
.password-rules li.ok { color: var(--green); }

/* ── Header ── */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  flex-wrap: wrap;
}
.profile { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #fbbf24);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
}
.profile-meta .name { font-weight: 700; font-size: 1.05rem; }
.profile-meta .tag { color: var(--muted); font-size: 0.8rem; }

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  transition: background 0.15s, border-color 0.15s;
}
.icon-btn:hover { background: #343b49; border-color: #4b5563; }
.icon-btn.muted { color: var(--muted); opacity: 0.7; }

.wallet-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.pill-btn {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pill-btn:hover { background: #343b49; }
.pill-btn.deposit {
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
}
.pill-btn.withdraw {
  border-color: rgba(245, 158, 11, 0.45);
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.12);
}
.pill-btn.admin {
  border-color: rgba(168, 85, 247, 0.45);
  color: #d8b4fe;
  background: rgba(168, 85, 247, 0.12);
}

.receive-box {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(34, 211, 238, 0.08));
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  margin-bottom: 4px;
}
.receive-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}
.receive-number {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--neon);
  letter-spacing: 0.04em;
  text-shadow: 0 0 16px rgba(57, 255, 20, 0.35);
}
.receive-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.receive-raw {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--cyan);
}
.receive-hint {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--muted);
}

.approval-banner {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 600;
}

.admin-intro {
  font-size: 0.85rem;
  color: var(--muted);
}
.admin-intro strong {
  color: var(--neon);
  font-family: ui-monospace, Consolas, monospace;
}
.admin-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.logout-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.logout-btn:hover {
  color: #fca5a5;
  border-color: #7f1d1d;
  background: rgba(127, 29, 29, 0.25);
}

.balance-box { text-align: right; min-width: 140px; }
.balance-box .label {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.balance-box .amount {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gold);
  transition: transform 0.2s, color 0.2s;
}
.balance-box .amount.flash {
  animation: balance-flash 0.6s ease;
}
@keyframes balance-flash {
  0% { transform: scale(1); color: var(--gold); }
  40% { transform: scale(1.08); color: var(--neon); }
  100% { transform: scale(1); color: var(--gold); }
}

/* ── Main layout ── */
.main {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  flex: 1;
}
.left-col { display: flex; flex-direction: column; gap: 16px; }

/* ── Game area ── */
.game-area {
  position: relative;
  background: linear-gradient(180deg, #1e232d 0%, #151820 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 24px;
}
.game-area::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 70%, rgba(57, 255, 20, 0.06), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.05), transparent 35%);
  pointer-events: none;
}
.game-area.shake { animation: crash-shake 0.45s ease; }

.flight-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.plane {
  position: absolute;
  width: 56px;
  height: 56px;
  z-index: 2;
  left: 8%;
  bottom: 12%;
  transform: translate(-50%, 50%) rotate(-18deg);
  opacity: 0;
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.55));
  transition: opacity 0.15s;
  pointer-events: none;
  will-change: left, top, transform;
}
.plane.visible { opacity: 1; }
.plane svg { width: 100%; height: 100%; display: block; }

.explosion {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.2);
  background: radial-gradient(circle, #fff 0%, #fbbf24 25%, #ef4444 55%, transparent 70%);
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.8);
}
.explosion.boom { animation: explode 0.55s ease-out forwards; }

@keyframes explode {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.2); }
  60% { opacity: 1; transform: translate(-50%, -50%) scale(1.4); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.8); }
}

.phase-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--muted);
  z-index: 4;
}
.phase-badge.betting { color: #60a5fa; border-color: #3b82f6; }
.phase-badge.running { color: var(--neon); border-color: var(--green); }
.phase-badge.crashed { color: var(--red); border-color: var(--red); }

.countdown {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.9rem;
  color: var(--muted);
  z-index: 4;
}
.countdown strong { color: #60a5fa; font-size: 1.1rem; }

.multiplier {
  font-size: clamp(3.5rem, 10vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--neon);
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.5), 0 0 30px rgba(57, 255, 20, 0.25);
  z-index: 4;
  user-select: none;
  position: relative;
}
.multiplier.running { animation: pulse-glow 0.8s ease-in-out infinite alternate; }
.multiplier.gold {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.55), 0 0 30px rgba(251, 191, 36, 0.3);
}
.multiplier.crashed {
  color: var(--red);
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
  animation: crash-shake 0.4s ease;
}

@keyframes pulse-glow {
  from { transform: scale(1); filter: brightness(1); }
  to { transform: scale(1.03); filter: brightness(1.15); }
}
@keyframes crash-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.status-msg {
  margin-top: 12px;
  font-size: 1.1rem;
  color: var(--muted);
  z-index: 4;
  text-align: center;
  min-height: 1.5em;
  position: relative;
}
.status-msg.win { color: var(--green); font-weight: 700; }
.status-msg.lose { color: var(--red); font-weight: 700; }
.status-msg.crash { color: var(--red); font-weight: 800; font-size: 1.25rem; }

/* ── Betting panel ── */
.bet-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bet-panel h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.bet-input-wrap label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.bet-input-wrap input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 12px 14px;
  outline: none;
}
.presets { display: flex; gap: 8px; flex-wrap: wrap; }
.preset-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.preset-btn:hover:not(:disabled) { background: #343b49; }
.preset-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.action-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 18px 20px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-transform: uppercase;
}
.action-btn:active:not(:disabled) { transform: scale(0.98); }
.action-btn.place {
  background: linear-gradient(180deg, var(--green) 0%, var(--green-dark) 100%);
  color: #052e16;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.35);
}
.action-btn.cashout {
  background: linear-gradient(180deg, var(--orange) 0%, var(--orange-dark) 100%);
  color: #1c1000;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
  animation: cashout-pulse 1s ease-in-out infinite;
}
@keyframes cashout-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 4px 28px rgba(245, 158, 11, 0.65); }
}
.action-btn.disabled,
.action-btn:disabled {
  background: #4b5563;
  color: #9ca3af;
  box-shadow: none;
  cursor: not-allowed;
  animation: none;
}
.bet-hint { font-size: 0.8rem; color: var(--muted); text-align: center; }

/* ── Live bets ── */
.live-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 680px;
}
.live-panel h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  margin-right: 6px;
  box-shadow: 0 0 8px var(--green);
  animation: blink 1.2s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.live-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.live-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}
.live-table td {
  padding: 10px 6px;
  border-bottom: 1px solid rgba(53, 59, 72, 0.6);
  vertical-align: middle;
}
.player-cell { display: flex; align-items: center; gap: 8px; }
.mini-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}
.status-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}
.status-pill.waiting { background: #1e3a5f; color: #93c5fd; }
.status-pill.playing { background: #14532d; color: #86efac; }
.status-pill.won { background: #365314; color: #bef264; }
.status-pill.lost { background: #450a0a; color: #fca5a5; }
.mult-cell { font-weight: 700; color: var(--neon); }
.mult-cell.empty { color: var(--muted); font-weight: 500; }
.amount-cell { color: var(--gold); font-weight: 600; }

.online-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 4px 2px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.online-bar strong {
  color: var(--neon);
  font-size: 0.95rem;
}

.offline-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 10, 14, 0.92);
  backdrop-filter: blur(8px);
}
.offline-overlay.hidden { display: none !important; }
.offline-card {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, #2a2f3a 0%, #1a1e27 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.offline-icon { font-size: 2.4rem; margin-bottom: 10px; }
.offline-card h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.offline-card p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.offline-detail {
  color: #fca5a5 !important;
  min-height: 1.2em;
  font-size: 0.85rem !important;
}
.offline-card .secondary-btn {
  margin-top: 10px;
  background: transparent;
  color: #e8eaed;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.offline-card .secondary-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}
.offline-card .hidden {
  display: none !important;
}

/* ── Wallet / History Modals ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 10, 14, 0.82);
  backdrop-filter: blur(6px);
}
.modal-overlay.hidden { display: none !important; }

.modal-card {
  width: 100%;
  max-width: 520px;
  background: linear-gradient(180deg, #2a2f3a 0%, #1a1e27 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-card.wide { max-width: 760px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
}
.modal-close:hover { color: var(--text); border-color: #4b5563; }

.modal-body {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pay-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pay-method {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.pay-method .icon { display: block; font-size: 1.25rem; margin-bottom: 4px; }
.pay-method.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.12);
}

.method-panel { display: none; flex-direction: column; gap: 12px; }
.method-panel.active { display: flex; }

.amount-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.amount-presets button {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.btn-primary,
.btn-secondary {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.btn-primary {
  background: linear-gradient(180deg, var(--green) 0%, var(--green-dark) 100%);
  color: #052e16;
}
.btn-primary.danger {
  background: linear-gradient(180deg, var(--orange) 0%, var(--orange-dark) 100%);
  color: #1c1000;
}
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-feedback {
  min-height: 1.2em;
  font-size: 0.85rem;
  text-align: center;
}
.form-feedback.error { color: #fca5a5; }
.form-feedback.success { color: #86efac; }

.balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 700;
}

/* Transaction table */
.tx-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tx-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.tx-filter {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.tx-filter.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
}

.tx-table-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
  max-height: 420px;
  background: var(--bg);
}
.tx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 640px;
}
.tx-table th {
  position: sticky;
  top: 0;
  background: #1c2028;
  text-align: left;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  z-index: 1;
}
.tx-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(53, 59, 72, 0.55);
  vertical-align: middle;
}
.tx-table tr:last-child td { border-bottom: none; }
.tx-id {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--cyan);
}
.tx-empty {
  text-align: center;
  color: var(--muted);
  padding: 36px 16px;
  font-size: 0.9rem;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge.success { background: #14532d; color: #86efac; }
.badge.pending { background: #713f12; color: #fde68a; }
.badge.failed { background: #7f1d1d; color: #fca5a5; }
.badge.deposit { background: #164e63; color: #67e8f9; }
.badge.withdrawal { background: #4c1d95; color: #c4b5fd; }

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
}
.toast {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  font-size: 0.85rem;
  animation: toast-in 0.25s ease;
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 860px) {
  .main { grid-template-columns: 1fr; }
  .live-panel { max-height: none; }
  .game-area { min-height: 300px; }
  .pay-methods { grid-template-columns: 1fr; }
  .balance-box { text-align: left; }
  .header-right { width: 100%; justify-content: space-between; }
}
