/**
 * Bingo Telegram Mini App - Phase 3-E Design Tokens
 * Establishes centralized semantic tokens for colors, typography, spacing,
 * radii, elevations, motion, and z-index across the Player UI.
 * 
 * Supports two authoritative themes:
 * - Light Mode: Modern White + Blue (clean, bright, airy, modern)
 * - Dark Mode:  Black + Gold Elegant (near-black, charcoal, warm gold, restrained)
 */

:root {
  /* ==========================================================================
     1. Default Palette (Dark Theme / Black + Gold Elegant)
     ========================================================================== */
  --color-bg: #0a0b0e;
  --color-bg-secondary: #050608;
  --color-surface: #13141a;
  --color-surface-muted: #181a22;
  --color-surface-elevated: #1d1f2a;
  --color-surface-highlight: #262938;

  --color-text-primary: #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-text-inverse: #0a0b0e;

  --color-border: #222430;
  --color-border-subtle: #191a24;
  --color-border-strong: #333748;
  --color-border-focus: #d4af37;

  /* Warm Elegant Gold Accent */
  --color-primary: #d4af37;
  --color-primary-hover: #e5be42;
  --color-primary-pressed: #be992c;
  --color-primary-disabled: #2a2b36;
  --color-primary-fg: #0a0b0e;
  --color-primary-glow: rgba(212, 175, 55, 0.22);

  --color-secondary-bg: #181a22;
  --color-secondary-hover: #20232e;
  --color-secondary-fg: #e2e8f0;

  /* Functional Status Colors */
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.12);
  --color-success-border: rgba(16, 185, 129, 0.3);
  --color-success-fg: #34d399;

  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.12);
  --color-warning-border: rgba(245, 158, 11, 0.3);
  --color-warning-fg: #fbbf24;

  --color-error: #ef4444;
  --color-error-bg: rgba(239, 68, 68, 0.12);
  --color-error-border: rgba(239, 68, 68, 0.3);
  --color-error-fg: #f87171;

  --color-info: #0284c7;
  --color-info-bg: rgba(2, 132, 199, 0.12);
  --color-info-border: rgba(2, 132, 199, 0.3);
  --color-info-fg: #38bdf8;

  /* Surface & Navigation Tokens */
  --card-gradient: linear-gradient(145deg, #15161d 0%, #101117 100%);
  --card-border-glow: rgba(212, 175, 55, 0.18);
  --nav-bg: rgba(18, 19, 25, 0.94);
  --header-bg: rgba(10, 11, 14, 0.88);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.7);

  /* Game Ball & Feature Accent */
  --ball-bg: linear-gradient(135deg, #d4af37 0%, #b89324 100%);
  --ball-fg: #0a0b0e;
  --ball-border: rgba(212, 175, 55, 0.4);
  --badge-vip-bg: rgba(212, 175, 55, 0.14);
  --badge-vip-fg: #e5be42;
  --badge-vip-border: rgba(212, 175, 55, 0.32);

  /* ==========================================================================
     2. Typography Stacks & Scale (Shared between themes)
     ========================================================================== */
  --font-family-latin: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-family-ethiopic: "Noto Sans Ethiopic", "Abyssinica SIL", "Nyala", "WashRa", sans-serif;
  --font-family-base: var(--font-family-latin), var(--font-family-ethiopic);
  --font-family-numbers: var(--font-family-latin);

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --font-size-display: 2rem;          /* 32px */
  --line-height-display: 1.25;

  --font-size-title-large: 1.5rem;    /* 24px */
  --line-height-title-large: 1.3;

  --font-size-title: 1.25rem;         /* 20px */
  --line-height-title: 1.35;

  --font-size-subtitle: 1.0625rem;    /* 17px */
  --line-height-subtitle: 1.45;

  --font-size-body: 1rem;             /* 16px */
  --line-height-body: 1.55;

  --font-size-body-small: 0.875rem;   /* 14px */
  --line-height-body-small: 1.5;

  --font-size-label: 0.8125rem;       /* 13px */
  --line-height-label: 1.4;

  --font-size-caption: 0.75rem;       /* 12px */
  --line-height-caption: 1.4;

  /* Monetary Numbers (Tabular & Lining) */
  --font-size-amount-large: 2.25rem;  /* 36px */
  --line-height-amount-large: 1.15;

  --font-size-amount-medium: 1.5rem;  /* 24px */
  --line-height-amount-medium: 1.2;

  /* ==========================================================================
     3. Spacing Scale (4px Base Grid)
     ========================================================================== */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* ==========================================================================
     4. Border Radii
     ========================================================================== */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* ==========================================================================
     5. Motion & Transitions
     ========================================================================== */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 350ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-decelerate: cubic-bezier(0, 0, 0.2, 1);

  /* ==========================================================================
     6. Z-Index Layering
     ========================================================================== */
  --z-header: 100;
  --z-bottom-nav: 100;
  --z-backdrop: 200;
  --z-modal: 210;
  --z-toast: 300;

  /* ==========================================================================
     7. Touch & Layout Dimensions
     ========================================================================== */
  --touch-target-min: 44px;
  --button-height-default: 48px;
  --button-height-sm: 36px;
  --input-height: 50px;
  --max-content-width: 480px;
}

