/* ===== Heliance Design System ===== */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=JetBrains+Mono:wght@400;500&family=Inter+Tight:wght@400;500;600&display=swap');

:root {
  --bg: #0a0a0a;
  --bg-elev: #111111;
  --bg-card: #141414;
  --border: #1f1f1f;
  --border-strong: #2a2a2a;
  --text: #f5f5f0;
  --text-dim: #8a8a85;
  --text-faint: #5a5a55;
  --accent: #d4ff3f;
  --accent-dim: #a8cc32;
  --green: #4ade80;
  --red: #f87171;
  --amber: #fbbf24;
  --serif: 'Fraunces', serif;
  --sans: 'Inter Tight', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }

/* ===== Background grain ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 0%, rgba(212, 255, 63, 0.04), transparent 40%),
    radial-gradient(circle at 80% 100%, rgba(212, 255, 63, 0.03), transparent 40%);
  z-index: 0;
}

/* ===== Layout ===== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

/* ===== Navbar ===== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.logo {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-mark {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  color: var(--text-dim);
  font-size: 14px;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0a;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-dim); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { border-color: var(--text-dim); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.3);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.1); }

.btn-success {
  background: var(--green);
  color: #0a0a0a;
  font-weight: 600;
}
.btn-success:hover { background: #22c55e; }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ===== Hero ===== */
.hero {
  padding: 100px 0 80px;
  text-align: left;
  position: relative;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 32px;
}

.hero-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  max-width: 900px;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero p {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 560px;
  margin-bottom: 40px;
}

.hero-actions { display: flex; gap: 12px; }

/* ===== Stats strip ===== */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 60px 0;
}

.stat-cell {
  padding: 32px;
  border-right: 1px solid var(--border);
}
.stat-cell:last-child { border-right: none; }

