/* ==========================================================================
   آربی کارتز — داشبورد (بازسازی دقیق مطابق دو طرح)
   ========================================================================== */

:root {
  --space-bg:      #030817;
  --glass-surface: rgba(11, 17, 40, 0.72);
  --glass-strong:  rgba(9, 14, 33, 0.9);
  --glass-border:  rgba(183, 156, 255, 0.22);

  --mint:      #23E6D2;
  --turquoise: #12BFB8;
  --cyan:      #45DDF1;
  --violet:    #8B5CF6;
  --deep-violet:#5B21B6;
  --lavender:  #B79CFF;
  --blue:      #3B82F6;
  --gold:      #FFC83D;

  --text-primary:   #F5F7FF;
  --text-secondary: #A9B2C7;
  --text-muted:     #69738A;

  --cover: max(100vh, 56.09vw);
  --fit:   calc((100vh - 280px) / 0.696);
  --ih:    min(var(--cover), var(--fit));
  --cy:    max(44vh, 106px + 0.348 * var(--ih));
  
  --input-surface: rgba(12, 19, 45, 0.9);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body { height: 100%; }

body {
  font-family: 'Vazirmatn', 'Inter', system-ui, sans-serif;
  color: var(--text-primary);
  overflow: hidden;
  background-color: var(--space-bg);
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--space-bg);
  pointer-events: none;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('assets/galaxy-bg.jpg') center center / cover no-repeat;
  filter: blur(22px) brightness(0.9) saturate(1.05);
  transform: scale(1.08);
}
.bg img {
  position: absolute;
  left: 50vw;
  top: var(--cy);
  transform: translate(-49.492%, -49.468%);
  height: var(--ih);
  width: auto;
  max-width: none;
}

/* NAV */
.nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px 7px 20px;
  background: rgba(10, 15, 38, 0.62);
  border: 1px solid rgba(183, 156, 255, 0.18);
  border-radius: 999px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  z-index: 200;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-toggle,
.nav-current {
  display: none;
}
.nav-link {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.25s, background 0.25s;
  white-space: nowrap;
  user-select: none;
}
.nav-link:hover { color: var(--text-primary); }
.nav-link.active {
  color: var(--mint);
  background: rgba(35, 230, 210, 0.08);
}
.nav-logout {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  padding: 9px 22px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--violet), #7c3aed);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.45);
  transition: transform 0.2s, box-shadow 0.2s;
}
.nav-logout:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.6);
}
.nav-link:focus-visible,
.nav-logout:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

/* PAGES */
.pages {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y proximity;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}
.pages::-webkit-scrollbar { width: 0; }

.section {
  position: relative;
  height: 100vh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 96px 40px 48px;
}

#spin {
  overflow: hidden;
  background-image: url('https://z-cdn-media.chatglm.cn/files/73ddc9b1-1405-4c9d-ba89-c432144333a4.png?auth_key=1886439150-206652f8b6f04aff8c36143ea67575f9-0-5f15109f1f3b677722981c42b5736d4f');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: var(--space-bg);
}

/* SPIN CONTAINER */
.spin-container-large {
  position: relative;
  width: 450px;
  height: 450px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
}

/* SPIN CORE */
.spin-core {
  position: absolute;
  left: 50vw;
  top:  var(--cy);
  transform: translate(-50%, -50%);
  width:  max(112px, 0.215 * var(--ih));
  height: max(112px, 0.215 * var(--ih));
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: transparent;
  z-index: 5;
}
.spin-core-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  transform: scale(1.32);
}
.spin-core::after {
  content: '';
  position: absolute;
  inset: -4%;
  border-radius: 50%;
  box-shadow: none;
  pointer-events: none;
}
.spin-core-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: max(24px, 0.048 * var(--ih));
  font-weight: 800;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  z-index: 2;
}
.spin-core:hover .spin-core-img { transform: scale(1.38); }
.spin-core.spinning { pointer-events: none; }
.spin-core.spinning .spin-core-img { animation: core-spin 0.7s linear infinite; }
@keyframes core-spin { to { transform: rotate(360deg) scale(1.32); } }