/* ==========================================================================
   Light Mode Theme: Modern White + Blue
   Bright, clean, airy, modern, soft, premium, simple, mobile-first
   ========================================================================== */
[data-theme="light"] {
  --color-bg: #f4f6fa;
  --color-bg-secondary: #eaedf3;
  --color-surface: #ffffff;
  --color-surface-muted: #f0f3f8;
  --color-surface-elevated: #ffffff;
  --color-surface-highlight: #e0e7ff;

  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #64748b;
  --color-text-inverse: #ffffff;

  --color-border: #e2e8f0;
  --color-border-subtle: #edf2f7;
  --color-border-strong: #cbd5e1;
  --color-border-focus: #2563eb;

  /* Modern Cobalt Blue Accent */
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-pressed: #1e40af;
  --color-primary-disabled: #cbd5e1;
  --color-primary-fg: #ffffff;
  --color-primary-glow: rgba(37, 99, 235, 0.18);

  --color-secondary-bg: #eef2f8;
  --color-secondary-hover: #e2e8f2;
  --color-secondary-fg: #1e293b;

  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.1);
  --color-success-border: rgba(16, 185, 129, 0.25);
  --color-success-fg: #059669;

  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.1);
  --color-warning-border: rgba(245, 158, 11, 0.25);
  --color-warning-fg: #d97706;

  --color-error: #ef4444;
  --color-error-bg: rgba(239, 68, 68, 0.1);
  --color-error-border: rgba(239, 68, 68, 0.25);
  --color-error-fg: #dc2626;

  --color-info: #0284c7;
  --color-info-bg: rgba(2, 132, 199, 0.1);
  --color-info-border: rgba(2, 132, 199, 0.25);
  --color-info-fg: #0284c7;

  --card-gradient: linear-gradient(145deg, #ffffff 0%, #f7faff 100%);
  --card-border-glow: rgba(37, 99, 235, 0.12);
  --nav-bg: rgba(255, 255, 255, 0.94);
  --header-bg: rgba(244, 246, 250, 0.88);

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 10px 28px rgba(15, 23, 42, 0.1);

  --ball-bg: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --ball-fg: #ffffff;
  --ball-border: rgba(37, 99, 235, 0.3);
  --badge-vip-bg: rgba(37, 99, 235, 0.1);
  --badge-vip-fg: #2563eb;
  --badge-vip-border: rgba(37, 99, 235, 0.25);
}

/* ==========================================================================
   Dark Mode Theme: Black + Gold Elegant
   Black, deep charcoal, gold accent, premium, elegant, clean, high contrast
   ========================================================================== */
[data-theme="dark"] {
  --color-bg: #0a0b0e;
  --color-bg-secondary: #050608;
  --color-surface: #13141a;
  --color-surface-muted: #181a22;
  --color-surface-elevated: #1d1f2a;
  --color-surface-highlight: #262938;

  --color-text-primary: #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-text-inverse: #0a0b0e;

  --color-border: #222430;
  --color-border-subtle: #191a24;
  --color-border-strong: #333748;
  --color-border-focus: #d4af37;

  --color-primary: #d4af37;
  --color-primary-hover: #e5be42;
  --color-primary-pressed: #be992c;
  --color-primary-disabled: #2a2b36;
  --color-primary-fg: #0a0b0e;
  --color-primary-glow: rgba(212, 175, 55, 0.22);

  --color-secondary-bg: #181a22;
  --color-secondary-hover: #20232e;
  --color-secondary-fg: #e2e8f0;

  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.12);
  --color-success-border: rgba(16, 185, 129, 0.3);
  --color-success-fg: #34d399;

  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.12);
  --color-warning-border: rgba(245, 158, 11, 0.3);
  --color-warning-fg: #fbbf24;

  --color-error: #ef4444;
  --color-error-bg: rgba(239, 68, 68, 0.12);
  --color-error-border: rgba(239, 68, 68, 0.3);
  --color-error-fg: #f87171;

  --color-info: #0284c7;
  --color-info-bg: rgba(2, 132, 199, 0.12);
  --color-info-border: rgba(2, 132, 199, 0.3);
  --color-info-fg: #38bdf8;

  --card-gradient: linear-gradient(145deg, #15161d 0%, #101117 100%);
  --card-border-glow: rgba(212, 175, 55, 0.18);
  --nav-bg: rgba(18, 19, 25, 0.94);
  --header-bg: rgba(10, 11, 14, 0.88);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.7);

  --ball-bg: linear-gradient(135deg, #d4af37 0%, #b89324 100%);
  --ball-fg: #0a0b0e;
  --ball-border: rgba(212, 175, 55, 0.4);
  --badge-vip-bg: rgba(212, 175, 55, 0.14);
  --badge-vip-fg: #e5be42;
  --badge-vip-border: rgba(212, 175, 55, 0.32);
}
