/* ===================================================
   TELEGRAM EARNING APP — COMPLETE STYLESHEET
   Faithfully converted from UI screenshots
   =================================================== */

/* ─── Google Fonts ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

/* ─── CSS Variables ─────────────────────────────────── */
:root {
  --primary:        #8B2828;
  --primary-dark:   #6E1F1F;
  --primary-light:  #A83535;
  --bg:             #F2F2F7;
  --card-bg:        #FFFFFF;
  --text:           #1A1A1A;
  --text-secondary: #888888;
  --text-muted:     #AAAAAA;
  --gold:           #E8A020;
  --silver:         #9BA3B0;
  --bronze:         #C47A3A;
  --border:         #EEEEEE;
  --shadow:         0 2px 12px rgba(0,0,0,0.07);
  --shadow-md:      0 4px 20px rgba(0,0,0,0.10);
  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --radius-xl:      28px;
  --nav-height:     72px;
  --font:           'DM Sans', sans-serif;
}

/* ─── Reset & Base ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}

body {
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { font-family: var(--font); cursor: pointer; border: none; outline: none; }
input { font-family: var(--font); }

/* ─── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 0; }

/* ─── App Shell ──────────────────────────────────────── */
#app {
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + 12px);
}

#page-content {
  padding: 20px 16px 0;
  min-height: calc(100vh - var(--nav-height));
}

/* ─── Loading Screen ─────────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  gap: 16px;
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.85;
  letter-spacing: 0.3px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Bottom Navigation ──────────────────────────────── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: var(--nav-height);
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding: 0 8px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  padding: 8px 0;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.nav-item.active { color: var(--primary); }

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

/* Center Play Button */
.nav-item.nav-play {
  position: relative;
  top: -14px;
  flex: 0 0 64px;
}

.nav-play-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(139,40,40,0.4);
  color: #fff;
  transition: transform 0.15s, box-shadow 0.15s;
}

.nav-play-btn:active {
  transform: scale(0.94);
  box-shadow: 0 2px 8px rgba(139,40,40,0.3);
}

.nav-play-btn svg { width: 26px; height: 26px; fill: #fff; stroke: none; }
.nav-item.nav-play .nav-label { margin-top: 6px; }

/* ─── Page Headers ───────────────────────────────────── */
.page-header {
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.page-header .greeting-name {
  color: var(--primary);
}

.page-header .greeting-emoji {
  display: inline-block;
  animation: wave 1.8s ease-in-out infinite;
  transform-origin: 70% 70%;
}

@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%, 30%      { transform: rotate(18deg); }
  20%           { transform: rotate(-8deg); }
  40%           { transform: rotate(12deg); }
  50%           { transform: rotate(-4deg); }
}

.page-header p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* User Avatar (top-right) */
.avatar-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

/* ─── Balance Card ───────────────────────────────────── */
.balance-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  color: #fff;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.balance-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.balance-card::after {
  content: '';
  position: absolute;
  bottom: -30px;
  right: 30px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

.balance-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  opacity: 0.75;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.balance-label svg { width: 14px; height: 14px; }

.balance-amount {
  font-size: 38px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.balance-amount .token {
  font-size: 18px;
  font-weight: 600;
  opacity: 0.9;
  margin-left: 4px;
}

.balance-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.btn-withdraw {
  flex: 1;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  transition: opacity 0.15s;
}

.btn-withdraw:hover { opacity: 0.92; }

.btn-invite {
  flex: 1;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  border: 1.5px solid rgba(255,255,255,0.35);
  transition: background 0.15s;
}

.btn-invite:hover { background: rgba(255,255,255,0.24); }

/* ─── Section Title ──────────────────────────────────── */
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-title svg { width: 16px; height: 16px; color: var(--primary); }

/* ─── Earn Cards Grid (Home) ─────────────────────────── */
.earn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.earn-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.earn-card:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-md);
}

