/* ===========================================================
   AI Arena — استایل اصلی (Neomorphism)
   پالت: پس‌زمینه روشن نرم با سایه‌های فرورفته/برجسته
=========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&family=Lalezar&display=swap');

:root{
  --bg: #e9edf3;
  --bg-deep: #dfe4ec;
  --text-main: #3a4458;
  --text-soft: #6b7588;
  --accent: #6c5ce7;
  --accent-2: #00b894;
  --accent-soft: #a29bfe;
  --gold: #c9a14a;
  --danger: #e0566b;

  --shadow-dark: #c2c8d4;
  --shadow-light: #ffffff;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --raised: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
  --raised-sm: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
  --pressed: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light);
  --pressed-sm: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
  --flat: 0 0 0 rgba(0,0,0,0);
}

*{ box-sizing: border-box; margin:0; padding:0; }

html{ scroll-behavior: smooth; }

body{
  font-family: 'Vazirmatn', sans-serif;
  background: var(--bg);
  color: var(--text-main);
  direction: rtl;
  min-height: 100vh;
  line-height: 1.8;
}

::selection{ background: var(--accent-soft); color:#fff; }

.font-display{
  font-family: 'Lalezar', 'Vazirmatn', sans-serif;
  letter-spacing: .5px;
}

a{ color: inherit; text-decoration:none; }
img{ max-width:100%; display:block; }
ul{ list-style:none; }
button{ font-family: inherit; cursor:pointer; border:none; background:none; color:inherit; }

/* ---------- Layout shell ---------- */
.page-wrap{
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px 80px;
}

/* ---------- Neumorphic base components ---------- */
.neo-card{
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--raised);
  padding: 28px;
}

.neo-card-sm{
  background: var(--bg);
  border-radius: var(--radius-md);
  box-shadow: var(--raised-sm);
  padding: 18px;
}

.neo-inset{
  background: var(--bg);
  border-radius: var(--radius-md);
  box-shadow: var(--pressed);
}

.neo-btn{
  background: var(--bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--raised-sm);
  padding: 12px 26px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  transition: box-shadow .18s ease, transform .18s ease, color .18s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.neo-btn:hover{ color: var(--accent); }
.neo-btn:active{ box-shadow: var(--pressed-sm); transform: scale(.98); }

.neo-btn.primary{
  color: #fff;
  background: linear-gradient(145deg, var(--accent), #8073f0);
  box-shadow: 6px 6px 14px var(--shadow-dark), -6px -6px 14px var(--shadow-light), 0 0 0 1px rgba(255,255,255,.04) inset;
}
.neo-btn.primary:hover{ color:#fff; filter: brightness(1.05); }
.neo-btn.primary:active{ box-shadow: var(--pressed-sm); }

.neo-btn.gold{
  color: #ffffff;
  background: linear-gradient(145deg, #d8b35f, var(--gold));
}

.neo-icon-btn{
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--raised-sm);
  display:flex; align-items:center; justify-content:center;
  transition: box-shadow .18s ease, transform .18s ease;
}
.neo-icon-btn:hover{ transform: translateY(-2px); }
.neo-icon-btn:active{ box-shadow: var(--pressed-sm); }

.pill{
  display:inline-flex; align-items:center; gap:6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--pressed-sm);
  font-size: .78rem;
  color: var(--text-soft);
  font-weight: 600;
}

.eyebrow{
  font-size: .8rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .5px;
  display:flex; align-items:center; gap:8px;
  margin-bottom: 10px;
}
.eyebrow::before{
  content:"";
  width: 18px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- Header / Nav ---------- */
.site-header{
  position: sticky; top:0; z-index: 50;
  background: var(--bg);
  padding: 18px 28px;
  box-shadow: 0 6px 18px rgba(166,176,196,.35);
}
.header-inner{
  max-width: 1240px; margin:0 auto;
  display:flex; align-items:center; justify-content:space-between;
  gap: 20px;
}
.brand{
  display:flex; align-items:center; gap:12px;
}
.brand-mark{
  width: 48px; height: 48px;
  border-radius: 16px;
  background: var(--bg);
  box-shadow: var(--raised-sm);
  display:flex; align-items:center; justify-content:center;
  color: var(--accent);
  font-size: 1.4rem;
  font-family: 'Lalezar', sans-serif;
}
.brand-text h1{
  font-family: 'Lalezar', sans-serif;
  font-size: 1.35rem;
  color: var(--text-main);
}
.brand-text span{
  font-size: .72rem;
  color: var(--text-soft);
  letter-spacing: .5px;
}

.main-nav{ display:flex; align-items:center; gap: 6px; }
.main-nav a{
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .92rem;
  color: var(--text-soft);
  transition: box-shadow .18s ease, color .18s ease;
}
.main-nav a:hover{ color: var(--accent); }
.main-nav a.active{
  color: var(--accent);
  box-shadow: var(--pressed-sm);
}

.header-actions{ display:flex; align-items:center; gap:12px; }

.nav-toggle{
  display:none;
  width:46px; height:46px;
  border-radius:14px;
  background: var(--bg);
  box-shadow: var(--raised-sm);
  align-items:center; justify-content:center;
  flex-direction:column; gap:5px;
  flex-shrink:0;
}
.nav-toggle span{
  width:20px; height:2px;
  background: var(--text-main);
  border-radius:2px;
  transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle.active{ box-shadow: var(--pressed-sm); }
.nav-toggle.active span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2){ opacity:0; }
.nav-toggle.active span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

.nav-overlay{
  position: fixed; inset:0;
  background: rgba(40,46,64,.35);
  opacity:0; pointer-events:none;
  transition: opacity .3s ease;
  z-index: 70;
}
.nav-overlay.open{ opacity:1; pointer-events:auto; }

/* ---------- Hero ---------- */
.hero{
  padding: 64px 0 40px;
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items:center;
}
.hero-title{
  font-family: 'Lalezar', sans-serif;
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 1.4;
  color: var(--text-main);
  margin-bottom: 18px;
}
.hero-title em{
  font-style: normal;
  color: var(--accent);
}
.hero-desc{
  color: var(--text-soft);
  font-size: 1.02rem;
  max-width: 50ch;
  margin-bottom: 28px;
}
.hero-actions{ display:flex; gap:14px; flex-wrap:wrap; }

.hero-visual{
  position:relative;
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--raised);
  display:flex; align-items:center; justify-content:center;
}
.hero-visual::before{
  content:"";
  position:absolute; inset: 14%;
  border-radius:50%;
  box-shadow: var(--pressed);
}
.hero-visual .calligraphy{
  position:relative; z-index:2;
  font-family: 'Lalezar', sans-serif;
  font-size: 3.4rem;
  color: var(--accent);
  text-shadow: 2px 2px 4px var(--shadow-dark), -2px -2px 4px var(--shadow-light);
}
.hero-stat{
  position:absolute;
  background: var(--bg);
  box-shadow: var(--raised-sm);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-main);
  display:flex; flex-direction:column; align-items:center;
}
.hero-stat span{ color: var(--text-soft); font-weight:500; font-size:.68rem; }
.hero-stat.s1{ top: 6%; right: 4%; }
.hero-stat.s2{ bottom: 8%; left: 2%; }
.hero-stat.s3{ top: 42%; right: -6%; }

/* ---------- Section heading ---------- */
.section{ padding: 56px 0; }
.section-head{
  display:flex; align-items:flex-end; justify-content:space-between;
  margin-bottom: 30px; gap: 20px; flex-wrap: wrap;
}
.section-title{
  font-family:'Lalezar', sans-serif;
  font-size: 1.8rem;
  color: var(--text-main);
}
.section-sub{ color: var(--text-soft); font-size:.92rem; max-width: 60ch; }

/* ---------- Tutorials ---------- */
.tut-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.tut-card{
  position:relative;
  display:flex; flex-direction:column; gap:14px;
}
.tut-icon{
  width: 54px; height:54px;
  border-radius: 16px;
  background: var(--bg);
  box-shadow: var(--pressed-sm);
  display:flex; align-items:center; justify-content:center;
  color: var(--accent);
  font-size: 1.4rem;
}
.tut-card h3{ font-size: 1.08rem; color: var(--text-main); }
.tut-card p{ color: var(--text-soft); font-size: .88rem; }
.tut-meta{
  display:flex; align-items:center; justify-content:space-between;
  margin-top: 6px;
  font-size: .78rem;
  color: var(--text-soft);
}
.progress-track{
  height: 10px; border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--pressed-sm);
  overflow:hidden;
}
.progress-fill{
  height:100%; border-radius:999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
}
.lock-badge{
  position:absolute; top:18px; left:18px;
  width: 30px; height:30px; border-radius:50%;
  background: var(--bg); box-shadow: var(--raised-sm);
  display:flex; align-items:center; justify-content:center;
  color: var(--gold); font-size: .85rem;
}

