* { box-sizing: border-box; touch-action: manipulation; }

:root {
  --bg-1: #05070f;
  --bg-2: #0d1326;
  --accent: #d4af37;
  --accent-2: #7b5cff;
  --accent-3: #00d4b5;
  --text: #f2f3f7;
  --text-dim: #9aa1b9;
  --glass: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.09);
  --danger: #ff5c7a;
  --success: #2ee6a8;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-1);
  color: var(--text);
  font-family: 'Vazirmatn', sans-serif;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  touch-action: pan-y;
  -ms-touch-action: pan-y;
  overscroll-behavior-y: contain;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: relative;
  isolation: isolate;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 12% 8%, rgba(123,92,255,0.38), transparent 42%),
    radial-gradient(circle at 100% 0%, rgba(0,212,181,0.24), transparent 42%),
    radial-gradient(circle at 30% 100%, rgba(212,175,55,0.20), transparent 48%),
    radial-gradient(circle at 90% 85%, rgba(255,90,140,0.14), transparent 40%),
    linear-gradient(160deg, #130c34 0%, #060814 50%, #05110f 100%);
  background-size: 180% 180%, 180% 180%, 180% 180%, 180% 180%, 100% 100%;
  animation: bgDrift 26s ease-in-out infinite;
}

@keyframes bgDrift {
  0%, 100% { background-position: 0% 0%, 100% 0%, 20% 100%, 90% 90%, 0 0; }
  50% { background-position: 25% 30%, 75% 25%, 35% 75%, 70% 70%, 0 0; }
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.app {
  min-height: 100vh;
  padding: 12px 16px 96px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- Ticker ---------- */
.ticker {
  position: sticky;
  top: 0;
  z-index: 20;
  overflow: hidden;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(120deg, rgba(212,175,55,0.55), rgba(123,92,255,0.5), rgba(0,212,181,0.5), rgba(212,175,55,0.55));
  background-size: 300% 300%;
  animation: tickerBorder 6s ease infinite;
  box-shadow: 0 10px 34px rgba(0,0,0,0.45);
}

@keyframes tickerBorder {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.ticker::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 19px;
  background: linear-gradient(160deg, #171233 0%, #0c0f24 55%, #0a1a22 100%);
  z-index: 0;
}

.ticker-shine {
  position: absolute;
  inset: 1px;
  border-radius: 19px;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.ticker-shine::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.10), transparent);
  animation: tickerShine 5s ease-in-out infinite;
}

@keyframes tickerShine {
  0% { transform: translateX(0); }
  100% { transform: translateX(420%); }
}

.ticker-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 2px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px 1px rgba(46,230,168,0.8);
  animation: livePulse 1.6s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.ticker-header-text {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-dim);
}

.ticker-items {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 4px 6px 10px;
}

.ticker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  text-align: center;
  position: relative;
}

.ticker-item:not(:first-child)::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 10%;
  height: 80%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.12), transparent);
}

.ticker-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 4px currentColor);
}

.ticker-icon svg {
  width: 100%;
  height: 100%;
}

.icon-usdt { color: var(--accent-3); }
.icon-usd { color: #7ea8ff; }
.icon-gold { color: var(--accent); }
.icon-gold-gram { color: #f2c879; }

.ticker-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.ticker-label {
  font-size: 10.5px;
  color: var(--text-dim);
  font-weight: 500;
}

.ticker-value {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(212,175,55,0.45);
  white-space: nowrap;
}

.ticker-unit {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.2px;
}

/* ---------- Brand ---------- */
.brand {
  text-align: center;
  margin-top: 6px;
}

.brand-badge {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(120deg, var(--accent), #f7e08a);
  color: #1a1300;
  box-shadow: 0 4px 20px rgba(212,175,55,0.35);
}

.brand h1 {
  margin: 14px 0 4px;
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(120deg, #fff, #c9c9ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
}

/* ---------- Home background ---------- */
#screen-home {
  position: relative;
  isolation: isolate;
}

.home-bg {
  position: absolute;
  inset: -20px -16px auto -16px;
  height: 560px;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.home-bg .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.55;
  will-change: transform;
}

.home-bg .blob-1 {
  width: 260px;
  height: 260px;
  top: -60px;
  right: -60px;
  background: radial-gradient(circle, rgba(123,92,255,0.65), transparent 70%);
  animation: floatA 13s ease-in-out infinite;
}

.home-bg .blob-2 {
  width: 220px;
  height: 220px;
  top: 140px;
  left: -70px;
  background: radial-gradient(circle, rgba(212,175,55,0.5), transparent 70%);
  animation: floatB 16s ease-in-out infinite;
}

.home-bg .blob-3 {
  width: 200px;
  height: 200px;
  top: 320px;
  right: 20px;
  background: radial-gradient(circle, rgba(0,212,181,0.45), transparent 70%);
  animation: floatC 19s ease-in-out infinite;
}

.home-bg .grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 20%, black, transparent 75%);
}

@keyframes floatA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-18px, 24px) scale(1.08); }
}

@keyframes floatB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -16px) scale(1.1); }
}

@keyframes floatC {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-14px, -18px) scale(1.06); }
}

/* ---------- Menu grid ---------- */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}

