/* main.css — تم بصری اصلی «ایران مخفی» */

@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
/* لایسنس فونت: Vazirmatn — SIL Open Font License 1.1 (رایگان، مجاز برای استفاده تجاری) */

:root {
  /* رنگ‌های گرم الهام‌گرفته از UI بازی‌های موبایلی */
  --color-bg: #1a1410;
  --color-bg-elevated: #241b15;
  --color-surface: #2c2119;
  --color-surface-2: #3a2c20;
  --color-primary: #c17f3e;
  --color-primary-dark: #9c6530;
  --color-accent: #e8b04b;
  --color-success: #5fa85f;
  --color-danger: #c0473f;
  --color-info: #4a90c0;
  --color-text: #f3e9dc;
  --color-text-muted: #b7a894;
  --color-border: #4a3a2a;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 999px;

  --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.06);

  --touch-target: 48px;

  --font-fa: 'Vazirmatn', Tahoma, sans-serif;
}

html {
  direction: rtl;
}

body {
  font-family: var(--font-fa);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 16px;
  line-height: 1.7;
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
}
.screen.is-active {
  display: flex;
}
/* --- انیمیشن کوتاه Fade هنگام نمایش هر صفحه‌ی جدید (Polish) --- */
@keyframes screen-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.screen.screen-fade-in {
  animation: screen-fade-in 0.22s ease;
}
@media (prefers-reduced-motion: reduce) {
  .screen.screen-fade-in { animation: none; }
}

/* --- کارت‌های گرد --- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft), var(--shadow-inset);
  padding: 20px;
}

/* --- دکمه‌ها --- */
.btn {
  min-height: var(--touch-target);
  padding: 0 22px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:active {
  transform: scale(0.96);
}
.btn-primary {
  background: linear-gradient(180deg, var(--color-accent), var(--color-primary));
  color: #241708;
  box-shadow: 0 4px 0 var(--color-primary-dark);
}
.btn-secondary {
  background: var(--color-surface-2);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* --- فرم‌ها --- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field label {
  font-size: 13px;
  color: var(--color-text-muted);
}
.field input {
  min-height: var(--touch-target);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0 16px;
  font-size: 15px;
}
.field input:focus {
  border-color: var(--color-primary);
}
.field-error {
  color: var(--color-danger);
  font-size: 13px;
  min-height: 18px;
}

/* --- Toast --- */
#toast-container {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-soft);
  font-size: 14px;
  text-align: center;
  animation: toast-in 0.2s ease;
}
.toast.success { border-color: var(--color-success); }
.toast.error { border-color: var(--color-danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Loading / Splash --- */
.splash {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(circle at 50% 30%, #3a2c1f, var(--color-bg));
}
.splash-logo {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--color-accent), var(--color-primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  box-shadow: var(--shadow-soft);
}
.splash-title {
  font-size: 22px;
  font-weight: 700;
}
.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- بنر قطع اینترنت --- */
.offline-banner {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  z-index: 999;
  background: var(--color-danger);
  color: #fff;
  text-align: center;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
  transform: translateY(-140%);
  transition: transform 0.25s ease;
}
.offline-banner.is-visible {
  transform: translateY(0);
}

/* --- انیمیشن «پرش» عدد سکه هنگام افزایش (Coin Gain) --- */
@keyframes coin-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); color: var(--color-accent); }
  100% { transform: scale(1); }
}
.coin-pop {
  display: inline-flex;
  animation: coin-pop 0.35s ease;
}

.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
