/* ============ Theme + base (mobile-first) — Gold (#f0b90b) ============ */
:root {
  --bg:        #0b0e11;
  --bg-2:      #11151c;
  --panel:     #161b22;
  --panel-2:   #1e2530;
  --line:      rgba(255,255,255,.07);
  --text:      #eaecef;
  --muted:     #848e9c;
  --accent:    #f0b90b;   /* gold */
  --accent-2:  #f8d12f;   /* light gold */
  --gold:      #f0b90b;
  --win:       #0ecb81;
  --lose:      #f6465d;
  --shadow:    0 12px 34px rgba(0,0,0,.5);
  --r:         14px;
  --r-sm:      10px;
  --tap:       44px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: radial-gradient(1200px 800px at 50% -10%, #15191f 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font-family: 'Sora', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  letter-spacing: .2px;
}
body { min-height: 100dvh; }

#app {
  max-width: 1040px; margin: 0 auto; min-height: 100dvh;
  display: flex; flex-direction: column; position: relative;
}

button { font-family: inherit; cursor: pointer; border: none; }

/* ============ Top bar ============ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(11,14,17,.97), rgba(11,14,17,.8));
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; background: none; color: var(--text); font-weight: 800; font-size: 18px; letter-spacing: .5px; }
.brand-mark { color: var(--accent); filter: drop-shadow(0 0 8px var(--accent)); }
.brand-name { color: var(--accent); }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: var(--tap); height: var(--tap); display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 18px; color: var(--text);
}
.balance {
  display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15;
  background: var(--panel); border: 1px solid var(--line); padding: 6px 12px; border-radius: var(--r-sm);
}
.balance-mode { font-size: 9px; letter-spacing: 1px; color: var(--muted); font-weight: 600; }
.balance-mode.real { color: var(--gold); }
.balance-amount { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============ Buttons ============ */
.btn {
  min-height: var(--tap); padding: 0 16px; border-radius: var(--r-sm);
  background: var(--panel-2); color: var(--text); font-weight: 500; font-size: 14px;
  border: 1px solid var(--line); transition: transform .06s ease, filter .15s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-login { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #1a1300; border: none; font-weight: 700; }
.btn-ghost { background: var(--panel); }

/* ============ View ============ */
.view { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* ============ Toasts ============ */
.toast-host {
  position: fixed; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; z-index: 60; padding: 0 14px;
}
.toast {
  pointer-events: auto; max-width: 92%;
  background: var(--panel-2); border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  animation: toast-in .25s ease, toast-out .3s ease forwards; animation-delay: 0s, var(--ttl, 2.4s);
}
.toast.win  { border-color: rgba(14,203,129,.5); box-shadow: 0 8px 28px rgba(14,203,129,.25); }
.toast.lose { border-color: rgba(246,70,93,.5); box-shadow: 0 8px 28px rgba(246,70,93,.25); }
.toast .toast-ic { display: inline-flex; }
.toast .toast-ic .ic { width: 18px; height: 18px; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(8px) scale(.98); } }

@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