/* NODES */
.node {
  position: absolute;
  width:  max(56px, 0.086 * var(--ih));
  height: max(56px, 0.086 * var(--ih));
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 3;
}
.node .orb {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 22px var(--glow, rgba(139,92,246,0.5)), inset 0 0 12px rgba(0,0,0,0.5);
  transition: transform 0.25s, box-shadow 0.25s;
}
.node .orb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  transform: scale(1.08);
  display: block;
}
.node:hover .orb {
  transform: scale(1.09);
  box-shadow: 0 0 34px var(--glow, rgba(139,92,246,0.7)), inset 0 0 12px rgba(0,0,0,0.5);
}
.node-label {
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: max(12px, 0.0145 * var(--ih));
  font-weight: 500;
  color: var(--text-primary);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.node-star     { --glow: rgba(35, 230, 210, 0.6); }
.node-refresh  { --glow: rgba(139, 92, 246, 0.6); }
.node-arbi     { --glow: rgba(139, 92, 246, 0.55); }
.node-wait     { --glow: rgba(59, 130, 246, 0.55); }
.node-bonus    { --glow: rgba(255, 200, 61, 0.5); }

.node.winner .orb {
  box-shadow: 0 0 0 3px rgba(35, 230, 210, 0.9), 0 0 34px 6px rgba(35, 230, 210, 0.7), inset 0 0 12px rgba(0,0,0,0.5);
  animation: winner-glow 1.8s ease-in-out infinite;
}
@keyframes winner-glow {
  0%,100% { box-shadow: 0 0 0 3px rgba(35,230,210,0.9), 0 0 30px 5px rgba(35,230,210,0.6), inset 0 0 12px rgba(0,0,0,0.5); }
  50%     { box-shadow: 0 0 0 3px rgba(35,230,210,1),   0 0 46px 10px rgba(35,230,210,0.85), inset 0 0 12px rgba(0,0,0,0.5); }
}
.node.winner .node-label { color: var(--mint); }
.winner-arrow {
  position: absolute;
  top: calc(100% + 30px);
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 12px solid var(--mint);
  filter: drop-shadow(0 0 6px rgba(35, 230, 210, 0.9));
}

.node.active .orb {
  transform: scale(1.2);
  box-shadow: 0 0 45px var(--glow, rgba(139, 92, 246, 0.8)), inset 0 0 12px rgba(0,0,0,0.5);
  filter: brightness(1.5);
}

/* SPIN RESULT */
.spin-result {
  position: absolute;
  left: 50vw;
  bottom: 1.6vh;
  transform: translateX(-50%);
  width: min(748px, 92vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 24px;
  background: var(--glass-surface);
  border: 1px solid rgba(183, 156, 255, 0.16);
  border-radius: 18px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 4;
}
.spin-result-text { text-align: right; }
.spin-result-label { font-size: 12px; color: var(--text-muted); margin-bottom: 3px; }
.spin-result-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.spin-result-title span { color: var(--mint); }
.spin-result-sub { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.mini-hourglass { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; transform: scale(1.08); box-shadow: 0 0 8px rgba(59, 130, 246, 0.6); }
.spin-result-btn {
  font-family: inherit;
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  color: #03101a;
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--mint), var(--turquoise));
  box-shadow: 0 8px 22px rgba(35, 230, 210, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.spin-result-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(35, 230, 210, 0.5); }

/* REWARD CARDS SECTION */
#cards {
  background-image: url('https://z-cdn-media.chatglm.cn/files/2ebe13ac-8fd6-4492-85f9-a05a58602e26.png?auth_key=1886528639-d0a96d78caac4edf8375c89a303d0967-0-e818b7671a41b739231bd2d6a25b2b6a');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}
.rewards-header, .rewards-grid { position: relative; z-index: 1; }

.balance-chip {
  position: absolute;
  top: 92px;
  right: 40px;
  min-width: 190px;
  text-align: center;
  padding: 14px 26px;
  background: var(--glass-strong);
  border: 1px solid rgba(183, 156, 255, 0.18);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 2;
}
.balance-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.balance-value { font-family: 'Inter', sans-serif; font-size: 30px; font-weight: 800; color: var(--mint); letter-spacing: 0.5px; text-shadow: 0 0 16px rgba(35, 230, 210, 0.4); }

.rewards-header { text-align: center; margin-bottom: 34px; }
.rewards-header h1 { font-size: 34px; font-weight: 800; color: var(--text-primary); margin-bottom: 12px; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7); }
.rewards-header p { font-size: 15px; color: var(--text-secondary); text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7); }

.rewards-grid {
  direction: ltr;
  display: grid;
  grid-template-columns: repeat(3, 320px);
  gap: 26px;
  width: 100%;
  max-width: 1040px;
}

.reward-card {
  --accent: var(--mint);
  --accent-soft: rgba(35, 230, 210, 0.5);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 26px 26px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(18, 24, 48, 0.92) 0%, rgba(8, 12, 28, 0.95) 100%);
  border: 1px solid var(--accent-soft);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 26px -6px var(--accent-soft);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}
.reward-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 62%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.reward-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.6), 0 0 40px -4px var(--accent-soft);
}