.menu-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 26px 10px;
  min-height: 130px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.menu-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120px circle at 50% 0%, rgba(123,92,255,0.25), transparent 70%);
  opacity: 0;
  transition: opacity .2s ease;
}

.menu-card:active {
  transform: scale(0.96);
  border-color: var(--accent);
}

.menu-card:active::before {
  opacity: 1;
}

.menu-icon-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(155deg, rgba(255,255,255,0.16), rgba(255,255,255,0.02) 45%, rgba(0,0,0,0.25)),
              linear-gradient(135deg, var(--accent-2), #4b2fbf);
  box-shadow:
    0 10px 20px rgba(0,0,0,0.45),
    0 2px 0 rgba(255,255,255,0.18) inset,
    0 -10px 18px rgba(0,0,0,0.35) inset;
  transform: perspective(300px) rotateX(6deg);
  transition: transform .2s ease;
}

.menu-card:active .menu-icon-wrap {
  transform: perspective(300px) rotateX(6deg) scale(0.92);
}

.menu-icon-wrap::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 9px;
  width: 46%;
  height: 30%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.55), transparent 70%);
  filter: blur(1px);
}

.menu-icon {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.45));
}

.menu-card:nth-child(1) .menu-icon-wrap {
  background: linear-gradient(155deg, rgba(255,255,255,0.16), rgba(255,255,255,0.02) 45%, rgba(0,0,0,0.25)),
              linear-gradient(135deg, #ff6b8b, #b0264f);
}

.menu-card:nth-child(2) .menu-icon-wrap {
  background: linear-gradient(155deg, rgba(255,255,255,0.16), rgba(255,255,255,0.02) 45%, rgba(0,0,0,0.25)),
              linear-gradient(135deg, #f7d774, #b8860b);
}

.menu-card:nth-child(3) .menu-icon-wrap {
  background: linear-gradient(155deg, rgba(255,255,255,0.16), rgba(255,255,255,0.02) 45%, rgba(0,0,0,0.25)),
              linear-gradient(135deg, #7b5cff, #3d2494);
}

.menu-card:nth-child(4) .menu-icon-wrap {
  background: linear-gradient(155deg, rgba(255,255,255,0.16), rgba(255,255,255,0.02) 45%, rgba(0,0,0,0.25)),
              linear-gradient(135deg, #00d4b5, #027d6b);
}

.menu-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.menu-title small {
  font-weight: 500;
  color: var(--text-dim);
  font-size: 11px;
}

/* ---------- Screens ---------- */
.screen {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn .25s ease;
}

.screen.active {
  display: flex;
}

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

.screen-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.screen-header h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
}

.back-btn {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
}

.card {
  border-radius: 20px;
  padding: 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.intro-text {
  margin: 0;
  font-size: 14px;
  line-height: 2;
  color: var(--text);
}

.academy-heading {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
}

.benefit-list {
  margin: 0;
  padding-inline-start: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--text);
}

.benefit-list > li::marker {
  color: transparent;
}

.benefit-sublist {
  margin: 8px 0 0;
  padding-inline-start: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-dim);
  font-size: 13px;
}

.benefit-sublist > li::marker {
  color: transparent;
}

.academy-goal {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  color: var(--accent);
  background: rgba(212,175,55,0.1);
  border: 1px solid rgba(212,175,55,0.25);
}

.divider {
  height: 1px;
  background: var(--glass-border);
  margin: 2px 0;
}

.referral-link {
  display: block;
  text-align: center;
  padding: 12px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: #1a1300;
  background: linear-gradient(120deg, var(--accent), #f7e08a);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.field input {
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  direction: ltr;
  text-align: right;
}

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

.primary-btn {
  padding: 14px;
  border-radius: 14px;
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(120deg, var(--accent-2), #9b7bff);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(123,92,255,0.35);
  transition: transform .15s ease;
}

.primary-btn:active {
  transform: scale(0.97);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.result-box {
  display: none;
  padding: 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.9;
}

.result-box.show {
  display: block;
}

.result-box.success {
  background: rgba(46,230,168,0.1);
  border: 1px solid rgba(46,230,168,0.35);
  color: var(--success);
}

.result-box.error {
  background: rgba(255,92,122,0.1);
  border: 1px solid rgba(255,92,122,0.35);
  color: var(--danger);
}

.result-box a.join-link {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--success);
  color: #052b1f;
  font-weight: 800;
  text-decoration: none;
}

.analysis-box {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 2.1;
  color: var(--text);
}

/* ---------- Education ---------- */
.course-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.course-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
}

.course-icon {
  font-size: 26px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(212,175,55,0.12);
  flex-shrink: 0;
}

.course-body h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.course-status {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}

/* ---------- Bottom bar ---------- */
.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg-1) 60%, transparent);
  z-index: 30;
}

.technicalist-btn {
  position: relative;
  width: 100%;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(0,212,181,0.4);
  background: linear-gradient(120deg, #062b28, #041d2e);
  color: #b8fff0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,212,181,0.18);
}

.tb-glow {
  position: absolute;
  inset: -60%;
  background: conic-gradient(from 0deg, transparent, rgba(0,212,181,0.28), transparent 25%);
  animation: spin 5s linear infinite;
  opacity: 0.8;
  filter: blur(2px);
}

.tb-text {
  position: relative;
  z-index: 1;
  display: block;
}

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