.earn-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #FFF0F0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--primary);
}

.earn-card-icon svg { width: 20px; height: 20px; }

.earn-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.earn-card .earn-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.earn-card .earn-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 3px;
}

.earn-card .earn-link svg { width: 13px; height: 13px; }

/* ─── Daily Spin Banner ──────────────────────────────── */
.spin-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  margin-bottom: 20px;
  transition: opacity 0.15s;
  position: relative;
  overflow: hidden;
}

.spin-banner::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.spin-banner:active { opacity: 0.9; }

.spin-banner-text h3 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
}

.spin-banner-text p {
  font-size: 12.5px;
  color: rgba(255,255,255,0.75);
}

.spin-banner-icon {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

/* ─── Tab Switcher ───────────────────────────────────── */
.tabs {
  display: flex;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.tab-btn {
  flex: 1;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn svg { width: 15px; height: 15px; }

.tab-btn.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ─── Task Cards ─────────────────────────────────────── */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  gap: 12px;
}

.task-info { flex: 1; min-width: 0; }

.task-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-reward {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.task-reward-icon {
  font-size: 14px;
}

.btn-start {
  padding: 9px 20px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, transform 0.12s;
  flex-shrink: 0;
}

.btn-start:hover  { background: var(--primary-light); }
.btn-start:active { transform: scale(0.95); }

.btn-done {
  padding: 9px 20px;
  background: var(--bg);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  flex-shrink: 0;
  cursor: default;
}

/* ─── Ad Cards (Watch & Earn) ────────────────────────── */
.ad-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  gap: 12px;
}

.ad-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #E8F4FF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #2878C8;
}

.ad-icon svg { width: 20px; height: 20px; }
.ad-info { flex: 1; min-width: 0; }

/* ─── Spin Wheel Page ────────────────────────────────── */
.spin-page-header {
  text-align: center;
  margin-bottom: 24px;
}

.spin-page-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.spin-page-header p {
  font-size: 13.5px;
  color: var(--text-secondary);
  max-width: 220px;
  margin: 0 auto;
  line-height: 1.5;
}

.spin-wheel-container {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 28px 20px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 18px;
}

/* Pointer triangle above wheel */
.spin-pointer {
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 18px solid var(--primary);
  margin-bottom: -4px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(139,40,40,0.3));
}

#spin-canvas {
  border-radius: 50%;
  box-shadow: 0 6px 30px rgba(139,40,40,0.2), 0 2px 8px rgba(0,0,0,0.1);
  display: block;
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

/* Center play button on wheel */
.spin-center-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spin-center-btn svg { width: 22px; height: 22px; fill: var(--text); stroke: none; }

.spin-canvas-wrapper {
  position: relative;
  display: inline-block;
}

.spin-status {
  margin-top: 20px;
  padding: 12px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
}

.spin-status svg { width: 16px; height: 16px; color: var(--primary); }

.spin-status.ready {
  border-color: rgba(139,40,40,0.3);
  color: var(--primary);
  background: rgba(139,40,40,0.05);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}

.spin-status.ready:hover { background: rgba(139,40,40,0.1); }

.spin-status.cooldown {
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ─── Refer Page ─────────────────────────────────────── */
.refer-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 0 22px;
}

.refer-avatar-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--text-muted);
}

.refer-avatar-wrap svg { width: 38px; height: 38px; }

.refer-header h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.refer-header p {
  font-size: 13.5px;
  color: var(--text-secondary);
  max-width: 240px;
}

.refer-header p strong {
  color: var(--primary);
}

/* Referral Stats */
.refer-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-card .stat-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

/* Referral Link Box */
.referral-link-box {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 22px;
}

