:root {
  --phone-width: 430px;
  --bg: #0e0d0a;
  --panel: #1a1810;
  --panel-2: #221f15;
  --gold: #d4af37;
  --gold-soft: rgba(212, 175, 55, 0.14);
  --gold-dark: #9c7f24;
  --cream: #f5ecd7;
  --muted: #a89a7c;
  --line: #332e1e;
  --danger: #ff8a80;
  --danger-bg: rgba(255, 87, 34, 0.14);
  --success: #b7e39a;
  --success-bg: rgba(139, 195, 74, 0.14);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--cream);
  background:
    radial-gradient(circle at 20% 10%, rgba(212, 175, 55, 0.08) 0, transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.06) 0, transparent 45%),
    #060504;
  display: flex;
  justify-content: center;
}

.app {
  position: relative;
  width: 100%;
  max-width: var(--phone-width);
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
}

/* ---- Header (phone-shell app only — the marketing page has its own .site-header) ---- */
.app > header {
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(180deg, #1a1810, #0e0d0a);
  border-bottom: 1px solid var(--line);
  color: var(--cream);
  padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.app > header .brand {
  font-size: 30px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--cream); text-decoration: none;
}
.app > header .brand span { color: var(--gold); }
.app > header .balance-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--gold-soft); border: 1px solid var(--gold-dark);
  color: var(--gold); border-radius: 999px; padding: 7px 14px;
  font-size: 13px; font-weight: 700;
}
.coin-icon-sm { width: 15px; height: auto; }
.icon-btn {
  position: relative;
  background: rgba(212, 175, 55, 0.1); border: none; color: var(--gold);
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 18px; cursor: pointer; display: grid; place-items: center;
}

/* ---- Content ---- */
main { flex: 1; overflow-y: auto; padding: 22px 20px 90px; }

.lead { margin: 0 0 18px; }
.lead h1 { margin: 0; font-size: 24px; color: var(--cream); }
.lead p { margin: 4px 0 0; color: var(--muted); }

.section-title {
  font-size: 13px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); margin: 24px 0 12px;
}

/* ---- Grid / tiles ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  cursor: pointer;
  font: inherit; color: var(--cream);
  transition: transform 0.12s ease;
}
.tile:active { transform: scale(0.96); }
.tile .tile-icon .coin-icon-tile { width: 26px; height: auto; display: block; }
.tile .tile-icon {
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--gold-soft);
  display: grid; place-items: center; font-size: 24px;
}
.tile .tile-label { font-size: 12px; font-weight: 600; text-align: center; }

/* ---- Cards ---- */
.card {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left; font: inherit; color: inherit;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px; margin-bottom: 12px;
  cursor: pointer; transition: transform 0.12s ease;
}
.card:active { transform: scale(0.98); }
.card .thumb {
  width: 56px; height: 56px; border-radius: 12px; background: var(--gold-soft);
  display: grid; place-items: center; font-size: 26px; flex-shrink: 0;
  border: 1px solid var(--gold-dark);
}
.thumb.thumb-logo { background: #fff; padding: 6px; }
.thumb.thumb-logo img { width: 100%; height: 100%; object-fit: contain; }
.card .info { flex: 1; }
.card .info .name { font-weight: 600; color: var(--cream); }
.card .info .desc { font-size: 13px; color: var(--muted); }
.card .price { font-weight: 700; color: var(--gold); }

.card-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; }
.commission-badge { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.commission-qualifier {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
  color: var(--muted); text-align: center; line-height: 1.1;
}
.commission-circle {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, #f0d878, var(--gold));
  color: #241d09; font-weight: 800; font-size: 13px; line-height: 1.05;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 2px; overflow: hidden;
}
.commission-circle.long-text { font-size: 9px; }

.merchant-card { position: relative; flex-direction: column; align-items: stretch; gap: 12px; }
.card-top-row { display: flex; align-items: center; gap: 14px; }
.card-top-row .info { flex: 1; }
.card-bottom-row { display: flex; justify-content: center; }
.card-bottom-row .btn-shop { width: auto; padding: 7px 20px; font-size: 12.5px; }

/* Shop buttons are always red, regardless of source order vs .btn-primary (tag+class beats plain class) */
a.btn-shop { background: #d32f2f; color: #fff; }

.info-icon-btn {
  position: absolute; left: 14px; bottom: 14px;
  width: 24px; height: 24px; border-radius: 50%;
  background: none; border: none; padding: 0;
  font-size: 15px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.85;
}

.merchant-detail-hero { display: flex; align-items: center; gap: 16px; }
.merchant-detail-thumb { width: 72px; height: 72px; font-size: 34px; }
.merchant-detail-name { color: var(--cream); font-size: 20px; margin: 18px 0 8px; }

/* ---- Bottom nav ---- */
nav.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--phone-width);
  background: var(--panel); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; padding: 10px 0 14px; z-index: 20;
}
nav.tabbar button {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--muted); font-size: 11px; padding: 4px 12px;
}
nav.tabbar button .icon { font-size: 20px; }
nav.tabbar button.active { color: var(--gold); }

