:root {
  color-scheme: dark;
  --bg: #090d16;
  --panel: #111827;
  --panel-2: #151b28;
  --line: rgba(255,255,255,.08);
  --text: #f8fafc;
  --muted: #8b98ad;
  --purple: #7c3aed;
  --blue: #1d4ed8;
  --green: #16a34a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, #151b32 0, #080b12 42%);
  font-family: Tahoma, Arial, sans-serif;
  color: var(--text);
}

.phone-shell {
  width: min(430px, 100vw);
  height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.topbar, .bottom-nav, .hero-footer, .category-row, .quick-grid {
  display: flex;
  align-items: center;
}

.topbar { justify-content: space-between; margin-bottom: 18px; padding: 18px 16px 0; flex-shrink: 0; }
.topbar strong span { color: #8b5cf6; }
.icon-btn {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 14px;
  background: #101622;
  color: var(--text);
}
button,
a,
select,
input[type="file"],
[data-open],
[data-lang],
[data-region],
[data-pkg] {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
}

.screen { display: none; animation: fade .2s ease; }
.screen.active {
  display: block;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px 16px;
}
@keyframes fade { from { opacity: .5; transform: translateY(4px); } }

.hero-card, .wallet-card, .profile-card, .big-tile, .list button, .menu-list button, .category, .flow-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  transition: all .2s ease-in-out;
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
  scroll-margin-top: 16px;
}
.hero-card:hover,
.wallet-card:hover,
.profile-card:hover,
.big-tile:hover,
.list button:hover,
.menu-list button:hover,
.category:hover,
.flow-card:hover {
  transform: scale(1.02);
  box-shadow: 0 16px 38px rgba(0,0,0,.18);
}

.hero-card {
  min-height: 112px;
  padding: 18px;
  margin-bottom: 14px;
  position: relative;
}
.hero-card p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.hero-card h1, .hero-card h2 { margin: 0; }
.purple { background: linear-gradient(135deg, rgba(124,58,237,.72), rgba(17,24,39,.95)); }
.green { background: linear-gradient(135deg, rgba(22,163,74,.72), rgba(17,24,39,.95)); }
.blue { background: linear-gradient(135deg, rgba(29,78,216,.65), rgba(17,24,39,.95)); }
.crown { position: absolute; left: 18px; top: 20px; font-size: 42px; opacity: .9; }
.hero-footer { justify-content: space-between; margin-top: 18px; font-size: 13px; }

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.quick-grid button, .menu-list button, .list button {
  min-height: 54px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel-2);
  border-radius: 16px;
  font-weight: 800;
}

h2 { margin: 8px 0 18px; font-size: 20px; }
h3 { margin: 22px 0 12px; font-size: 15px; color: var(--muted); }
.category-row { gap: 10px; margin-bottom: 16px; }
.category {
  flex: 1;
  color: var(--text);
  padding: 16px 10px;
}
.category.active { background: linear-gradient(135deg, #4c1d95, #1f1b47); }
[data-lang].active, [data-region].active, [data-currency].active {
  border: 2px solid #8b5cf6;
  color: #a78bfa;
  font-weight: 700;
}
.list, .menu-list { display: grid; gap: 16px; }
.list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.menu-list { grid-template-columns: 1fr; }
.list button, .menu-list button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  text-align: right;
  min-width: 0;
  gap: 10px;
}
.list button {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
}
.item-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  background: rgba(124,58,237,.18);
  color: #c4b5fd;
  font-size: 17px;
}
.item-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.item-copy span,
.item-copy small {
  overflow-wrap: anywhere;
}
.flow-card { padding: 16px; margin-top: 14px; }
.flow-card h4 { margin: 0 0 12px; font-size: 16px; }
.flow-card .option {
  width: 100%;
  margin-bottom: 10px;
  min-height: 54px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-radius: 16px;
  padding: 12px 14px;
}
.flow-card .option:hover { border-color: rgba(124,58,237,.55); }
.flow-card .summary { display: grid; gap: 10px; color: var(--muted); margin-bottom: 12px; }
.flow-card .summary,
.profile-flow-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-2);
  padding: 12px;
}
.flow-card .summary strong { color: var(--text); }
.flow-card label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 12px 0 8px;
}
.flow-card input,
.flow-card select,
.flow-card textarea {
  width: 100%;
  min-height: 48px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}