/* ---------- Arena ---------- */
.arena-panel{
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 22px;
  align-items:center;
}
.fighter{
  text-align:center;
  padding: 26px 18px;
}
.fighter-avatar{
  width: 84px; height:84px; margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--raised-sm);
  display:flex; align-items:center; justify-content:center;
  font-family:'Lalezar', sans-serif;
  font-size: 1.6rem;
  color: var(--accent);
}
.fighter.you .fighter-avatar{ color: var(--accent-2); }
.fighter h4{ margin-bottom: 4px; }
.fighter .rank{ font-size:.78rem; color: var(--text-soft); }

.vs-badge{
  width: 64px; height:64px; border-radius:50%;
  background: var(--bg);
  box-shadow: var(--pressed);
  display:flex; align-items:center; justify-content:center;
  font-family:'Lalezar', sans-serif;
  font-size: 1.1rem;
  color: var(--danger);
}

.arena-prompt-box{
  margin-top: 26px;
}
.prompt-textarea{
  width:100%;
  min-height: 96px;
  border:none; outline:none;
  resize: vertical;
  background: var(--bg);
  border-radius: var(--radius-md);
  box-shadow: var(--pressed);
  padding: 16px 18px;
  font-family: inherit;
  font-size: .92rem;
  color: var(--text-main);
}
.prompt-textarea::placeholder{ color: var(--text-soft); }

.arena-footer{
  display:flex; align-items:center; justify-content:space-between;
  margin-top: 18px; flex-wrap:wrap; gap:14px;
}
.timer{
  display:flex; align-items:center; gap:10px;
  font-weight:700; color: var(--text-main);
}
.timer-ring{
  width: 38px; height:38px; border-radius:50%;
  background: var(--bg); box-shadow: var(--raised-sm);
  display:flex; align-items:center; justify-content:center;
  font-size:.78rem; color: var(--accent);
}

.leaderboard-list{ display:flex; flex-direction:column; gap:12px; margin-top: 18px;}
.lb-row{
  display:flex; align-items:center; gap:14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-shadow: var(--raised-sm);
}
.lb-rank{
  width:30px; height:30px; border-radius:50%;
  background: var(--bg); box-shadow: var(--pressed-sm);
  display:flex; align-items:center; justify-content:center;
  font-size:.8rem; font-weight:700; color: var(--text-soft);
}
.lb-rank.gold{ color: var(--gold); }
.lb-name{ flex:1; font-weight:600; font-size:.92rem; }
.lb-score{ font-size:.82rem; color: var(--text-soft); font-weight:700;}

