
:root {
  --bg: #080b16;
  --bg2: #0e1631;
  --panel: rgba(14, 23, 47, 0.92);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8f4ff;
  --muted: #95a6c0;
  --gold: #ffd600;
  --green: #00e676;
  --red: #ff1744;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top, #111b37 0%, #04060d 45%, #05070f 100%);
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
}

button, input, select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

body > * {
  position: relative;
}

nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  background: rgba(5, 8, 18, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.nav-logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.45rem;
  letter-spacing: 0.16em;
}

.nav-logo span {
  color: var(--gold);
}

.nav-balance {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
}

.nav-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-nav[hidden] {
  display: none;
}

.btn-nav,
.input-btn,
.preset-btn,
.btn-modal-submit {
  border: none;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.btn-nav:hover,
.input-btn:hover,
.preset-btn:hover,
.btn-modal-submit:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.14);
}

.main {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 22px;
  padding: 24px;
  max-width: 1320px;
  margin: 0 auto;
}

.crash-panel,
.bet-panel,
.leaderboard,
.modal {
  background: rgba(4, 8, 20, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.crash-header,
.panel-title,
.lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.crash-header {
  padding: 20px 24px 10px;
}

.crash-title,
.panel-title {
  font-weight: 700;
  font-size: 1rem;
}

.history-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chart-wrap {
  position: relative;
  padding: 24px;
}

canvas {
  width: 100%;
  min-height: 300px;
  border-radius: 24px;
  background: #050b1c;
}

.multiplier-display {
  position: absolute;
  left: 24px;
  top: 34px;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.8rem, 3vw, 3.25rem);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.countdown-bar {
  margin: 14px 24px 0;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.countdown-fill {
  height: 100%;
  background: linear-gradient(90deg, #5c9cff, #00e676);
  width: 100%;
  transition: width 0.35s ease;
}

.status-bar {
  margin: 16px 24px 24px;
  padding: 14px 18px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.bet-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.vip-panel {
  margin-bottom: 22px;
  padding: 24px;
  background: rgba(4, 8, 20, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.vip-level-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 16px;
  padding: 8px 14px;
  border: 1px solid rgba(255,214,0,0.4);
  border-radius: 999px;
  color: var(--gold);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
}

.vip-description {
  color: var(--muted);
}

.vip-panel .btn-modal-submit {
  width: 100%;
}

.vip-panel .btn-modal-submit:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.form-group,
.modal-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label,
label {
  font-size: 0.88rem;
  color: var(--muted);
}

.input-row {
  display: flex;
  gap: 10px;
}

input[type="number"],
input[type="text"],
input[type="password"],
input[type="email"],
select {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(107,183,255,0.8);
  box-shadow: 0 0 0 3px rgba(107,183,255,0.12);
}

.btn-bet {
  width: 100%;
  padding: 16px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.btn-bet-place {
  background: #4f5cff;
  color: #fff;
}

.btn-cashout {
  background: #00c66d;
  color: #fff;
}

.btn-bet.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.potential-win {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.pw-label {
  color: var(--muted);
}

.pw-value {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
}

.leaderboard {
  padding: 24px;
  margin-top: 22px;
}

.transactions-panel {
  margin-top: 22px;
  padding: 24px;
  background: rgba(4, 8, 20, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 26px;
}

.transactions-table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}

.transactions-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.transactions-table th,
.transactions-table td {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.86rem;
  color: var(--text);
}

.transactions-table th {
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.transactions-table tr:not(:last-child) td {
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.transactions-table .empty-row {
  text-align: center;
  color: var(--muted);
  padding: 24px 0;
}

.transactions-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.pager-button {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
}

.pager-button.active {
  background: rgba(79,92,255,0.15);
  border-color: rgba(79,92,255,0.35);
}

.transaction-type-deposit {
  color: #8bc34a;
  font-weight: 700;
}

.transaction-type-withdraw {
  color: #ffb300;
  font-weight: 700;
}

.transaction-status {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.transaction-status.confirmed {
  background: rgba(0,198,109,0.12);
  color: #00c66d;
}

.transaction-status.processing {
  background: rgba(92,156,255,0.12);
  color: #5c9cff;
}

.transaction-status.pending {
  background: rgba(255,214,0,0.12);
  color: #f0b300;
}

.transaction-status.failed {
  background: rgba(255,87,34,0.12);
  color: #ff5722;
}

/* Spinner and payment status */
.payment-status {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.12);
  border-top-color: var(--green);
  border-radius: 50%;
  display: inline-block;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

.lb-header {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 0.84rem;
  color: var(--muted);
}

.lb-row {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 0.9fr;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.lb-row:last-child {
  border-bottom: none;
}

.lb-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lb-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #09101c;
  font-weight: 700;
}

.lb-mult {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
}

.lb-mult.red {
  color: var(--red);
}

.lb-profit {
  color: var(--muted);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3,8,23,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 30;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  width: min(540px, 100%);
  padding: 24px;
  border-radius: 28px;
}

.modal-close {
  position: absolute;
  right: 20px;
  top: 20px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
}

.modal-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.modal-sub {
  color: var(--muted);
  margin-bottom: 18px;
}

.amount-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-green {
  background: #00c66d;
}

.btn-gold {
  background: #f0b300;
}

.btn-purple {
  background: #7c4dff;
}

.aff-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
}

.aff-code {
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.08em;
}

.aff-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.aff-stat {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  text-align: center;
}

.aff-stat-val {
  font-size: 1.1rem;
  font-weight: 700;
}

.aff-stat-lbl {
  color: var(--muted);
  font-size: 0.78rem;
}

.divider {
  border: none;
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 18px 0;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 14px 20px;
  border-radius: 18px;
  border: 1px solid transparent;
  background: rgba(10,16,30,0.95);
  color: var(--green);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

@media (max-width: 980px) {
  .main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .nav-buttons {
    justify-content: center;
  }
  .input-row {
    flex-direction: column;
  }
  .lb-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .lb-header {
    display: none;
  }
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
  min-height: 60px;
  padding: 10px 20px;
}

.auth-panel,
.auth-inputs {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.auth-inputs {
  flex-wrap: wrap;
}

.auth-inputs input {
  height: 32px;
  padding: 6px 10px;
  box-sizing: border-box;
}

.auth-inputs > div {
  display: flex;
  align-items: center;
}

#togglePassword {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: none;
  border: none;
  color: #fff;
}

@media (max-width: 680px) {
  .topbar,
  .auth-panel,
  .auth-inputs {
    justify-content: center;
  }
}