.flow-card textarea { resize: vertical; }
.flow-card .primary-action { width: 100%; background: linear-gradient(135deg, #7c3aed, #2563eb); }
.flow-card .danger-note { color: #fda4af; font-size: 13px; margin-top: 8px; }
.big-tile { padding: 22px; margin-bottom: 12px; font-weight: 900; }
.wallet-card { padding: 24px; margin-bottom: 14px; background: linear-gradient(135deg, #116b35, #102018); }
.wallet-card span { display: block; color: #b7f7c8; margin-bottom: 8px; }
.wallet-card strong { font-size: 30px; }
.profile-card { padding: 24px; display: grid; place-items: center; gap: 8px; margin-bottom: 14px; }
.avatar { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, #f59e0b, #60a5fa); display: grid; place-items: center; font-size: 30px; }
.profile-card span, .profile-card small { color: var(--muted); }

.bottom-nav {
  flex-shrink: 0;
  height: 76px;
  background: rgba(10,15,25,.96);
  border-top: 1px solid var(--line);
  justify-content: space-around;
}
.bottom-nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  gap: 4px;
  font-size: 18px;
}
.bottom-nav button span { font-size: 11px; }
.bottom-nav button.active { color: #8b5cf6; }

/* آیکون‌های اختصاصی پلیر */
.player-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}
.list button .item-icon.player-icon { font-size: 15px; }

/* لینک‌های دانلود */
.download-links { display: grid; gap: 8px; margin-top: 12px; }
.dl-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: border-color .2s;
}
.dl-btn:hover { border-color: rgba(124,58,237,.5); }
.dl-btn .dl-icon { font-size: 22px; flex-shrink: 0; }
.dl-btn .dl-info { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.dl-btn .dl-info small { color: var(--muted); font-size: 11px; }
.dl-section-title { font-size: 13px; color: var(--muted); margin: 14px 0 8px; }

/* ══ SHOP — دسته‌بندی اصلی ══ */
.shop-cat-tabs {
  display: flex; gap: 8px; margin: 14px 0 20px;
  overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
}
.shop-cat-tabs::-webkit-scrollbar { display: none; }
.shop-cat-tabs button {
  flex-shrink: 0; padding: 10px 18px; border-radius: 24px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font-weight: 800; font-size: 14px; white-space: nowrap;
}
.shop-cat-tabs button.active {
  background: linear-gradient(135deg, #4c1d95, #1e3a8a);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px rgba(124,58,237,.3);
}

/* ══ SHOP — هدر بخش ══ */
.shop-section-head { margin-bottom: 18px; }
.shop-section-head h2 { margin: 0 0 6px; font-size: 21px; font-weight: 900; }
.shop-section-head p  { margin: 0; color: var(--muted); font-size: 13px; }

/* ══ SHOP — فیلتر مدت ══ */
.duration-tabs {
  display: flex; gap: 8px; margin-bottom: 18px;
  overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
}
.duration-tabs::-webkit-scrollbar { display: none; }
.dur-tab {
  flex-shrink: 0; padding: 7px 16px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--panel-2);
  color: var(--text); font-size: 13px; font-weight: 700; white-space: nowrap;
}
.dur-tab.active {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  border-color: transparent; color: #fff;
  box-shadow: 0 3px 12px rgba(124,58,237,.3);
}

/* ══ SHOP — کارت سرور ══ */
.server-card {
  background: var(--panel);
  border: 1px solid rgba(124,58,237,.15);
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 14px;
  cursor: pointer;
  transition: border-color .25s, box-shadow .25s, transform .15s;
  overflow: hidden;
  position: relative;
}
.server-card::before {
  content: '';
  position: absolute; inset: 0; border-radius: 22px;
  background: linear-gradient(135deg, rgba(124,58,237,.04), rgba(37,99,235,.04));
  pointer-events: none;
}
.server-card:active { transform: scale(.99); }
.server-card:hover {
  border-color: rgba(124,58,237,.42);
  box-shadow: 0 0 32px rgba(124,58,237,.13);
}

.server-card-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
}
.server-logo {
  width: 84px; height: 84px; border-radius: 16px; flex-shrink: 0;
  overflow: hidden; display: grid; place-items: center;
  font-size: 13px; font-weight: 900; color: #fff; letter-spacing: .5px; text-align: center;
}
.server-logo img { width: 100%; height: 100%; object-fit: contain; }
.server-meta { flex: 1; min-width: 0; }
.server-name {
  font-size: 17px; font-weight: 900; margin: 0 0 8px; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.server-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 20px; font-size: 11px; font-weight: 800;
}
.badge-orange { background: rgba(249,115,22,.15); color: #fb923c; border: 1px solid rgba(249,115,22,.3); }
.badge-blue   { background: rgba(59,130,246,.15);  color: #60a5fa; border: 1px solid rgba(59,130,246,.3); }
.badge-purple { background: rgba(124,58,237,.15);  color: #a78bfa; border: 1px solid rgba(124,58,237,.3); }
.badge-green  { background: rgba(34,197,94,.15);   color: #4ade80; border: 1px solid rgba(34,197,94,.3);  }
.server-arrow { color: var(--muted); font-size: 24px; flex-shrink: 0; line-height: 1; }

.server-features {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 6px;
  border-top: 1px solid rgba(255,255,255,.07); padding-top: 14px;
}
.feat-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-align: center; padding: 8px 4px;
  background: rgba(255,255,255,.03); border-radius: 12px;
}
.feat-icon { font-size: 20px; line-height: 1; }
.feat-val  { font-size: 11px; font-weight: 800; color: var(--text); line-height: 1.3; }
.feat-lbl  { font-size: 9px; color: var(--muted); line-height: 1.2; }

/* ══ SERVER DETAIL ══ */
.detail-hero {
  background: linear-gradient(135deg, rgba(124,58,237,.18), rgba(37,99,235,.12));
  border: 1px solid rgba(124,58,237,.25);
  border-radius: 22px; padding: 20px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 16px;
}
.detail-logo {
  width: 72px; height: 72px; border-radius: 14px; flex-shrink: 0;
  overflow: hidden; display: grid; place-items: center;
  font-size: 18px; font-weight: 900; color: #fff;
}
.detail-logo img { width: 100%; height: 100%; object-fit: contain; }
.detail-info { flex: 1; }
.detail-name { font-size: 20px; font-weight: 900; margin: 0 0 6px; }
.detail-badge { font-size: 12px; }

.plans-title {
  font-size: 16px; font-weight: 800; margin: 0 0 14px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.plan-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px; margin-bottom: 10px; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.plan-card:hover, .plan-card.selected {
  border-color: rgba(124,58,237,.5);
  box-shadow: 0 0 18px rgba(124,58,237,.12);
}
.plan-card:active { transform: scale(.98); }
.plan-duration-badge {
  background: linear-gradient(135deg, #4c1d95, #1e3a8a);
  color: #fff; border-radius: 12px; padding: 8px 12px;
  font-size: 13px; font-weight: 900; flex-shrink: 0;
  min-width: 60px; text-align: center;
  box-shadow: 0 3px 10px rgba(76,29,149,.3);
}
.plan-info { flex: 1; }
.plan-label { font-size: 15px; font-weight: 800; margin: 0 0 4px; }
.plan-features { font-size: 12px; color: var(--muted); }
.plan-price {
  font-size: 17px; font-weight: 900; color: #a78bfa;
  flex-shrink: 0; text-align: left;
}
.plan-price small { font-size: 11px; color: var(--muted); display: block; font-weight: 400; }

.back-btn {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); background: transparent; border: none;
  font-size: 14px; padding: 8px 0 16px; cursor: pointer;
}
.back-btn:hover { color: var(--text); }

.pkg-features { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }

@media (min-width: 700px) {
  .phone-shell {
    width: min(920px, 100vw);
  }
  .quick-grid,
  .list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