.reward-card.theme-sol { --accent: var(--mint);   --accent-soft: rgba(35, 230, 210, 0.5); }
.reward-card.theme-eth { --accent: var(--violet); --accent-soft: rgba(139, 92, 246, 0.55); }
.reward-card.theme-btc { --accent: var(--gold);   --accent-soft: rgba(255, 200, 61, 0.55); }

.reward-icon-well {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,0.06), rgba(0,0,0,0.4));
  border: 2px solid var(--accent-soft);
  box-shadow: 0 0 24px -4px var(--accent-soft), inset 0 0 16px rgba(0,0,0,0.6);
  margin-bottom: 18px;
}
.reward-coin { width: 74px; height: 74px; border-radius: 50%; object-fit: cover; transform: scale(1.12); }

.reward-name { font-size: 21px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.reward-pct { font-family: 'Inter', sans-serif; font-size: 50px; font-weight: 800; line-height: 1; color: var(--text-primary); margin-bottom: 18px; letter-spacing: 1px; }

.platform-chip {
  font-family: 'Inter', sans-serif;
  direction: ltr;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  cursor: default;
}
.platform-logo { width: 26px; height: 26px; border-radius: 7px; background: #fff; padding: 3px; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.platform-logo img { width: 100%; height: 100%; object-fit: contain; }

.reward-desc {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}
.reward-desc-title { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.reward-desc p { font-size: 13px; line-height: 1.7; color: var(--text-muted); }

.reward-select {
  font-family: inherit;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  color: #03101a;
  cursor: pointer;
  background: linear-gradient(135deg, var(--mint), var(--turquoise));
  box-shadow: 0 8px 22px rgba(35, 230, 210, 0.3);
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}
.reward-select:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(35, 230, 210, 0.5); }

/* CARD STATES (Locked/Unlocked) */
.reward-card.locked { 
  opacity: 1; 
  filter: none; 
  pointer-events: auto;
  transform: scale(1); 
}
.reward-card.locked .reward-select { 
  background: rgba(255, 255, 255, 0.05); 
  color: #5a6378; 
  box-shadow: none; 
  cursor: not-allowed; 
}
.reward-card.unlocked { 
  opacity: 1; 
  filter: none; 
  pointer-events: auto; 
  transform: scale(1); 
  border-color: var(--accent); 
  animation: unlock-pulse 1s ease-out; 
}
.reward-card.unlocked .reward-select { 
  background: linear-gradient(135deg, var(--mint), var(--turquoise)); 
  color: #030817; 
}
@keyframes unlock-pulse { 0% { transform: scale(0.9); opacity: 0.5; } 50% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1); } }

