:root {
  /* Typography — self-hosted font is preferred; falls back to system Arabic support */
  --font-family: 'Vazirmatn', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Core palette extracted from logo + UI assets */
  --color-bg: #120a05;
  --color-surface: #1f120b;
  --color-surface-elevated: #2b1d0e;
  --color-border: #5c4033;

  --color-primary: #ffc72c;
  --color-primary-light: #fff0aa;
  --color-primary-dark: #d88712;

  --color-text: #fff2d8;
  --color-text-muted: #c2a078;

  /*
    Season BGs: cream/gold skies (~#F8E6C0, brightness 200–240).
    Light cream text disappears there — use warm cocoa for floating labels.
  */
  --color-on-scene: #2a1810;
  --color-on-scene-soft: #5c3d28;
  --color-on-scene-accent: #8a5510;
  --shadow-on-scene:
    0 1px 0 rgba(255, 244, 220, 0.75),
    0 2px 10px rgba(255, 236, 200, 0.55);

  --color-accent-red: #8b1d1d;
  --color-success: #43a047;
  --color-info: #1e88e5;

  --color-shadow: rgba(0, 0, 0, 0.45);

  /* Tiles */
  --tile-size: 56px;
  --tile-gap: 8px;
  --tile-bg: linear-gradient(180deg, #4b3621 0%, #3e2723 100%);
  --tile-border: #d87400;
  --tile-text: #fff2d8;
  --tile-shadow: 0 4px 0 #2b1d0e, 0 6px 8px rgba(0, 0, 0, 0.35);

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px var(--color-shadow);
  --shadow-md: 0 4px 8px var(--color-shadow);
  --shadow-lg: 0 8px 24px var(--color-shadow);

  /* Shared glass (exact home card recipe) */
  --glass-bg: rgba(30, 18, 10, 0.72);
  --glass-blur: blur(8px) saturate(1.1);
  --glass-border: 1px solid rgba(255, 199, 44, 0.22);
  --glass-shadow:
    0 8px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 240, 170, 0.12);

  /* Background images */
  --bg-image-start: url('../assets/images/backgrounds/start.webp');
  --bg-image-main: url('../assets/images/backgrounds/main.webp');

  /* Telegram safe area — env() fallback + live values from WebApp when present */
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-safe-top, 0px), var(--tg-content-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-bottom, 0px), var(--tg-content-bottom, 0px));
  /* Space clear of floating bottom dock (icons + label + lift) */
  --nav-clearance: calc(128px + var(--safe-bottom));
}

/* Slightly smaller tiles on very small screens */
@media (max-width: 360px) {
  :root {
    --tile-size: 48px;
    --tile-gap: 6px;
  }
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../assets/fonts/Vazirmatn-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../assets/fonts/Vazirmatn-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../assets/fonts/Vazirmatn-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
