* { box-sizing: border-box; }

@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #08090d;
  --card: #14161e;
  --card-2: #1a1d28;
  --card-border: #262b3a;
  --text: #f2f3f7;
  --muted: #8e97ab;
  --accent: #7c6cff;
  --accent2: #ff5fa2;
  --accent3: #ffb020;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  font-family: "Vazirmatn", Tahoma, sans-serif;
}

html { scrollbar-color: #363c4d transparent; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #363c4d; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #464e63; }

body {
  margin: 0;
  background:
    radial-gradient(560px 420px at 12% -8%, rgba(124, 108, 255, 0.24), transparent 65%),
    radial-gradient(480px 380px at 100% 0%, rgba(255, 95, 162, 0.14), transparent 60%),
    radial-gradient(520px 460px at 85% 90%, rgba(255, 176, 32, 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  direction: rtl;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.1px;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 14px 118px;
  animation: app-fade-in 0.3s ease;
}

@keyframes app-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

h1, h2, h3 { margin: 0 0 14px; letter-spacing: 0.1px; }
h1 { font-size: 19px; font-weight: 700; }
h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

/* ==================== کارت‌ها ==================== */

.card {
  position: relative;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.03) inset,
    0 12px 28px rgba(0,0,0,0.35);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.row > * { flex: 1 1 150px; }

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

/* ==================== فرم‌ها ==================== */

input, select, textarea, button {
  font-family: inherit;
  font-size: 14px;
}

input, select, textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid #2c3140;
  background: #0d0f15;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder { color: #565f75; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 108, 255, 0.22);
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-left: 30px;
}

/* ==================== دکمه‌ها ==================== */

button {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--accent), #9a7bff);
  color: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(124, 108, 255, 0.32);
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

button:active { transform: scale(0.965); }
button:hover { filter: brightness(1.08); }

button.danger {
  background: linear-gradient(135deg, #e14b4b, #ff7a6b);
  box-shadow: 0 6px 18px rgba(225, 75, 75, 0.3);
}

button.secondary {
  background: #232735;
  box-shadow: none;
  border: 1px solid #2f3546;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
}

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row button { flex: 1 1 auto; }

.field { margin-bottom: 12px; }

.table-scroll { overflow-x: auto; }

table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  text-align: right;
  padding: 10px 10px;
  border-bottom: 1px solid #1f2330;
}

th { color: var(--muted); font-weight: 600; font-size: 12px; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

.badge.ok { background: rgba(99, 217, 140, 0.14); color: #63d98c; }
.badge.warn { background: rgba(224, 193, 92, 0.14); color: #e0c15c; }
.badge.err { background: rgba(224, 124, 124, 0.14); color: #e07c7c; }

.msg { margin-top: 10px; font-size: 13px; font-weight: 600; }
.msg.ok { color: #63d98c; }
.msg.err { color: #e07c7c; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  padding-top: env(safe-area-inset-top, 0px);
}

#welcome-title { margin-bottom: 3px; }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  background: var(--card-2);
  border: 1px solid var(--card-border);
  box-shadow: none;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  flex-shrink: 0;
}

.icon-btn:hover { border-color: #3a4054; filter: none; }

.muted { color: var(--muted); font-size: 13px; }
.small-note { margin: 0 0 16px; text-align: right; font-size: 12px; }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tabs button {
  background: var(--card-2);
  border: 1px solid var(--card-border);
  color: var(--muted);
  white-space: nowrap;
  box-shadow: none;
  font-weight: 600;
}

.tabs button.active {
  background: linear-gradient(135deg, var(--accent), #9a7bff);
  color: white;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(124, 108, 255, 0.3);
}

pre.result, .result-list pre {
  background: #0d0f15;
  border: 1px solid #1f2330;
  border-radius: var(--radius-sm);
  padding: 10px;
  max-height: 320px;
  overflow: auto;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

[hidden] { display: none !important; }

/* ==================== صفحه‌ی ورود ==================== */

#view-login {
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}

.login-card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 36px 28px;
  width: 100%;
  max-width: 340px;
  text-align: center;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 24px 60px rgba(0,0,0,0.5);
}

.login-card h2 { font-size: 18px; margin-bottom: 4px; }

.login-logo {
  font-size: 46px;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 18px rgba(255,140,60,0.55));
  animation: flicker 2.4s ease-in-out infinite;
}

@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.08) rotate(-3deg); }
}

.login-card .field { text-align: right; margin-top: 16px; }

#login-btn { width: 100%; margin-top: 18px; padding: 13px; font-size: 15px; }

/* ==================== موجودی/شارژ در هدر ==================== */

.header-wallet {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.header-wallet-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent3);
}

.header-wallet-label { font-size: 11.5px; }

.header-topup-btn {
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
  background: linear-gradient(135deg, #22c58b, #17a878);
  box-shadow: 0 4px 12px rgba(34, 197, 139, 0.3);
}

/* ==================== پاپ‌آپ شارژ سریع ==================== */

.quick-topup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
  animation: payexa-fade-in 0.18s ease;
}

.quick-topup-card {
  width: 100%;
  max-width: 340px;
  margin: 0;
  animation: payexa-pop-in 0.22s cubic-bezier(.34,1.4,.64,1);
}

/* ==================== کارت برجسته‌ی پلنِ نامحدود ==================== */

.plan-card {
  position: relative;
  overflow: hidden;
  padding: 0;
  background:
    radial-gradient(280px 160px at 100% 0%, rgba(255, 176, 32, 0.22), transparent 65%),
    linear-gradient(135deg, #2a2216, #201a2e);
  border: 1px solid #4a3a20;
}

.plan-card-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  background: none;
  box-shadow: none;
  border: none;
  cursor: pointer;
  text-align: right;
  flex-wrap: wrap;
}

.plan-card-header:hover { filter: none; opacity: 0.92; }
.plan-card-header:active { transform: none; }

.plan-card-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: #1a1408;
  background: linear-gradient(135deg, #ffd15c, #ffb020);
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(255, 176, 32, 0.35);
  flex-shrink: 0;
}

.plan-card-hint {
  flex: 1;
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  min-width: 0;
  animation: plan-hint-blink 1.8s ease-in-out infinite;
}

@keyframes plan-hint-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.plan-card-chevron {
  font-size: 18px;
  color: var(--muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.plan-card.expanded .plan-card-chevron { transform: rotate(90deg); }
.plan-card.expanded .plan-card-hint { animation: none; opacity: 0.85; }

#plan-card-body {
  padding: 0 18px 18px;
}

.plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.plan-info-title { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.plan-info-sub { font-size: 12.5px; color: var(--muted); }

.feature-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
  margin: -6px 0 14px;
}

.plan-card button {
  flex-shrink: 0;
  background: linear-gradient(135deg, #ffd15c, #ff9a4d);
  box-shadow: 0 6px 18px rgba(255, 176, 32, 0.32);
  color: #1a1408;
}

.plan-card button.secondary {
  background: #232735;
  color: var(--text);
  box-shadow: none;
  border: 1px solid #2f3546;
}

.plan-list { display: flex; flex-direction: column; gap: 10px; }

.plan-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.plan-list-item.active-plan {
  border-color: #ffb020;
  background: rgba(255, 176, 32, 0.08);
}

.plan-item-name {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.plan-item-active-badge {
  font-size: 10.5px;
  font-weight: 800;
  color: #1a1408;
  background: linear-gradient(135deg, #ffd15c, #ffb020);
  padding: 2px 8px;
  border-radius: 999px;
}

.plan-item-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.plan-item-price { font-size: 13px; font-weight: 800; color: var(--accent3); white-space: nowrap; }

/* ==================== آیکون‌های سکشن ==================== */

.section-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 16px;
  background: radial-gradient(circle, rgba(255,255,255,0.08), transparent 70%);
}

.boost-tagline {
  font-size: 11.5px;
  font-weight: 700;
  background: linear-gradient(135deg, #ff7a3d, #ff4d6d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-right: 4px;
}

.anim-fire { animation: flicker 2s ease-in-out infinite; }
.anim-pulse { animation: softPulse 2.2s ease-in-out infinite; }
.anim-glow { animation: softPulse 2.6s ease-in-out infinite; }

@keyframes softPulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.12); }
}

.c-purple { background: radial-gradient(circle, rgba(180,110,255,0.35), transparent 70%); }
.c-blue   { background: radial-gradient(circle, rgba(90,160,255,0.35), transparent 70%); }
.c-pink   { background: radial-gradient(circle, rgba(255,110,170,0.35), transparent 70%); }
.c-gold   { background: radial-gradient(circle, rgba(255,200,90,0.35), transparent 70%); }

/* ==================== نوار پایین موبایل (شناور) ==================== */

.bottom-nav {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  max-width: 696px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  background: rgba(20, 22, 30, 0.78);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 22px;
  padding: 8px 6px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
  z-index: 50;
}

.bn-item {
  background: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 6px;
  border-radius: 12px;
  color: var(--muted);
  flex: 1;
  font-weight: 600;
}

.bn-item:active { transform: none; }
.bn-item.active { color: var(--text); }

.bn-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  opacity: 0.5;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.bn-item.active .bn-icon {
  opacity: 1;
  transform: translateY(-2px) scale(1.1);
  animation: bnGlow 2.2s ease-in-out infinite;
}

@keyframes bnGlow {
  0%, 100% { box-shadow: 0 0 6px 0 rgba(255,255,255,0.18); }
  50% { box-shadow: 0 0 16px 4px rgba(255,255,255,0.32); }
}

.grad-1 { background: linear-gradient(135deg, #ff7a5c, #ff4d94); }
.grad-2 { background: linear-gradient(135deg, #b46eff, #6d5bff); }
.grad-3 { background: linear-gradient(135deg, #5aa0ff, #4de0ff); }
.grad-4 { background: linear-gradient(135deg, #ff6ea6, #ff4d6d); }
.grad-5 { background: linear-gradient(135deg, #ffd15c, #ff9a4d); }

.bn-label { font-size: 10.5px; }

/* ==================== کارت‌های نتیجه‌ی فیچرها ==================== */

.result-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }

.result-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 16px 0; }

.result-item {
  display: flex;
  align-items: center;
  gap: 11px;
  background: #0d0f15;
  border: 1px solid #1f2330;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transition: border-color 0.15s ease;
}

.result-item:hover { border-color: #363c4d; }

.result-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #23262e;
  flex-shrink: 0;
}

.result-avatar-fallback {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a3f4c, #23262e);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.result-main { flex: 1; min-width: 0; }
.result-name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.result-value { font-size: 13px; font-weight: 800; color: var(--accent3); white-space: nowrap; }

/* ==================== کاورِ روم (حسِ اتصالِ واقعی به بیگو) ==================== */

.room-cover-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
  background: #0d0f15;
  border: 1px solid #1f2330;
}

.room-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.room-cover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px 12px;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.75) 100%);
}

.room-cover-name {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-cover-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #63d98c;
  background: rgba(16, 36, 26, 0.85);
  padding: 3px 9px;
  border-radius: 999px;
}

.room-cover-live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #63d98c;
  animation: payexa-blink 1.1s ease-in-out infinite;
}

/* ==================== گرید آماری وضعیتِ زنده ==================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.stat-box {
  background: #0d0f15;
  border: 1px solid #1f2330;
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
}

.stat-box .v { font-size: 17px; font-weight: 800; }
.stat-box .l { font-size: 11px; color: var(--muted); margin-top: 4px; font-weight: 600; }

/* ==================== ریسپانسیو ==================== */

@media (max-width: 480px) {
  .row > * { flex: 1 1 100%; }
  .login-card { padding: 30px 20px; }
}
