/* ============ Mammoth Mini App — dark gold tech theme ============ */
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #14100c;
  --bg-2: #1c1610;
  --card: rgba(255, 224, 178, 0.045);
  --card-border: rgba(224, 180, 120, 0.16);
  --gold: #d9a962;
  --gold-2: #f3ddad;
  --gold-deep: #a97b42;
  --text: #f4ece0;
  --muted: #a89a86;
  --green: #4ade80;
  --red: #f87171;
  --radius: 18px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: Vazirmatn, -apple-system, "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

/* animated background */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(217, 169, 98, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217, 169, 98, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
}
.orb {
  position: fixed; border-radius: 50%; filter: blur(70px); z-index: 0;
  pointer-events: none; opacity: .5; animation: float 9s ease-in-out infinite alternate;
}
.orb-1 { width: 240px; height: 240px; top: -70px; left: -60px; background: radial-gradient(circle, rgba(217,169,98,.35), transparent 70%); }
.orb-2 { width: 300px; height: 300px; bottom: -110px; right: -90px; background: radial-gradient(circle, rgba(169,123,66,.28), transparent 70%); animation-delay: -4s; }
@keyframes float { from { transform: translateY(0) } to { transform: translateY(26px) } }

#app { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: 14px 16px calc(28px + env(safe-area-inset-bottom)); }

.view { display: none; animation: viewIn .3s ease; }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

.glass {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ---------------- topbar ---------------- */
.topbar { display: flex; align-items: center; gap: 10px; padding: 6px 2px 16px; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 12px; object-fit: cover;
  border: 1px solid var(--card-border);
  box-shadow: 0 0 18px rgba(217, 169, 98, .25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-title {
  font-weight: 700; font-size: 17px; letter-spacing: 4px;
  background: linear-gradient(100deg, var(--gold-deep), var(--gold-2) 45%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { font-size: 9px; letter-spacing: 2.5px; color: var(--muted); direction: ltr; text-align: left; }
.live-dot {
  margin-right: auto; display: flex; align-items: center; gap: 6px;
  font-size: 10px; letter-spacing: 1.5px; color: var(--green);
  border: 1px solid rgba(74, 222, 128, .25); border-radius: 999px; padding: 4px 10px;
  background: rgba(74, 222, 128, .06);
}
.live-dot i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(74,222,128,.5) } 55% { box-shadow: 0 0 0 6px rgba(74,222,128,0) } }

/* ---------------- profile ---------------- */
.profile-card { display: flex; align-items: center; gap: 14px; padding: 16px; position: relative; overflow: hidden; }
.profile-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(243, 221, 173, .07) 50%, transparent 70%);
  animation: sheen 4.5s linear infinite;
}
@keyframes sheen { from { transform: translateX(-100%) } to { transform: translateX(100%) } }
.avatar-ring {
  width: 62px; height: 62px; border-radius: 50%; padding: 2.5px; flex-shrink: 0;
  background: conic-gradient(from 180deg, var(--gold-deep), var(--gold-2), var(--gold), var(--gold-deep));
  animation: spin 6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }
.avatar-ring img, .avatar-fallback {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  background: var(--bg-2); animation: spin 6s linear infinite reverse;
}
.avatar-fallback { display: flex; align-items: center; justify-content: center; font-size: 26px; }
.profile-info { min-width: 0; }
.hello { font-size: 12px; color: var(--muted); }
.user-name { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-username { font-size: 12px; color: var(--gold); direction: ltr; text-align: right; }
.profile-badge {
  margin-right: auto; font-size: 11px; font-weight: 700; color: var(--gold-2);
  border: 1px solid var(--card-border); border-radius: 999px; padding: 5px 10px;
  background: rgba(217, 169, 98, .08); flex-shrink: 0;
}

/* ---------------- ticker ---------------- */
.ticker-wrap { margin-top: 14px; padding: 0; overflow: hidden; position: relative; }
.ticker { overflow: hidden; padding: 11px 0; direction: ltr; }
.ticker-track { display: inline-flex; gap: 26px; white-space: nowrap; will-change: transform; animation: marquee 40s linear infinite; padding-inline-start: 26px; direction: ltr; }
@keyframes marquee { from { transform: translateX(0) } to { transform: translateX(-50%) } }
.tick { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; direction: ltr; }
.tick .sym { font-weight: 700; color: var(--gold-2); letter-spacing: .5px; }
.tick .price { color: var(--text); font-variant-numeric: tabular-nums; }
.tick .chg { font-size: 11px; font-variant-numeric: tabular-nums; }
.tick .chg.up { color: var(--green); } .tick .chg.down { color: var(--red); }
.ticker-fade {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: linear-gradient(90deg, var(--bg) 0%, transparent 8%, transparent 92%, var(--bg) 100%);
  opacity: .8;
}

/* ---------------- sections ---------------- */
.section-title { display: flex; align-items: center; gap: 12px; margin: 22px 2px 12px; color: var(--muted); font-size: 12.5px; }
.section-title::before, .section-title::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--card-border)); }
.section-title::after { background: linear-gradient(90deg, var(--card-border), transparent); }

