:root {
  --bg: #07080c;
  --panel: #14171e;
  --panel-2: #1c2029;
  --line: #2c3340;
  --text: #f6f7fb;
  --muted: #93a0b8;
  --red: #ff2d55;
  --red-dim: #b31238;
  --green: #22c55e;
  --green-dim: #15803d;
  --gold: #f5c84c;
  --cyan: #5eead4;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: "Outfit", "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
  touch-action: manipulation;
}
button, input { font: inherit; }
button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
button, a, .icon-btn, .action, .tab, .step, .quick-row button,
.guest-auth-btn, .feed-tab, .auth-tab, .pass-toggle, .wallet-btn {
  touch-action: manipulation;
}
.hidden { display: none !important; }

.splash {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #000;
  padding: 0;
  touch-action: none;
}
.spribe-load {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
}
.spribe-logo-img {
  width: min(180px, 52vw);
  height: auto;
  display: block;
  filter: invert(1);
}
.spribe-dots {
  position: relative;
  width: 56px;
  height: 56px;
  animation: spribe-spin 1.1s linear infinite;
}
.spribe-dots i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px;
  border-radius: 50%;
  background: #e10600;
  box-shadow: 0 0 8px rgba(225, 6, 0, 0.55);
}
.spribe-dots i:nth-child(1) { transform: rotate(0deg) translateY(-22px); opacity: 1; }
.spribe-dots i:nth-child(2) { transform: rotate(45deg) translateY(-22px); opacity: 0.9; }
.spribe-dots i:nth-child(3) { transform: rotate(90deg) translateY(-22px); opacity: 0.8; }
.spribe-dots i:nth-child(4) { transform: rotate(135deg) translateY(-22px); opacity: 0.7; }
.spribe-dots i:nth-child(5) { transform: rotate(180deg) translateY(-22px); opacity: 0.6; }
.spribe-dots i:nth-child(6) { transform: rotate(225deg) translateY(-22px); opacity: 0.5; }
.spribe-dots i:nth-child(7) { transform: rotate(270deg) translateY(-22px); opacity: 0.4; }
.spribe-dots i:nth-child(8) { transform: rotate(315deg) translateY(-22px); opacity: 0.3; }
@keyframes spribe-spin {
  to { transform: rotate(360deg); }
}
.splash-connection {
  margin: 0;
  color: #fff;
  font-size: clamp(18px, 4.5vw, 28px);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.site-lobby {
  position: fixed; inset: 0; z-index: 45;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(225, 6, 0, 0.18), transparent 50%),
    linear-gradient(180deg, #0b0d12 0%, #07080c 100%);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: calc(18px + var(--safe-t)) 16px calc(24px + var(--safe));
  color: var(--text);
  touch-action: pan-y;
}
.site-lobby-top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 8px;
}
.lobby-chip {
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(20, 23, 30, 0.88);
  color: #e8edf5;
  font-size: 12px;
  font-weight: 700;
  touch-action: manipulation;
}
.site-lobby-inner {
  width: min(720px, 100%);
  margin: 0 auto;
}
.site-lobby-head {
  text-align: center;
  margin: 10px 0 22px;
}
.site-lobby-head h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 800;
  letter-spacing: 0.2px;
}
.site-lobby-sub {
  margin: 0 auto;
  max-width: 34ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.site-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 8px;
}
@media (min-width: 640px) {
  .site-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 10px; }
}
.site-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 8px 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  min-height: 88px;
  min-width: 0;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.site-card:active {
  transform: scale(0.94);
  opacity: 0.85;
}
.site-logo-wrap {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: transparent;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: none;
  pointer-events: none;
}
.site-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0;
  display: block;
  pointer-events: none;
}
.site-name {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  pointer-events: none;
}

