@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d0d0d;
  --surface:   #161616;
  --surface2:  #1e1e1e;
  --border:    #2a2a2a;
  --accent:    #f0a500;
  --accent-dim:#b07800;
  --green:     #22c55e;
  --red:       #ef4444;
  --text:      #e8e8e8;
  --muted:     #666;
  --font:      'Inter', system-ui, sans-serif;
  --radius:    8px;
  --radius-sm: 4px;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Layout ── */
.app { display: grid; grid-template-rows: 48px 1fr; min-height: 100vh; }

/* ── Header ── */
header {
  display: flex; align-items: center; padding: 0 20px; gap: 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.logo { font-weight: 700; font-size: 18px; letter-spacing: -0.5px; color: var(--accent); flex: 1; }
.balance-display { font-size: 13px; color: var(--muted); }
.balance-display span { color: var(--text); font-weight: 600; }
.btn-icon { background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px; font-size: 16px; transition: color .2s; }
.btn-icon:hover { color: var(--text); }

/* ── Main game area ── */
main { display: grid; grid-template-columns: 1fr 260px; gap: 0; max-width: 1100px; margin: 0 auto; width: 100%; padding: 20px; gap: 16px; }

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

/* ── Game panel ── */
.game-panel { display: flex; flex-direction: column; gap: 12px; }

/* ── Crash chart ── */
.chart-wrap {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  position: relative; overflow: hidden; aspect-ratio: 16/7;
}
#crash-canvas { width: 100%; height: 100%; display: block; }

.multiplier-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.multiplier-big {
  font-size: clamp(48px, 8vw, 72px); font-weight: 700; letter-spacing: -2px;
  color: var(--accent); text-shadow: 0 0 40px rgba(240,165,0,.4);
  transition: color .1s;
}
.multiplier-big.crashed { color: var(--red); text-shadow: 0 0 40px rgba(239,68,68,.4); }
.multiplier-big.betting { color: var(--muted); font-size: clamp(20px, 4vw, 32px); }

.status-badge {
  position: absolute; top: 12px; left: 12px;
  padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
}
.status-badge.betting  { background: rgba(240,165,0,.15); color: var(--accent); border: 1px solid rgba(240,165,0,.3); }
.status-badge.in_progress { background: rgba(34,197,94,.15); color: var(--green); border: 1px solid rgba(34,197,94,.3); }
.status-badge.crashed  { background: rgba(239,68,68,.15); color: var(--red); border: 1px solid rgba(239,68,68,.3); }
.status-badge.waiting  { background: rgba(102,102,102,.15); color: var(--muted); border: 1px solid rgba(102,102,102,.3); }

/* ── Bet controls ── */
.bet-controls {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.bet-controls label { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.input-group { display: flex; gap: 8px; align-items: center; }
.input-group input {
  flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font); font-size: 14px; padding: 8px 12px;
  outline: none; transition: border-color .2s;
}
.input-group input:focus { border-color: var(--accent); }
.input-group input::-webkit-inner-spin-button { display: none; }
.quick-btns { display: flex; gap: 6px; }
.btn-quick {
  background: var(--surface2); border: 1px solid var(--border); color: var(--muted);
  border-radius: var(--radius-sm); padding: 4px 8px; font-size: 11px; cursor: pointer;
  transition: all .15s;
}
.btn-quick:hover { border-color: var(--accent); color: var(--accent); }

/* ── Primary/secondary buttons ── */
.btn {
  border: none; border-radius: var(--radius-sm); padding: 10px 20px;
  font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .15s; width: 100%;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover:not(:disabled) { background: #ffb800; }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-cashout { background: var(--green); color: #000; display: none; }
.btn-cashout:hover:not(:disabled) { background: #16a34a; }
.btn-cashout.visible { display: block; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-secondary { background: var(--surface2); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ── Game history strip ── */
.history-strip {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 0;
  scrollbar-width: none;
}
.history-strip::-webkit-scrollbar { display: none; }
.history-pill {
  flex-shrink: 0; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 600;
  border: 1px solid transparent;
}
.history-pill.low  { background: rgba(239,68,68,.15);  color: var(--red);   border-color: rgba(239,68,68,.3); }
.history-pill.mid  { background: rgba(240,165,0,.12);  color: var(--accent); border-color: rgba(240,165,0,.25); }
.history-pill.high { background: rgba(34,197,94,.12);  color: var(--green); border-color: rgba(34,197,94,.25); }

/* ── Side panel ── */
.side-panel { display: flex; flex-direction: column; gap: 12px; }

.panel-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-box h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--border); }

/* ── Players list ── */
.players-list { max-height: 220px; overflow-y: auto; }
.player-row {
  display: flex; align-items: center; padding: 8px 14px; gap: 10px;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.player-row:last-child { border-bottom: none; }
.player-id { flex: 1; color: var(--muted); font-size: 11px; font-family: monospace; }
.player-amount { font-weight: 600; color: var(--text); }
.player-status { font-size: 11px; font-weight: 600; }
.player-status.cashed { color: var(--green); }
.player-status.active { color: var(--accent); }

/* ── Modals ── */
.modal-bg {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.75);
  align-items: center; justify-content: center; z-index: 200;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; width: 100%; max-width: 440px; margin: 16px;
}
.modal h2 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.modal p { color: var(--muted); margin-bottom: 12px; font-size: 13px; line-height: 1.6; }
.modal .key-display {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; font-family: monospace; font-size: 12px; word-break: break-all;
  margin-bottom: 16px; color: var(--accent); letter-spacing: .5px;
}
.modal-actions { display: flex; gap: 8px; }
.modal-actions .btn { flex: 1; }

/* ── Deposit modal content ── */
.deposit-address {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; font-family: monospace; font-size: 11px; word-break: break-all;
  margin: 12px 0; color: var(--text); letter-spacing: .5px;
}
.qr-placeholder { width: 140px; height: 140px; margin: 0 auto 12px; background: var(--surface2); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 16px; font-size: 13px; opacity: 0; transform: translateY(10px);
  transition: all .3s; max-width: 280px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error   { border-color: var(--red);   color: var(--red); }
.toast.info    { border-color: var(--accent); color: var(--accent); }

/* ── Verify modal ── */
.verify-row { display: grid; grid-template-columns: 120px 1fr; gap: 8px; font-size: 12px; margin-bottom: 8px; }
.verify-row .label { color: var(--muted); }
.verify-row .value { font-family: monospace; word-break: break-all; color: var(--text); }
.verify-ok   { color: var(--green); font-weight: 600; }
.verify-fail { color: var(--red);   font-weight: 600; }

/* ── Withdraw form ── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-group label { font-size: 12px; color: var(--muted); font-weight: 500; }
.form-group input { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-family: var(--font); font-size: 13px; padding: 8px 12px; outline: none; width: 100%; transition: border-color .2s; }
.form-group input:focus { border-color: var(--accent); }

/* ── Secret key banner ── */
.key-banner {
  background: rgba(240,165,0,.08); border: 1px solid rgba(240,165,0,.3);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; display: none;
}
.key-banner.show { display: flex; gap: 12px; align-items: flex-start; }
.key-banner-icon { font-size: 18px; flex-shrink: 0; }
.key-banner-text { font-size: 12px; line-height: 1.6; color: var(--muted); }
.key-banner-text strong { color: var(--accent); }
.key-banner-key { font-family: monospace; font-size: 11px; color: var(--text); word-break: break-all; margin-top: 4px; }

/* ── Game seed info bar ── */
.seed-bar {
  font-size: 11px; color: var(--muted); display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.seed-bar span { color: var(--text); font-family: monospace; }
.seed-bar a { color: var(--accent); text-decoration: none; cursor: pointer; }
.seed-bar a:hover { text-decoration: underline; }

/* ── Header action buttons ── */
.btn-header {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 5px 12px; font-family: var(--font);
  font-size: 12px; font-weight: 500; cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.btn-header:hover { border-color: var(--accent); color: var(--accent); }

/* ── Footer ── */
footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--muted); background: var(--surface);
  flex-wrap: wrap; gap: 8px;
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--muted); text-decoration: none; transition: color .15s; }
.footer-links a:hover { color: var(--accent); }

/* ── App grid with footer ── */
.app { grid-template-rows: 48px 1fr auto; }

/* ── FAQ accordion ── */
.faq-item {
  border-bottom: 1px solid var(--border); padding: 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  padding: 12px 4px; cursor: pointer; font-weight: 500; font-size: 13px;
  color: var(--text); list-style: none; display: flex; justify-content: space-between;
  align-items: center;
}
.faq-item summary::after { content: '+'; color: var(--accent); font-size: 16px; }
.faq-item[open] summary::after { content: '−'; }
.faq-item summary:hover { color: var(--accent); }
.faq-item p { padding: 0 4px 12px; color: var(--muted); font-size: 13px; line-height: 1.7; }
