/* ============ Lobby ============ */
.lobby { padding: 16px 14px 28px; }
.lobby-hero {
  border-radius: var(--r);
  background:
    radial-gradient(600px 200px at 15% 0%, rgba(240,185,11,.22), transparent 70%),
    radial-gradient(600px 200px at 95% 10%, rgba(240,185,11,.12), transparent 70%),
    var(--panel);
  border: 1px solid var(--line); padding: 22px 18px; margin-bottom: 18px;
}
.lobby-hero h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.lobby-hero p { margin: 0; color: var(--muted); font-size: 13px; }
.lobby-section-title { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 4px 4px 12px; font-weight: 600; }
.game-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.game-card {
  position: relative; text-align: left; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px; min-height: 132px; display: flex; flex-direction: column;
  justify-content: space-between; overflow: hidden; color: var(--text); transition: transform .08s ease, border-color .15s ease;
}
.game-card:active { transform: scale(.98); }
.game-card.live { border-color: rgba(240,185,11,.4); }
.game-card.soon { opacity: .55; }
.game-card .icon { display: inline-flex; }
.game-card .icon .ic { width: 34px; height: 34px; }
.game-card.live .icon { color: var(--accent); }
.game-card.soon .icon { color: var(--muted); }
.game-card .title { font-weight: 600; font-size: 16px; margin-top: 8px; }
.game-card .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.game-card .glow { position: absolute; inset: auto -40% -60% auto; width: 160px; height: 160px; background: radial-gradient(circle, rgba(240,185,11,.18), transparent 70%); pointer-events: none; }
.badge { position: absolute; top: 10px; right: 10px; font-size: 9px; font-weight: 700; letter-spacing: .5px; padding: 4px 7px; border-radius: 999px; }
.badge.live { background: rgba(240,185,11,.18); color: var(--gold); }
.badge.soon { background: rgba(255,255,255,.08); color: var(--muted); }