/* Light theme */
body.theme-light {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-2: #eef1f6;
  --line: #d5dbe6;
  --text: #12151c;
  --muted: #5b6578;
}
body.theme-light .site-lobby {
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(225, 6, 0, 0.08), transparent 50%),
    linear-gradient(180deg, #f7f8fb 0%, #eef1f6 100%);
}
body.theme-light .lobby-chip {
  background: rgba(255, 255, 255, 0.95);
  border-color: #d5dbe6;
  color: #12151c;
}
body.theme-light .app,
body.theme-light .modal-card,
body.theme-light .auth-card {
  color: var(--text);
}

.splash h1, .auth-card h1 {
  margin: 6px 0 2px; letter-spacing: 0.4px; font-size: 24px; font-weight: 800;
}
.auth-card {
  width: min(420px, 100%);
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(34, 197, 94, 0.12), transparent 55%),
    linear-gradient(180deg, #171b24 0%, #10131a 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 22px 20px 18px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.auth-brand { margin-bottom: 14px; }
.auth-brand .brand-logo.lg {
  height: 64px; max-width: 110px; margin-bottom: 4px;
}
.brand-mark.lg { font-size: 42px; color: var(--red); }
.auth-lead, .modal-copy { color: #b7c2d6; font-size: 13px; line-height: 1.45; margin: 0 auto; max-width: 32ch; }
.modal-copy.dim { color: var(--muted); }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin: 16px 0 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.auth-tab {
  height: 42px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.auth-tab.active {
  background: linear-gradient(180deg, #2a3344, #1d2431);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
.auth-pane { text-align: left; }

.auth-card label, .modal-card label {
  display: block; text-align: left; font-size: 12px; color: #9aa8c0; margin: 12px 0;
  font-weight: 600;
}
.auth-card label > span, .modal-card label > span { display: block; margin-bottom: 6px; }
.auth-card input, .modal-card input[type="text"],
.modal-card input[type="password"], .modal-card input[type="number"],
.modal-card input[type="tel"] {
  width: 100%; margin-top: 0; height: 48px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1); background: #0b0d12; color: #fff;
  padding: 0 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-card input:focus, .modal-card input:focus {
  outline: none;
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}
.password-field input {
  padding-right: 48px !important;
}
.pass-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #9aa8c0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pass-toggle:active { color: #fff; background: rgba(255, 255, 255, 0.06); }
.auth-error { min-height: 18px; color: #ff6b88; font-size: 12px; margin: 4px 0 10px; text-align: left; }
.auth-submit {
  width: 100%;
  min-height: 50px !important;
  margin-top: 4px;
  font-size: 15px;
  letter-spacing: 0.4px;
}
.auth-close {
  width: 100%;
  margin-top: 12px;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #8b97ad;
  font-weight: 600;
}
.auth-close:active { color: #fff; background: rgba(255, 255, 255, 0.05); }
.auth-modal-actions { flex-direction: column; gap: 8px; }
.auth-modal-actions .action { width: 100%; }

.guest-auth-btn {
  height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line);
  background: #1a2030; color: #e8edf5; font-size: 11px; font-weight: 700;
}
.guest-auth-btn.primary {
  background: linear-gradient(180deg, #22c55e, #16a34a); color: #052e16; border-color: transparent;
}
.guest-actions {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}
.guest-chip {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #151922;
  color: #c5cddc;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.guest-theme svg { display: block; }
body.theme-light .guest-chip {
  background: #fff;
  color: #12151c;
  border-color: #d5dbe6;
}
body.guest-mode .brand-user {
  display: none;
}
body.guest-mode .bet-card .action.bet:not(:disabled) {
  opacity: 0.92;
}
.action.alt { background: #2a3140; margin-top: 8px; }

.app {
  height: 100%; display: flex; flex-direction: column;
  padding-top: var(--safe-t); min-height: 0;
}

.balance-pill {
  display: flex; flex-direction: column; justify-content: center;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px 10px; min-width: 0;
}
.top-balance {
  flex: 0 1 auto;
  max-width: 120px;
  min-height: 38px;
}
.bal-label {
  font-size: 9px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.balance-pill strong { font-size: 14px; color: var(--green); line-height: 1.15; }
.wallet-btn {
  border: 0; border-radius: 12px; font-size: 12px; font-weight: 800;
  padding: 0 14px; flex-shrink: 0; min-height: 44px;
}
.wallet-btn.deposit-btn {
  background: linear-gradient(180deg, #1a2e1a, #102210);
  color: #86efac;
}
.wallet-btn.withdraw-btn {
  background: linear-gradient(180deg, #3d2a10, #2a1c0a);
  color: #fbbf24;
}
.wallet-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.app-main {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-bottom: var(--safe);
}

.game-center {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.game-sidebar {
  flex-shrink: 0;
}

.bets-scroll {
  flex-shrink: 0;
  overflow-x: hidden;
  overflow-y: hidden;
}

.bets {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px 10px;
}

.bet-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
}

.bet-card-inner {
  display: grid;
  grid-template-columns: 1fr minmax(108px, 34%);
  gap: 8px;
  align-items: stretch;
}

.bet-controls {
  min-width: 0;
}

.bet-card-inner > .action {
  margin-top: 0;
  min-height: 88px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 6px;
  font-size: clamp(11px, 3.2vw, 14px);
  line-height: 1.25;
  border-radius: 10px;
}

.home-contact {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 10px;
  padding: 10px 12px 14px;
  font-size: 12px; color: var(--muted);
  background: #0a0c10; border-top: 1px solid var(--line);
}
.wa-btn {
  border: 0; border-radius: 999px; padding: 8px 14px;
  background: linear-gradient(180deg, #25d366, #128c7e);
  color: #fff; font-size: 12px; font-weight: 800;
}
.wa-btn:disabled { opacity: 0.45; }
.guest-footer-controls {
  display: none;
  align-items: center;
  gap: 6px;
}
.guest-footer-controls .guest-chip {
  width: 32px;
  height: 32px;
}
.guest-sound svg { display: block; }

@media (min-width: 900px) {
  body.guest-mode .guest-top-chip {
    display: inline-flex;
  }
  body.guest-mode .guest-footer-controls {
    display: none !important;
  }
}

@media (max-width: 899px) {
  body.guest-mode .guest-top-chip {
    display: none !important;
  }
  body.guest-mode .guest-footer-controls {
    display: inline-flex;
  }
}

.deposit-payto {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: #10131a; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; margin: 10px 0 12px;
}
.deposit-payto-label {
  font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.8px; width: 100%;
}
.deposit-payto-number {
  flex: 1; font-size: 22px; color: var(--green);
}
.copy-btn {
  height: 36px; padding: 0 12px; border-radius: 10px;
  background: #2a3140; color: #fff; border: 0; font-weight: 700; font-size: 12px;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 6px; gap: 8px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  border: 0; background: transparent; color: inherit; text-align: left; padding: 0;
  min-width: 0;
}
.brand-logo {
  height: 36px; width: auto; max-width: 42px;
  object-fit: contain; flex-shrink: 0;
  border-radius: 8px;
  background: #fff;
}
.brand-logo.lg {
  height: 72px; max-width: 120px;
  display: block; margin: 0 auto 8px;
  border-radius: 12px;
}
.brand-mark { color: var(--red); font-size: 22px; }
.brand-name { display: block; font-weight: 800; letter-spacing: 0.6px; font-size: 13px; }
.brand-user { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  min-width: 44px; height: 44px; border: 0; border-radius: 12px;
  background: var(--panel); color: var(--text); padding: 0 8px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.icon-btn:active, .step:active, .quick-row button:active, .tab:active, .action:active {
  transform: scale(0.97);
}
.predict-btn {
  background: linear-gradient(180deg, #2a1730, #1a1022);
  color: #f0abfc; font-size: 11px; font-weight: 800; padding: 0 10px;
}
.menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
}
.menu-lines {
  display: flex; flex-direction: column; gap: 4px; width: 16px;
}
.menu-lines i {
  display: block; height: 2px; width: 100%;
  background: #e8edf5; border-radius: 99px;
}
.account-card { max-height: min(86vh, 720px); overflow: auto; }
.account-section {
  margin: 12px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #222733;
}
.account-section:last-of-type { border-bottom: 0; }
.account-section h3 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--muted);
}
.account-list {
  list-style: none; margin: 0; padding: 0;
}
.account-list li {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 8px 0;
  border-bottom: 1px solid #1a1f2a;
  font-size: 13px; color: #c9d2e3;
}
.account-list li:last-child { border-bottom: 0; }
.account-list strong { color: #fff; font-weight: 700; text-align: right; }
.account-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 10px;
}
.account-actions .wallet-btn { width: 100%; min-height: 42px; }
.account-toggle {
  border: 1px solid var(--line); border-radius: 999px;
  background: #1a2030; color: #e8edf5;
  font-size: 12px; font-weight: 700;
  padding: 6px 12px;
}
.deposit-box {
  background: #10131a; border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; text-align: center; margin: 12px 0;
}
.deposit-kicker { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.deposit-number { display: block; font-size: 28px; margin: 8px 0; color: var(--green); }

.history-block {
  flex-shrink: 0;
  padding: 0 10px 6px;
}
.history-wrap {
  display: flex; align-items: center; gap: 4px;
}
.history-strip {
  display: flex; gap: 10px; align-items: center;
  flex: 1; min-width: 0;
  min-height: 28px;
  overflow-x: auto; scrollbar-width: none;
}
.history-strip::-webkit-scrollbar { display: none; }
.history-more {
  flex-shrink: 0;
  width: 28px; height: 28px; border: 0; border-radius: 6px;
  background: transparent; color: #8b95a8; font-size: 18px; line-height: 1;
  padding: 0; transition: background 0.15s, color 0.15s;
}
.history-more.open {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.history-more.hidden { display: none; }
.history-expanded {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid #1a1d24;
}
.history-expanded.hidden { display: none; }
.history-grid {
  display: flex; flex-wrap: wrap;
  gap: 8px 12px;
}
.chip {
  flex: 0 0 auto;
  font-size: 13px; font-weight: 700;
  background: transparent; border: 0; padding: 0;
}
.chip.low { color: #6eb5d9; }
.chip.mid { color: #a78bfa; }
.chip.high { color: #a78bfa; }
.chip.moon { color: #e879f9; }

.stage {
  position: relative; flex: 0 0 auto;
  height: clamp(170px, 30vh, 280px);
  margin: 0 10px;
  border-radius: 12px; overflow: hidden;
  background: #000;
  border: 1px solid #1a1d24;
}
#sky { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage-overlay {
  position: absolute; inset: 0; pointer-events: none;
}
.wait-brand {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 16px;
}
.wait-brand.hidden { display: none; }
.wait-logos {
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.wait-logo {
  height: clamp(64px, 16vw, 96px); width: auto; max-width: min(280px, 70vw);
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}
.wait-mark {
  font-size: 28px; color: #e31c2d;
  filter: drop-shadow(0 0 12px rgba(227, 28, 45, 0.5));
}
.wait-name {
  font-size: clamp(18px, 4vw, 26px); font-weight: 800; letter-spacing: 0.5px;
  color: #fff;
}
.wait-partner {
  margin: 0; font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: #8b95a8; font-weight: 700;
}
.wait-badge {
  margin-top: 4px; padding: 6px 14px; border-radius: 8px;
  background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac; font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
}
.fly-hud {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.fly-hud.hidden { display: none; }
.round-banner {
  margin-bottom: 4px;
  font-size: clamp(14px, 3vw, 20px); letter-spacing: 2px;
  color: #fff; font-weight: 800; text-transform: uppercase;
}
.round-banner.hidden { display: none; }
.multiplier {
  font-size: clamp(52px, 14vw, 88px); font-weight: 800; letter-spacing: -2px;
  line-height: 1;
  transition: text-shadow 0.45s ease, color 0.45s ease;
}
.multiplier.live {
  color: #fff;
}
.multiplier.live.tier-low {
  text-shadow:
    0 0 48px rgba(110, 181, 217, 0.65),
    0 0 100px rgba(110, 181, 217, 0.35),
    0 0 170px rgba(110, 181, 217, 0.18),
    0 0 240px rgba(110, 181, 217, 0.08);
}
.multiplier.live.tier-mid {
  text-shadow:
    0 0 48px rgba(167, 139, 250, 0.68),
    0 0 100px rgba(167, 139, 250, 0.36),
    0 0 170px rgba(167, 139, 250, 0.18),
    0 0 240px rgba(167, 139, 250, 0.08);
}
.multiplier.live.tier-moon {
  text-shadow:
    0 0 52px rgba(232, 121, 249, 0.7),
    0 0 110px rgba(232, 121, 249, 0.38),
    0 0 180px rgba(232, 121, 249, 0.2),
    0 0 260px rgba(232, 121, 249, 0.1);
}
.multiplier span { font-size: 0.55em; margin-left: 2px; }
.multiplier.crash { color: #e31c2d; text-shadow: 0 0 30px rgba(227, 28, 45, 0.35); }
.countdown {
  position: relative;
  width: min(220px, 70%); height: 4px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(227, 27, 47, 0.55);
  border-radius: 99px; overflow: hidden;
}
.countdown.hidden { opacity: 0; }
.countdown i {
  position: absolute;
  left: 0;
  top: 0;
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, #e31b2f, #ff4d5e);
  transform: translateX(0);
  will-change: transform;
}
.player-badge {
  position: absolute; right: 10px; bottom: 10px;
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px 4px 4px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
}
.pb-avatars { display: flex; align-items: center; }
.pb-av {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid #111; margin-left: -6px;
  display: inline-block;
}
.pb-av:first-child { margin-left: 0; }
.pb-av.a1 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.pb-av.a2 { background: linear-gradient(135deg, #22c55e, #14b8a6); }
.pb-av.a3 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
#playerCount { font-size: 12px; font-weight: 700; color: #fff; }

.bet-tabs { display: flex; gap: 4px; margin-bottom: 6px; flex-shrink: 0; }
.tab, .feed-tab {
  flex: 1; border: 0; background: #1a1f28; color: var(--muted);
  border-radius: 8px; padding: 6px; font-size: 11px; font-weight: 800;
}
.tab.active, .feed-tab.active { background: #2d3544; color: #fff; }
.amount-row { display: flex; align-items: center; gap: 4px; }
.step {
  width: 40px; height: 40px; border: 0; border-radius: 8px;
  background: #2a3140; color: #fff; font-size: 18px;
}
.amount {
  flex: 1; height: 40px; border-radius: 8px; border: 1px solid var(--line);
  background: #0f1116; color: #fff; text-align: center; font-weight: 800; font-size: 14px;
}
.quick-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 4px 0; }
.quick-row button {
  border: 0; background: #1e2430; color: #c5cddc; border-radius: 6px;
  padding: 10px 0; font-size: 11px; font-weight: 700;
  min-height: 36px;
}
.auto-cash, .auto-bet {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 4px;
  font-size: 10px; color: var(--muted); margin: 2px 0 0;
  flex-shrink: 0;
}
.auto-cash-at {
  width: 54px; height: 24px; border-radius: 6px; border: 1px solid var(--line);
  background: #0f1116; color: #fff; text-align: center; font-size: 11px;
}
.auto-cash-at:disabled { opacity: 0.45; }
.action {
  width: 100%; min-height: 46px; border: 0; border-radius: 12px;
  font-weight: 800; letter-spacing: 0.3px; color: #fff;
  flex-shrink: 0;
}
.action.bet { background: linear-gradient(180deg, #4ade80, #16a34a); color: #052e16; }
.action.cash {
  background: linear-gradient(180deg, #ff6b88, var(--red));
  animation: pulse 1s ease-in-out infinite;
  color: #fff;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.action.cash * { pointer-events: none; }
.action.wait { background: #3a3f4b; color: #bbb; }
.action.disabled { opacity: 0.55; pointer-events: none; }
@keyframes pulse { 50% { filter: brightness(1.15); } }

.feed {
  padding: 10px 10px 8px;
  display: flex; flex-direction: column;
  flex-shrink: 0;
}
.feed-summary {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--muted);
  padding: 6px 4px 8px;
  border-bottom: 1px solid #1c1f27;
  margin-bottom: 4px;
}
.feed-summary #feedTotalWin { color: var(--green); font-weight: 700; }
.feed-tabs { display: flex; gap: 4px; margin-bottom: 0; }
.feed-head, .feed-row {
  display: grid; grid-template-columns: 1.4fr 0.9fr 0.7fr 0.9fr;
  gap: 6px; font-size: 11px; align-items: center;
}
.feed-head { color: var(--muted); padding: 6px 4px 4px; }
.feed-body { overflow: visible; }
.feed-player {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
}
.feed-av {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover;
  background: #1c2030;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.feed-row { padding: 6px 4px; border-bottom: 1px solid #1c1f27; }
.feed-row.cashed {
  background: rgba(46, 139, 87, 0.18);
}
.feed-row .win { color: var(--green); font-weight: 700; }
.feed-row .lost { color: var(--red); }
.feed-row.me { background: rgba(255, 45, 85, 0.08); }

.demo-note { text-align: center; font-size: 10px; color: #667085; padding: 0 10px 6px; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.72);
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 40; padding: 18px; overflow: auto;
}
.modal-card {
  width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 18px; margin: auto;
}
.modal-card.wide { width: min(480px, 100%); }
.modal-card.admin-card { width: min(640px, 100%); max-height: min(92vh, 900px); display: flex; flex-direction: column; }
.admin-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 8px;
}
.admin-header h2 { margin: 0; }
.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.admin-chip {
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: #2a2f3a !important;
  color: #fff !important;
  border-radius: 10px !important;
}
.admin-chip svg { display: block; }
.admin-refresh {
  height: 36px !important; padding: 0 12px; font-size: 12px; width: auto;
  background: #2a2f3a !important; color: #fff !important;
}
.admin-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 0 10px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.admin-tab {
  border: 0; border-radius: 999px; padding: 8px 12px;
  background: #1a2030; color: var(--muted);
  font-size: 12px; font-weight: 800; cursor: pointer;
}
.admin-tab.active { background: #323a4c; color: #fff; }
.admin-tab-panel { min-height: 120px; }
.admin-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 14px;
  font-size: 14px;
  color: var(--text);
}
.admin-check input { width: 18px; height: 18px; }
.admin-card .host-body {
  flex: 1; min-height: 0; overflow: auto;
  margin-top: 0; padding-right: 2px;
}
.modal-card h2 { margin: 0 0 10px; }
.withdraw-tax-amount {
  margin: 12px 0 18px;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--green);
  text-align: center;
}
#taxPayAmount {
  opacity: 0.95;
  cursor: default;
  color: var(--green);
  font-weight: 800;
}
.modal-card ul { padding-left: 18px; color: #cfd5e3; line-height: 1.7; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.modal-actions button, .host-body .action {
  height: 44px; border: 0; border-radius: 12px; background: var(--green); color: #052e16;
  font-weight: 800;
}
.modal-actions .ghost, .action.ghost { background: #2a2f3a; color: #fff; }

.plan-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.plan {
  width: 100%; text-align: left; border: 1px solid var(--line); background: #10131a;
  border-radius: 14px; padding: 12px; color: inherit;
}
.plan strong { display: block; font-size: 16px; }
.plan em { color: var(--gold); font-style: normal; font-weight: 800; }
.plan span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.plan:disabled { opacity: 0.5; pointer-events: none; }

.host-body { margin-top: 12px; }
.host-plans-wrap { margin-top: 14px; }
.host-plans-wrap h3 { margin: 0 0 6px; font-size: 14px; }
.host-plans { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
#btnHostSavePlans { width: 100%; margin-top: 8px; min-height: 46px; }
.host-plan-row {
  display: grid; grid-template-columns: 1.1fr 0.6fr 0.7fr 0.6fr 0.7fr 0.6fr; gap: 6px;
}
.host-plan-row input {
  height: 36px; border-radius: 8px; border: 1px solid var(--line);
  background: #0d0f14; color: #fff; padding: 0 8px; font-size: 12px;
}
.plan.active-plan {
  text-align: center; border-color: var(--green);
  background: rgba(34, 197, 94, 0.08);
}
.host-users { font-size: 12px; color: #c9d2e3; line-height: 1.6; margin-top: 0; }
.host-users h3 { margin: 0 0 8px; font-size: 14px; }
.user-row {
  background: #10131a; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px; margin-bottom: 8px; font-size: 12px;
}
.user-row-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 4px;
}
.user-row-top strong { margin: 0; }
.user-row-top span { color: var(--green); font-weight: 800; }
.user-row code {
  color: #fbbf24; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.user-row-actions {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center;
}
.user-pin-input,
.user-tax-input {
  width: 88px; height: 36px; border-radius: 8px; border: 1px solid var(--line);
  background: #0d0f14; color: #fff; padding: 0 8px; font-size: 12px;
}
.user-tax-input { width: 72px; }
.user-pin-input { width: 120px; }
.user-password {
  color: #fbbf24;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  user-select: all;
}
.user-row-actions .ok,
.user-row-actions .no {
  height: 36px; border: 0; border-radius: 8px; font-weight: 800; cursor: pointer;
  padding: 0 10px;
}
.user-row-actions .ok { background: var(--green); color: #052e16; }
.user-row-actions .no { background: #7f1d1d; color: #fff; }
.admin-users-toolbar {
  margin: 0 0 12px;
}
.admin-users-toolbar input {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0d0f14;
  color: #fff;
  padding: 0 12px;
  font-size: 13px;
}
.admin-create-user {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #10131a;
}
.admin-create-user h3 {
  margin: 0 0 10px;
  font-size: 14px;
}
.admin-create-user-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.admin-create-user-fields input {
  flex: 1 1 120px;
  min-width: 110px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0d0f14;
  color: #fff;
  padding: 0 10px;
  font-size: 12px;
}
.admin-create-user-fields .action {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 14px;
  width: auto;
}
body.theme-light .admin-users-toolbar input,
body.theme-light .admin-create-user,
body.theme-light .admin-create-user-fields input {
  background: #fff;
  color: #111;
}

body.admin-only {
  overflow: auto;
  background: var(--bg);
}
body.admin-only #hostModal {
  position: relative;
  inset: auto;
  display: flex !important;
  background: transparent;
  min-height: 100dvh;
  padding: 12px;
  z-index: 1;
}
body.admin-only #hostModal .modal-card {
  width: min(640px, 100%);
  margin: 0 auto 24px;
}
.host-queue h3 { margin: 0 0 8px; font-size: 14px; }
.predictor-history-list {
  max-height: min(55vh, 420px);
  overflow: auto;
  margin: 10px 0 4px;
}
.req-row.req-history {
  opacity: 0.92;
}
.req-row {
  background: #10131a; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px; margin-bottom: 8px; font-size: 12px;
}
.req-row strong { display: block; margin-bottom: 4px; }
.req-row .req-meta { color: var(--muted); margin-bottom: 8px; }
.req-actions { display: flex; gap: 6px; }
.req-actions button {
  flex: 1; height: 36px; border: 0; border-radius: 8px; font-weight: 800; cursor: pointer;
}
.req-actions .ok { background: var(--green); color: #052e16; }
.req-actions .no { background: #3a3f4b; color: #fff; }
.req-pending { color: var(--gold); }
.req-approved { color: var(--green); }
.req-rejected { color: var(--red); }

.wallet-tabs { display: flex; gap: 6px; margin: 12px 0; }
.wallet-tab {
  flex: 1; border: 0; background: var(--panel-2); color: var(--muted);
  border-radius: 10px; padding: 8px; font-weight: 800; font-size: 12px;
}
.wallet-tab.active { background: #323a4c; color: #fff; }
.wallet-history { max-height: 42vh; overflow: auto; margin-top: 8px; }

.share-steps { color: #c9d2e3; padding-left: 18px; line-height: 1.55; font-size: 13px; }
code { font-size: 12px; background: #0d0f14; padding: 1px 5px; border-radius: 6px; }

.toast {
  position: fixed; left: 50%; bottom: calc(18px + var(--safe));
  transform: translate(-50%, 120%);
  background: #111827; color: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 10px 16px; font-size: 13px; font-weight: 700;
  z-index: 80; max-width: 90%; text-align: center;
  transition: transform 0.25s ease;
}
.toast.show { transform: translate(-50%, 0); }

@media (min-width: 900px) {
  .app-main {
    display: grid;
    grid-template-columns: minmax(252px, 28%) 1fr;
    grid-template-areas: "sidebar game";
    overflow: hidden;
    padding-bottom: 0;
  }

  .game-sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border-right: 1px solid var(--line);
    background: #0c0e12;
  }

  .game-center {
    grid-area: game;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .history-strip {
    padding: 8px 12px 6px;
  }

  .stage {
    flex: 1;
    min-height: 210px;
    max-height: 300px;
    height: auto;
    margin: 0 12px 8px;
    border-radius: 12px;
  }

  .bets-scroll {
    flex-shrink: 0;
    padding: 0 12px 12px;
  }

  .bets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0;
  }

  .bet-card {
    padding: 10px;
    border-radius: 12px;
    background: #12151c;
  }

  .bet-card-inner > .action {
    min-height: 96px;
    font-size: 13px;
  }

  .feed {
    flex: 1;
    min-height: 0;
    padding: 12px;
    display: flex;
    flex-direction: column;
  }

  .feed-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
  }

  .home-contact {
    flex-shrink: 0;
    border-top: 1px solid var(--line);
    background: #0a0c10;
  }
}

@media (max-width: 899px) {
  .game-center { order: 1; }
  .game-sidebar { order: 2; }
  .feed-body {
    max-height: 336px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  /* Compact bet cards while predictor is open so more of the page fits */
  body.predictor-open .bets {
    gap: 4px;
    padding: 4px 8px 6px;
  }
  body.predictor-open .bet-card {
    padding: 4px 6px;
    border-radius: 10px;
  }
  body.predictor-open .bet-card-inner {
    grid-template-columns: 1fr minmax(72px, 28%);
    gap: 4px;
  }
  body.predictor-open .bet-card-inner > .action {
    min-height: 52px;
    padding: 4px 4px;
    font-size: 10px;
    border-radius: 8px;
  }
  body.predictor-open .bet-tabs .tab {
    padding: 4px 6px;
    font-size: 10px;
    min-height: 28px;
  }
  body.predictor-open .amount-row {
    gap: 4px;
  }
  body.predictor-open .amount-row .amount {
    height: 28px;
    font-size: 12px;
  }
  body.predictor-open .step {
    width: 28px;
    height: 28px;
    min-height: 28px;
    font-size: 14px;
  }
  body.predictor-open .quick-row {
    gap: 3px;
  }
  body.predictor-open .quick-row button {
    padding: 4px 0;
    font-size: 9px;
    min-height: 26px;
  }
  body.predictor-open .auto-cash,
  body.predictor-open .auto-bet {
    font-size: 9px;
    margin: 0;
    gap: 3px;
  }
  body.predictor-open .auto-cash-at {
    width: 44px;
    height: 22px;
    font-size: 10px;
  }
}

@media (max-width: 380px) {
  .multiplier { font-size: 40px; }
  .predict-btn { font-size: 10px; padding: 0 6px; }
  .wallet-btn { font-size: 11px; padding: 0 10px; }
  .bet-card { padding: 7px; }
  .quick-row button { font-size: 10px; padding: 6px 0; }
}