/* TOAST */
.toast {
  position: fixed;
  bottom: 26px;
  left: 26px;
  padding: 13px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #03101a;
  background: var(--mint);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 3000;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* HERO / HOME SECTION */
.hero-bg-section {
  background-image: url('https://z-cdn-media.chatglm.cn/files/1775a612-dcf9-4dd0-afff-9bc170d6924c.png?auth_key=1886375449-b115bf36c63c4839829dd7bb94aba92b-0-ab7c3102aef8fb9656dd8f1760b7c407');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 120px;
  padding-bottom: 50px;
}
.hero-top-row { display: grid; grid-template-columns: 1fr 1fr 1fr; width: 100%; max-width: 1400px; align-items: center; flex: 1; }
.hero-left-content { padding-left: 40px; margin-right: 1000px; margin-left: -1000px; }
.hero-left-content h1 { font-size: 38px; font-weight: 800; line-height: 1.2; margin-bottom: 20px; background: linear-gradient(to right, #F5F7FF, #A9B2C7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-left-content p { color: var(--text-secondary); font-size: 15px; line-height: 1.6; margin-bottom: 30px; max-width: 320px; }
.hero-actions { display: flex; gap: 12px; }
.btn-primary {
  width: auto; 
  padding: 14px 30px;
  background: linear-gradient(135deg, var(--mint) 0%, var(--turquoise) 100%);
  color: #030817; 
  font-weight: 700; 
  font-size: 15px;
  border: none; 
  border-radius: 12px; 
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 12px rgba(35, 230, 210, 0.45), 0 0 32px rgba(18, 191, 184, 0.20);
  margin-top: 10px;
  font-family: inherit;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 20px rgba(35, 230, 210, 0.6), 0 0 48px rgba(18, 191, 184, 0.3); }
.hero-bottom-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; width: 100%; max-width: 1400px; margin-top: 125px; }

.step-card-overlay {
  background: rgba(10, 16, 41, 0.75);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 10px;
  backdrop-filter: blur(12px);
  position: relative;
  height: 130px;
  isolation: isolate;
}
.step-card-overlay .step-icon-img { width: 40px; height: 40px; object-fit: contain; margin-bottom: 12px; display: block; position: relative; z-index: 2; filter: drop-shadow(0 0 8px rgba(35, 230, 210, 0.4)); }
.step-card-overlay h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.step-card-overlay p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

.spotlight-border::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px; 
  background: radial-gradient(250px circle at var(--mouse-x, -100px) var(--mouse-y, -100px), rgba(20, 196, 188, 1) 0%, rgba(20, 196, 188, 0.4) 35%, transparent 70%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; 
  mask-composite: exclude;
  pointer-events: none; 
  z-index: 5; 
  opacity: 0; 
  transition: opacity 0.4s ease;
}
.spotlight-border:hover::after { opacity: 1; }

/* RESULTS SECTION (Profile) & MODALS */
.results-bg-section {
  background-image: url('https://z-cdn-media.chatglm.cn/files/2ebe13ac-8fd6-4492-85f9-a05a58602e26.png?auth_key=1886528639-d0a96d78caac4edf8375c89a303d0967-0-e818b7671a41b739231bd2d6a25b2b6a');
  background-size: cover;
  background-position: center center;
  flex-direction: column;
  justify-content: flex-start;
  padding: 80px 30px 20px;
  overflow: hidden;
  gap: 15px;
}
.results-header { text-align: center; margin-bottom: 10px; }
.results-header h2 { font-size: 24px; font-weight: 800; background: linear-gradient(to right, #F5F7FF, #A9B2C7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.results-header p { color: var(--text-secondary); margin-top: 2px; font-size: 12px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; width: 100%; max-width: 1400px; }
.stat-card { background: var(--glass-surface); border: 1px solid var(--glass-border); border-radius: 14px; padding: 15px; backdrop-filter: blur(12px); position: relative; }
.stat-card .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.stat-card .value { font-size: 20px; font-weight: 700; margin-top: 6px; }
.stat-card .sub { font-size: 11px; color: var(--mint); margin-top: 4px; display: flex; align-items: center; gap: 4px; }

.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 15px; width: 100%; max-width: 1400px; height: 240px; }
.chart-card { background: var(--glass-surface); border: 1px solid var(--glass-border); border-radius: 14px; padding: 15px; backdrop-filter: blur(12px); display: flex; flex-direction: column; }
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.chart-header h3 { font-size: 14px; font-weight: 700; }
.time-filters { display: flex; gap: 4px; }
.time-filters button { background: transparent; border: 1px solid var(--glass-border); color: var(--text-muted); padding: 3px 8px; border-radius: 6px; font-size: 10px; cursor: pointer; transition: 0.2s; }
.time-filters button.active { background: var(--mint); color: #000; border-color: var(--mint); }
.chart-container { flex: 1; position: relative; }
.donut-container { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; }
.donut-chart { width: 120px; height: 120px; border-radius: 50%; background: conic-gradient(var(--mint) 0% 18.4%, rgba(255,255,255,0.05) 18.4% 100%); display: flex; align-items: center; justify-content: center; margin-bottom: 10px; position: relative; }
.donut-chart::before { content: ''; position: absolute; width: 90px; height: 90px; background: var(--glass-surface); border-radius: 50%; }
.donut-text { position: relative; z-index: 2; text-align: center; }
.donut-text .pct { font-size: 22px; font-weight: 800; color: var(--mint); }
.donut-text .val { font-size: 10px; color: var(--text-secondary); }
.donut-legend { text-align: center; font-size: 12px; color: var(--text-secondary); }
.donut-legend span { color: var(--mint); font-weight: 700; }

.table-card { width: 100%; max-width: 1400px; background: var(--glass-surface); border: 1px solid var(--glass-border); border-radius: 14px; padding: 15px; backdrop-filter: blur(12px); flex-grow: 1; display: flex; flex-direction: column; }
.arb-table { width: 100%; border-collapse: collapse; }
.arb-table th { text-align: left; font-size: 10px; color: var(--text-muted); text-transform: uppercase; padding: 8px 12px; border-bottom: 1px solid var(--glass-border); }
.arb-table td { padding: 10px 12px; border-bottom: 1px solid rgba(183, 156, 255, 0.1); font-size: 13px; }
.arb-table tr:last-child td { border-bottom: none; }
.asset-cell { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.status-completed { display: inline-flex; align-items: center; gap: 6px; background: rgba(35, 230, 210, 0.1); color: var(--mint); padding: 3px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; }

/* MODALS */
#invest-modal, #deposit-modal, #withdraw-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; z-index: 1000; }
.invest-modal-content { background: var(--glass-surface); border: 1px solid var(--glass-border); border-radius: 16px; padding: 30px; width: 100%; max-width: 400px; box-shadow: 0 0 40px rgba(0,0,0,0.5); }
.invest-input { width: 100%; padding: 12px; background: var(--input-surface); border: 1px solid var(--glass-border); border-radius: 8px; color: var(--text-primary); margin: 10px 0; outline: none; }
.invest-input:focus { border-color: var(--mint); }
.input-group { margin-bottom: 10px; }
.input-label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; display: block; text-transform: uppercase; letter-spacing: 1px; }
.btn-primary-sm { background: linear-gradient(135deg, var(--mint) 0%, var(--turquoise) 100%); color: #030817; font-weight: 700; font-size: 13px; padding: 10px 20px; border: none; border-radius: 10px; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 12px rgba(35, 230, 210, 0.3); }
.btn-ghost-sm { background: transparent; border: 1px solid var(--glass-border); color: var(--text-primary); font-weight: 600; font-size: 13px; padding: 10px 20px; border-radius: 10px; cursor: pointer; transition: 0.3s; }

/* LOGIN PAGE */
body.login-page {
  background-color: var(--space-bg); 
  background-image: url('https://z-cdn-media.chatglm.cn/files/28bcace7-c7a2-4be3-bf31-d69e47a39a30.png?auth_key=1886095157-fffcaaf43e2d4aaa8759b93117efe4b9-0-2d7ec64f630dcf390be71f2cb5397470');
  background-size: contain; 
  background-position: right center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text-primary);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 5%;
  min-height: 100vh;
  position: relative;
}

.login-card {
  background: var(--glass-surface);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 0 40px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
  z-index: 10;
}

.bg-image { position: fixed; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; z-index: -1; }

h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.subtitle { color: var(--text-secondary); margin-bottom: 32px; font-size: 14px; }
.input-group { margin-bottom: 20px; }
.input-label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; display: block; text-transform: uppercase; letter-spacing: 1px; }
.input-field {
  background: var(--input-surface);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text-primary);
  width: 100%; 
  outline: none;
  transition: all 0.3s;
  font-size: 14px;
}
.input-field:focus { border-color: var(--mint); box-shadow: 0 0 12px rgba(35, 230, 210, 0.3); }

.btn-primary {
  width: 100%; 
  padding: 14px;
  background: linear-gradient(135deg, var(--mint) 0%, var(--turquoise) 100%);
  color: #030817; 
  font-weight: 700; 
  font-size: 15px;
  border: none; 
  border-radius: 12px; 
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 12px rgba(35, 230, 210, 0.45), 0 0 32px rgba(18, 191, 184, 0.20);
  margin-top: 10px;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 20px rgba(35, 230, 210, 0.6), 0 0 48px rgba(18, 191, 184, 0.3); }

.divider { display: flex; align-items: center; margin: 24px 0; }
.divider-line { height: 1px; background: var(--glass-border); flex: 1; }
.divider span { padding: 0 16px; color: var(--text-muted); font-size: 12px; }
.socials { display: flex; gap: 12px; }
.btn-social {
  flex: 1; background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 12px; border-radius: 12px;
  cursor: pointer; transition: 0.3s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px;
}
.btn-social:hover { background: rgba(255,255,255,0.05); border-color: var(--lavender); }

.tabs-container { display: flex; gap: 10px; margin-bottom: 24px; background: rgba(255,255,255,0.05); padding: 4px; border-radius: 12px; }
.tab-btn { flex: 1; padding: 10px; text-align: center; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--text-muted); transition: 0.3s; background: transparent; border: none; font-size: 14px; }
.tab-btn.active { background: var(--glass-surface); color: var(--mint); box-shadow: 0 2px 10px rgba(0,0,0,0.2); }

.form-hidden { display: none; }
.error-msg { color: #ef4444; font-size: 13px; margin-top: 15px; text-align: center; }
.success-msg { color: var(--mint); font-size: 13px; margin-top: 15px; text-align: center; }

/* SPIN PROGRESS BAR WITH TARGETS */
.spin-progress-wrapper { margin-bottom: 10px; }
.spin-progress-info { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.mts-progress-track { position: relative; height: 8px; background: rgba(255, 255, 255, 0.08); border-radius: 10px; overflow: visible; }
.mts-progress-fill { height: 100%; background: linear-gradient(90deg, var(--turquoise), var(--mint)); border-radius: 10px; transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 0 10px rgba(35, 230, 210, 0.6); position: relative; z-index: 1; }

.progress-target { position: absolute; top: 50%; transform: translate(-50%, -50%); z-index: 2; }
.target-dot { width: 14px; height: 14px; background: var(--space-bg); border: 2px solid var(--text-muted); border-radius: 50%; transition: 0.3s; cursor: pointer; }
.target-dot.active { background: var(--mint); border-color: var(--mint); box-shadow: 0 0 10px var(--mint); }
.target-tooltip { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--glass-strong); border: 1px solid var(--glass-border); padding: 6px 10px; border-radius: 8px; font-size: 10px; color: var(--text-primary); white-space: nowrap; opacity: 0; pointer-events: none; transition: 0.3s; text-align: center; line-height: 1.4; }
.progress-target:hover .target-dot { transform: scale(1.2); }
.progress-target:hover .target-tooltip { opacity: 1; bottom: 24px; }


/* ==========================================================================
   RESPONSIVE - MOBILE LOGIN PAGE
   ========================================================================== */
@media (max-width: 768px) {
  body.login-page {
    /* جایگزینی بک‌گراند با عکس موبایلی که ساختی */
    background-image: url('https://z-cdn-media.chatglm.cn/files/4ae0bbb8-15ff-451d-a551-523d47e5aad8.png?auth_key=1888043776-53b4ba40b75e4dddb0918843d55eb4b1-0-0f021a77e8909fcc95182c620cdf1919');
    background-size: cover; /* پوشش دادن کل صفحه */
    background-position: center center; /* وسط‌چین کردن بک‌گراند */
    justify-content: center; /* آوردن کارت لاگین به وسط صفحه */
    padding: 20px; /* فاصله از لبه‌های گوشی */
    overflow-y: auto; /* اجازه اسکرول در صورتی که کیبورد باز شد */
  }

  .login-card {
    max-width: 100%; /* کارت کل عرض گوشی رو بگیره (با احتساب پدینگ 20px) */
    padding: 30px 24px; /* کاهش پدینگ داخلی کارت برای جلوگیری از شلوغی */
    margin: auto; /* وسط‌چین شدن عمودی در صفحه */
    z-index: 10;
  }

  h1 {
    font-size: 24px; /* کمی کاهش سایز فونت برای موبایل */
  }

  .subtitle {
    font-size: 13px;
    margin-bottom: 24px;
  }

  /* دکمه‌های ورود و ثبت نام تمام عرض میشن */
  .btn-primary {
    width: 100%;
    padding: 14px;
  }

  /* فاصله‌بندی دکمه‌های شبکه‌های اجتماعی */
  .socials {
    gap: 10px;
  }

  .btn-social {
    padding: 12px 8px;
    font-size: 13px;
  }
}

/* برای گوشی‌های خیلی کوچیک (مثل آیفون SE) */
@media (max-width: 360px) {
  .login-card {
    padding: 24px 18px;
  }
  
  .btn-social span {
    font-size: 12px;
  }
}

/* ==========================================================================
   RESPONSIVE - DASHBOARD

   Desktop declarations above remain authoritative. These rules only change
   composition when the available viewport can no longer contain that layout.
   Colors, typefaces, borders, shadows and component styling are preserved.
   ========================================================================== */

/* Compact desktop and tablet */
@media (max-width: 1180px) {
  .nav {
    max-width: calc(100vw - 24px);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link,
  .nav-logout {
    flex: 0 0 auto;
  }

  .section:not(#spin) {
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    padding-right: 24px;
    padding-left: 24px;
  }

  #spin {
    --ih: min(var(--fit), calc((100vw - 88px) / 1.40682));
    --cy: max(44vh, calc(106px + 0.348 * var(--ih)));
    height: 100vh;
    height: 100svh;
  }

  #spin .node[style*="margin-left"] {
    margin-left: 0 !important;
  }

  .hero-bg-section {
    justify-content: flex-start;
    padding-top: 110px;
    padding-bottom: 40px;
  }

  .hero-top-row {
    display: block;
    flex: 0 0 auto;
  }

  .hero-left-content {
    width: min(100%, 480px);
    margin-right: auto;
    margin-left: 0;
  }

  .hero-bottom-row {
    margin-top: 64px;
  }

  .results-bg-section {
    justify-content: flex-start;
    overflow: visible;
    padding-top: 90px;
    padding-bottom: 32px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .charts-grid {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }

  .chart-card {
    min-height: 240px;
  }

  .table-card {
    flex-grow: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .arb-table {
    min-width: 680px;
  }

  #cards {
    justify-content: flex-start;
    padding-top: 92px;
    padding-bottom: 48px;
  }

  .balance-chip {
    position: relative;
    top: auto;
    right: auto;
    align-self: flex-start;
    margin-bottom: 24px;
  }

  .rewards-grid {
    grid-template-columns: repeat(2, minmax(0, 320px));
    justify-content: center;
    max-width: 666px;
  }
}

/* Tablet portrait and wide phones */
@media (max-width: 900px) {
  #spin .node[style*="margin-top"] {
    margin-top: 0 !important;
  }

  .invest-modal-content {
    width: calc(100% - 32px);
    max-height: calc(100vh - 32px);
    max-height: calc(100svh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .time-filters {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .time-filters::-webkit-scrollbar {
    display: none;
  }
}

/* Phones */
@media (max-width: 720px) {
  .section:not(#spin) {
    padding-right: 16px;
    padding-left: 16px;
  }

  .hero-bg-section {
    padding-top: 96px;
    padding-bottom: 28px;
  }

  .hero-left-content {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
    padding-left: 0;
  }

  .hero-bottom-row {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 48px;
  }

  .rewards-grid {
    grid-template-columns: minmax(0, 320px);
    max-width: 320px;
  }
}

@media (max-width: 640px) {
  .nav {
    top: max(12px, env(safe-area-inset-top));
  }

  #spin {
    --ih: min(var(--fit), calc((100vw - 64px) / 1.40682));
    --cy: max(42vh, calc(104px + 0.348 * var(--ih)));
  }

  .spin-core {
    width: clamp(56px, 21vw, 112px);
    height: clamp(56px, 21vw, 112px);
  }

  .spin-core-text {
    font-size: clamp(14px, 5vw, 24px);
    letter-spacing: clamp(1.5px, 0.75vw, 3px);
  }

  .node {
    width: clamp(32px, 12vw, 56px);
    height: clamp(32px, 12vw, 56px);
  }

  .spin-result {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    bottom: max(1.6vh, calc(env(safe-area-inset-bottom) + 6px));
    width: calc(100vw - 24px);
    padding-right: 16px;
    padding-left: 16px;
  }

  .spin-result-btn {
    width: 100%;
  }

  .results-bg-section {
    padding-top: 82px;
  }

  .chart-header {
    align-items: flex-start;
    gap: 12px;
  }

  .chart-header h3 {
    flex: 0 0 auto;
  }

  .time-filters {
    flex: 1 1 auto;
  }

  .progress-target[style*="left: 0%"] .target-tooltip {
    left: 0;
    transform: none;
  }

  .progress-target[style*="left: 100%"] .target-tooltip {
    right: 0;
    left: auto;
    transform: none;
  }

  #spin .node[style*="+ 0.70341"] .node-label {
    right: 0;
    left: auto;
    transform: none;
  }

  #spin .node[style*="- 0.70341"] .node-label {
    left: 0;
    transform: none;
  }

  #cards {
    padding-top: 82px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }

  .balance-chip {
    max-width: 100%;
  }

  .toast {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px;
    width: auto;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #stat-spins {
    margin-top: 12px !important;
  }
}