/* ---------- Profile ---------- */
.profile-grid{
  display:grid;
  grid-template-columns: .9fr 1.4fr;
  gap: 26px;
}
.profile-card{ text-align:center; position:relative; }
.profile-avatar{
  width: 110px; height:110px; margin: 0 auto 16px;
  border-radius:50%;
  background: var(--bg);
  box-shadow: var(--raised);
  display:flex; align-items:center; justify-content:center;
  font-family:'Lalezar', sans-serif; font-size:2.1rem;
  color: var(--accent);
}
.profile-card h3{ margin-bottom:4px; }
.profile-card .handle{ color: var(--text-soft); font-size:.85rem; margin-bottom: 16px;}
.premium-chip{
  display:inline-flex; align-items:center; gap:6px;
  padding: 6px 16px; border-radius:999px;
  background: linear-gradient(145deg,#d8b35f,var(--gold));
  color:#fff; font-size:.76rem; font-weight:700;
  box-shadow: var(--raised-sm);
  margin-bottom: 16px;
}
.stat-row{
  display:flex; justify-content:space-between; gap:10px;
  margin-top: 20px;
}
.stat-box{
  flex:1; text-align:center;
  padding: 14px 8px;
  border-radius: var(--radius-sm);
  box-shadow: var(--pressed-sm);
}
.stat-box b{ display:block; font-size:1.05rem; color: var(--text-main); }
.stat-box span{ font-size:.72rem; color: var(--text-soft); }

.profile-side{ display:flex; flex-direction:column; gap:22px; }
.badge-grid{
  display:grid; grid-template-columns: repeat(4,1fr); gap:16px;
}
.badge-item{
  text-align:center; padding: 16px 8px;
}
.badge-icon{
  width:50px;height:50px;margin:0 auto 8px;
  border-radius:14px; background:var(--bg);
  box-shadow: var(--raised-sm);
  display:flex; align-items:center; justify-content:center;
  font-size:1.2rem; color: var(--accent-2);
}
.badge-item span{ font-size:.74rem; color: var(--text-soft);}

.upgrade-banner{
  display:flex; align-items:center; justify-content:space-between;
  gap: 20px; flex-wrap:wrap;
  background: linear-gradient(135deg, #efe3c8, var(--bg) 60%);
}
.upgrade-banner h3{ font-family:'Lalezar', sans-serif; color:#9c7a2c; font-size:1.3rem; margin-bottom:6px;}
.upgrade-banner p{ color: var(--text-soft); font-size:.88rem; max-width:42ch;}

/* ---------- Modal ---------- */
.modal-overlay{
  position: fixed; inset:0;
  background: rgba(58,68,88,.42);
  backdrop-filter: blur(3px);
  display:flex; align-items:center; justify-content:center;
  z-index: 200;
  opacity:0; pointer-events:none;
  transition: opacity .25s ease;
  padding: 20px;
}
.modal-overlay.open{ opacity:1; pointer-events:auto; }

.modal-box{
  width: 100%; max-width: 720px;
  max-height: 88vh; overflow-y:auto;
  background: var(--bg);
  border-radius: var(--radius-lg);
  /* box-shadow: 16px 16px 32px var(--shadow-dark), -16px -16px 32px var(--shadow-light); */
  padding: 32px;
  transform: translateY(18px) scale(.97);
  transition: transform .28s ease;
}
.modal-overlay.open .modal-box{ transform: translateY(0) scale(1); }

.modal-head{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom: 20px;
}
.modal-head h2{ font-family:'Lalezar', sans-serif; font-size:1.5rem; color: var(--text-main);}
.modal-close{
  width:38px;height:38px;border-radius:50%;
  background:var(--bg); box-shadow: var(--raised-sm);
  display:flex; align-items:center; justify-content:center;
}
.modal-close:active{ box-shadow: var(--pressed-sm); }

.plans-grid{
  display:grid; grid-template-columns: repeat(3, 1fr); gap:16px;
  margin-bottom: 22px;
}
.plan-card{
  padding: 22px; border-radius: var(--radius-md);
  box-shadow: var(--raised-sm);
  cursor:pointer;
  border: 2px solid transparent;
  border-top: 4px solid var(--accent-soft);
  transition: box-shadow .18s ease, border-color .18s ease;
  position:relative;
}
.plan-card[data-plan="basic"]{ border-top-color: #16a085; }
.plan-card[data-plan="pro"]{ border-top-color: #d8b35f; }
.plan-card[data-plan="elite"]{ border-top-color: #8e44ad; }
.plan-card[data-plan="basic"] .plan-price{ color: #16a085; }
.plan-card[data-plan="elite"] .plan-price{ color: #8e44ad; }
.plan-card.selected{
  border-color: var(--accent);
  box-shadow: var(--pressed-sm);
}
.plan-card .tag{
  position:absolute; top:-10px; right:18px;
  background: var(--gold); color:#fff;
  font-size:.7rem; padding:3px 10px; border-radius:999px;
  font-weight:700;
}
.plan-price{ font-family:'Lalezar', sans-serif; font-size:1.7rem; color: var(--accent); margin:8px 0;}
.plan-price span{ font-size:.85rem; color: var(--text-soft); font-family:'Vazirmatn',sans-serif; }
.plan-card ul{ margin-top:12px; display:flex; flex-direction:column; gap:8px; }
.plan-card li{ font-size:.84rem; color: var(--text-soft); display:flex; gap:8px; align-items:flex-start;}
.plan-card li::before{ content:"✓"; color: var(--accent-2); font-weight:700; }

.pay-form{ display:none; flex-direction:column; gap:14px; }
.pay-form.show{ display:flex; }
.field{ display:flex; flex-direction:column; gap:6px; }
.field label{ font-size:.82rem; color: var(--text-soft); font-weight:600; }
.field input{
  border:none; outline:none;
  background: var(--bg);
  box-shadow: var(--pressed-sm);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-family:'Vazirmatn',sans-serif;
  font-size:.92rem; color: var(--text-main);
  direction: ltr;
  text-align: right;
}
.field-row{ display:grid; grid-template-columns: 1fr 1fr; gap:14px; }
.pay-total{
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 18px; border-radius: var(--radius-sm);
  box-shadow: var(--pressed-sm);
  font-weight:700;
}
.pay-total b{ color: var(--accent); font-family:'Lalezar', sans-serif; font-size:1.2rem;}
.pay-note{ font-size:.74rem; color: var(--text-soft); display:flex; gap:6px; align-items:center; }

.modal-step-actions{ display:flex; gap:12px; margin-top:8px; }
.modal-step-actions .neo-btn{ flex:1; justify-content:center; }

.processing-state{
  display:none; flex-direction:column; align-items:center; gap:18px;
  padding: 30px 10px; text-align:center;
}
.processing-state.show{ display:flex; }
.spinner{
  width:64px;height:64px;border-radius:50%;
  box-shadow: var(--pressed);
  position:relative;
}
.spinner::after{
  content:"";
  position:absolute; inset:8px; border-radius:50%;
  border: 4px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent-soft);
  animation: spin 0.9s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.site-footer{
  text-align:center; padding: 30px 0 50px;
  color: var(--text-soft); font-size:.82rem;
}

/* ---------- Wallet (coins & gems) ---------- */
.wallet{ display:flex; align-items:center; gap:8px; }
.wallet-chip{
  display:flex; align-items:center; gap:6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--pressed-sm);
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-main);
  transition: transform .25s ease;
}
.wallet-chip.flash{ animation: walletFlash .5s ease; }
@keyframes walletFlash{
  0%{ transform: scale(1); }
  35%{ transform: scale(1.16); }
  100%{ transform: scale(1); }
}
.wallet-icon{ font-size: .95rem; }
.wallet-mini{ gap:6px; }
.wallet-chip.coin b{ color: #b8860b; }
.wallet-chip.gem b{ color: #8e44ad; }

/* ---------- Challenges ---------- */
.challenge-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.challenge-card{
  display:flex; flex-direction:column; gap:14px;
  position: relative;
}
.challenge-card.completed{ opacity:.7; }
.challenge-icon{
  width: 54px; height:54px;
  border-radius: 16px;
  background: var(--bg);
  box-shadow: var(--pressed-sm);
  display:flex; align-items:center; justify-content:center;
  font-size: 1.4rem;
  color: var(--accent);
}
.challenge-card h3{ font-size: 1.05rem; color: var(--text-main); }
.challenge-card p{ color: var(--text-soft); font-size: .87rem; }
.challenge-meta{
  display:flex; align-items:center; justify-content:space-between;
  font-size: .78rem; color: var(--text-soft);
}
.challenge-reward{
  display:flex; align-items:center; gap:12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--pressed-sm);
  font-size: .82rem; font-weight:700;
}
.challenge-reward span{ display:flex; align-items:center; gap:5px; }
.challenge-reward .reward-coin{ color:#b8860b; }
.challenge-reward .reward-gem{ color:#8e44ad; }
.challenge-btn{ width:100%; justify-content:center; margin-top:auto; }
.challenge-btn[disabled]{
  box-shadow: var(--pressed-sm);
  color: var(--accent-2);
  cursor: default;
}

/* ---------- Articles page ---------- */
.articles-filters {
  margin-bottom: 40px;
  padding: 24px 28px;
}

.search-input {
  width: 100%;
  padding: 16px 20px;
  border: none;
  outline: none;
  background: var(--bg);
  box-shadow: var(--pressed-sm);
  border-radius: var(--radius-md);
  font-size: 1rem;
  margin-bottom: 20px;
  font-family: inherit;
  color: var(--text-main);
}
.search-input::placeholder{ color: var(--text-soft); }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.filter-label {
  font-weight: 600;
  color: var(--text-soft);
  margin-left: 8px;
  white-space: nowrap;
}

.tags-container,
.sort-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Tag Buttons */
.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-btn {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--pressed-sm);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  color: var(--text-soft);
  font-family: inherit;
}

.tag-btn:hover {
  transform: translateY(-2px);
}

.tag-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: var(--raised-sm);
}

/* Sort select */
.sort-select-input{
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--pressed-sm);
  border: 2px solid transparent;
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

/* Articles Grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.article-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-8px);
  box-shadow: 12px 12px 24px var(--shadow-dark),
              -12px -12px 24px var(--shadow-light);
}

.article-emoji {
  font-size: 2.8rem;
  margin-bottom: 12px;
  display: block;
}

.article-category {
  display: inline-block;
  padding: 4px 14px;
  background: var(--accent-soft);
  color: white;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 12px;
  align-self: flex-start;
}

.article-card h3 {
  font-size: 1.18rem;
  line-height: 1.4;
  margin-bottom: 10px;
  color: var(--text-main);
}

.article-card p {
  color: var(--text-soft);
  flex-grow: 1;
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-bottom: 18px;
  border-top: 1px solid rgba(0,0,0,0.05);
  padding-top: 12px;
}

.no-results{
  text-align:center; padding: 50px 20px;
  color: var(--text-soft);
  display:none;
}
.no-results.show{ display:block; }

/* Responsive */
@media (max-width: 720px) {
  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .search-input {
    font-size: 0.95rem;
  }
}


.battle-card{ max-width: 760px; margin: 0 auto; }
.battle-frame{
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: var(--radius-md);
  background: var(--bg);
  box-shadow: var(--pressed);
  overflow: hidden;
  display:flex; align-items:center; justify-content:center;
}
.battle-frame img{
  width:100%; height:100%; object-fit: cover;
  border-radius: var(--radius-md);
  opacity:0;
  transition: opacity .4s ease;
}
.battle-frame img.show{ opacity:1; }
.battle-placeholder{
  display:flex; flex-direction:column; align-items:center; gap:10px;
  color: var(--text-soft);
}
.battle-placeholder .ph-icon{ font-size: 2.2rem; }
.battle-loading{
  display:none;
  flex-direction:column; align-items:center; gap:14px;
}
.battle-loading.show{ display:flex; }
.battle-frame.is-loading .battle-placeholder,
.battle-frame.has-image .battle-placeholder{ display:none; }
.battle-frame.is-loading .battle-loading{ display:flex; }

.battle-skeleton{
  position:absolute; inset:0;
  background: linear-gradient(100deg, var(--bg) 30%, var(--bg-deep) 50%, var(--bg) 70%);
  background-size: 200% 100%;
  animation: skeletonShine 1.4s ease-in-out infinite;
  display:none;
}
.battle-frame.is-loading .battle-skeleton{ display:block; }
@keyframes skeletonShine{
  0%{ background-position: 200% 0; }
  100%{ background-position: -200% 0; }
}

.battle-controls{
  display:flex; align-items:center; justify-content:space-between;
  margin-top: 18px; flex-wrap:wrap; gap:14px;
}
.battle-timer{
  display:flex; align-items:center; gap:10px; font-weight:700;
}
.battle-round-pill{ font-size:.78rem; }

.opponent-status{
  display:flex; align-items:center; gap:10px;
  padding: 12px 18px;
  margin-top: 14px;
  font-size: .82rem;
  color: var(--text-soft);
}
.opponent-status-label{ font-weight:700; color: var(--text-main); }
.typing-dots{ display:flex; gap:4px; }
.typing-dots span{
  width:6px; height:6px; border-radius:50%;
  background: var(--accent-soft);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2){ animation-delay: .2s; }
.typing-dots span:nth-child(3){ animation-delay: .4s; }
@keyframes typingBounce{
  0%, 60%, 100%{ transform: translateY(0); opacity:.5; }
  30%{ transform: translateY(-4px); opacity:1; }
}


.reward-toast{
  position: fixed;
  bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  display:flex; align-items:center; gap:10px;
  background: var(--bg);
  box-shadow: var(--raised);
  border-radius: var(--radius-md);
  padding: 14px 22px;
  font-size: .88rem; font-weight:700;
  color: var(--text-main);
  opacity: 0; pointer-events:none;
  transition: opacity .3s ease, transform .3s ease;
  z-index: 300;
}
.reward-toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* ---------- Responsive ---------- */
@media (max-width: 980px){
  .hero{ grid-template-columns: 1fr; }
  .tut-grid{ grid-template-columns: repeat(2,1fr); }
  .challenge-grid{ grid-template-columns: repeat(2,1fr); }
  .profile-grid{ grid-template-columns: 1fr; }
  .arena-panel{ grid-template-columns: 1fr; }
  .vs-badge{ margin: 0 auto; }
  .plans-grid{ grid-template-columns: 1fr; }
}
@media (max-width: 720px){
  .nav-toggle{ display:flex; }
  .wallet-chip{ padding: 6px 10px; font-size: .74rem; }
  .main-nav{
    position: fixed; top:0; bottom:0; right:-100%;
    width: 78%; max-width: 320px;
    height: 100vh;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 100px 26px 28px;
    box-shadow: -14px 0 30px rgba(40,46,64,.18);
    transition: right .35s ease;
    z-index: 80;
  }
  .main-nav.open{ right:0; }
  .main-nav a{ width:100%; padding: 13px 18px; }
  .tut-grid{ grid-template-columns: 1fr; }
  .challenge-grid{ grid-template-columns: 1fr; }
  .badge-grid{ grid-template-columns: repeat(2,1fr); }
  .plans-grid{ grid-template-columns: 1fr; }
  .field-row{ grid-template-columns: 1fr; }
}

/* ---------- Page transition ---------- */
body{
  animation: pageFadeIn .45s ease both;
}
body.page-exit{
  animation: pageFadeOut .32s ease forwards;
}
@keyframes pageFadeIn{
  from{ opacity:0; transform: translateY(10px); }
  to{ opacity:1; transform: translateY(0); }
}
@keyframes pageFadeOut{
  to{ opacity:0; transform: translateY(-10px); }
}
/* ==================== BATTLE RESPONSIVE ==================== */
@media (max-width: 720px) {
  .battle-card {
    padding: 18px;
  }
  
  .arena-panel {
    grid-template-columns: 1fr;
    gap: 16px;
    text-align: center;
  }
  
  .vs-badge {
    margin: 10px auto;
  }
  
  .battle-controls {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }
  
  .battle-frame {
    aspect-ratio: 16/11;
  }
  
  .prompt-textarea {
    min-height: 120px;
    font-size: 0.95rem;
  }
  
  .opponent-status {
    font-size: 0.8rem;
    padding: 10px 14px;
  }
}
/* ===========================================================
   AI Arena — استایل اصلی (Neomorphism) + Responsive Strong
=========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&family=Lalezar&display=swap');

:root{
  --bg: #e9edf3;
  --bg-deep: #dfe4ec;
  --text-main: #3a4458;
  --text-soft: #6b7588;
  --accent: #6c5ce7;
  --accent-2: #00b894;
  --accent-soft: #a29bfe;
  --gold: #c9a14a;
  --danger: #e0566b;

  --shadow-dark: #c2c8d4;
  --shadow-light: #ffffff;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --raised: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
  --raised-sm: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
  --pressed: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light);
  --pressed-sm: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

* { box-sizing: border-box; margin:0; padding:0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Vazirmatn', sans-serif;
  background: var(--bg);
  color: var(--text-main);
  direction: rtl;
  min-height: 100vh;
  line-height: 1.8;
  font-size: 16px;
}

::selection { background: var(--accent-soft); color:#fff; }

/* ==================== LAYOUT ==================== */
.page-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

@media (max-width: 480px) {
  .page-wrap { padding: 0 12px 60px; }
}

/* Neumorphic Components */
.neo-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--raised);
  padding: 24px;
}

@media (max-width: 480px) {
  .neo-card { padding: 18px; border-radius: 20px; }
}

.neo-btn {
  background: var(--bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--raised-sm);
  padding: 12px 24px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
}

.neo-btn:active { box-shadow: var(--pressed-sm); transform: scale(0.96); }

.neo-btn.primary, .neo-btn.gold {
  color: white;
}

/* Header */
.site-header {
  position: sticky; top:0; z-index: 50;
  background: var(--bg);
  padding: 16px 20px;
  box-shadow: 0 6px 18px rgba(166,176,196,.35);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

@media (max-width: 720px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
}

/* ==================== BATTLE PAGE - SUPER RESPONSIVE ==================== */
.battle-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px;
}

.battle-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: var(--radius-md);
  background: var(--bg);
  box-shadow: var(--pressed);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.battle-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.battle-frame img.show { opacity: 1; }

.battle-placeholder,
.battle-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-soft);
  text-align: center;
}

.battle-placeholder .ph-icon { font-size: 3rem; }

.battle-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.battle-timer {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

@media (max-width: 640px) {
  .battle-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .battle-frame {
    aspect-ratio: 4/3;
  }
  
  .arena-panel {
    grid-template-columns: 1fr;
    gap: 16px;
    text-align: center;
  }
  
  .prompt-textarea {
    min-height: 140px;
    font-size: 1rem;
  }
  
  .opponent-status {
    padding: 12px;
    font-size: 0.85rem;
  }
}

/* ==================== OTHER PAGES RESPONSIVE ==================== */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .tut-grid, .challenge-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-grid { grid-template-columns: 1fr; }
  .plans-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .tut-grid, .challenge-grid { grid-template-columns: 1fr; }
  .badge-grid { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
  
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .neo-card { padding: 20px 16px; }
}

/* Mobile Nav */
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed;
    top: 0; bottom: 0; right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: var(--bg);
    flex-direction: column;
    padding: 100px 20px 40px;
    box-shadow: -10px 0 30px rgba(0,0,0,0.2);
    transition: right 0.35s ease;
    z-index: 80;
  }
  .main-nav.open { right: 0; }
}

/* Final Touches */
body { animation: pageFadeIn 0.45s ease both; }

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===========================================================
   AI Arena — استایل اصلی (Neomorphism)
   پالت: پس‌زمینه روشن نرم با سایه‌های فرورفته/برجسته
=========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&family=Lalezar&display=swap');

:root{
  --bg: #e9edf3;
  --bg-deep: #dfe4ec;
  --text-main: #3a4458;
  --text-soft: #6b7588;
  --accent: #6c5ce7;
  --accent-2: #00b894;
  --accent-soft: #a29bfe;
  --gold: #c9a14a;
  --danger: #e0566b;

  --shadow-dark: #c2c8d4;
  --shadow-light: #ffffff;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --raised: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
  --raised-sm: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
  --pressed: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light);
  --pressed-sm: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
  --flat: 0 0 0 rgba(0,0,0,0);
}

*{ box-sizing: border-box; margin:0; padding:0; }

html{ scroll-behavior: smooth; }

body{
  font-family: 'Vazirmatn', sans-serif;
  background: var(--bg);
  color: var(--text-main);
  direction: rtl;
  min-height: 100vh;
  line-height: 1.8;
}

::selection{ background: var(--accent-soft); color:#fff; }

.font-display{
  font-family: 'Lalezar', 'Vazirmatn', sans-serif;
  letter-spacing: .5px;
}

a{ color: inherit; text-decoration:none; }
img{ max-width:100%; display:block; }
ul{ list-style:none; }
button{ font-family: inherit; cursor:pointer; border:none; background:none; color:inherit; }

/* ---------- Layout shell ---------- */
.page-wrap{
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px 80px;
}

/* ---------- Neumorphic base components ---------- */
.neo-card{
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--raised);
  padding: 28px;
}

.neo-card-sm{
  background: var(--bg);
  border-radius: var(--radius-md);
  box-shadow: var(--raised-sm);
  padding: 18px;
}

.neo-inset{
  background: var(--bg);
  border-radius: var(--radius-md);
  box-shadow: var(--pressed);
}

.neo-btn{
  background: var(--bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--raised-sm);
  padding: 12px 26px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  transition: box-shadow .18s ease, transform .18s ease, color .18s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.neo-btn:hover{ color: var(--accent); }
.neo-btn:active{ box-shadow: var(--pressed-sm); transform: scale(.98); }

.neo-btn.primary{
  color: #fff;
  background: linear-gradient(145deg, var(--accent), #8073f0);
  box-shadow: 6px 6px 14px var(--shadow-dark), -6px -6px 14px var(--shadow-light), 0 0 0 1px rgba(255,255,255,.04) inset;
}
.neo-btn.primary:hover{ color:#fff; filter: brightness(1.05); }
.neo-btn.primary:active{ box-shadow: var(--pressed-sm); }

.neo-btn.gold{
  color: #ffffff;
  background: linear-gradient(145deg, #d8b35f, var(--gold));
}

.neo-icon-btn{
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--raised-sm);
  display:flex; align-items:center; justify-content:center;
  transition: box-shadow .18s ease, transform .18s ease;
}
.neo-icon-btn:hover{ transform: translateY(-2px); }
.neo-icon-btn:active{ box-shadow: var(--pressed-sm); }

.pill{
  display:inline-flex; align-items:center; gap:6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--pressed-sm);
  font-size: .78rem;
  color: var(--text-soft);
  font-weight: 600;
}

.eyebrow{
  font-size: .8rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .5px;
  display:flex; align-items:center; gap:8px;
  margin-bottom: 10px;
}
.eyebrow::before{
  content:"";
  width: 18px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- Header / Nav ---------- */
.site-header{
  position: sticky; top:0; z-index: 50;
  background: var(--bg);
  padding: 18px 28px;
  box-shadow: 0 6px 18px rgba(166,176,196,.35);
}
.header-inner{
  max-width: 1240px; margin:0 auto;
  display:flex; align-items:center; justify-content:space-between;
  gap: 20px;
}
.brand{
  display:flex; align-items:center; gap:12px;
}
.brand-mark{
  width: 48px; height: 48px;
  border-radius: 16px;
  background: var(--bg);
  box-shadow: var(--raised-sm);
  display:flex; align-items:center; justify-content:center;
  color: var(--accent);
  font-size: 1.4rem;
  font-family: 'Lalezar', sans-serif;
}
.brand-text h1{
  font-family: 'Lalezar', sans-serif;
  font-size: 1.35rem;
  color: var(--text-main);
}
.brand-text span{
  font-size: .72rem;
  color: var(--text-soft);
  letter-spacing: .5px;
}

.main-nav{ display:flex; align-items:center; gap: 6px; }
.main-nav a{
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .92rem;
  color: var(--text-soft);
  transition: box-shadow .18s ease, color .18s ease;
}
.main-nav a:hover{ color: var(--accent); }
.main-nav a.active{
  color: var(--accent);
  box-shadow: var(--pressed-sm);
}

.header-actions{ display:flex; align-items:center; gap:12px; }

.nav-toggle{
  display:none;
  width:46px; height:46px;
  border-radius:14px;
  background: var(--bg);
  box-shadow: var(--raised-sm);
  align-items:center; justify-content:center;
  flex-direction:column; gap:5px;
  flex-shrink:0;
}
.nav-toggle span{
  width:20px; height:2px;
  background: var(--text-main);
  border-radius:2px;
  transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle.active{ box-shadow: var(--pressed-sm); }
.nav-toggle.active span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2){ opacity:0; }
.nav-toggle.active span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

.nav-overlay{
  position: fixed; inset:0;
  background: rgba(40,46,64,.35);
  opacity:0; pointer-events:none;
  transition: opacity .3s ease;
  z-index: 70;
}
.nav-overlay.open{ opacity:1; pointer-events:auto; }

/* ---------- Hero ---------- */
.hero{
  padding: 64px 0 40px;
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items:center;
}
.hero-title{
  font-family: 'Lalezar', sans-serif;
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 1.4;
  color: var(--text-main);
  margin-bottom: 18px;
}
.hero-title em{
  font-style: normal;
  color: var(--accent);
}
.hero-desc{
  color: var(--text-soft);
  font-size: 1.02rem;
  max-width: 50ch;
  margin-bottom: 28px;
}
.hero-actions{ display:flex; gap:14px; flex-wrap:wrap; }

.hero-visual{
  position:relative;
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--raised);
  display:flex; align-items:center; justify-content:center;
}
.hero-visual::before{
  content:"";
  position:absolute; inset: 14%;
  border-radius:50%;
  box-shadow: var(--pressed);
}
.hero-visual .calligraphy{
  position:relative; z-index:2;
  font-family: 'Lalezar', sans-serif;
  font-size: 3.4rem;
  color: var(--accent);
  text-shadow: 2px 2px 4px var(--shadow-dark), -2px -2px 4px var(--shadow-light);
}
.hero-stat{
  position:absolute;
  background: var(--bg);
  box-shadow: var(--raised-sm);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-main);
  display:flex; flex-direction:column; align-items:center;
}
.hero-stat span{ color: var(--text-soft); font-weight:500; font-size:.68rem; }
.hero-stat.s1{ top: 6%; right: 4%; }
.hero-stat.s2{ bottom: 8%; left: 2%; }
.hero-stat.s3{ top: 42%; right: -6%; }

/* ---------- Section heading ---------- */
.section{ padding: 56px 0; }
.section-head{
  display:flex; align-items:flex-end; justify-content:space-between;
  margin-bottom: 30px; gap: 20px; flex-wrap: wrap;
}
.section-title{
  font-family:'Lalezar', sans-serif;
  font-size: 1.8rem;
  color: var(--text-main);
}
.section-sub{ color: var(--text-soft); font-size:.92rem; max-width: 60ch; }

/* ---------- Tutorials ---------- */
.tut-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.tut-card{
  position:relative;
  display:flex; flex-direction:column; gap:14px;
}
.tut-icon{
  width: 54px; height:54px;
  border-radius: 16px;
  background: var(--bg);
  box-shadow: var(--pressed-sm);
  display:flex; align-items:center; justify-content:center;
  color: var(--accent);
  font-size: 1.4rem;
}
.tut-card h3{ font-size: 1.08rem; color: var(--text-main); }
.tut-card p{ color: var(--text-soft); font-size: .88rem; }
.tut-meta{
  display:flex; align-items:center; justify-content:space-between;
  margin-top: 6px;
  font-size: .78rem;
  color: var(--text-soft);
}
.progress-track{
  height: 10px; border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--pressed-sm);
  overflow:hidden;
}
.progress-fill{
  height:100%; border-radius:999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
}
.lock-badge{
  position:absolute; top:18px; left:18px;
  width: 30px; height:30px; border-radius:50%;
  background: var(--bg); box-shadow: var(--raised-sm);
  display:flex; align-items:center; justify-content:center;
  color: var(--gold); font-size: .85rem;
}

/* ---------- Arena ---------- */
.arena-panel{
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 22px;
  align-items:center;
}
.fighter{
  text-align:center;
  padding: 26px 18px;
}
.fighter-avatar{
  width: 84px; height:84px; margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--raised-sm);
  display:flex; align-items:center; justify-content:center;
  font-family:'Lalezar', sans-serif;
  font-size: 1.6rem;
  color: var(--accent);
}
.fighter.you .fighter-avatar{ color: var(--accent-2); }
.fighter h4{ margin-bottom: 4px; }
.fighter .rank{ font-size:.78rem; color: var(--text-soft); }