.cards { display: flex; flex-direction: column; gap: 12px; }
.svc-card {
  display: flex; align-items: center; gap: 14px; padding: 16px; width: 100%;
  color: var(--text); font-family: inherit; text-align: right; cursor: pointer;
  transition: transform .15s ease, border-color .2s, box-shadow .2s;
}
.svc-card:active { transform: scale(.98); }
.svc-card.featured {
  border-color: rgba(217, 169, 98, .45);
  background: linear-gradient(135deg, rgba(217,169,98,.13), rgba(217,169,98,.04));
  box-shadow: 0 0 26px rgba(217, 169, 98, .12);
}
.svc-icon {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 23px;
  background: rgba(217, 169, 98, .1); border: 1px solid var(--card-border);
}
.svc-body { flex: 1; min-width: 0; }
.svc-name { font-size: 15px; font-weight: 700; }
.svc-desc { font-size: 12px; color: var(--muted); margin-top: 3px; }
.svc-arrow { color: var(--gold); font-size: 22px; opacity: .8; }
.tag-mt {
  font-size: 10px; font-weight: 700; letter-spacing: 1px; vertical-align: 2px;
  color: #14100c; background: linear-gradient(100deg, var(--gold), var(--gold-2));
  border-radius: 6px; padding: 2px 7px; margin-inline-start: 4px;
}

.foot { text-align: center; color: var(--muted); font-size: 11px; margin-top: 26px; opacity: .7; }
.foot b { color: var(--gold); }

/* ---------------- MT view ---------------- */
.subhead { display: flex; align-items: center; gap: 12px; padding: 6px 2px 16px; }
.back-btn {
  width: 38px; height: 38px; border-radius: 12px; font-size: 20px; cursor: pointer;
  color: var(--gold-2); background: var(--card); border: 1px solid var(--card-border);
}
.subhead-title { font-size: 17px; font-weight: 700; }

.mt-hero { padding: 18px; position: relative; overflow: hidden; }
.mt-hero-glow {
  position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
  width: 260px; height: 130px; border-radius: 50%; filter: blur(50px);
  background: rgba(217, 169, 98, .22); pointer-events: none;
}
.mt-hero h2 { font-size: 16.5px; margin-bottom: 14px; color: var(--gold-2); }
.feat-list { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.feat-list li { font-size: 13.5px; line-height: 1.9; }
.mt-goal { margin-top: 16px; font-size: 13.5px; font-weight: 700; color: var(--gold); line-height: 1.9; }

.step { display: flex; gap: 13px; padding: 17px 15px; margin-top: 12px; }
.step-num {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  color: #14100c; background: linear-gradient(135deg, var(--gold), var(--gold-2));
  box-shadow: 0 0 14px rgba(217, 169, 98, .3);
}
.step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 11px; }
.step-body p { font-size: 13.5px; line-height: 2; }
.warn { color: #fbbf24; }

.link-box {
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px;
  border: 1px dashed rgba(217, 169, 98, .5); border-radius: 13px;
  background: rgba(217, 169, 98, .06);
}
.link-box a {
  flex: 1; min-width: 0; color: var(--gold-2); font-size: 13px; direction: ltr;
  text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none; font-variant-numeric: tabular-nums;
}
.copy-btn {
  flex-shrink: 0; font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  color: #14100c; background: linear-gradient(100deg, var(--gold), var(--gold-2));
  border: none; border-radius: 10px; padding: 9px 14px;
  transition: transform .15s;
}
.copy-btn:active { transform: scale(.94); }

.email-row input {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--text);
  background: rgba(0, 0, 0, .3); border: 1px solid var(--card-border);
  border-radius: 13px; padding: 13px 15px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.email-row input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 169, 98, .15); }
.email-row input::placeholder { color: #6b5f4e; }

.gold-btn {
  font-family: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer;
  color: #14100c; background: linear-gradient(100deg, var(--gold-deep), var(--gold) 40%, var(--gold-2));
  border: none; border-radius: 13px; padding: 14px; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  box-shadow: 0 4px 22px rgba(217, 169, 98, .25);
  transition: transform .15s, opacity .2s;
}
.gold-btn:active { transform: scale(.98); }
.gold-btn[disabled] { opacity: .6; pointer-events: none; }
.btn-spinner {
  width: 17px; height: 17px; border-radius: 50%;
  border: 2.5px solid rgba(20, 16, 12, .25); border-top-color: #14100c;
  animation: spin .7s linear infinite;
}

.verify-result { border-radius: 13px; padding: 13px 15px; font-size: 13.5px; line-height: 2; animation: viewIn .25s ease; }
.verify-result.ok { background: rgba(74, 222, 128, .08); border: 1px solid rgba(74, 222, 128, .35); color: #bbf7d0; }
.verify-result.bad { background: rgba(248, 113, 113, .07); border: 1px solid rgba(248, 113, 113, .3); color: #fecaca; }
.verify-result.warn { background: rgba(251, 191, 36, .07); border: 1px solid rgba(251, 191, 36, .3); color: #fde68a; }
.verify-result a { color: var(--gold-2); word-break: break-all; }
.join-btn { margin-top: 10px; }

/* ---------------- modal ---------------- */
[hidden] { display: none !important; }
.modal {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 8, 6, .75); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 24px; animation: viewIn .2s ease;
}
.modal-card { max-width: 340px; width: 100%; padding: 28px 22px; text-align: center; }
.modal-emoji { font-size: 44px; margin-bottom: 12px; }
.modal-card h3 { font-size: 17px; margin-bottom: 10px; color: var(--gold-2); }
.modal-card p { font-size: 13.5px; line-height: 2; color: var(--text); margin-bottom: 18px; }