@media (max-width: 360px) {
  .rewards-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 100%;
  }

  .reward-card {
    width: 100%;
  }

  .reward-pct {
    font-size: clamp(40px, 13vw, 50px);
  }

  .invest-modal-content {
    width: calc(100% - 24px);
    padding: 24px 18px;
  }
}

/* Short desktop displays keep every section reachable without clipping. */
@media (min-width: 1181px) and (max-height: 760px) {
  .section:not(#spin) {
    height: auto;
    min-height: 100vh;
  }

  .results-bg-section {
    overflow: visible;
  }
}

/* Landscape phones use a scrollable stage so the spinner never overlaps its
   result panel, even when the physical viewport is unusually short. */
@media (max-width: 900px) and (max-height: 620px) and (orientation: landscape) {
  #spin {
    --ih: min(400px, calc((100vw - 100px) / 1.40682));
    --cy: 285px;
    height: 640px;
    min-height: 640px;
  }
}

/* ==========================================================================
   RESPONSIVE NAVIGATION
   Keeps the desktop glass pill unchanged and converts it to an accessible
   dropdown only when the full navigation row no longer fits comfortably.
   ========================================================================== */
@media (max-width: 720px) {
  .nav {
    top: max(12px, env(safe-area-inset-top));
    width: calc(100vw - 24px);
    max-width: 420px;
    padding: 7px 8px;
    gap: 10px;
    overflow: visible;
  }

  .nav-toggle {
    display: inline-flex;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--mint);
    background: rgba(35, 230, 210, 0.08);
    border: 1px solid rgba(183, 156, 255, 0.18);
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, box-shadow 0.2s;
  }

  .nav-current {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 2px;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-toggle-icon {
    position: relative;
    display: block;
    width: 18px;
    height: 14px;
  }

  .nav-toggle-icon span {
    position: absolute;
    right: 0;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transform-origin: center;
    transition: top 0.2s, opacity 0.2s, transform 0.2s;
  }

  .nav-toggle-icon span:nth-child(1) { top: 0; }
  .nav-toggle-icon span:nth-child(2) { top: 6px; }
  .nav-toggle-icon span:nth-child(3) { top: 12px; }

  .nav-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 4px;
    max-height: calc(100vh - 84px);
    max-height: calc(100svh - 84px);
    padding: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    direction: rtl;
    background: rgba(10, 15, 38, 0.94);
    border: 1px solid rgba(183, 156, 255, 0.18);
    border-radius: 20px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.52);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top center;
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    overscroll-behavior: contain;
  }

  .nav-menu .nav-link {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 8px 16px;
    text-align: right;
  }

  .nav-menu .nav-logout {
    width: 100%;
    min-height: 44px;
    margin-top: 4px;
  }

  .nav.menu-open .nav-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .nav.menu-open .nav-toggle {
    color: var(--text-primary);
    background: rgba(35, 230, 210, 0.14);
    box-shadow: 0 0 14px rgba(35, 230, 210, 0.24);
  }

  .nav.menu-open .nav-toggle-icon span:nth-child(1) {
    top: 6px;
    transform: rotate(45deg);
  }

  .nav.menu-open .nav-toggle-icon span:nth-child(2) {
    opacity: 0;
  }

  .nav.menu-open .nav-toggle-icon span:nth-child(3) {
    top: 6px;
    transform: rotate(-45deg);
  }
}