.vs-badge{
  width: 64px; height:64px; border-radius:50%;
  background: var(--bg);
  box-shadow: var(--pressed);
  display:flex; align-items:center; justify-content:center;
  font-family:'Lalezar', sans-serif;
  font-size: 1.1rem;
  color: var(--danger);
}

.arena-prompt-box{
  margin-top: 26px;
}
.prompt-textarea{
  width:100%;
  min-height: 96px;
  border:none; outline:none;
  resize: vertical;
  background: var(--bg);
  border-radius: var(--radius-md);
  box-shadow: var(--pressed);
  padding: 16px 18px;
  font-family: inherit;
  font-size: .92rem;
  color: var(--text-main);
}
.prompt-textarea::placeholder{ color: var(--text-soft); }

.arena-footer{
  display:flex; align-items:center; justify-content:space-between;
  margin-top: 18px; flex-wrap:wrap; gap:14px;
}
.timer{
  display:flex; align-items:center; gap:10px;
  font-weight:700; color: var(--text-main);
}
.timer-ring{
  width: 38px; height:38px; border-radius:50%;
  background: var(--bg); box-shadow: var(--raised-sm);
  display:flex; align-items:center; justify-content:center;
  font-size:.78rem; color: var(--accent);
}

.leaderboard-list{ display:flex; flex-direction:column; gap:12px; margin-top: 18px;}
.lb-row{
  display:flex; align-items:center; gap:14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-shadow: var(--raised-sm);
}
.lb-rank{
  width:30px; height:30px; border-radius:50%;
  background: var(--bg); box-shadow: var(--pressed-sm);
  display:flex; align-items:center; justify-content:center;
  font-size:.8rem; font-weight:700; color: var(--text-soft);
}
.lb-rank.gold{ color: var(--gold); }
.lb-name{ flex:1; font-weight:600; font-size:.92rem; }
.lb-score{ font-size:.82rem; color: var(--text-soft); font-weight:700;}

