/* ============================================
   OTD GAMES — DESIGN SYSTEM
   "Train Your Mind. Master Your Trade."
   ============================================ */

:root {
  /* === COLOR PALETTE === */
  /* Backgrounds */
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-tertiary: #1a1a24;
  --bg-card: rgba(22, 22, 35, 0.85);
  --bg-card-hover: rgba(30, 30, 48, 0.95);
  --bg-glass: rgba(16, 16, 28, 0.6);
  --bg-overlay: rgba(0, 0, 0, 0.7);

  /* Brand Colors */
  --accent-primary: #00d4ff;
  --accent-primary-rgb: 0, 212, 255;
  --accent-secondary: #7b2fff;
  --accent-secondary-rgb: 123, 47, 255;
  --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #7b2fff 100%);
  --accent-gradient-h: linear-gradient(90deg, #00d4ff 0%, #7b2fff 100%);

  /* Semantic Colors */
  --color-success: #00e676;
  --color-success-rgb: 0, 230, 118;
  --color-warning: #ffab00;
  --color-warning-rgb: 255, 171, 0;
  --color-danger: #ff1744;
  --color-danger-rgb: 255, 23, 68;
  --color-info: #00b0ff;

  /* Text */
  --text-primary: #f0f0f5;
  --text-secondary: rgba(240, 240, 245, 0.65);
  --text-tertiary: rgba(240, 240, 245, 0.4);
  --text-inverse: #0a0a0f;

  /* Streak & XP */
  --streak-color: #ff6d00;
  --xp-color: #00e676;
  --xp-gradient: linear-gradient(135deg, #00e676 0%, #00d4ff 100%);

  /* Level Colors */
  --level-1: #ff1744;  /* Impulsive */
  --level-2: #ff6d00;  /* Fearful */
  --level-3: #ffab00;  /* Reactive */
  --level-4: #00e676;  /* Controlled */
  --level-5: #00d4ff;  /* Disciplined */
  --level-6: #7b2fff;  /* OTD Elite */

  /* === TYPOGRAPHY === */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --text-xs: 0.6875rem;   /* 11px */
  --text-sm: 0.8125rem;   /* 13px */
  --text-base: 0.9375rem; /* 15px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.375rem;    /* 22px */
  --text-2xl: 1.75rem;    /* 28px */
  --text-3xl: 2.25rem;    /* 36px */
  --text-4xl: 3rem;       /* 48px */

  --weight-light: 300;
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-black: 900;

  /* === SPACING === */
  --space-xxs: 0.25rem;   /* 4px */
  --space-xs: 0.5rem;     /* 8px */
  --space-sm: 0.75rem;    /* 12px */
  --space-md: 1rem;       /* 16px */
  --space-lg: 1.5rem;     /* 24px */
  --space-xl: 2rem;       /* 32px */
  --space-2xl: 3rem;      /* 48px */
  --space-3xl: 4rem;      /* 64px */

  /* === BORDERS & RADIUS === */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  --border-subtle: 1px solid rgba(255, 255, 255, 0.06);
  --border-glass: 1px solid rgba(255, 255, 255, 0.1);
  --border-accent: 1px solid rgba(0, 212, 255, 0.3);

  /* === SHADOWS === */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow-accent: 0 0 20px rgba(0, 212, 255, 0.3);
  --shadow-glow-success: 0 0 20px rgba(0, 230, 118, 0.3);
  --shadow-glow-danger: 0 0 20px rgba(255, 23, 68, 0.3);

  /* === TRANSITIONS === */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* === LAYOUT === */
  --header-height: 56px;
  --nav-height: 72px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* === RESET === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  min-height: 100vh;
  min-height: 100dvh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0, 212, 255, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(123, 47, 255, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--accent-primary); text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

/* === SELECTION === */
::selection {
  background: rgba(0, 212, 255, 0.3);
  color: var(--text-primary);
}

/* === UTILITY CLASSES === */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: var(--border-glass);
}

.glow-accent { box-shadow: var(--shadow-glow-accent); }
.glow-success { box-shadow: var(--shadow-glow-success); }
.glow-danger { box-shadow: var(--shadow-glow-danger); }