/* ============ History strip ============ */
.history-strip { display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px; scrollbar-width: none; }
.history-strip::-webkit-scrollbar { display: none; }
.hist-pill { flex: 0 0 auto; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.05); color: var(--muted); border: 1px solid var(--line); }
.hist-pill.low  { color: #9aa7bd; }
.hist-pill.mid  { color: var(--accent); }
.hist-pill.high { color: var(--accent-2); }
.hist-pill.bust { color: var(--lose); }

/* ============ Growth pills (shared) ============ */
.growth-pills { display: flex; gap: 8px; }
.growth-pill { flex: 1; min-height: 34px; border-radius: 8px; font-weight: 600; font-size: 12px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.growth-pill.active { color: #1a1300; background: var(--accent); border-color: transparent; }

/* ============ Bet slot ============ */
.bets { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); }

.slot { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.slot.armed { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.slot-tabs { display: flex; gap: 4px; background: var(--bg); border-radius: 999px; padding: 3px; align-self: flex-start; }
.slot-tab { font-size: 11px; padding: 5px 14px; border-radius: 999px; color: var(--muted); background: none; font-weight: 600; }
.slot-tab.active { background: var(--panel-2); color: var(--text); }

.slot-stake-row { display: flex; align-items: center; gap: 8px; }
.slot-stake { flex: 1; display: flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); min-height: 42px; padding: 0 4px; }
.slot-stake input { flex: 1; width: 100%; min-width: 0; background: none; border: none; color: var(--text); font-size: 17px; font-weight: 600; text-align: center; outline: none; font-variant-numeric: tabular-nums; }
.stake-step { width: 32px; min-width: 32px; height: 32px; border-radius: 8px; background: var(--panel-2); color: var(--text); font-size: 20px; display: grid; place-items: center; font-weight: 600; }
.slot-chips { display: flex; gap: 6px; }
.slot-chips .chip { flex: 1; min-height: 30px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font-size: 12px; font-weight: 600; }

.slot-auto { display: none; flex-direction: column; gap: 8px; }
.slot.auto-mode .slot-auto { display: flex; }
.auto-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.auto-val { display: flex; align-items: center; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; min-height: 32px; }
.auto-val input { width: 52px; background: none; border: none; color: var(--text); text-align: right; font-weight: 600; outline: none; font-variant-numeric: tabular-nums; }

.switch { position: relative; width: 40px; height: 22px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .track { position: absolute; inset: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; transition: .2s; }
.switch .thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked + .track { background: rgba(240,185,11,.25); border-color: var(--accent); }
.switch input:checked + .track .thumb { left: 21px; background: var(--accent); }

.launch-btn {
  width: 100%; min-height: 56px; border-radius: var(--r); font-size: 17px; font-weight: 700; letter-spacing: .3px;
  color: #04130d; background: linear-gradient(180deg, #16d98e, #07b977);
  box-shadow: 0 6px 18px rgba(14,203,129,.28); transition: transform .06s ease, filter .15s ease;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
}
.launch-btn:active { transform: scale(.98); }
.launch-btn .sub { font-size: 12px; font-weight: 500; opacity: .85; }
.launch-btn.cashout { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #1a1300; box-shadow: 0 6px 18px rgba(240,185,11,.32); animation: pulse 1s ease-in-out infinite; }
.launch-btn.waiting { background: var(--panel-2); color: var(--muted); box-shadow: none; border: 1px solid var(--lose); }
.launch-btn.disabled, .launch-btn:disabled { filter: grayscale(.3) brightness(.85); opacity: .7; pointer-events: none; }
@keyframes pulse { 50% { filter: brightness(1.12); } }

/* My-bets list */
.mybets { padding: 4px 14px 10px; }
.mybets h4 { margin: 6px 0; font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; font-weight: 600; }
.mybet { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 7px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.mybet .at { color: var(--muted); font-size: 12px; }
.mybet .pnl.win { color: var(--win); font-weight: 600; }
.mybet .pnl.lose { color: var(--lose); font-weight: 600; }

@media (min-width: 560px) { .game-grid { grid-template-columns: repeat(3, 1fr); } }

/* ===== Icons ===== */
.ic { display: block; }
.ic-wrap { display: inline-flex; align-items: center; justify-content: center; }
.icon-btn .ic { width: 20px; height: 20px; }
.brand-mark { display: inline-flex; }
.brand-mark .ic { width: 22px; height: 22px; }
.crash-header .title { display: inline-flex; align-items: center; gap: 6px; }
.crash-header .title .ic { width: 18px; height: 18px; }
.btn-ghost .ic { width: 16px; height: 16px; }
.btn-ghost { display: inline-flex; align-items: center; gap: 6px; }

/* ===== Result popup (non-blocking, animated) ===== */
.popup-host { position: fixed; left: 0; right: 0; top: 20%; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; z-index: 70; padding: 0 14px; }
.result-pop {
  display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-radius: 16px; min-width: 210px;
  background: linear-gradient(180deg, rgba(30,37,48,.98), rgba(17,21,28,.98));
  border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: rp-in .42s cubic-bezier(.18,1.5,.4,1) both;
}
.result-pop.out { animation: rp-out .3s ease forwards; }
.result-pop.win { border-color: rgba(240,185,11,.55); box-shadow: 0 14px 44px rgba(240,185,11,.3); }
.result-pop.lose { border-color: rgba(246,70,93,.5); box-shadow: 0 14px 44px rgba(246,70,93,.28); }
.rp-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; flex: 0 0 auto; }
.result-pop.win .rp-icon { color: var(--accent); background: rgba(240,185,11,.14); animation: pop-bounce .6s ease 1; }
.result-pop.lose .rp-icon { color: var(--lose); background: rgba(246,70,93,.14); }
.rp-title { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.rp-big { font-size: 26px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; color: #fff; }
.rp-amt { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-pop.win .rp-amt { color: var(--win); }
.result-pop.lose .rp-amt { color: var(--lose); }
@keyframes rp-in { 0% { opacity: 0; transform: translateY(18px) scale(.8); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes rp-out { to { opacity: 0; transform: translateY(-10px) scale(.96); } }
@keyframes pop-bounce { 0%,100% { transform: scale(1); } 40% { transform: scale(1.18); } }

/* ===== Blocking dialog ===== */
.modal-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(5,7,10,.62); backdrop-filter: blur(3px); opacity: 0; transition: opacity .2s ease; }
.modal-overlay.show { opacity: 1; }
.modal-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px 22px; text-align: center; box-shadow: var(--shadow); transform: translateY(14px) scale(.94); opacity: 0; transition: transform .25s cubic-bezier(.18,1.4,.4,1), opacity .2s ease; }
.modal-overlay.show .modal-card { transform: translateY(0) scale(1); opacity: 1; }
.modal-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; color: var(--accent); background: rgba(240,185,11,.14); margin-bottom: 12px; }
.modal-icon .ic { width: 26px; height: 26px; }
.modal-title { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.modal-msg { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.modal-ok { width: 100%; }

/* ===== Skeleton loader ===== */
@keyframes skeleton-wave {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--panel-2) 25%, rgba(255,255,255,.06) 50%, var(--panel-2) 75%);
  background-size: 800px 100%;
  animation: skeleton-wave 1.4s ease-in-out infinite;
  border-radius: 8px;
}
/* Structured account-card skeleton (mirrors the real card layout). */
.acct-card-skel { pointer-events: none; cursor: default; }
.acct-card-skel:hover { border-color: var(--line); background: var(--panel-2); }
.skel-avatar { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; }
.skel-lines { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.skel-line { height: 10px; border-radius: 5px; }
.skel-badge { width: 46px; height: 12px; }
.skel-id   { width: 72%; }
.skel-bal  { width: 40%; height: 16px; margin-top: 2px; }

/* Balance chip skeleton (while connecting / switching account) */
.balance.loading .balance-mode,
.balance.loading .balance-amount {
  display: block; color: transparent !important;
  background: linear-gradient(90deg, var(--panel-2) 25%, rgba(255,255,255,.08) 50%, var(--panel-2) 75%);
  background-size: 800px 100%; animation: skeleton-wave 1.4s ease-in-out infinite; border-radius: 5px;
}
.balance.loading .balance-mode   { width: 36px; height: 8px; margin-bottom: 5px; }
.balance.loading .balance-amount { width: 64px; height: 14px; }

/* ===== Account picker (pro) ===== */
.acct-picker-card {
  padding: 0 !important; text-align: left !important; overflow: hidden;
  max-width: 400px !important;
}
.acct-picker-hd {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px 16px; border-bottom: 1px solid var(--line);
}
.acct-picker-hd .modal-icon { margin: 0; width: 38px; height: 38px; flex-shrink: 0; }
.acct-picker-hd h3 { margin: 0; font-size: 16px; font-weight: 600; }
.acct-picker-hd p  { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

.acct-list { display: flex; flex-direction: column; gap: 8px; padding: 14px; }

.acct-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel-2); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 14px 16px; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .08s ease;
}
.acct-card:hover  { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.03); }
.acct-card:active { transform: scale(.985); }
.acct-card.active.demo { border-color: rgba(240,185,11,.55); background: rgba(240,185,11,.06); }
.acct-card.active.real { border-color: rgba(14,203,129,.55); background: rgba(14,203,129,.05); }

.acct-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; letter-spacing: .5px;
}
.acct-avatar.demo { background: rgba(240,185,11,.15); color: var(--gold); }
.acct-avatar.real { background: rgba(14,203,129,.15); color: var(--win); }

.acct-info { flex: 1; min-width: 0; }
.acct-badge {
  display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: 1.2px;
  padding: 2px 7px; border-radius: 999px; margin-bottom: 4px;
}
.acct-badge.demo { background: rgba(240,185,11,.15); color: var(--gold); }
.acct-badge.real { background: rgba(14,203,129,.15); color: var(--win); }
.acct-id  { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-bal { font-size: 20px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.5px; }

.acct-check { flex-shrink: 0; display: flex; color: var(--accent); }
.acct-check.real { color: var(--win); }

.acct-cancel {
  width: 100%; border-radius: 0 !important; border-top: 1px solid var(--line) !important;
  background: transparent !important; color: var(--muted) !important;
  min-height: 50px; font-size: 14px; font-weight: 500;
  border: none !important; transition: background .15s ease, color .15s ease;
}
.acct-cancel:hover { background: rgba(255,255,255,.04) !important; color: var(--text) !important; }

/* Balance chip — clickable when logged in */
.balance.can-switch { cursor: pointer; transition: border-color .15s ease, transform .08s ease; }
.balance.can-switch:hover  { border-color: rgba(240,185,11,.35); }
.balance.can-switch:active { transform: scale(.96); }