/* ---------- Profile ---------- */
.profile-grid{
  display:grid;
  grid-template-columns: .9fr 1.4fr;
  gap: 26px;
}
.profile-card{ text-align:center; position:relative; }
.profile-avatar{
  width: 110px; height:110px; margin: 0 auto 16px;
  border-radius:50%;
  background: var(--bg);
  box-shadow: var(--raised);
  display:flex; align-items:center; justify-content:center;
  font-family:'Lalezar', sans-serif; font-size:2.1rem;
  color: var(--accent);
}
.profile-card h3{ margin-bottom:4px; }
.profile-card .handle{ color: var(--text-soft); font-size:.85rem; margin-bottom: 16px;}
.premium-chip{
  display:inline-flex; align-items:center; gap:6px;
  padding: 6px 16px; border-radius:999px;
  background: linear-gradient(145deg,#d8b35f,var(--gold));
  color:#fff; font-size:.76rem; font-weight:700;
  box-shadow: var(--raised-sm);
  margin-bottom: 16px;
}
.stat-row{
  display:flex; justify-content:space-between; gap:10px;
  margin-top: 20px;
}
.stat-box{
  flex:1; text-align:center;
  padding: 14px 8px;
  border-radius: var(--radius-sm);
  box-shadow: var(--pressed-sm);
}
.stat-box b{ display:block; font-size:1.05rem; color: var(--text-main); }
.stat-box span{ font-size:.72rem; color: var(--text-soft); }

.profile-side{ display:flex; flex-direction:column; gap:22px; }
.badge-grid{
  display:grid; grid-template-columns: repeat(4,1fr); gap:16px;
}
.badge-item{
  text-align:center; padding: 16px 8px;
}
.badge-icon{
  width:50px;height:50px;margin:0 auto 8px;
  border-radius:14px; background:var(--bg);
  box-shadow: var(--raised-sm);
  display:flex; align-items:center; justify-content:center;
  font-size:1.2rem; color: var(--accent-2);
}
.badge-item span{ font-size:.74rem; color: var(--text-soft);}

.upgrade-banner{
  display:flex; align-items:center; justify-content:space-between;
  gap: 20px; flex-wrap:wrap;
  background: linear-gradient(135deg, #efe3c8, var(--bg) 60%);
}
.upgrade-banner h3{ font-family:'Lalezar', sans-serif; color:#9c7a2c; font-size:1.3rem; margin-bottom:6px;}
.upgrade-banner p{ color: var(--text-soft); font-size:.88rem; max-width:42ch;}

/* ---------- Modal ---------- */
.modal-overlay{
  position: fixed; inset:0;
  background: rgba(58,68,88,.42);
  backdrop-filter: blur(3px);
  display:flex; align-items:center; justify-content:center;
  z-index: 200;
  opacity:0; pointer-events:none;
  transition: opacity .25s ease;
  padding: 20px;
}
.modal-overlay.open{ opacity:1; pointer-events:auto; }

.modal-box{
  width: 100%; max-width: 720px;
  max-height: 88vh; overflow-y:auto;
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: 0px 0px 15px 7px rgba(255,255,255,0.8);
  padding: 32px;
  transform: translateY(18px) scale(.97);
  transition: transform .28s ease;
}
.modal-overlay.open .modal-box{ transform: translateY(0) scale(1); }

.modal-head{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom: 20px;
}
.modal-head h2{ font-family:'Lalezar', sans-serif; font-size:1.5rem; color: var(--text-main);}
.modal-close{
  width:38px;height:38px;border-radius:50%;
  background:var(--bg); box-shadow: var(--raised-sm);
  display:flex; align-items:center; justify-content:center;
}
.modal-close:active{ box-shadow: var(--pressed-sm); }

.plans-grid{
  display:grid; grid-template-columns: repeat(3, 1fr); gap:16px;
  margin-bottom: 22px;
}
.plan-card{
  padding: 22px; border-radius: var(--radius-md);
  box-shadow: var(--raised-sm);
  cursor:pointer;
  border: 2px solid transparent;
  border-top: 4px solid var(--accent-soft);
  transition: box-shadow .18s ease, border-color .18s ease;
  position:relative;
}
.plan-card[data-plan="basic"]{ border-top-color: #16a085; }
.plan-card[data-plan="pro"]{ border-top-color: #d8b35f; }
.plan-card[data-plan="elite"]{ border-top-color: #8e44ad; }
.plan-card[data-plan="basic"] .plan-price{ color: #16a085; }
.plan-card[data-plan="elite"] .plan-price{ color: #8e44ad; }
.plan-card.selected{
  border-color: var(--accent);
  box-shadow: var(--pressed-sm);
}
.plan-card .tag{
  position:absolute; top:-10px; right:18px;
  background: var(--gold); color:#fff;
  font-size:.7rem; padding:3px 10px; border-radius:999px;
  font-weight:700;
}
.plan-price{ font-family:'Lalezar', sans-serif; font-size:1.7rem; color: var(--accent); margin:8px 0;}
.plan-price span{ font-size:.85rem; color: var(--text-soft); font-family:'Vazirmatn',sans-serif; }
.plan-card ul{ margin-top:12px; display:flex; flex-direction:column; gap:8px; }
.plan-card li{ font-size:.84rem; color: var(--text-soft); display:flex; gap:8px; align-items:flex-start;}
.plan-card li::before{ content:"✓"; color: var(--accent-2); font-weight:700; }

.pay-form{ display:none; flex-direction:column; gap:14px; }
.pay-form.show{ display:flex; }
.field{ display:flex; flex-direction:column; gap:6px; }
.field label{ font-size:.82rem; color: var(--text-soft); font-weight:600; }
.field input{
  border:none; outline:none;
  background: var(--bg);
  box-shadow: var(--pressed-sm);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-family:'Vazirmatn',sans-serif;
  font-size:.92rem; color: var(--text-main);
  direction: ltr;
  text-align: right;
}
.field-row{ display:grid; grid-template-columns: 1fr 1fr; gap:14px; }
.pay-total{
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 18px; border-radius: var(--radius-sm);
  box-shadow: var(--pressed-sm);
  font-weight:700;
}
.pay-total b{ color: var(--accent); font-family:'Lalezar', sans-serif; font-size:1.2rem;}
.pay-note{ font-size:.74rem; color: var(--text-soft); display:flex; gap:6px; align-items:center; }

.modal-step-actions{ display:flex; gap:12px; margin-top:8px; }
.modal-step-actions .neo-btn{ flex:1; justify-content:center; }

.processing-state{
  display:none; flex-direction:column; align-items:center; gap:18px;
  padding: 30px 10px; text-align:center;
}
.processing-state.show{ display:flex; }
.spinner{
  width:64px;height:64px;border-radius:50%;
  box-shadow: var(--pressed);
  position:relative;
}
.spinner::after{
  content:"";
  position:absolute; inset:8px; border-radius:50%;
  border: 4px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent-soft);
  animation: spin 0.9s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.site-footer{
  text-align:center; padding: 30px 0 50px;
  color: var(--text-soft); font-size:.82rem;
}

/* ---------- Arena matchmaking (idle / searching / found) ---------- */
.arena-stage{ position:relative; }
.arena-state{ display:none; }
.arena-stage[data-state="idle"] .state-idle{ display:flex; }
.arena-stage[data-state="searching"] .state-searching{ display:flex; }
.arena-stage[data-state="found"] .state-found{ display:block; animation: foundReveal .4s ease both; }

@keyframes foundReveal{
  from{ opacity:0; transform: translateY(10px); }
  to{ opacity:1; transform: translateY(0); }
}

.state-idle, .state-searching{
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 48px 20px;
}
.idle-icon{
  width: 76px; height:76px; border-radius:50%;
  background: var(--bg);
  box-shadow: var(--raised);
  display:flex; align-items:center; justify-content:center;
  font-size: 1.9rem;
  margin-bottom: 6px;
}
.idle-title{ font-size: 1.15rem; color: var(--text-main); }
.idle-desc{ color: var(--text-soft); font-size: .9rem; max-width: 42ch; margin-bottom: 6px; }
.find-btn{ margin-top: 8px; }
.cancel-btn{ margin-top: 8px; color: var(--danger); }

.radar{
  position: relative;
  width: 120px; height:120px;
  display:flex; align-items:center; justify-content:center;
  margin-bottom: 4px;
}
.radar-core{
  position: relative; z-index: 2;
  width: 56px; height:56px; border-radius:50%;
  background: var(--bg);
  box-shadow: var(--raised-sm);
  display:flex; align-items:center; justify-content:center;
  font-size: 1.3rem;
}
.radar-ring{
  position:absolute; inset:0;
  border-radius:50%;
  border: 2px solid var(--accent-soft);
  opacity:0;
  animation: radarPulse 2.4s ease-out infinite;
}
.radar-ring:nth-child(2){ animation-delay: .8s; }
.radar-ring:nth-child(3){ animation-delay: 1.6s; }
@keyframes radarPulse{
  0%{ transform: scale(.4); opacity:.7; }
  100%{ transform: scale(1.6); opacity:0; }
}


/* ---------- Responsive ---------- */
@media (max-width: 980px){
  .hero{ grid-template-columns: 1fr; }
  .tut-grid{ grid-template-columns: repeat(2,1fr); }
  .profile-grid{ grid-template-columns: 1fr; }
  .arena-panel{ grid-template-columns: 1fr; }
  .vs-badge{ margin: 0 auto; }
  .plans-grid{ grid-template-columns: 1fr; }
}
@media (max-width: 720px){
  .nav-toggle{ display:flex; }
  .main-nav{
    position: fixed; top:0; bottom:0; right:-100%;
    width: 78%; max-width: 320px;
    height: 100vh;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 100px 26px 28px;
    box-shadow: -14px 0 30px rgba(40,46,64,.18);
    transition: right .35s ease;
    z-index: 80;
  }
  .main-nav.open{ right:0; }
  .main-nav a{ width:100%; padding: 13px 18px; }
  .tut-grid{ grid-template-columns: 1fr; }
  .badge-grid{ grid-template-columns: repeat(2,1fr); }
  .plans-grid{ grid-template-columns: 1fr; }
  .field-row{ grid-template-columns: 1fr; }
}

/* ---------- Page transition ---------- */
body{
  animation: pageFadeIn .45s ease both;
}
body.page-exit{
  animation: pageFadeOut .32s ease forwards;
}
@keyframes pageFadeIn{
  from{ opacity:0; transform: translateY(10px); }
  to{ opacity:1; transform: translateY(0); }
}
@keyframes pageFadeOut{
  to{ opacity:0; transform: translateY(-10px); }
}

/* ==================== PERFECT FOOTER ==================== */
.site-footer {
  background: var(--bg-deep);
  padding: 70px 20px 40px;
  margin-top: 80px;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
}

.footer-main {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 40px;
  margin-bottom: 50px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--bg);
  box-shadow: var(--raised);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--accent);
  flex-shrink: 0;
}

.brand-info h3 {
  font-family: 'Lalezar', sans-serif;
  font-size: 1.55rem;
  margin-bottom: 4px;
}

.footer-columns {
  display: flex;
  gap: 60px;
  flex-wrap: wrap;
}

.footer-col h4 {
  font-size: 0.95rem;
  margin-bottom: 16px;
  color: var(--text-main);
  font-weight: 700;
}

.footer-col a {
  display: block;
  padding: 7px 0;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.92rem;
}

.footer-col a:hover {
  color: var(--accent);
}

.maker {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.maker-sub {
  color: var(--text-soft);
  font-size: 0.85rem;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 30px;
  border-top: 1px solid rgba(0,0,0,0.08);
  font-size: 0.85rem;
  color: var(--text-soft);
  flex-wrap: wrap;
  gap: 12px;
}

.made-with strong {
  color: var(--accent);
}

/* Mobile */
@media (max-width: 768px) {
  .footer-main {
    flex-direction: column;
    text-align: center;
    gap: 40px;
  }
  
  .footer-columns {
    justify-content: center;
    gap: 40px;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
/* ==================== IMPROVED HEADER (Mobile Friendly) ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  padding: 14px 20px;
  box-shadow: 0 4px 16px rgba(166,176,196,0.25);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--bg);
  box-shadow: var(--raised-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent);
  font-family: 'Lalezar', sans-serif;
}

.brand-text h1 {
  font-family: 'Lalezar', sans-serif;
  font-size: 1.35rem;
  line-height: 1.1;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--text-soft);
  display: block;
}

/* Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav a {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-soft);
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--accent);
  box-shadow: var(--pressed-sm);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wallet-mini {
  font-size: 0.82rem;
}

/* Mobile Menu */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--raised-sm);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(40,46,64,0.6);
  opacity: 0;
  pointer-events: none;
  z-index: 90;
  transition: opacity 0.3s ease;
}

.nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ==================== MOBILE STYLES ==================== */
@media (max-width: 768px) {
  .main-nav {
    display: none;
  }
  
  .nav-toggle {
    display: flex;
  }

  .header-inner {
    padding: 8px 0;
  }

  .brand-text h1 {
    font-size: 1.25rem;
  }

  .header-actions {
    gap: 8px;
  }

  .neo-btn {
    padding: 10px 8px;;
    font-size: 0.9rem;
  }
}