.panel { display: none; }
.panel.active { display: block; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* ---- Slide-in sub-pages ---- */
.screen {
  position: absolute; inset: 0; background: var(--bg);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.28s ease; z-index: 40;
}
.screen.open { transform: translateX(0); }
.screen-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; background: var(--panel); border-bottom: 1px solid var(--line);
  color: var(--cream);
}
.screen-header .title { font-size: 18px; font-weight: 700; }
.screen-body { flex: 1; overflow-y: auto; padding: 18px; }

details {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px 14px; margin-bottom: 10px;
}
details summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none; color: var(--cream); }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; float: right; color: var(--gold); }
details[open] summary::after { content: "\2013"; }
details p { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.5; }

.info-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.info-row:last-child { border-bottom: none; }
.info-row .oicon { font-size: 20px; }
.info-row .label { font-size: 12px; color: var(--muted); }
.info-row .value { font-weight: 600; color: var(--cream); }
.prose { line-height: 1.6; color: var(--muted); }

/* ---- Flash banner ---- */
.flash { border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 13px; font-weight: 600; }
.flash.success { background: var(--success-bg); color: var(--success); }
.flash.error { background: var(--danger-bg); color: var(--danger); }

/* ---- Forms ---- */
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2);
  font: inherit; color: var(--cream);
}
.form-field .hint { font-size: 11px; color: var(--muted); margin-top: 6px; }
.dob-row { display: flex; gap: 8px; }
.dob-row select { width: auto; }
.dob-row select:nth-child(1) { flex: 1.3; }
.dob-row select:nth-child(2) { flex: 0.8; }
.dob-row select:nth-child(3) { flex: 1; }
.btn-primary {
  display: inline-block; width: 100%; padding: 13px; border: none; border-radius: 10px;
  background: var(--gold); color: #241d09; font: inherit; font-weight: 700;
  cursor: pointer; text-decoration: none; text-align: center; box-sizing: border-box;
}
button:disabled, .btn-primary:disabled {
  background: var(--line); color: var(--muted); cursor: not-allowed;
}
.btn-secondary {
  width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 10px;
  background: none; color: var(--cream); font: inherit; font-weight: 600;
  cursor: pointer;
}
.btn-link { background: none; border: none; color: var(--gold); font: inherit; cursor: pointer; padding: 0; }
.otp-input {
  width: 100%; padding: 16px; border-radius: 10px; text-align: center;
  font-size: 28px; letter-spacing: 12px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--cream);
}

/* ---- Landing (static explainer) ---- */
.landing-hero { padding: 36px 4px 10px; }
.landing-hero .logo { font-size: 32px; font-weight: 800; letter-spacing: 0.5px; }
.landing-hero .logo span { color: var(--gold); }
.landing-hero h1 { font-size: 26px; line-height: 1.3; margin: 18px 0 10px; color: var(--cream); }
.landing-hero p { color: var(--muted); line-height: 1.6; margin: 0 0 8px; }
.feature-list { margin: 22px 0; padding: 0; list-style: none; }
.feature-list li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.feature-list .ic { font-size: 22px; }
.feature-list .tx b { display: block; color: var(--cream); }
.feature-list .tx span { font-size: 13px; color: var(--muted); }

/* ---- Balance / mining ---- */
.balance-card {
  background: linear-gradient(135deg, #1a1810, #262111);
  border: 1px solid var(--gold-dark);
  color: var(--cream); border-radius: 16px;
  padding: 22px; margin-bottom: 20px; text-align: center;
}
.balance-card .amount { font-size: 32px; font-weight: 700; color: var(--gold); }
.balance-card .label { font-size: 12px; opacity: 0.8; margin-top: 4px; }
.balance-card .usd { font-size: 12px; color: var(--muted); margin-top: 6px; }

.miner-orb {
  width: 180px; height: 180px; border-radius: 50%; margin: 20px auto;
  background: radial-gradient(circle at 35% 30%, #3a3115, #17140b 70%);
  border: 2px solid var(--gold-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 54px;
}
.miner-timer { text-align: center; font-size: 22px; font-weight: 700; color: var(--gold); margin: 10px 0 4px; }
.miner-rate { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 20px; }

.tx-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; margin-bottom: 12px;
}
.tx-card .top-row { display: flex; justify-content: space-between; align-items: baseline; }
.tx-card .ref { font-weight: 700; color: var(--cream); font-size: 13px; }
.tx-card .pts { font-weight: 700; }
.tx-card .pts.pos { color: var(--gold); }
.tx-card .pts.neg { color: var(--danger); }
.tx-card .desc { font-size: 13px; color: var(--muted); margin-top: 4px; }
.tx-card .date { font-size: 11px; color: var(--muted); margin-top: 8px; }
.tx-tag {
  display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--gold-soft); color: var(--gold); padding: 2px 8px; border-radius: 999px; margin-right: 6px;
}

/* ---- Gift cards / redeem ---- */
.giftcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center;
}
.giftcard .name { font-weight: 700; color: var(--cream); }
.giftcard .cost { font-size: 12px; color: var(--muted); margin-top: 4px; }
.giftcard button {
  background: var(--gold); color: #241d09; border: none; border-radius: 8px;
  padding: 8px 14px; font-weight: 700; cursor: pointer; font-size: 13px;
}