.stat-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.stat-value {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.stat-sub { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

/* ===== Tiers ===== */
.section { padding: 80px 0; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 48px;
  flex-wrap: wrap;
  gap: 20px;
}

.section-title {
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.section-sub { color: var(--text-dim); max-width: 400px; }

.tier-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.tier-card {
  background: var(--bg);
  padding: 28px;
  transition: background 0.3s;
  position: relative;
}

.tier-card:hover { background: var(--bg-elev); }

.tier-card.featured {
  background: var(--bg-elev);
}

.tier-card.featured::before {
  content: 'POPULAR';
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.tier-stake {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.tier-mult {
  font-family: var(--serif);
  font-size: 56px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 16px;
}

.tier-mult sup { font-size: 24px; color: var(--text-dim); }

.tier-amount {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 16px;
}

.tier-cap {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ===== Auth pages ===== */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-side {
  background: var(--bg-elev);
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.auth-side::after {
  content: '';
  position: absolute;
  bottom: -50%;
  right: -30%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(212, 255, 63, 0.08), transparent 70%);
  pointer-events: none;
}

.auth-quote {
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.02em;
  max-width: 420px;
  position: relative;
  z-index: 2;
}

.auth-quote em { font-style: italic; color: var(--accent); }

.auth-form-side {
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-form {
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
}

.auth-form h2 {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.auth-form .lead {
  color: var(--text-dim);
  margin-bottom: 36px;
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.2s;
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.field-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 6px;
}

.auth-foot {
  text-align: center;
  margin-top: 28px;
  color: var(--text-dim);
  font-size: 14px;
}

.auth-foot a { color: var(--accent); }

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 18px;
  border: 1px solid;
}
.alert-error { background: rgba(248, 113, 113, 0.08); border-color: rgba(248, 113, 113, 0.2); color: var(--red); }
.alert-success { background: rgba(74, 222, 128, 0.08); border-color: rgba(74, 222, 128, 0.2); color: var(--green); }
.alert-info { background: rgba(212, 255, 63, 0.06); border-color: rgba(212, 255, 63, 0.2); color: var(--accent); }

/* ===== Dashboard ===== */
.dash-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  padding: 28px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  padding: 0 28px 28px;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  padding: 20px 16px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: var(--text-dim);
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 2px;
  transition: all 0.2s;
}
.sidebar-link:hover { background: var(--bg); color: var(--text); }
.sidebar-link.active { background: var(--bg); color: var(--text); }
.sidebar-link.active::before {
  content: '';
  width: 3px;
  height: 16px;
  background: var(--accent);
  border-radius: 2px;
  margin-left: -14px;
  margin-right: 11px;
}

.sidebar-foot {
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
}

.dash-main {
  padding: 32px 40px;
  overflow-x: hidden;
}

.dash-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.dash-head h1 {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.welcome-sub { color: var(--text-dim); margin-top: 4px; font-size: 14px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.metric {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.metric:hover { border-color: var(--border-strong); }

.metric-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.metric-value {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}

.metric-delta {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
  font-family: var(--mono);
}

.metric.accent { background: linear-gradient(135deg, var(--bg-card), rgba(212, 255, 63, 0.04)); border-color: rgba(212, 255, 63, 0.15); }

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 24px;
  overflow: hidden;
}

.panel-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.panel-body { padding: 24px; }

.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 14px 24px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  font-weight: 500;
  background: var(--bg-elev);
}

tbody tr { transition: background 0.15s; }
tbody tr:hover { background: var(--bg-elev); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.badge-pending { background: rgba(251, 191, 36, 0.1); color: var(--amber); }
.badge-active { background: rgba(74, 222, 128, 0.1); color: var(--green); }
.badge-rejected { background: rgba(248, 113, 113, 0.1); color: var(--red); }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-backdrop.active { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-head {
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-head h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 22px;
  line-height: 1;
}
.modal-close:hover { background: var(--bg-elev); color: var(--text); }

.modal-body { padding: 26px; }

/* ===== Deposit options ===== */
.method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.method-card {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 22px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.method-card:hover { border-color: var(--text-dim); }
.method-card.selected { border-color: var(--accent); background: rgba(212, 255, 63, 0.05); }

.method-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.method-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.method-desc { font-size: 12px; color: var(--text-dim); }

.qr-box {
  background: white;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  text-align: center;
}

.qr-box img { max-width: 220px; }

.deposit-info {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: 13px;
}

.deposit-info-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.deposit-info-row span:first-child { color: var(--text-dim); }

.upload-area {
  border: 1.5px dashed var(--border-strong);
  border-radius: 8px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
}
.upload-area:hover { border-color: var(--accent); background: rgba(212, 255, 63, 0.03); }
.upload-area input { display: none; }
.upload-area.has-file { border-color: var(--green); border-style: solid; }
.upload-area img.preview { max-width: 100%; max-height: 200px; border-radius: 6px; }

/* ===== Referral copy ===== */
.copy-box {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  overflow: hidden;
  align-items: stretch;
}

.copy-box code {
  flex: 1;
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  background: transparent;
  border: none;
}

.copy-box button {
  padding: 0 18px;
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  font-size: 13px;
  font-family: var(--mono);
  color: var(--text-dim);
  transition: color 0.2s;
}
.copy-box button:hover { color: var(--accent); }

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  padding: 12px 18px;
  font-size: 14px;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
}
.tab.active { color: var(--text); border-color: var(--accent); }
.tab:hover { color: var(--text); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 80px;
  color: var(--text-dim);
  font-size: 13px;
}

.foot-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

/* ===== Utilities ===== */
.text-mono { font-family: var(--mono); }
.text-dim { color: var(--text-dim); }
.text-accent { color: var(--accent); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.hidden { display: none !important; }

/* ===== Loading ===== */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-page {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* ===== Responsive ============================================== */
/* Breakpoints:
   1200px - large laptop  : moderate adjustments
   980px  - tablet/small  : sidebar collapses, 2-col grids
   720px  - large phone   : 1-col mostly, condensed metrics
   480px  - small phone   : tight typography, max compression
   360px  - tiny phone    : extreme compression
   ============================================================== */

/* Make all images/media fluid by default */
img, svg, canvas, video {
  max-width: 100%;
  height: auto;
}

/* Prevent horizontal overflow globally */
html, body { overflow-x: hidden; }

/* Sidebar overlay backdrop (mobile) */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 140;
}
.sidebar-backdrop.show { display: block; }

/* ── Tables always scroll horizontally on small screens ── */
.table-wrap, .panel > div[style*="overflow"] {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table { min-width: 0; }

/* ── ≤ 1200px : large laptop tweaks ── */
@media (max-width: 1200px) {
  .container { padding: 0 24px; }
  .tier-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── ≤ 980px : tablet — collapse sidebar, 2-col grids ── */
@media (max-width: 980px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-form-side { padding: 48px 32px; }

  .dash-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    transition: left 0.3s ease;
    z-index: 150;
    width: 260px;
    height: 100vh;
    overflow-y: auto;
  }
  .sidebar.open { left: 0; box-shadow: 4px 0 24px rgba(0,0,0,.4); }

  .stats-strip,
  .metric-grid,
  .tier-grid { grid-template-columns: repeat(2, 1fr); }

  .two-col { grid-template-columns: 1fr; }

  .container { padding: 0 20px; }
  .dash-main { padding: 24px 20px; }
  .nav { padding: 16px 20px; }

  .section { padding: 56px 0; }
  .section-head { margin-bottom: 32px; }
  .section-title, .hero h1 { font-size: clamp(36px, 6vw, 56px); }

  th, td { padding: 12px 16px; }
  .menu-toggle { display: inline-flex; }

  .dash-head h1 { font-size: 28px; }
  .dash-head { gap: 12px; }

  .modal { max-width: calc(100% - 32px); }
}

/* ── ≤ 720px : large phone — single column ── */
@media (max-width: 720px) {
  body { font-size: 14px; }

  .container { padding: 0 16px; }
  .nav { padding: 14px 16px; }
  .nav-links { gap: 14px; }
  .nav-links a:not(.btn) { display: none; }

  .stats-strip,
  .metric-grid,
  .tier-grid { grid-template-columns: 1fr; }
  .stat-cell {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 24px 20px;
  }
  .stat-cell:last-child { border-bottom: none; }
  .stat-value { font-size: 30px; }

  .section { padding: 44px 0; }
  .section-title, .hero h1 { font-size: clamp(30px, 8vw, 44px); }
  .hero p { font-size: 16px; }

  .auth-form-side { padding: 36px 22px; }
  .auth-form h2 { font-size: 32px; }

  .dash-main { padding: 20px 14px; }
  .dash-head h1 { font-size: 24px; }
  .dash-head { flex-wrap: wrap; }
  .dash-head > button { align-self: flex-start; }

  .panel-head { padding: 16px 18px; flex-wrap: wrap; gap: 8px; }
  .panel-body { padding: 16px; }
  .panel-title { font-size: 18px; }

  /* All tables scroll horizontally */
  .panel, .tab-content { overflow-x: hidden; }
  .panel > div, .tab-content > .panel > div { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 13px; }
  th, td { padding: 10px 12px; font-size: 13px; white-space: nowrap; }

  .method-grid { grid-template-columns: 1fr; }

  .metric { padding: 18px; }
  .metric-value { font-size: 26px; }

  .tier-grid { grid-template-columns: 1fr 1fr; }
  .tier-card { padding: 22px; }
  .tier-mult { font-size: 44px; }

  .modal { max-width: calc(100vw - 24px); margin: 12px; }
  .modal-head { padding: 18px 20px; }
  .modal-body { padding: 20px; }
  .modal-head h3 { font-size: 20px; }

  .smt-amt input { font-size: 26px; }
  .smt-amt { padding: 14px; }

  /* Stake preview: wrap long rows */
  .prev-row { flex-wrap: wrap; gap: 4px; }

  /* My Stakes rows: stack on mobile */
  .msk-row { grid-template-columns: 1fr; gap: 10px; }
  .msk-row > div:last-child { text-align: left; }
  .msk-row > div:last-child button { width: auto; }

  /* Admin two-col overview panels */
  .two-col { grid-template-columns: 1fr !important; }

  /* Register step bar: compact */
  .steps-bar { gap: 0; }
  .step-item { font-size: 10px; gap: 6px; }
  .step-connector { margin: 0 4px; }

  .footer .foot-grid,
  footer .foot-grid { flex-direction: column; align-items: flex-start; gap: 8px; }
  footer { padding: 28px 0; margin-top: 48px; }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
    font-size: 13px;
  }

  /* Stake/cashout modal action buttons stack */
  .modal-body > div[style*="display:flex"][style*="gap:12px"] {
    flex-direction: column;
  }

  /* Market search input full width */
  .search-input { width: 100% !important; }

  /* Chart pair row wraps neatly */
  .pair-row, #cpairRow { flex-wrap: wrap; gap: 4px; }
  .prn, .cpair { font-size: 9px; padding: 3px 6px; }
}

/* ── ≤ 480px : small phone ── */
@media (max-width: 480px) {
  body { font-size: 13.5px; }

  .container { padding: 0 12px; }
  .nav { padding: 12px 12px; }

  .btn { padding: 10px 16px; font-size: 13px; }
  .btn-sm { padding: 7px 12px; font-size: 12px; }

  /* Auth pages: single column, no side panel */
  .auth-form h2 { font-size: 26px; }
  .auth-form .lead { margin-bottom: 24px; font-size: 13px; }
  .auth-form-side { padding: 24px 16px; }
  .auth-form { max-width: 100% !important; }

  .field input, .field select, .field textarea {
    padding: 12px 14px;
    font-size: 14px;
  }

  /* Register: two-col name/phone grid → single col */
  div[style*="grid-template-columns:1fr 1fr"] {
    display: block !important;
  }

  .dash-main { padding: 14px 10px; }
  .dash-head { margin-bottom: 18px; }
  .dash-head h1 { font-size: 20px; }
  .welcome-sub { font-size: 12px; }

  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { padding: 14px; }
  .metric-value { font-size: 20px; }
  .metric-label { font-size: 10px; }
  .stat-value { font-size: 24px; }

  .tier-grid { grid-template-columns: 1fr; }
  .tier-mult { font-size: 38px; }
  .tier-card { padding: 18px; }

  /* Stake modal */
  .smt-amt input { font-size: 22px; }
  .q-row { gap: 4px; }
  .q-row .qb { min-width: 0; flex: 1 1 calc(33.33% - 4px); font-size: 10px; padding: 6px 2px; }

  /* QR codes */
  .qr-box img, .qr-wrap img,
  #qr-img { width: 140px !important; height: 140px !important; }
  .qr-wrap { width: 168px; padding: 10px; }

  .copy-box code { padding: 10px 12px; font-size: 12px; word-break: break-all; }
  .copy-box button { padding: 0 12px; font-size: 12px; }

  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 14px; }

  .upload-area, .upload-zone { padding: 20px 12px; }

  /* Admin market creation form: single col */
  div[style*="grid-template-columns:repeat(auto-fit"] { grid-template-columns: 1fr !important; }

  /* Panel head: stack title and badge */
  .panel-head { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ── ≤ 360px : tiny phone (iPhone SE / Galaxy Fold etc.) ── */
@media (max-width: 360px) {
  .nav-links .btn-sm:first-of-type { display: none; }
  .auth-form-side { padding: 18px 12px; }
  .auth-form h2 { font-size: 22px; }
  .smt-amt input { font-size: 20px; }
  .q-row .qb { flex: 1 1 calc(50% - 3px); }
  .dash-head h1 { font-size: 18px; }
  .metric-value { font-size: 18px; }
  .metric-grid { gap: 8px; }
  .metric { padding: 12px; }
  .panel-body { padding: 12px; }
}

/* ── Accessibility: respect reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ticker-tape { animation: none !important; }
}

/* ── Hide hover effects on touch devices ── */
@media (hover: none) {
  .ticker-tape:hover { animation-play-state: running; }
  .btn-primary:hover { transform: none; }
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 20px;
  margin-right: 12px;
  vertical-align: middle;
}
.menu-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 300;
  transform: translateX(120%);
  transition: transform 0.3s;
  max-width: 320px;
}
.toast.show { transform: translateX(0); }
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

/* ===== Dashboard — Markets & Instruments ===== */
.inst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 14px; }
.icard { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 18px 16px; transition: border-color .2s; }
.icard:hover { border-color: var(--accent); }
.ic-badge { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--accent); background: rgba(212,255,63,.1); padding: 3px 8px; border-radius: 4px; display: inline-block; margin-bottom: 10px; }
.ic-name { font-weight: 600; font-size: 13px; margin-bottom: 1px; }
.ic-sym { font-family: var(--mono); font-size: 10px; color: var(--text-dim); margin-bottom: 11px; }
.ic-price { font-family: var(--serif); font-size: 19px; font-weight: 500; letter-spacing: -.02em; margin-bottom: 2px; }
.ic-chg { font-family: var(--mono); font-size: 11px; margin-bottom: 11px; }
.ic-chg.up { color: var(--green); }
.ic-chg.dn { color: var(--red); }
.ic-spark { height: 36px; margin-bottom: 10px; }
.ic-staked { font-family: var(--mono); font-size: 10px; color: var(--text-dim); min-height: 14px; margin-bottom: 5px; }
.ic-staked strong { color: var(--accent); }
.ic-pb-lbl { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--text-faint); margin-bottom: 3px; }
.ic-pb-track { height: 3px; background: var(--border); border-radius: 2px; margin-bottom: 9px; overflow: hidden; }
.ic-pb-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .5s; }
.ic-vol { font-family: var(--mono); font-size: 10px; color: var(--text-faint); margin-bottom: 8px; display: flex; justify-content: space-between; }
.ic-vol span:last-child { color: var(--text-dim); }

/* Pool / stake progress bar on card */
.ic-spb-wrap { margin-bottom: 8px; }
.ic-spb-lbl { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 10px; margin-bottom: 3px; }
.ic-spb-lbl span:first-child { color: var(--text-faint); }
.ic-spb-lbl span:last-child { color: var(--accent); font-weight: 700; }
.ic-spb-track { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.ic-spb-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; background: linear-gradient(90deg, var(--accent), #a8cc32); }

/* Instrument action buttons */
.ic-btns { display: flex; gap: 5px; }
.icb { flex: 1; padding: 7px 4px; border-radius: 6px; font-family: var(--mono); font-size: 10px; font-weight: 700; cursor: pointer; border: 1px solid; transition: all .2s; text-align: center; }
.icb.stake { background: var(--accent); color: #0a0a0a; border-color: var(--accent); }
.icb.stake:hover { background: var(--accent-dim); }
.icb.cash { background: transparent; color: var(--green); border-color: var(--green); }
.icb.cash:hover { background: rgba(74,222,128,.1); }
.icb:disabled { opacity: .35; cursor: not-allowed; }

/* ===== Dashboard — Progress bars ===== */
.prog-wrap { margin-bottom: 10px; }
.prog-lbl { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.prog-track { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.prog-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #a8cc32); border-radius: 3px; transition: width .5s; }

/* ===== Dashboard — Stake modal ===== */
.smt-amt { text-align: center; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 8px; padding: 18px; margin-bottom: 14px; }
.smt-amt label { font-family: var(--mono); font-size: 10px; color: var(--text-faint); letter-spacing: .1em; display: block; margin-bottom: 8px; }
.smt-amt input { font-family: var(--serif); font-size: 32px; font-weight: 500; background: transparent; border: none; outline: none; color: var(--accent); text-align: center; width: 100%; letter-spacing: -.02em; }
.q-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.qb { flex: 1; min-width: 58px; padding: 7px; border-radius: 6px; font-family: var(--mono); font-size: 11px; border: 1px solid var(--border-strong); color: var(--text-dim); cursor: pointer; background: none; transition: all .2s; }
.qb:hover { border-color: var(--accent); color: var(--accent); }
.prev-box { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.prev-row { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.prev-row:last-child { border: none; }
.prev-row span:first-child { color: var(--text-dim); }
.prev-row span:last-child { font-family: var(--mono); font-size: 12px; }

/* ===== Dashboard — My Stakes ===== */
.msk-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--border); }
.msk-row:last-child { border: none; }

/* ===== Dashboard — Chart controls ===== */
.crng { font-family: var(--mono); font-size: 11px; padding: 5px 10px; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--text-dim); background: none; cursor: pointer; transition: all .2s; }
.crng.on { border-color: var(--accent); color: var(--accent); background: rgba(212,255,63,.06); }
.cpair { font-family: var(--mono); font-size: 10px; padding: 4px 8px; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--text-dim); background: none; cursor: pointer; transition: all .2s; }
.cpair.on { border-color: var(--accent); color: var(--accent); background: rgba(212,255,63,.06); }

/* ===== Dashboard — Search ===== */
.search-input { background: var(--bg); border: 1px solid var(--border-strong); border-radius: 6px; padding: 6px 14px; color: var(--text); font-family: var(--mono); font-size: 11px; outline: none; width: 220px; transition: border-color 0.2s; }
.search-input:focus { border-color: var(--accent); }

/* ===== Wallet tab ===== */
.wallet-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.wallet-tab-btn { padding: 10px 22px; border-radius: 6px; font-family: var(--mono); font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid var(--border-strong); color: var(--text-dim); background: none; transition: all 0.2s; letter-spacing: 0.06em; }
.wallet-tab-btn.active { background: var(--accent); color: #0a0a0a; border-color: var(--accent); }

@media (max-width: 700px) {
  .inst-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .icard { padding: 14px 12px; }
  .ic-price { font-size: 17px; }
}
@media (max-width: 420px) {
  .inst-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .icard { padding: 12px 10px; }
  .ic-price { font-size: 15px; }
  .ic-btns { flex-wrap: wrap; }
  .icb { font-size: 11px; padding: 9px 6px; }
}

/* ── Dashboard wallet tab ── */
@media (max-width: 600px) {
  /* Wallet deposit/withdraw buttons side by side */
  .tabs { gap: 4px; }
  .tab { padding: 10px 12px; font-size: 13px; }

  /* Deposit info rows wrap */
  .deposit-info-row { flex-wrap: wrap; gap: 2px; }

  /* Admin tabs scroll */
  #tab-deposits .tabs,
  #tab-withdrawals .tabs { flex-wrap: wrap; gap: 4px; }
}

/* ── Admin overview two-col panels ── */
@media (max-width: 860px) {
  .two-col[style*="grid-template-columns:1fr 1fr"],
  div.two-col { grid-template-columns: 1fr !important; }
}