/* ==========================================================================
   MOBILE SPINNER OVERRIDES
   Only the spinner is changed. Existing responsive navigation and all other
   dashboard sections remain controlled by their original rules above.
   ========================================================================== */
@media (max-width: 768px) {
  /* Mobile-only spinner artwork. */
  #spin {
    background-image: url('https://z-cdn-media.chatglm.cn/files/2b74955e-9a69-4bf8-add1-21771e6872c8.png?auth_key=1888057696-24219a5baa064720b3236c3c5e0fb580-0-0029538d06c26d5c3f922bdd1d591bf6') !important;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    padding: 0;
  }

  /* Responsive orbs and labels. */
  #spin > .node {
    width: 8% !important;
    height: 5% !important;
    min-width: 0;
    min-height: 0;
    margin: 0 !important;
    transform: translate(-50%, -50%) !important;
  }

  #spin .node-label {
    top: calc(100% + 4px) !important;
    font-size: clamp(9px, 2.5vw, 12px) !important;
  }

  #spin .winner-arrow {
    top: calc(100% + 12px) !important;
    border-top-width: 9px !important;
  }

  /* Orb positions follow the mobile background composition. */
  #spin > .node:nth-child(1) {
    left: 50vw !important;
    top: 33vh !important;
  }

  #spin > .node:nth-child(2) {
    left: 82vw !important;
    top: 36vh !important;
  }

  #spin > .node:nth-child(3) {
    left: 90vw !important;
    top: 46vh !important;
  }

  #spin > .node:nth-child(4) {
    left: 82vw !important;
    top: 59vh !important;
  }

  #spin > #node-winner {
    left: 50vw !important;
    top: 62vh !important;
  }

  #spin > .node:nth-child(6) {
    left: 18vw !important;
    top: 59vh !important;
  }

  #spin > .node:nth-child(7) {
    left: 10vw !important;
    top: 46vh !important;
  }

  #spin > .node:nth-child(8) {
    left: 18vw !important;
    top: 36vh !important;
  }

  /* Spinner core. */
  #spin > .spin-core {
    left: 50vw !important;
    top: 46vh !important;
    width: 16% !important;
    height: 10% !important;
    transform: translate(-50%, -50%) !important;
  }

  #spin .spin-core-text {
    font-size: clamp(16px, 4vw, 22px) !important;
  }

  /* Spin result panel. */
  #spin > .spin-result {
    bottom: 15px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 92vw;
    padding: 14px;
    text-align: center;
  }

  #spin .spin-result-text {
    text-align: center;
  }

  #spin .spin-result-sub {
    justify-content: center;
  }

  #spin .spin-result-btn {
    width: 100%;
    padding: 10px;
    font-size: 14px;
  }

  #spin .mini-hourglass {
    width: 14px;
    height: 14px;
  }
}

/* Mobile hero: show the artwork's quiet left side behind the page copy. */
@media (max-width: 768px) {
  .hero-bg-section {
    background-color: var(--space-bg);
    background-image:
      linear-gradient(180deg, rgba(3, 8, 23, 0.5), rgba(3, 8, 23, 0.68)),
      url('../assets/arbi-card-galaxy-hero.png');
    background-size: cover, auto 100%;
    background-position: center, left center;
    background-repeat: no-repeat;
  }
}