/* ---- QR ---- */
.qr-box {
  background: #fff; border-radius: 16px; padding: 20px;
  display: flex; align-items: center; justify-content: center; margin: 20px auto;
  width: 220px; height: 220px;
}
.referral-code {
  text-align: center; font-size: 22px; font-weight: 800; letter-spacing: 3px;
  color: var(--gold); margin: 6px 0 20px;
}
#qr-video { width: 100%; border-radius: 12px; background: #000; }
.qr-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.qr-tabs button {
  flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--muted); font: inherit; font-weight: 600; cursor: pointer;
}
.qr-tabs button.active { background: var(--gold-soft); color: var(--gold); border-color: var(--gold-dark); }

/* ============================================================
   MARKETING LANDING PAGE — full-width desktop layout.
   Only the logged-out "/" page uses this; the signup wizard,
   login, and the authenticated app all stay in the phone shell
   above, since those are genuinely mobile-app-shaped screens.
   ============================================================ */
body.marketing { display: block; }

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(14, 13, 10, 0.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  max-width: 1080px; margin: 0 auto; box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
}
.site-header .brand {
  font-size: 30px; font-weight: 700;
  color: var(--cream); text-decoration: none;
}
.site-header .brand span { color: var(--gold); }
.site-header .nav-cta {
  display: inline-block; padding: 9px 20px; border-radius: 8px;
  border: 1px solid var(--gold-dark); color: var(--gold); text-decoration: none;
  font-size: 14px; font-weight: 600;
}

.marketing-hero {
  max-width: 1080px; margin: 0 auto; padding: 72px 32px 40px;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center;
}
.marketing-hero h1 {
  font-size: clamp(32px, 4vw, 52px); line-height: 1.15; margin: 0 0 20px; color: var(--cream);
}
.marketing-hero p {
  font-size: 17px; line-height: 1.7; color: var(--muted); margin: 0 0 32px; max-width: 46ch;
}
.marketing-hero .cta-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.marketing-hero .btn-primary { width: auto; padding: 15px 32px; font-size: 15px; }
.marketing-hero .cta-row a:not(.btn-primary) { color: var(--muted); font-size: 14px; text-decoration: none; }
.marketing-hero .cta-row a b { color: var(--gold); font-weight: 600; }

.hero-coin-img {
  display: block; width: 100%; max-width: 340px; height: auto; margin: 0 auto;
}

.marketing-features {
  max-width: 1080px; margin: 0 auto; padding: 40px 32px 80px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.feature-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 26px 22px;
}
.feature-card .ic { font-size: 30px; margin-bottom: 14px; display: block; }
.feature-card .ic-coin { width: 30px; height: auto; margin-bottom: 14px; display: block; }
.feature-card b { display: block; color: var(--cream); font-size: 16px; margin-bottom: 8px; }
.feature-card span { color: var(--muted); font-size: 14px; line-height: 1.55; }

.marketing-partners { max-width: 1080px; margin: 0 auto; padding: 10px 32px 70px; }
.marketing-partners .section-heading { text-align: center; margin-bottom: 28px; }
.marketing-partners .section-heading h2 { font-size: 22px; color: var(--cream); margin: 0 0 8px; }
.marketing-partners .section-heading p { color: var(--muted); font-size: 14px; margin: 0; }
.partner-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.partner-card {
  background: #fff; border-radius: 14px; padding: 14px;
  height: 72px; display: flex; align-items: center; justify-content: center;
}
.partner-card img { max-width: 100%; max-height: 38px; object-fit: contain; }

.marketing-footer {
  border-top: 1px solid var(--line); padding: 28px 32px; text-align: center;
  color: var(--muted); font-size: 13px;
}
.marketing-footer a { color: var(--gold); text-decoration: none; }

@media (max-width: 860px) {
  .marketing-hero { grid-template-columns: 1fr; padding: 48px 24px 30px; text-align: center; }
  .marketing-hero p { margin-left: auto; margin-right: auto; }
  .marketing-hero .cta-row { justify-content: center; }
  .hero-coin-img { order: -1; max-width: 220px; }
  .marketing-features { grid-template-columns: repeat(2, 1fr); padding: 20px 24px 60px; }
  .marketing-partners { padding: 10px 24px 60px; }
  .partner-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .marketing-features { grid-template-columns: 1fr; }
  .partner-grid { grid-template-columns: repeat(2, 1fr); }
  .site-header-inner { padding: 16px 20px; }
}
