/* ============ AVIATOR — Red & Black theme ============ */
:root {
  --bg: #0b0b0f;
  --bg-2: #121218;
  --bg-3: #1a1a22;
  --panel: #16161d;
  --border: #2a2a35;
  --red: #e50539;
  --red-2: #ff2d55;
  --red-dark: #8f0224;
  --text: #f2f2f5;
  --muted: #8b8b99;
  --green: #28a745;
  --gold: #ffb800;
  --purple: #913ef8;
  --blue: #34b4ff;
  --radius: 14px;
  --font-display: 'Rajdhani', 'Inter', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: radial-gradient(ellipse at top, #1c0a10 0%, var(--bg) 55%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; }
a { color: inherit; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #33333f; border-radius: 3px; }

#app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; gap: 12px;
  background: linear-gradient(180deg, #17171f, #0f0f14);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: 2px; color: var(--red); text-shadow: 0 0 18px rgba(229,5,57,.55); }
.brand i { font-size: 22px; transform: rotate(-20deg); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.balance-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 14px; font-weight: 700; font-family: var(--font-display); font-size: 18px;
}
.balance-chip .cur { color: var(--green); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; transition: .15s; background: var(--bg-3); color: var(--text); border: 1px solid var(--border); }
.btn:hover { filter: brightness(1.15); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn-red { background: linear-gradient(180deg, var(--red-2), var(--red)); border-color: var(--red); box-shadow: 0 4px 18px rgba(229,5,57,.35); }
.btn-green { background: linear-gradient(180deg, #34c759, #28a745); border-color: #28a745; box-shadow: 0 4px 18px rgba(40,167,69,.35); }
.btn-gold { background: linear-gradient(180deg, #ffd24d, var(--gold)); color: #1a1200; border-color: var(--gold); }
.btn-outline { background: transparent; }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 50%; position: relative; }
.badge-dot { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; }

/* ---------- layout ---------- */
.main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; padding: 14px; max-width: 1400px; width: 100%; margin: 0 auto; }
@media (max-width: 960px) { .main { grid-template-columns: 1fr; } .side { order: 2; } }
#game-col { min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.panel-title { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }

/* ---------- history strip ---------- */
.history { display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px; scrollbar-width: none; }
.history::-webkit-scrollbar { display: none; }
.hchip { flex: 0 0 auto; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; font-family: var(--font-display); background: var(--bg-3); border: 1px solid var(--border); }
.hchip.low { color: var(--blue); }
.hchip.mid { color: var(--purple); }
.hchip.high { color: var(--red-2); text-shadow: 0 0 10px rgba(255,45,85,.6); }

/* ---------- game canvas ---------- */
.game-wrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid #3a0c17;
  background: radial-gradient(ellipse at bottom left, #2a0611 0%, #0b0b0f 60%);
  box-shadow: inset 0 0 80px rgba(229,5,57,.12), 0 10px 40px rgba(0,0,0,.6); }
.game-canvas { display: block; width: 100%; height: 380px; }
@media (max-width: 600px) { .game-canvas { height: 280px; } }
.game-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.mult { font-family: var(--font-display); font-weight: 700; font-size: 84px; line-height: 1; color: #fff; text-shadow: 0 0 30px rgba(255,255,255,.35); letter-spacing: 1px; }
.mult.crashed { color: var(--red-2); text-shadow: 0 0 40px rgba(229,5,57,.8); }
.flew { font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: 3px; text-transform: uppercase; color: #ffb3c4; margin-bottom: 6px; }
.waiting { font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: 3px; text-transform: uppercase; color: #fff; }
.countdown-bar { width: 220px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); margin-top: 14px; overflow: hidden; }
.countdown-bar > div { height: 100%; background: linear-gradient(90deg, var(--red-dark), var(--red-2)); transition: width .2s linear; box-shadow: 0 0 12px var(--red); }
.online { position: absolute; top: 10px; left: 12px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.online b { color: var(--green); }
.fair { position: absolute; top: 10px; right: 12px; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; pointer-events: auto; cursor: pointer; }
.fair:hover { color: var(--text); }
@media (max-width: 600px) { .mult { font-size: 60px; } }

/* ---------- bet panels ---------- */
.bets { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
@media (max-width: 700px) { .bets { grid-template-columns: 1fr; } }
.bet-card { background: linear-gradient(180deg, #1b1b24, #13131a); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; position: relative; }
.bet-card.active { border-color: var(--red); box-shadow: 0 0 0 1px var(--red), 0 0 24px rgba(229,5,57,.25); }
.bet-card.won { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), 0 0 24px rgba(40,167,69,.3); }
.bet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.bet-head .tag { font-family: var(--font-display); font-weight: 700; letter-spacing: 1px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.mode-toggle { display: flex; background: var(--bg); border-radius: 999px; padding: 2px; }
.mode-toggle button { background: transparent; color: var(--muted); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 600; }
.mode-toggle button.on { background: var(--bg-3); color: var(--text); }
.amount-row { display: flex; gap: 10px; align-items: stretch; }
.amount-box { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; display: flex; align-items: center; padding: 4px 6px; }
.amount-box button { width: 34px; height: 34px; border-radius: 50%; background: var(--bg-3); color: var(--text); font-size: 18px; font-weight: 700; }
.amount-box input { flex: 1; background: transparent; border: none; color: var(--text); text-align: center; font-family: var(--font-display); font-size: 22px; font-weight: 700; outline: none; width: 40px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.quick button { background: var(--bg); border: 1px solid var(--border); color: var(--muted); border-radius: 8px; padding: 6px 0; font-size: 12px; font-weight: 600; }
.quick button:hover { color: var(--text); border-color: #444; }
.auto-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.auto-row > span:first-child { white-space: nowrap; }
.auto-row input[type=number] { width: 80px; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 6px 8px; font-weight: 600; text-align: center; }
.switch { position: relative; width: 40px; height: 22px; background: var(--bg); border: 1px solid var(--border); border-radius: 11px; cursor: pointer; transition: .2s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch.on { background: var(--red-dark); border-color: var(--red); }
.switch.on::after { left: 20px; background: #fff; }
.bet-btn { width: 100%; margin-top: 12px; padding: 16px; border-radius: 14px; font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.bet-btn small { font-size: 13px; font-weight: 600; opacity: .9; letter-spacing: 0; text-transform: none; font-family: var(--font-body); }
.bet-btn.place { background: linear-gradient(180deg, var(--red-2), var(--red)); color: #fff; box-shadow: 0 6px 24px rgba(229,5,57,.4); }
.bet-btn.cancel { background: linear-gradient(180deg, #ff5c5c, #cc2b2b); color: #fff; }
.bet-btn.cash { background: linear-gradient(180deg, #ffb800, #e09a00); color: #1a1200; box-shadow: 0 6px 24px rgba(255,184,0,.4); animation: pulse 1s infinite; }
.bet-btn.wait { background: var(--bg-3); color: var(--muted); border: 1px solid var(--border); }
.bet-btn.won { background: linear-gradient(180deg, #34c759, #28a745); color: #fff; }
@keyframes pulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.02);} }

/* ---------- side: live bets ---------- */
.side { display: flex; flex-direction: column; gap: 14px; }
.livebets { max-height: 420px; overflow-y: auto; }
.lb-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; padding: 8px 14px; font-size: 13px; border-bottom: 1px solid #1f1f28; align-items: center; }
.lb-row .u { color: var(--muted); }
.lb-row .m { font-weight: 700; color: var(--purple); }
.lb-row .w { color: var(--green); font-weight: 600; }
.lb-row.won { background: rgba(40,167,69,.08); }
.empty { padding: 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- contact ---------- */
.contact { padding: 12px 14px; font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.contact a { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); }
.contact a i { width: 18px; text-align: center; color: var(--red-2); }
.contact .hours { color: var(--muted); font-size: 12px; text-align: center; }

/* ---------- modals ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.75); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 14px; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 80px rgba(0,0,0,.7); }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.modal-head .x { background: transparent; color: var(--muted); font-size: 20px; }
.modal-body { padding: 18px; }
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 12px; margin-bottom: 16px; }
.tabs button { flex: 1; background: transparent; color: var(--muted); padding: 10px; border-radius: 9px; font-weight: 600; font-size: 13px; }
.tabs button.on { background: var(--red); color: #fff; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.field input, .field select, .field textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 12px; font-size: 15px; outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--red); }
.qr-box { text-align: center; padding: 16px; background: #fff; border-radius: 14px; margin-bottom: 14px; }
.qr-box img { max-width: 220px; width: 100%; border-radius: 8px; }
.qr-box .noqr { color: #666; padding: 30px; font-size: 13px; }
.upi-line { display: flex; align-items: center; justify-content: space-between; background: var(--bg); border: 1px dashed var(--red-dark); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-weight: 600; }
.upi-line button { background: var(--bg-3); color: var(--text); padding: 6px 10px; border-radius: 8px; font-size: 12px; }
.note { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 14px; padding: 10px 12px; background: rgba(229,5,57,.08); border-left: 3px solid var(--red); border-radius: 6px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.row-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.row-item .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.status { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.status.pending { background: rgba(255,184,0,.15); color: var(--gold); }
.status.approved { background: rgba(40,167,69,.15); color: var(--green); }
.status.rejected { background: rgba(229,5,57,.15); color: var(--red-2); }
.status.won { background: rgba(40,167,69,.15); color: var(--green); }
.status.lost { background: rgba(229,5,57,.15); color: var(--red-2); }
.status.placed { background: rgba(52,180,255,.15); color: var(--blue); }
.amt-pos { color: var(--green); font-weight: 700; }
.amt-neg { color: var(--red-2); font-weight: 700; }
.error { background: rgba(229,5,57,.12); border: 1px solid var(--red-dark); color: #ffb3c4; padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; }
.success { background: rgba(40,167,69,.12); border: 1px solid #1b5e20; color: #a5e6b2; padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(ellipse at 30% 20%, #3a0713 0%, transparent 50%), radial-gradient(ellipse at 80% 90%, #2a0410 0%, transparent 45%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: rgba(22,22,29,.92); border: 1px solid var(--border); border-radius: 22px; padding: 28px; box-shadow: 0 30px 100px rgba(229,5,57,.15); }
.auth-logo { text-align: center; margin-bottom: 20px; }
.auth-logo .brand { justify-content: center; font-size: 40px; }
.auth-logo p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.auth-plane { width: 120px; height: 60px; margin: 0 auto 10px; }

/* ---------- chat ---------- */
.chat-fab { position: fixed; right: 18px; bottom: 18px; width: 58px; height: 58px; border-radius: 50%; background: linear-gradient(180deg, var(--red-2), var(--red)); color: #fff; font-size: 24px; box-shadow: 0 8px 30px rgba(229,5,57,.5); z-index: 50; display: flex; align-items: center; justify-content: center; }
.chat-win { position: fixed; right: 18px; bottom: 86px; width: 360px; max-width: calc(100vw - 36px); height: 500px; max-height: calc(100vh - 110px); background: var(--panel); border: 1px solid var(--border); border-radius: 18px; display: flex; flex-direction: column; overflow: hidden; z-index: 50; box-shadow: 0 20px 60px rgba(0,0,0,.7); }
.chat-head { padding: 12px 14px; background: linear-gradient(180deg, var(--red), var(--red-dark)); font-family: var(--font-display); font-weight: 700; font-size: 17px; display: flex; justify-content: space-between; align-items: center; }
.chat-cats { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); }
.chat-cats button { flex: 1; background: var(--bg); color: var(--muted); border-radius: 8px; padding: 7px 4px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); }
.chat-cats button.on { background: var(--bg-3); color: var(--text); border-color: var(--red); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 82%; padding: 8px 12px; border-radius: 14px; font-size: 13px; line-height: 1.45; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--red); color: #fff; border-bottom-right-radius: 4px; }
.msg.admin { align-self: flex-start; background: var(--bg-3); border-bottom-left-radius: 4px; }
.msg time { display: block; font-size: 10px; opacity: .6; margin-top: 3px; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 10px 12px; outline: none; }
.chat-input button { background: var(--red); color: #fff; width: 42px; border-radius: 10px; }

/* ---------- toast ---------- */
.toasts { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 10px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: toastin .25s ease; }
.toast.ok { background: #1f7a33; color: #fff; }
.toast.err { background: var(--red); color: #fff; }
.toast.win { background: linear-gradient(180deg, #ffd24d, var(--gold)); color: #1a1200; font-family: var(--font-display); font-size: 18px; }
@keyframes toastin { from { opacity: 0; transform: translateY(-10px);} to { opacity: 1; transform: none;} }

.footer { text-align: center; color: var(--muted); font-size: 11px; padding: 14px; border-top: 1px solid var(--border); }
.footer a { color: var(--muted); }
