/* ============================================================================
   PlayForge — website design system
   ----------------------------------------------------------------------------
   Plain CSS, no build step, dark-only. This file IS the shared component
   contract for every view (hub, market, studio, account, auth, legal …):
   the exact class names and values below are depended on by the other js
   modules, so change them with care. Extras beyond the shared contract are
   marked with an "EXTRA:" comment.

   Palette (zinc darks + rose accent — never blue/indigo):
     bg #09090b · surface #18181b · raised #1c1c1f · border #27272a
     border-strong #3f3f46 · text #fafafa / #d4d4d8 / #a1a1aa / #71717a
     accent (rose) #fb7185 · success #34d399 · teal #2dd4bf
     warn #fbbf24 · danger #f43f5e
   ============================================================================ */

/* ---------- base ---------- */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #09090b;
  color: #d4d4d8;
  font: 400 14px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a { color: #34d399; }

button, input, select, textarea { font-family: inherit; }

::selection { background: rgba(251, 113, 133, 0.35); }

:focus-visible { outline: 2px solid rgba(251, 113, 133, 0.55); outline-offset: 2px; }

/* global scrollbars (thin, zinc) */
* { scrollbar-width: thin; scrollbar-color: #3f3f46 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #27272a; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #3f3f46; }

code, kbd, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- layout ---------- */

.view {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  flex: 1;
}

/* sticky footer (body is a flex column; the view grows, the footer parks) */
.footer { margin-top: auto; }

/* EXTRA: footer chrome used by index.html */
.footer {
  border-top: 1px solid #27272a;
  background: #0c0c0e;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-note { margin: 0; font-size: 11.5px; color: #71717a; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: #a1a1aa; font-size: 12px; text-decoration: none; }
.footer-links a:hover { color: #fafafa; text-decoration: underline; }

/* ---------- topbar / nav ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #27272a;
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 0 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fafafa;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
}
.brand:hover { color: #fafafa; }
.brand-mark { color: #fb7185; }
.brand-name em { color: #fb7185; font-style: normal; }

.nav-links { display: flex; gap: 4px; }

.nav-link {
  padding: 8px 12px;
  border-radius: 10px;
  color: #a1a1aa;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.nav-link:hover { color: #d4d4d8; background: #18181b; }
.nav-link.active { color: #fafafa; background: #27272a; }
.nav-studio { border: 1px solid rgba(251, 113, 133, 0.35); color: #fb7185; }
.nav-studio:hover { color: #fb7185; background: rgba(251, 113, 133, 0.08); }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.nav-burger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid #27272a;
  border-radius: 12px;
  background: #18181b;
  color: #d4d4d8;
  cursor: pointer;
}
.nav-burger:hover { background: #27272a; }

/* EXTRA: rows appended to #nav-links that only appear in the mobile menu */
.nav-links .nav-mobile-only { display: none; }

/* ---------- grids & cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.card {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 16px;
}
.card-pad { padding: 16px; }
.card-head {
  padding: 14px 16px;
  border-bottom: 1px solid #27272a;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-title { font-size: 14px; font-weight: 700; color: #fafafa; }
.card-sub { font-size: 11px; color: #71717a; }

.game-card { overflow: hidden; cursor: pointer; transition: transform 0.15s; border-radius: 16px; }
.game-card:hover { transform: translateY(-2px); border-color: #3f3f46; }
.card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #09090b;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-fallback { color: #3f3f46; }
.featured-flag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(9, 9, 11, 0.85);
  pointer-events: none;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid #27272a;
  background: #18181b;
  color: #d4d4d8;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: #27272a; color: #fafafa; }
.btn-primary { background: #fb7185; border-color: #fb7185; color: #210b10; }
.btn-primary:hover { background: #f95d7c; border-color: #f95d7c; color: #210b10; }
.btn-danger { border-color: rgba(244, 63, 94, 0.5); color: #f43f5e; background: transparent; }
.btn-danger:hover { background: rgba(244, 63, 94, 0.1); color: #f43f5e; }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 34px; padding: 0 10px; font-size: 12px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- fields ---------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.label {
  font-size: 11px;
  font-weight: 700;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input, .textarea, .select {
  width: 100%;
  background: #09090b;
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 11px 13px;
  color: #fafafa;
  font-size: 14px;
  font-family: inherit;
  min-height: 44px;
  box-sizing: border-box;
}
.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #71717a 50%), linear-gradient(135deg, #71717a 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.select option { background: #18181b; color: #fafafa; }
.textarea { min-height: 90px; resize: vertical; }

:is(.input, .textarea, .select):focus {
  outline: 2px solid rgba(251, 113, 133, 0.55);
  outline-offset: 1px;
  border-color: #3f3f46;
}
.input::placeholder, .textarea::placeholder { color: #52525b; }

.hint { font-size: 11px; color: #71717a; }
.err {
  font-size: 12px;
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: 10px;
  padding: 8px 10px;
}

.otp-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.otp-row input {
  flex: 0 1 auto;
  width: 46px;
  height: 54px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #09090b;
  border: 1px solid #27272a;
  border-radius: 12px;
  color: #fafafa;
  padding: 0;
}
.otp-row input:focus { outline: 2px solid rgba(251, 113, 133, 0.55); outline-offset: 1px; border-color: #3f3f46; }
.otp-row input:disabled { opacity: 0.5; }

/* code-length picker above the boxes (email OTP flows: codes are 6–10 digits) */
.otp-len {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.otp-len .otp-len-label { font-size: 11px; font-weight: 600; color: #71717a; margin-right: 4px; }
.otp-len .chip { padding: 3px 10px; font-size: 11px; min-width: 36px; justify-content: center; }

.checkbox-row { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: #a1a1aa; }
.checkbox-row input { width: 18px; height: 18px; accent-color: #fb7185; margin-top: 2px; flex-shrink: 0; }

/* ---------- typography ---------- */

.h1 { font-size: 26px; font-weight: 800; color: #fafafa; letter-spacing: -0.02em; margin: 0 0 6px; }
.h2 { font-size: 19px; font-weight: 700; color: #fafafa; margin: 0 0 10px; }
.h3 { font-size: 15px; font-weight: 700; color: #fafafa; margin: 0 0 8px; }
.sm { font-size: 12px; }
.xs { font-size: 11px; }
.muted { color: #71717a; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.link { color: #34d399; text-decoration: none; }
.link:hover { text-decoration: underline; }
.bits { color: #fbbf24; font-weight: 700; white-space: nowrap; }

/* EXTRA: big wallet balance figure */
.balance { font-size: 34px; font-weight: 800; color: #fbbf24; letter-spacing: -0.01em; line-height: 1.2; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* EXTRA: icon spans emitted by PFUI.icon() */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  vertical-align: middle;
  line-height: 0;
}

/* ---------- badges & chips ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid #3f3f46;
  color: #a1a1aa;
  background: #18181b;
  white-space: nowrap;
}
.badge-teal { color: #2dd4bf; border-color: rgba(45, 212, 191, 0.4); }
.badge-rose { color: #fb7185; border-color: rgba(251, 113, 133, 0.4); }
.badge-amber { color: #fbbf24; border-color: rgba(251, 191, 36, 0.4); }
.badge-violet { color: #a78bfa; border-color: rgba(167, 139, 250, 0.4); }

.chip {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #27272a;
  background: #09090b;
  color: #a1a1aa;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.chip.active { border-color: #fb7185; color: #fb7185; }

/* ---------- toasts ---------- */

.toasts {
  position: fixed;
  bottom: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 90;
  max-width: 340px;
}
.toast {
  background: #18181b;
  border: 1px solid #27272a;
  border-left: 3px solid #71717a;
  color: #d4d4d8;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.25s;
  animation: toast-in 0.25s forwards;
}
.toast.out { opacity: 0; transform: translateY(8px); }
.toast-ok { border-left-color: #34d399; }
.toast-err { border-left-color: #f43f5e; }
.toast-info { border-left-color: #2dd4bf; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #18181b;
  border: 1px solid #3f3f46;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #27272a;
}
.modal-head h3 { margin: 0; font-size: 15px; color: #fafafa; }
.modal-close {
  background: none;
  border: none;
  color: #71717a;
  font-size: 22px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  line-height: 1;
}
.modal-close:hover { color: #fafafa; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid #27272a;
}
.modal-actions .btn { min-height: 38px; }

/* ---------- spinners / boot / empty ---------- */

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #27272a;
  border-top-color: #fb7185;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.spinner-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #71717a;
  font-size: 13px;
  padding: 28px 0;
  justify-content: center;
}
.boot-splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 80px 0;
  color: #71717a;
}

.empty-state { text-align: center; padding: 60px 16px; color: #71717a; }
.empty-state h2 { color: #d4d4d8; font-size: 18px; }
.empty-state a { color: #34d399; }

/* ---------- chat (agents.js) ---------- */

.chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  overflow-y: auto;
  flex: 1;
  min-height: 200px;
  scrollbar-width: thin;
  scrollbar-color: #3f3f46 transparent;
}
.chat::-webkit-scrollbar { width: 8px; }
.chat::-webkit-scrollbar-thumb { background: #27272a; border-radius: 8px; }

.msg { max-width: 78%; display: flex; flex-direction: column; gap: 4px; }
.msg.me { align-self: flex-end; }
.msg.agent { align-self: flex-start; }
.msg-head { display: flex; gap: 7px; align-items: center; font-size: 11px; color: #71717a; }
.msg-body {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 14px;
  padding: 10px 13px;
  font-size: 13.5px;
  color: #d4d4d8;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}
.msg.me .msg-body { background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.3); }
.msg.system { align-self: center; text-align: center; color: #71717a; font-size: 11.5px; max-width: 90%; }
.msg-code {
  background: #09090b;
  border: 1px solid #27272a;
  border-radius: 10px;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre;
  color: #a1a1aa;
  margin-top: 6px;
}

.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #27272a; }
.composer textarea {
  flex: 1;
  min-height: 44px;
  max-height: 160px;
  background: #09090b;
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 11px 13px;
  color: #fafafa;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  box-sizing: border-box;
}
.composer textarea:focus { outline: 2px solid rgba(251, 113, 133, 0.55); outline-offset: 1px; border-color: #3f3f46; }

.mode-picker { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 12px 0; }

/* ---------- rows / lists / utilities ---------- */

.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- avatars ---------- */

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #27272a;
  color: #d4d4d8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.avatar-lg { width: 72px; height: 72px; font-size: 26px; }

/* ---------- tables ---------- */

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #71717a;
  padding: 8px 10px;
  border-bottom: 1px solid #27272a;
}
.table td {
  padding: 9px 10px;
  border-bottom: 1px solid #1c1c1f;
  color: #d4d4d8;
  vertical-align: top;
}
.table tr:hover td { background: rgba(255, 255, 255, 0.015); }

/* ---------- tabs ---------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid #27272a; margin-bottom: 16px; overflow-x: auto; }
.tab {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #71717a;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover { color: #d4d4d8; }
.tab.active { color: #fafafa; border-bottom-color: #fb7185; }

/* ---------- legal ---------- */

.legal { max-width: 780px; }
.legal h2 { font-size: 17px; font-weight: 700; color: #fafafa; margin: 28px 0 10px; }
.legal p { font-size: 13.5px; line-height: 1.7; color: #d4d4d8; margin: 0 0 12px; }
.legal ul { padding-left: 22px; margin: 0 0 12px; }
.legal li { font-size: 13.5px; line-height: 1.7; color: #d4d4d8; margin-bottom: 6px; }
.legal strong { color: #fafafa; }
.legal .legal-meta { color: #71717a; font-size: 12px; }

/* ---------- auth ---------- */

.auth-card { max-width: 430px; margin: 32px auto 0; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.auth-tabs .tab { flex: 1; text-align: center; }

/* Cloudflare Turnstile slot (js/turnstile.js). Empty when bot protection
 * isn't configured — collapse entirely so forms keep their rhythm. */
.turnstile-slot { margin: 2px 0 12px; min-width: 0; }
.turnstile-slot:empty { display: none; margin: 0; }
.turnstile-slot iframe { max-width: 100%; border-radius: 8px; }
.captcha-hint { margin: 8px 0 0; }

/* ---------- nav widgets ---------- */

.bits-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #18181b;
  border: 1px solid #27272a;
  color: #fbbf24;
  font-weight: 700;
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: 999px;
  text-decoration: none;
}
.bits-chip:hover { border-color: #3f3f46; color: #fbbf24; }

.bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid #27272a;
  background: #18181b;
  color: #a1a1aa;
  cursor: pointer;
}
.bell:hover { color: #fafafa; background: #27272a; }
.bell .dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fb7185;
  border: 2px solid #09090b;
}

/* EXTRA: notifications dropdown panel anchored under the topbar */
.notif-pop {
  position: absolute;
  top: 54px;
  right: 12px;
  width: min(360px, calc(100vw - 24px));
  background: #18181b;
  border: 1px solid #3f3f46;
  border-radius: 14px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55);
  z-index: 60;
  overflow: hidden;
}
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { padding: 11px 14px; border-bottom: 1px solid #1c1c1f; display: block; }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: rgba(251, 113, 133, 0.05); }
.notif-item .notif-title { font-size: 13px; font-weight: 700; color: #fafafa; margin: 0 0 2px; }
.notif-item.unread .notif-title::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fb7185;
  margin-right: 7px;
  vertical-align: 1px;
}
.notif-item .notif-body { font-size: 12px; color: #a1a1aa; margin: 0; }

/* ---------- one-time codes ---------- */

.otp-box {
  background: #09090b;
  border: 1px solid #34d399;
  border-radius: 12px;
  padding: 18px 12px;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 30px;
  font-weight: 700;
  color: #fafafa;
  letter-spacing: 10px;
}

/* ---------- ads / misc ---------- */

.ad-card { border: 1px dashed #3f3f46; }
.ad-tag { font-size: 9px; color: #71717a; letter-spacing: 0.12em; }

.kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  background: #09090b;
  border: 1px solid #27272a;
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 2px 6px;
  color: #a1a1aa;
}

/* EXTRA: white plate so TOTP QR codes scan reliably on the dark theme */
.qr-box {
  background: #ffffff;
  border-radius: 12px;
  padding: 10px;
  width: fit-content;
  margin: 0 auto;
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: #09090b;
    border-bottom: 1px solid #27272a;
    padding: 10px 16px;
    flex-direction: column;
  }
  .nav-links .nav-mobile-only { display: flex; }
  .nav-burger { display: flex; }
  .view { padding: 14px 12px 40px; }
  .msg { max-width: 92%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .otp-row input { height: 48px; }
  .auth-tabs .tab { padding: 10px 6px; font-size: 12px; }
}

/* EXTRA: hide desktop-only nav widgets on small screens (the mobile menu covers them) */
@media (max-width: 640px) {
  .hide-sm { display: none !important; }
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- economy: wallet cap meter + bit pack cards ---------- */

.meter {
  height: 8px;
  border-radius: 999px;
  background: #27272a;
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  border-radius: 999px;
  background: #fbbf24;
  transition: width .3s ease;
}
.meter-fill.over { background: #fb7185; }
.meter-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #71717a;
  margin-top: 4px;
}
.note-amber {
  font-size: 12px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 0 0 12px;
}
.note-teal {
  font-size: 12px;
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.08);
  border: 1px solid rgba(45, 212, 191, 0.3);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 0 0 12px;
}
.pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.pack-card {
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #0c0c0f;
}
.pack-card.popular { border-color: rgba(251, 113, 133, 0.55); }
.pack-card.best-value { border-color: rgba(251, 191, 36, 0.55); }
.pack-bits {
  font-size: 22px;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.pack-price {
  font-size: 15px;
  font-weight: 700;
  color: #fafafa;
}
.pack-value { font-size: 11px; color: #71717a; }

@media (max-width: 640px) {
  .pack-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
}