.referral-link-label {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.referral-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.referral-link-text {
  flex: 1;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.copy-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  transition: background 0.15s, transform 0.12s;
  cursor: pointer;
}

.copy-btn:hover  { background: rgba(255,255,255,0.28); }
.copy-btn:active { transform: scale(0.9); }
.copy-btn svg { width: 17px; height: 17px; }

/* Leaderboard */
.leaderboard-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.leaderboard-title .trophy { font-size: 17px; }

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-item {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
}

.rank-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: #fff; font-size: 16px; }
.rank-2 { background: linear-gradient(135deg, #C0C0C0, #A0A8B0); color: #fff; font-size: 16px; }
.rank-3 { background: linear-gradient(135deg, #CD7F32, #B8662A); color: #fff; font-size: 16px; }
.rank-n { background: var(--bg); color: var(--text-secondary); font-size: 12px; font-weight: 700; }

.lb-user-info { flex: 1; min-width: 0; }

.lb-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.lb-username {
  font-size: 12px;
  color: var(--text-muted);
}

.lb-count {
  text-align: right;
  flex-shrink: 0;
}

.lb-count .count-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.lb-count .count-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ─── Account Page ───────────────────────────────────── */
.account-profile-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-info {}

.profile-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.profile-username {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.profile-id {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.profile-id .copy-id-btn {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s;
}

.profile-id .copy-id-btn:hover { color: var(--primary); }
.profile-id .copy-id-btn svg { width: 14px; height: 14px; }

/* Account Balance Card */
.account-balance-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.account-balance-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.acc-bal-info {}

.acc-bal-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 6px;
}

.acc-bal-amount {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.acc-bal-amount .token {
  font-size: 15px;
  font-weight: 600;
  opacity: 0.85;
  margin-left: 3px;
}

.acc-bal-card-btn {
  padding: 10px 18px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid rgba(255,255,255,0.35);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  z-index: 1;
}

.acc-bal-card-btn:hover { background: rgba(255,255,255,0.28); }

/* Account Menu Items */
.account-menu {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.account-menu-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}

.account-menu-item:last-child { border-bottom: none; }
.account-menu-item:hover { background: var(--bg); }
.account-menu-item:active { background: var(--border); }

.menu-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #FFF0F0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}

.menu-item-icon svg { width: 18px; height: 18px; }

.menu-item-text { flex: 1; }

.menu-item-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1px;
}

.menu-item-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.menu-item-arrow {
  color: var(--text-muted);
}

.menu-item-arrow svg { width: 17px; height: 17px; }

/* ─── Withdraw Page ──────────────────────────────────── */
.withdraw-balance-info {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.withdraw-balance-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.withdraw-balance-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.withdraw-form {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  box-shadow: var(--shadow);
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: block;
}

.form-input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s;
  outline: none;
  margin-bottom: 14px;
}

.form-input:focus { border-color: var(--primary); }

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s, opacity 0.15s;
  display: block;
}

.btn-primary:hover  { background: var(--primary-light); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled,
.btn-primary.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ─── Empty States ───────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.4; }

.empty-state p {
  font-size: 14px;
  line-height: 1.6;
}

/* ─── Toast Notifications ────────────────────────────── */
#toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 360px;
}

.toast {
  background: #1A1A1A;
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: toastIn 0.25s ease, toastOut 0.3s ease 2.3s forwards;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  pointer-events: all;
}

.toast.success { background: #1A7A3A; }
.toast.error   { background: #8B2828; }
.toast.info    { background: #1A4A8B; }

.toast svg { width: 16px; height: 16px; flex-shrink: 0; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

/* ─── Utility / Helpers ──────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mt-20  { margin-top: 20px; }
.mb-8   { margin-bottom: 8px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }
.text-center { text-align: center; }
.w-full { width: 100%; }

/* ─── Animations ─────────────────────────────────────── */
.page-enter {
  animation: pageIn 0.22s ease;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.skeleton {
  background: linear-gradient(90deg, #F0F0F0 25%, #E8E8E8 50%, #F0F0F0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ─── Responsive / Safe Area ─────────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  }
}